include 'dbFunctions.php';
include 'menu.php';
include 'css.php';
$user_id=$_SESSION['user_id'];
$acc_id = $_POST['acc_id'];
$period = $_POST['period'];
$sort = $_POST['sort'];
$type = $_POST['type'];
$total_debit = 0;
$total_credit = 0;
$date = date("l jS \of F Y h:i:s A")
?>
#table
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
#table td, #table th
{
font-size:1em;
border:1px solid #000000;
padding:3px 7px 2px 7px;
}
#table th
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
background-color:#0080FF;
color:#ffffff;
}
#table tr.alt td
{
color:#000000;
background-color:#A9E2F3;
}
Transaction History
echo $date ."" ."";
$query ="SELECT account_number FROM account WHERE account_id ='$acc_id' AND user_id= '$user_id'"; // where date=$period
$result = mysqli_query($link, $query) or die(mysqli_error($link));
while ($row = mysqli_fetch_array($result)) {
$acc_num = $row ['account_number'];
?>
RP INTERNET BANKING ACCOUNT <?php echo $acc_num ?>
}
?>
DateTransaction CodeReferenceDebit
(Withdrawal)Credit
(Deposit)
if ($period == 'current'){
$query1 ="SELECT * FROM transaction WHERE account_id ='$acc_id' AND user_id= '$user_id' AND MONTH(CURDATE())= MONTH(date)";
}
else if ($period == 'current_first'){
$query1 ="SELECT * FROM transaction WHERE account_id ='$acc_id' AND user_id= '$user_id' AND date BETWEEN CURRENT_DATE - INTERVAL 2 MONTH AND CURRENT_DATE";
}
else if ($period == 'current_second'){
$query1 ="SELECT * FROM transaction WHERE account_id ='$acc_id' AND user_id= '$user_id' AND date BETWEEN CURRENT_DATE - INTERVAL 3 MONTH AND CURRENT_DATE";
}
if($type == 'credit'){
$query1 .=" AND debit IS NULL";
}
else if ($type == 'debit'){
$query1 .=" AND credit IS NULL";
}
else if ($type == 'both'){
$query1 .="";
}
if ($sort == 'latest'){
$query1 .=" ORDER BY date DESC";
}
else if ($sort == 'earliest'){
$query1 .=" ORDER BY date ASC";
}
else if ($sort == 'codes'){
$query1 .=" ORDER BY transaction_code ASC";
}
$result1 = mysqli_query( $link, $query1 ) or die( mysqli_error( $link ) );
while ($row1 = mysqli_fetch_array($result1))
{
$date1 = $row1['date'];
$trans_code = $row1['transaction_code'];
$reference = $row1['reference'];
$debit = $row1['debit'];
$credit = $row1['credit'];
$total_debit += $debit;
$total_credit += $credit;
$date = new DATETIME($date1);
?>
<?php echo $date->format('d-m-Y'); ?><?php echo $trans_code ?><?php echo $reference ?>if ($debit != NULL) {
echo"S$" ."" . $debit;
}
?>
if ($credit != NULL) {
echo 'S$' . ' ' . $credit;
}
?>
}
?>
Total:echo 'S$' . ' ' . $total_debit;
}
?>
echo 'S$' . ' ' . $total_credit;
}
?>
Back