<?php
include 'functions/getProfileDetails.php';
if (isset($_SESSION['UserID'])) {
include 'functions/TransactionScript.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Transactions - JP TRUST Bank</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="content-language" content="en">
<meta name="theme-color" content="#426fb6" >
<meta name="msapplication-navbutton-color" content="#426fb6">
<meta name="apple-mobile-web-app-status-bar-style" content="#426fb6">
<meta name="keywords" content="">
<meta name="description" content="" >
<meta property="og:type" content="website">
<meta property="og:site_name" content="">
<meta property="og:title" content="JP TRUST Bank">
<meta property="og:description" content="">
<meta property="og:site_name" content="">
<meta property="og:image" content="">
<meta name="msapplication-TileColor" content="#426fb6">
<meta name="msapplication-TileImage" content="https://d4u5qzkfpc9yt.cloudfront.net/favicons/mstile-144x144.7f7356b104f883d3d4fb2cf19d18d3f24c8cb71d.png">
<meta property="og:url" content="">
<link rel="stylesheet" type="text/css" href="/personal-access/personal/assets/css_animate/animate.min.css">
<link rel="stylesheet" type="text/css" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="icon" type="image/x-icon" href="/personal-access/favicon.png">
<link rel="stylesheet" type="text/css" href="/personal-access/personal/assets/stylesheet/layout.css">
<link rel="stylesheet" type="text/css" href="/personal-access/personal/assets/stylesheet/fonts.css">
<link rel="stylesheet" type="text/css" href="/personal-access/personal/assets/stylesheet/responsive.css">
<link rel="stylesheet" type="text/css" href="/personal-access/assets/stylesheet/responsive.css">
<link rel="stylesheet" type="text/css" href="/personal-access/assets/stylesheet/fonts.css">
<!--========================== PRELOAD FONTS============================= -->
<link rel="preload" href="/personal-access/personal/fonts/Roboto-Light.ttf" as="font">

<!--========================== PRELOAD FONTS============================= -->
<link rel="preload" href="/personal-access/assets/fonts/hind-medium.otf" as="font">
<link rel="preload" href="/personal-access/assets/fonts/hind-light.otf" as="font">
<link rel="preload" href="/personal-access/assets/fonts/hind-bold.otf" as="font">
<link rel="preload" href="/personal-access/assets/fonts/hind-regular.otf" as="font">
<link rel="preload" href="/personal-access/assets/fonts/hind-semibold.otf" as="font">
<link rel=’stylesheet’ href=typicons.font-master/src/font/typicons.min.css’>
<link rel="stylesheet" href="/personal-access/admin/css/sweetalert2.min.css">
<script src="/personal-access/admin/js/sweetalert2.all.min.js"></script>
<!-- ====================== JS SCRIPTS =====================================-->
<script type="text/javascript" src="/personal-access/personal/assets/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/personal-access/personal/assets/js/global.js"></script>
<script type="text/javascript" src="/personal-access/assets/js/global.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript" src="/personal-access/personal/assets/js/wow.min.js"></script>
<script src="//code.tidio.co/0alnnwgl6kfajk69exguacitnlhfyb3c.js" async></script>
<script type="text/javascript">
new WOW().init();
</script>


</head>
<body>
<!-- ======================= WHOLE BODY WRAPPER   ================================================= -->
<!--<div id="google_translate_element"></div>-->

<!--<script type="text/javascript">-->
<!--function googleTranslateElementInit() {-->
<!--  new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');-->
<!--}-->
<!--</script>-->

<!--<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>-->
<div id="Body_container">
<div class="top_Nav">
 <?php require 'header.php'; ?>
 
</div>
</div>

<!-- ======================= ENDS WHOLE BODY WRAPPER   ================================================= -->
<!-- ======================= MAIN BODY CONTENT WRAPPER   ================================================= -->
<div id="container">
<div class="innerBankOperaion">

<div class="welMsg">
<div class="accountImage"><picture><img src="/personal-access/admin/AccImage/<?php echo $AccImage; ?>" alt=""></picture></div>
<h2 class="welcome">Hello, <?php echo $AccFullname; ?></h2>

<a href="#">Update profile</a>
<a href="#" class="security">Security center</a>

<form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST" class="helpForm">
<div class="inputWrapper">
<input type="text" name="helpCenter" placeholder="How can we help you ?">
<button type="submit"><i class="icon ion-ios-search"></i> </button>
</div>
</form>
</div>

<section id="dataSection">
<div class="listData">

<div class="wrapper">
<header><h2>All Transactions</h2></header>
<div class="container">
<?php
if ($transactionCount > 0) {
while ($transDetails = mysqli_fetch_assoc($TransQuery)) {
//================ TRANSACTION DETAILS ================================
$ID = $transDetails['ID'];
$ReferenceNum = $transDetails['ReferenceNum'];
$Amount = $transDetails['Amount'];
$Status = $transDetails['Status'];
$Type = $transDetails['Type'];
$SenderName = $transDetails['SenderName'];
$ReceiverAccNum = $transDetails['ReceiverAccNum'];
$Narration = $transDetails['Narration'];
$DateTrans = $transDetails['TransDate'];

$Note = $transDetails['Note'];
//========== CONVERT SUCCESS TO STRING ==========================
if ($Status == 0) {
$ConvertedStatus = "PENDING";
}else {
$ConvertedStatus = "SUCCESSFUL";
}

//================get Time and Date ================
$SplitTimeDate = explode(' ', $DateTrans);
$Date = $SplitTimeDate[0];
$Time = $SplitTimeDate[1];
//============get Accurate AM/PM Time ================
$TimeSplit = explode(':', $Time);
$Time1 = $TimeSplit[0];
$Time2 = $TimeSplit[1];
$accurateTime = $Time1.":".$Time2;

// get pending transfer level

$getPendLevel =  mysqli_query($connect, "SELECT * FROM tracktrans WHERE TransID = '$ID' ");
$fetchPendLevel = mysqli_fetch_assoc($getPendLevel);
$ThisLevel = $fetchPendLevel['Level'];

?>
<ul class="transactions unselectable">
<li class="dateTrans"><?php echo $Date; ?> <?php echo date('h:i a ', strtotime($accurateTime)); ?> <span class="transferAmount" 
style="<?php if($Type == 'CREDIT'){echo "color: green;";}else{echo "color: black;";} ?>">
    <?php if($Type == 'CREDIT'){echo"+ ";echo $currn.$Amount;}else{echo"- ";echo $currn.$Amount;} ?>
    </span></li>
<li class="TransDesc"> <span><?php echo $Type; ?></span> @ <?php echo $Narration; ?></li>
<li class="moreInfo">
Tap for more details
<ul class="transactionChildDetails" style="overflow: hidden;">
<h2>Transaction Details</h2>
<li><span class="bolderSpan">Date</span>: <span class="data"><?php echo $Date; ?></span></li>
<li><span class="bolderSpan">Time</span>: <span class="data"><?php echo date('h:i a ', strtotime($accurateTime)); ?></span></li>
<li><span class="bolderSpan">Reference</span>: <span class="data"><?php echo $ReferenceNum; ?></span></li>
<li><span class="bolderSpan">Amount</span>: <span class="data"><?php echo $currn.$Amount.""; ?></span></li>
<li><span class="bolderSpan">Status</span>: <span class="data" style="<?php if($Status == 0){echo "color: orange;";}else {echo "color: green;";} ?>"><?php echo $ConvertedStatus; ?></span></li>
<li><span class="bolderSpan">Type</span>: <span class="data"><?php echo $Type; ?></span></li>
<h2>Accounts Details</h2>
<li><span class="bolderSpan">Sender name</span>: <span class="data"><?php echo $SenderName; ?></span></li>
<?php
if ($Type == "FUND TRANSFER") {?>
<li><span class="bolderSpan">Receiver Account Number</span>: <span class="data"><?php echo $ReceiverAccNum; ?></span></li>
<?php
}
?>
<li><span class="bolderSpan">Narration</span>: <span class="data"><?php echo $Narration; ?></span></li>
<li><span class="bolderSpan">Note</span>:</li>
<p><?php if($Note == ''){echo "NAN";}else {echo $Note;} ?></p>
<p><?php if($Note == ''){echo "NAN";}else {echo $Note;} ?></p>
<?php
if($ThisLevel != 4 && $Status != 1) {?>
<button class="completeThisTransaction"  style="cursor: pointer; color: #000; border: none; font-weight: 600; font-family: 'hind bold', sans-serif; float: right; padding: 5px 10px; font-size: 15px; background-color: #fedf01;" data-id="<?php echo $ID; ?>" data-level="<?php echo $ThisLevel; ?>">Continue Pending Transaction</button>
<?php
}
?>
</ul>
</li>
</ul>
<?php
}

}else {
?>
<ul>
<li>No Recent Transaction</li>
</ul>
<?php
}

?> 
</div>


</div>
</div>


<div class="activityCenter">
<header><h2>Activity Center</h2></header>
<div class="ActivityNavWrapper">
<picture><img  src="/personal-access/personal/img/alert.png" alt=""></picture>
<span>Alerts</span>
</div>
<div class="ActivityNavWrapper">
<picture><img  src="/personal-access/personal/img/billPay.png" alt=""></picture>
<span>Bill Pay</span>
</div>
<div class="ActivityNavWrapper">
<a href="transactions">
<picture><img  src="/personal-access/personal/img/transactions.png" alt=""></picture>
<span>Transactions</span>
</a>
</div>
<div class="ActivityNavWrapper">
<a href="../dashboard/transfer">
<picture><img  src="/personal-access/personal/img/Transfers.jpg" alt=""></picture>
<span>Transfer Funds</span>
</a>
</div>
<div class="ActivityNavWrapper">
<picture><img  src="/personal-access/personal/img/SpecialOffers.svg" alt=""></picture>
<span>Special Offers</span>
</div>
<div class="ActivityNavWrapper">
<picture><img  src="/personal-access/personal/img/messages.png" alt=""></picture>
<span>Messages</span>
</div>
<div class="ActivityNavWrapper">
<picture><img  src="/personal-access/personal/img/spending.png" alt=""></picture>
<span>Spending &amp; Budgeting</span>
</div>
<div class="ActivityNavWrapper">
<picture><img  src="/personal-access/personal/img/Goals.png" alt=""></picture>
<span>Goals</span>
</div>
<div class="ActivityNavWrapper">
<picture><img  src="/personal-access/personal/img/openaccount.png" alt=""></picture>
<span>Open account</span>
</div>

</div>


</section>
<div class="footerBefore">
<div class="inner_wrapper">
<p class="info">
For checking, savings, and money market accounts, the balance may reflect transaction that have not yet posted to your account. For credit card Gold option
and Gold reserve accounts, the balance may not reflect recent transactions or pending payments.
<br>
</p>
<p class="info">
Last sign in <?php echo $sepDate; ?> <?php echo date('h:i a ', strtotime($gottenAccurateTime)); ?>
<div class="signoutFooter">
<ul>
<li>Secure Area <span class="signOut"><a href="#">En Espanol</a> <a href="/personal-access/cgi-bin/rbaccess/logout.php" >Sign out</a></span></li>
</ul>
</div>
</div>
</div>
</div>


<!--======================== SUBSCRIBE TO OUR NEWLETTERS =========================================-->
<section id="subscribeNews">
<div class="containerWidth inner_container">
<div class="subscribeLeft">
<h3>Subscribe to Our Email List</h3>
<form action="<?Php $_SERVER['PHP_SELF'] ?>" method="POST">
<input type="text" name="Fullname" placeholder="Fullname">
<input type="email" name="email" placeholder="Email">
<button>Sign up</button>
</form>
</div>
<div class="downloadApp">
<h3><a href="#" >Download</a> our free mobile App today!</h3>
<a href="#" target="_blank"><img src="/personal-access/assets/Img/apple-large.jpg" alt=""></a>
<a href="#" target="_blank"><img src="/personal-access/assets/Img/google-large.jpg" alt=""></a>
</div>
</div>
</section>
<!--====================== FOOTER =========================================-->
<footer>
<div class="footer containerWidth">
<div class="socialFooter">
<a href="#" target="_blank"><img src="/personal-access/assets/Img/facebook.png" alt=""></a>
<a href="#" target="_blank"><img src="/personal-access/assets/Img/twitter.png" alt=""></a>
<a href="#" target="_blank"><img src="/personal-access/assets/Img/linkedin.png" alt=""></a>
<a href="#" target="_blank"><img src="/personal-access/assets/Img/instagram.png" alt=""></a>
<a href="#" target="_blank"><img src="/personal-access/assets/Img/youtube.png" alt=""></a>
</div>
<div class="footerLink1">
<p><a href="#">Contact Us <span>/</span></a> <a href="#">Find a branch or ATM <span>/</span></a><a href="#">Careers <span>/</span></a><a href="#">Disclosure &amp; Privacy Policy</a>
</p>
</div>
<p class="footerParagraph">Phone +17072438251 / NMLS ID 411068</p>
<p class="footerParagraph">Copyright &copy; <?php echo date('Y'); ?>  JP TRUST Bank. All Rights Reserved. <a href="https://www.fdic.gov/"><img src="/personal-access/assets/Img/fdic.png" alt=""></a>
<a href="https://www.hud.gov/"><img src="/personal-access/assets/Img/ehl.png" alt=""></a></p>

</div>
</footer>





</div>
<!-- ======================= ENDS MAIN BODY CONTENT WRAPPER   ================================================= -->
</div>


<div id="TranferProgress" style="z-index: 10;">
<div class="progressCount">
<!-- LOADER -->
<div class="loader loader--style1" title="0">
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">
<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946
s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634
c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"/>
<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
C22.32,8.481,24.301,9.057,26.013,10.047z">
<animateTransform attributeType="xml"
attributeName="transform"
type="rotate"
from="0 20 20"
to="360 20 20"
dur="0.5s"
repeatCount="indefinite"/>
</path>
</svg>
</div>
<!--COUNT-->
<div class="progressCountWrapper">
<h2 class="count"><span class="Maincount" data-count="87"></span>%<span class="Processing">Processing..</span></h2> 
</div>

</div>

<div id="errorPopup">
<h2>FUND TRANSFER SUCCESSFUL.</h2>
<button type="button" id="closeErrorMessage">Close</button>
</div>


</div>
<div id="ErrorBodyCode">

<div id="errorPopupCodeInput">
<h2>Please Input COT</h2>
<p style="color: #333; text-align: center; font-size: 14px;">Please contact our help center at <a style="font-weight: 900; color: #426fb6; text-align: center; font-size: 14px;" href="mailto:<?php require 'functions/email.php'; ?>"><?php require 'functions/email.php'; ?></a> for help</p>
<div class="transferCodeText">Invalid Transfer Code</div>
<input type="text" name="TransferCode" placeholder="Transfer Code.." autofocus>
<button type="button" id="SubmitTransferCode">Submit</button>
</div>

</div>
</body>
    


</html>
<?php
}else {
header("Location: /personal-access/");
}
?>