<?php
session_start();
if (!isset($_SESSION['user'])) {
        header("location:../loginfailed.html");
    }
    else {
        $now = time(); // Checking the time now when home page starts.
}
        if ($now > $_SESSION['expire']) {
            session_destroy();
            header("location:../loginfailed.html");
        }
       
$username= $_SESSION['user'];		  
include '../connect.php';

$sql = mysqli_query($con, "SELECT * FROM customers where username='$username' ");
$row3 = mysqli_fetch_array($sql);
$name=$row3['name'];
$address=$row3['address'];
$phone=$row3['phone'];
$acctype=$row3['account_type'];
$serial=$row3['serial'];
$acctnum=$row3['account_no'];
$currency = $row3['currency'];
$date1=$row3['date1'];
$date2=$row3['date2'];
$date3=$row3['date3'];
$date4=$row3['date4'];
$amount1=$row3['amount1'];
$amount2=$row3['amount2'];
$amount3=$row3['amount3'];
$amount4=$row3['amount4'];
$new_bal=$row3['new_bal'];

$file=$row3['file'];
$file_path = '../../Images/';
$file=$file_path.$row3['file'];
?><?php
$total="";
$sqm = mysqli_query($con, "SELECT SUM(credit - debit) FROM transactions WHERE username='$username' ");
while($row = mysqli_fetch_array($sqm)){
$total = $row['SUM(credit - debit)'];
}
?>


<!DOCTYPE html>
<html style="height: 100%;"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <meta charset="utf-8">
    <meta content="ie=edge" http-equiv="x-ua-compatible">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <link href="https://connexibankonline.sbkport.com/ibank/favicon.png" rel="shortcut icon">
	<title>Santander Bank | Account Activities</title>
    <link href="https://connexibankonline.sbkport.com/ibank/apple-touch-icon.png" rel="apple-touch-icon">
	<link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/select2.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/daterangepicker.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/dropzone.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/dataTables.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/fullcalendar.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/perfect-scrollbar.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/slick.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/main.css" rel="stylesheet">
    <link href="Connex%20Credit%20Union%20_%20Account%20Activities_files/icofont.htm" rel="stylesheet">
<link type="text/css" rel="stylesheet" charset="UTF-8" href="Connex%20Credit%20Union%20_%20Account%

20Activities_files/translateelement.css"><script type="text/javascript" charset="UTF-8" src="Connex%20Credit%20Union%20_%

20Account%20Activities_files/main_002.js"></script><style type="text/css">/* Chart.js */
@-webkit-keyframes chartjs-render-animation{from{opacity:0.99}to{opacity:1}}@keyframes chartjs-render-animation{from

{opacity:0.99}to{opacity:1}}.chartjs-render-monitor{-webkit-animation:chartjs-render-animation 0.001s;animation:chartjs-

render-animation 0.001s;}</style><style>.cke{visibility:hidden;}</style><script type="text/javascript" charset="UTF-8" 

src="Connex%20Credit%20Union%20_%20Account%20Activities_files/element_main.js"></script></head>

<body class="menu-position-side menu-side-left full-screen" style="position: relative; min-height: 100%; top: 0px;">
    <div class="all-wrapper solid-bg-all">
        <!--------------------
START - Top Bar
-------------------->
        <div class="top-bar color-scheme-bright">
            <div class="logo-w menu-size">
                <a class="logo" href="index.php">
                    <div class="logo-label"><img src="../logo.png"></div>
                </a>
            </div>
            
            
            <!--------------------
END - Top Menu Controls
-------------------->
        </div>
        <!--------------------
END - Top Bar
-------------------->
       
        <div class="layout-w">
            <!--------------------
