<?php require ("header.php") ?>
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
    
 
 <!---begin of Mobile View Here   only from Digital Forest Team-->
 
     
   
   
  				
  <script>
    $(document).ready(function() {
      $('#mybutton').hide().delay(5000).fadeIn(2200);
});
    </script> 

 <style>
input[type=text2] {
  width: 60%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
} 

input[type=text], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}

input[type=number], date{
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}


input[type=submit] {
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input[type=submit]:hover {
  background-color: #45a049;
}

.container {
  border-radius: 5px;
  background-color: ;
  padding: 20px;
}
</style>
						
<style>


.card-block {
  height: 260px;
  background: #6236FF;
  border-radius: 10px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.09);
  color: #fff;
  position: relative;
}

.card-block .card-main {
  background-image: linear-gradient(-180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.23) 100%);
  position: absolute;
  border-radius: 10px;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px 24px;
}

.card-block .card-button {
  position: absolute;
  right: 10px;
  top: 10px;
}

.card-block .card-button > .btn {
  background: transparent !important;
  color: #fff !important;
}

.card-block span.label {
  font-size: 11px;
  letter-spacing: 1px;
  opacity: 0.5;
  line-height: 1em;
  margin-bottom: 5px;
  text-transform: uppercase;
  display: block;
  font-weight: 500;
}

.card-block .in .card-number {
  font-size: 17px;
  letter-spacing: 3px;
  font-weight: 500;
}

.card-block .in .card-expiry {
  font-size: 14px;
  font-weight: 500;
  margin-right: 20px;
}

.card-block .in .card-ccv {
  font-weight: 500;
  font-size: 14px;
}

.card-block .bottom {
  display: flex;
  align-items: center;
  margin-top: 20px;
}

.card-block .balance {
  position: absolute;
  left: 24px;
  top: 24px;
}

.card-block .balance .title {
  font-weight: 700;
  color: #fff;
  margin-top: 7px;
  font-size: 24px;
}


</style>				
				
				







					
<br><br>
 
 
 
                                                                             
     <?php
// Assuming PDO connection is stored in $pdo
$stmt = $pdo->prepare("SELECT * FROM logins WHERE id = :id");
$stmt->execute(['id' => $id]);
$ordrow = $stmt->fetch(PDO::FETCH_ASSOC);

if ($ordrow) {
    // Display the card header
    echo "
        <div class='container-fluid py-4'>
            <div class='row'>
                <div class='col-12'>
                    <div class='card my-4'>
                        <div class='card-header p-0 position-relative mt-n4 mx-3 z-index-2'>
                            <div class='bg-gradient-primary shadow-primary border-radius-lg pt-4 pb-3'>
                                <h4 class='text-white text-capitalize ps-3'>
                                    <img src='icon/ibft.png' height='40' width='40' >
                                    <strong>" . ($ordrow['CARD_TYP'] == 1 ? "VISA CARD" : "MASTER CARD") . "</strong>
                                </h4>
                            </div>
                        </div>
                        <div class='card-body px-0 pb-2'> 
                            <div class='row'>
                                <div class='col-md-7 mt-4'>
                                    <div class='card'>
                                        <div class='card-body pt-4 p-3'>
                                            <p style='background-color:#0d5154; color:white; text-align:center;'>Fund your card from your Available Balance. <br>Then contact the Billing Department for your card balance activation. Thank you...</p>
                                            <div class='container'>
                                                <form method='POST' action=''>";

    if (isset($success_fund)) {
        echo htmlspecialchars($success_fund);
    }

    if (isset($success_disabe)) {
        echo htmlspecialchars($success_disabe);
    }

    // Fund Card Form
    echo "
        <label for='fund'>Fund Amount:</label>
        <input type='text' name='card_balc' value='0.00' required/>
        <label for='fund'>Available Balance:</label>
        <input type='text' value='" . htmlspecialchars($cur) . " " . htmlspecialchars($balc) . "' readonly/>
        <label for='fund'>Card Balance:</label>
        <input type='text' class='form-control' value='" . htmlspecialchars($cur) . " " . number_format($ordrow['card_balc'], 2) . "' readonly/>
        <button type='submit' name='fund_card' class='btn bg-gradient-dark mb-0'>Fund Card</button>
    </form>
</div>
</div>
</div>
</div>
</div>

<div class='col-md-5 mt-4'>
    <div class='card h-100 mb-4'>
        <div class='card-header pb-0 px-3'>
            <div class='row'>
                <div class='col-md-6'>
                    <h6 class='mb-0'>MY-ATM CARD</h6>
                </div>
            </div>
        </div>

        <div class='card-body pt-4 p-3'>
            <div class='col-md-6 d-flex justify-content-start justify-content-md-end align-items-center'>
                <i class='material-icons me-2 text-xl'></i>
                <small>" . htmlspecialchars($ordrow['card_date']) . "</small>
            </div>";

    // Card details block
    echo "
            <div class='card-block' style='background-color:#0d5154;'>
                <div class='card-main'>
                    <div class='card-button dropdown'>";
                    
    if ($ordrow['CARD_TYP'] == 1) {
        echo "<img src='tools/visacard.png' height='20px' width='70px'>";
    } elseif ($ordrow['CARD_TYP'] == 2) {
        echo "<img src='tools/mastercard.png' height='50px' width='70px'>";
    }
                    
    echo "
                    </div>
                    <div class='balance'>
                        <span class='label'>BALANCE</span>
                        <h3 class='title'>" . htmlspecialchars($cur) . " " . htmlspecialchars($ordrow['card_balc']) . "</h3>
                    </div>
                    <div class='in'>
                        <div class='card-number'>
                            <span class='label'>Card Number</span>
                            <strong style='font-size:16px; font-weight:700;'>" . htmlspecialchars(substr($ordrow['CARD'], 0, 4) . " **** **** " . substr($ordrow['CARD'], -4)) . "</strong>
                        </div>
                        <div class='bottom'>
                            <div class='card-expiry'>
                                <span class='label'>Expiry</span>
                                " . htmlspecialchars($ordrow['EXP']) . "
                            </div>
                            <div class='card-ccv'>
                                <span class='label'>CCV</span>
                                *** <!-- Masked CVV -->
                            </div>
                            
                            <div class='card-ccv'>";
                            
                            if ($ordrow['CARDstatus'] == 0) {
                                echo "
                                    <input type='hidden' value='0'/>
                                    <input type='submit' class='btn bg-gradient-primary' style='width:120px;' value='CARD DISABLED'/>
                                ";
                            } elseif ($ordrow['CARDstatus'] == 1) {
                                echo "
                                    <input type='hidden' value='1'/>
                                    <input type='submit' class='btn bg-gradient-success' style='width:120px;' value='CARD ENABLED'/>
                                ";
                            }

                            echo "
                            </div>
                        </div>
                    </div>
                </div>
            </div><hr>";
}
?>

            
            
           
            </div>
            
            
            
            
            
            
            
          </div>
        </div>
      </div>
                
                
      
                          
		    
		    </div>
 
                 
              
              <br><br>
            </div>
          </div>
        </div><br><br>
      </div>
 
 
 
 </div>
 






 <!--&nbsp;&nbsp; &nbsp;&nbsp;<strong style='color:red;'><a #='delete_card.php?id=26'>X DELETE</a></strong>&nbsp;&nbsp;&nbsp;&nbsp;-->










 <?php require ("footer.php") ?>