File Manager
Viewing File: statement.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 transfer WHERE email = '$email' ");
$temp->execute(array(":acc_no" => $_SESSION['acc_no']));
$rows = $temp->fetch(PDO::FETCH_ASSOC);
?>
<?php include 'mheader.php';
?>
<title>Account Statement</title>
<!-- content @s --><br><br>
<script>function printtag(tagid) {
var hashid = "#"+ tagid;
var tagname = $(hashid).prop("tagName").toLowerCase() ;
var attributes = "";
var attrs = document.getElementById(tagid).attributes;
$.each(attrs,function(i,elem){
attributes += " "+ elem.name+" ='"+elem.value+"' " ;
})
var divToPrint= $(hashid).html() ;
var head = "<html><head>"+ $("head").html() + "</head>" ;
var allcontent = head + "<body onload='window.print()' >"+ "<" + tagname + attributes + ">" + divToPrint + "</" + tagname + ">" + "</body></html>" ;
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write(allcontent);
newWin.document.close();
// setTimeout(function(){newWin.close();},10);
}</script>
<div id='DivIdToPrint'>
<div id="dvContainer">
<div class="nk-content nk-content-fluid">
<div class="container-xl wide-lg">
<div class="nk-content-body">
<div class="nk-block-head nk-block-head-sm">
<div class="nk-block-between">
<div class="nk-block-head-content">
<h3 class="nk-block-title page-title">Account Statement</h3>
</div><!-- .nk-block-head-content -->
<div class="nk-block-head-content">
<div class="toggle-wrap nk-block-tools-toggle">
<a href="#" class="btn btn-icon btn-trigger toggle-expand mr-n1" data-target="pageMenu"><em class="icon ni ni-menu-alt-r"></em></a>
<div class="toggle-expand-content" data-content="pageMenu">
<ul class="nk-block-tools g-3">
<li><button type="button" onclick='printtag("DivIdToPrint");' id='btn' class="btn btn-white btn-outline-light"><em class="icon ni ni-download-cloud"></em><span>Export</span></button></li>
</ul>
</div>
</div><!-- .toggle-wrap -->
</div><!-- .nk-block-head-content -->
</div><!-- .nk-block-between -->
</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">Transactions</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%">#</th>
<th style="white-space: nowrap">AMOUNT</th>
<th style="white-space: nowrap">RECIEVING ACCOUNT AND NAME</th>
<th style="white-space: nowrap">TYPE</th>
<th style="white-space: nowrap">BANK</th>
<th style="white-space: nowrap">DESCRIPTION</th>
<th style="white-space: nowrap">DATE/TIME</th>
<th style="white-space: nowrap">STATUS</th>
</tr>
</thead>
<tbody>
<?php
$acc_no = $_SESSION['acc_no'];
$email = $row['email'];
$his = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email'");
$his->execute(array(":acc_no"=>$_SESSION['acc_no']));
while($rows = $his->fetch(PDO::FETCH_ASSOC)){?>
<tr>
<td></td>
<td><?php echo $row['currency']; ?> <?php echo $rows['amount']; ?></td>
<td><?php echo $rows['acc_no']; ?> - <?php echo $rows['acc_name']; ?></td>
<td><?php echo $rows['transtype']; ?></td>
<td><?php echo $rows['bank_name']; ?></td>
<td><?php echo $rows['remarks']; ?></td>
<td><?php echo $rows['date']; ?></td>
<td><?php echo $rows['status']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div><!-- .card-preview -->
</div> <!-- nk-block -->
<div class="nk-block nk-block-lg">
<div class="nk-block-head">
<div class="nk-block-head-content">
</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%">Ref No.</th>
<th style="white-space: nowrap">TYPE</th>
<th style="white-space: nowrap">AMOUNT <b>(<?php echo $row['currency']; ?>)</b></th>
<th style="white-space: nowrap">TO/FROM</th>
<th style="white-space: nowrap">DESCRIPTION</th>
<th style="white-space: nowrap">DATE/TIME</th>
</tr>
</thead>
<tbody>
<?php
$uname = $_SESSION['acc_no'];
$debcre = $reg_user->runQuery("SELECT * FROM alerts WHERE uname = '$uname'");
$debcre->execute();
while($rows = $debcre->fetch(PDO::FETCH_ASSOC)){?>
<tr>
<td><?php echo $rows['id']; ?>
</td>
<td><?php include('ss.php'); ?></td>
<td><?php echo $rows['amount']; ?></td>
<td><?php echo $rows['sender_name']; ?></td>
<td><?php echo $rows['remarks']; ?></td>
<td><?php echo $rows['date']; ?> <?php echo $rows['time']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<!-- END table -->
</div>
</div><!-- .card-preview -->
</div> <!-- nk-block -->
</div>
</div></div>
</div> </div>
</div>
<?php include 'mfooter.php';
?>