START - Mobile Menu
-------------------->
            <div class="menu-mobile menu-activated-on-click color-scheme-dark">
                <div class="mm-logo-buttons-w">
                    <a class="mm-logo" href="index.php"><img src="../logo.png"><span>Santander Bank</span></a>
                    <div class="mm-buttons">
                        <div class="content-panel-open">
                            <div class="os-icon os-icon-grid-circles"></div>
                        </div>
                        <div class="mobile-menu-trigger">
                            <div class="os-icon os-icon-hamburger-menu-1"></div>
                        </div>
                    </div>
                </div>
                <div class="menu-and-user"><a href="profile.php">
                    </a><div class="logged-user-w"><a href="profile.php">

                        </a><div class="logged-user-info-w"><a href="profile.php"></a>
                            <div class="logged-user-name"><?php echo strtoupper($name); ?></div>
                            <div class="logged-user-role"><?php echo $acctype; ?> [<?php echo $acctnum; ?>]</div>
                        </div>
                    </div>
                    <!--------------------
START - Mobile Menu List
-------------------->
                    <ul class="main-menu">
                        <li>
                            <a href="index.php">
                                <div class="icon-w">
                                   <i class="os-icon os-icon-wallet-loaded"></i>
                                </div><span>Account Summary</span></a>
                        </li>


						<li class="has-sub-menu">
                            <a>
                                <div class="icon-w">
                                    <div class="os-icon os-icon-grid-10"></div>
                                </div><span>Transfer</span></a>
                            <ul class="sub-menu" style="list-style-type:none;">
                                <li><i class="icofont icofont-exchange"> &nbsp;</i><a href="../transfer.php">Transfer 

Funds</a></li>
                            </ul>
                        </li>

                        <li>
                            <a href="activities.php">
                                <div class="icon-w">
                                   <i class="icofont icofont-coins"></i>
                                </div><span>Account Activities</span></a>

                        </li>

						<li>
                            <a href="change_pwd.php">
                                <div class="icon-w">
                                    <div class="os-icon os-icon-fingerprint"></div>
                                </div><span>Change Password</span></a>

                        </li>

						<div class="divider"></div>
						<li>
                            <a href="logout" id="logout">
                                <div class="icon-w">
                                    <i class="icofont icofont-logout"></i>
                                </div><span>Logout</span></a>

                        </li>
                        </ul>

                    <!--------------------
END - Mobile Menu List
-------------------->

					 </div>


            </div>
            <!--------------------
END - Mobile Menu
-------------------->
            <!--------------------
START - Main Menu
-------------------->
            <div class="menu-w color-scheme-light color-style-transparent menu-position-side menu-side-left menu-layout-

compact sub-menu-style-over sub-menu-color-bright selected-menu-color-light menu-activated-on-hover menu-has-selected-link">
                <div class="logged-user-w avatar-inline">
                    <div class="logged-user-i">

                        <div class="logged-user-info-w">
                            <div class="logged-user-name"><h3><?php echo strtoupper($name); ?></h3></div>
                            <div class="logged-user-role"><?php echo $acctype; ?> [<?php echo $serial; ?>]</div>
                        </div>
                        <div class="logged-user-toggler-arrow">
                            <div class="os-icon os-icon-chevron-down"></div>
                        </div><a href="profile.php">
                        <div class="logged-user-menu color-style-bright">
                            <div class="logged-user-avatar-info">

                                <div class="logged-user-info-w">
                                    <div class="logged-user-name"><?php echo strtoupper($name); ?></div>
                                    <div class="logged-user-role"><?php echo $acctype; ?> [<?php echo $acctnum; ?>]</div>

                                </div>
                            </div>

                        </div></a>
                    </div>
                </div>


                <ul class="main-menu">
                    <li class="sub-header"><span></span></li>
                    <li>
                            <a href="index.php">
                                <div class="icon-w">
                                   <i class="os-icon os-icon-wallet-loaded"></i>
                                </div><span>Account Summary</span></a>
                    </li>
                   <li class="has-sub-menu">
                            <a>
                                <div class="icon-w">
                                    <div class="os-icon os-icon-grid-10"></div>
                                </div><span>Transfer</span></a>
							 <ul class="sub-menu">
                                <li><a href="transfer.php">Transfer to Account</a></li>
                            </ul>

                        </li>
                        <li>
                            <a href="activities.php">
                                <div class="icon-w">
                                   <i class="icofont icofont-coins"></i>
                                </div><span>Account Activities</span></a>

                        </li>

						<li>
                            <a href="change_pwd.php">
                                <div class="icon-w">
                                    <div class="os-icon os-icon-fingerprint"></div>
                                </div><span>Change Password</span></a>

                        </li>

						<div class="divider"></div>
						<li>
                            <a href="logout" id="logout">
                                <div class="icon-w">
                                    <i class="icofont icofont-logout"></i>
                                </div><span>Logout</span></a>

                        </li>

                </ul>
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: 

