File Manager
Viewing File: cards.php
<?php
session_start();
include_once ('../include/session.php');
require_once '../include/class.user.php';
if (!isset($_SESSION['acc_no'])) {
header("Location: login.php");
exit();
}
$reg_user = new USER();
$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no=:acc_no");
$stmt->execute(array(":acc_no" => $_SESSION['acc_no']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$email = $row['email'];
$temp = $reg_user->runQuery("SELECT * FROM card WHERE email = '$email' ");
$temp->execute(array(":acc_no" => $_SESSION['acc_no']));
$rows = $temp->fetch(PDO::FETCH_ASSOC);
?>
<?php include 'mheader.php';
?>
<title>Card List</title>
<!-- content @s -->
<div class="nk-content nk-content-fluid">
<div class="container-xl wide-lg">
<div class="nk-content-body">
<div class="components-preview wide-md mx-auto">
<div class="nk-block-head nk-block-head-lg wide-sm">
<div class="nk-block-head-content">
<br>
<h2 class="nk-block-title fw-normal">Card List</h2>
</div>
</div><!-- .nk-block-head -->
<div class="nk-block nk-block-lg">
<div class="nk-block-head">
<div class="nk-block-head-content">
<h4 class="nk-block-title">History</h4>
</div>
</div>
<div class="card card-preview">
<div class="card-inner">
<table class="datatable-init-export nowrap table" data-export-title="Export">
<thead>
<tr>
<th class="no-sort" style="width:1%"> Card No.</th>
<th style="white-space: nowrap">Expiry Date</th>
<th style="white-space: nowrap"> Security Code</th>
<th style="white-space: nowrap">Card PIN</th>
<th style="white-space: nowrap">Card Type</th>
<th style="white-space: nowrap">Card Status</th>
</tr>
</thead>
<tbody>
<?php
$acc_no = $_SESSION['acc_no'];
$email = $row['email'];
$his = $reg_user->runQuery("SELECT * FROM card WHERE email = '$email'");
$his->execute(array(":acc_no"=>$_SESSION['acc_no']));
while($rows = $his->fetch(PDO::FETCH_ASSOC)){?>
<tr>
<td><?php echo $rows['cardno']; ?> </td>
<td><?php echo $rows['expirydate']; ?> </td>
<td><?php echo $rows['securitycode']; ?></td>
<td><?php echo $rows['cardpin']; ?></td>
<td><?php echo $rows['cardtype']; ?></td>
<td><?php echo $rows['status']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div><!-- .card-preview -->
</div> <!-- nk-block -->
</div>
</div>
</div></div>
</div>
</div>
<?php include 'mfooter.php';
?>