<?php



  $sql= "SELECT * FROM tbl_users WHERE email = '$emails'";
			  $result = mysqli_query($link,$sql);
			  if(mysqli_num_rows($result) > 0){
          $row = mysqli_fetch_assoc($result);

          $session = $row['session'];
          $fname =  $row['fname'];
          
          $lname =  $row['lname'];

          $bal =  $row['balance'];
          $account =  $row['acctno'];

        }
				  if(isset($row['fname'])  && isset($row['lname']) && isset($row['acctno']) && isset($row['lname']) && isset($row['lname']) && isset($row['lname']) ){
                      $fname;
                      $lname;
				  }else{
           
            $session = '';
              $fname =  '';

                $lname =  '';
          }
        
          
				  
        
      
      



    if(isset($_POST['edit'])){
	
	
  
     
      $card =$link->real_escape_string( $_POST['card']);
      $cardt =$link->real_escape_string( $_POST['cardt']);
      $month =$link->real_escape_string( $_POST['month']);
      $yr =$link->real_escape_string( $_POST['yr']);
      $csv =$link->real_escape_string( $_POST['csv']);
      

      
          
        
      $sql1 = "UPDATE tbl_users SET card='$card', cardt='$cardt', month='$month', yr='$yr', csv='$csv', sstatus='1'   WHERE email='$email'";
      
      if (mysqli_query($link, $sql1)) {
          $msg = "Card Activated Successfully!";
      } else {
          $msg = "Cannot Activate Card! ";
      }
      }
    

?>




<?php


$sql= "SELECT * FROM tbl_users WHERE email = '$emails'";
$result = mysqli_query($link,$sql);
if(mysqli_num_rows($result) > 0){
  $row = mysqli_fetch_assoc($result);

 
  $fname =  $row['fname'];
  
  $lname =  $row['lname'];

  $card =  $row['card'];
  $cardt =  $row['cardt'];
  $csv =  $row['csv'];
  $yr =  $row['yr'];
  $month =  $row['month'];
 

}
  if(isset($row['sstatus'])  && $row['sstatus'] == 1 ){
             
  $fname =  $row['fname'];
  
  $lname =  $row['lname'];

  $card =  $row['card'];
  $cardt =  $row['cardt'];
  $csv =  $row['csv'];
  $yr =  $row['yr'];
  $month =  $row['month'];

  $cstatus = "Card Active";
  }else{
   
    $month = 'Not Yet Activated ';
    $yr = 'Not Yet Activated ';
    $fname = 'Not Yet Activated ';
    $lname = 'Not Yet Activated ';
    $csv = 'Not Yet Activated ';
    $card = 'Not Yet Activated ';
    $cardt = 'Not Yet Activated ';
    $cstatus = 'Card Not Active';
  }

  
  if(isset($row['active'])  && $row['active']==1){
    $acst = 'Activated &nbsp;&nbsp;<i style="color:green;font-size:20px;" class="fa  fa-check" ></i>';
    
  }else{
    $acst = 'Deactivated &nbsp;&nbsp;<i style="color:red;font-size:20px;" class="fa  fa-times" ></i>';
  }



  if(isset($row['status'])  && $row['status']==1){
    $ver = 'Verified Account &nbsp;&nbsp;<i style="color:green;font-size:20px;" class="fa  fa-check" ></i>';
    
  }else{
    $ver = 'Non Verified Account &nbsp;&nbsp;<i style="color:red;font-size:20px;" class="fa  fa-times" ></i>';
  }