google.translate.TranslateElement.InlineLayout.HORIZONTAL}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?

cb=googleTranslateElementInit"></script>
            </div>
            <!--------------------
END - Main Menu
-------------------->
			  <!--------------------
END - Breadcrumbs
-------------------->
              <div class="content-box">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="element-wrapper">
                                    <h6 class="element-header">Account Activities</h6>
							   
								</div>
                            <div class="element-box">
                               <div class="table-responsive">
<table width="100%" border="1" bordercolor="#FFFFFF">
  <tr bordercolor="#FFFFFF" >
    <td height="50" style="color: #000066;
	font-weight: bold;"><div align="center">Date</div></td>
    <td height="50" style="color: #000066;
	font-weight: bold;"><div align="center">Description</div></td>
    <td height="50" style="color: #000066;
	font-weight: bold;"><div align="center">Type</div></td>
    <td height="50" style="color: #000066;
	font-weight: bold;"><div align="center">Amount</div></td>
    <td height="50" style="color: #000066;
	font-weight: bold;"><div align="center">Status</div></td>
    </tr>



<?php 
$sm = mysqli_query($con,"SELECT * FROM transactions WHERE username= '$username' ORDER BY DATE DESC");
if(mysqli_num_rows($sm) < '0'){
$history = "<span style:'color:blue'><strong>You do not currently have any transactions</strong></span>";
}
while($ra = mysqli_fetch_array($sm)){
$date = $ra['date'];
$description = $ra['description'];
$type= $ra['type'];
$credit = $ra['credit'];
$status = $ra['status'];

$history ='		
<tr bordercolor="#CCCCCC" >
<td><div align="center" class="style109">'.$date.'</div></td>
<td><div align="center" class="style109">'.$description.'</div></td>
<td><div align="center" class="style109">'.$type.'</div></td>
<td><div align="center" class="style109">'.$credit.'</div></td>
<td><div align="center" class="style109"><span class="status-pill smaller green"></span><span>'.$status.'</span></div></td>
<tr>
';
echo $history;


}
echo '<br>'
?>
</table>
</div>                            </div>
                        </div>
                        </div>
                        <!--------------------
START - Color Scheme Toggler
-------------------->
            
        </div>
        </div>
        <div class="display-type"></div>
    </div>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/jquery.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/popper.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/moment.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/Chart.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/select2.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/jquery_002.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/ckeditor.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/validator.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/daterangepicker.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/ion.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/dropzone.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/mindmup-editabletable.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/jquery_003.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/dataTables.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/fullcalendar.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/perfect-scrollbar.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/tether.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/slick.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/util.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/alert.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/button.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/carousel.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/collapse.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/dropdown.js"></script>
    <script src="Connex%20Credit%20Union%20_%./%20Activities_files/modal.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/tab.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/tooltip.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/popover.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/demo_customizer.js"></script>
    <script src="Connex%20Credit%20Union%20_%20Account%20Activities_files/main.js"></script>
	
    


<div class="goog-te-spinner-pos"><div class="goog-te-spinner-animation"><svg xmlns="http://www.w3.org/2000/svg" class="goog-

te-spinner" width="96px" height="96px" viewBox="0 0 66 66"><circle class="goog-te-spinner-path" fill="none" stroke-width="6" 

stroke-linecap="round" cx="33" cy="33" r="30"></circle></svg></div></div><iframe class="goog-te-menu-frame skiptranslate" 

title="Language Translate Widget" style="visibility: visible; box-sizing: content-box; width: 231px; height: 274px; display: 

none;" frameborder="0"></iframe></body></html>