<?php 
session_start();
include('conn_auth.php');
include('customInfo.php');
$selTrans = $conn->query("select * from credit_info  where accnt_nmb = '" . $rowUser['acct_nmb'] . "' order by transact_id DESC") or die($conn->error);
$rowTrans = $selTrans->fetch_assoc();
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta charset="UTF-8">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta property="og:type" content="Citi bank">
    <meta name="author" content="Citi bank">
    <meta name="keyword" content="banking, citi, financial services, checking account, savings account, credit cards, banking, best banking platform, citi bank, online platform"> 
    <meta name="description" content="Take advantage of the variety of offers available from Citibank, including banking products like checking, mortgage loans and credit cards">
    <meta property="og:title" content="Banking with Citi">
    <meta property="og:description" content="Take advantage of the variety of offers available from Citibank, including banking products like checking, mortgage loans and credit cards">
    <meta property="og:url" content="">
    <meta property="og:site_name" content="Citi.com">
    <meta property="og:image" content="">
    <meta property="og:image:width" content="">
    <meta property="og:image:height" content="">
    <meta name="twitter:card" content="">
    <meta name="twitter:description" content="">
    <meta property="og:url" content="">
<meta property="og:image" content="">

    <title> <?php echo $rowUser['cust_name']; ?> | Main transactions </title>
  
    <!-- css -->
    <link href="img/new_img/logo-2.png" rel="image" type="icon">
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" type="text/css" href="plugins/cubeportfolio/css/cubeportfolio.min.css">
  <link href="css/nivo-lightbox.css" rel="stylesheet" />
  <link href="css/nivo-lightbox-theme/default/default.css" rel="stylesheet" type="text/css" />
  <link href="css/owl.carousel.css" rel="stylesheet" media="screen" />
    <link href="css/owl.theme.css" rel="stylesheet" media="screen" />
  <link href="css/animate.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet">

  <!-- boxed bg -->
  <link id="bodybg" href="bodybg/bg1.css" rel="stylesheet" type="text/css" />
  <!-- template skin -->
  <link id="t-colors" href="color/default.css" rel="stylesheet">
</head>
<style type="text/css">
.box2 p{
font-size:0.9em;
}
.box2 img{
  height:170px;
}
.baltable th{
font-size: 0.9em;
color:rgba(0, 0, 0, 0.7);
padding: 10px;
}
.baltable td{
font-size: 0.8em;
color:rgba(0, 0, 0, 0.6);
padding: 10px;
}

.prmain-bd{

margin:22px 0px 0px 0px;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
padding-bottom: 20px;
}
.box2 span{
  font-size: 0.8em;
  font-weight: 700;
}
.box2 ul{
list-style: none;
margin-left: -40px;
  }
.box2 ul li a{
font-size: 0.8em;
}
</style>
<body id="page-top" data-spy="scroll" data-target=".navbar-custom">

<div id="wrapper">
  
   <?php include('main_header.php'); ?>
  <!-- Section: intro -->
 
  
  <!-- /Section: intro -->

  <!-- Section: boxes -->
    <section id="boxes" class="home-section xtramup">
  
      <div class="row">
        <div class="col-lg-12">
          <div class="info-b">
          <span class="wldiv">Welcome  <span class="stBig"><?php echo $rowUser['cust_name']; ?></span> to Citi bank !&nbsp; | &nbsp;</span>
          <span class="colorb">Last Transaction: </span><span class="colorR"><?php echo $rowTrans['dat_pay'] ==""? "Not available":  date('d l, Y', strtotime($rowTrans['dat_pay'])); ?> &nbsp; | &nbsp;</span>
          <span class=""><a href="update-profile">My profile</a></span>
                 </div>
        </div>
        <div class="col-lg-8 col-md-12">
            <div class="portfolio-page">
      
                
  <div class="col-lg-12">
                        <div class="pInfo">
                       <div role="application" style="font-size:14px;">
    <span id="accordion-bottom-ariaLabel" alt="expanded" class="hide"></span>
    <h2>Account Summary</h2>


    
                  <br>


<strong></strong>
                                    
                                    
                                    
              <table width="100%" height="98" cellpadding="7" cellspacing="0" class="baltable table-responsive">
               <tr style="border:1px solid rgba(0, 0, 0, 0.1);">
                           <th height="41"><div align="left" class="style1 style3 style1">Account Name</div></th>
                           <th ><div align="left" class="style5 style1">Account Number</div></th>
                           <th ><div align="left" class="style5 style1">Sort code</div></th>             
                           <th ><div align="left" class="style5 style1">Balance</div></th>             
                           <th ><div align="left" class="style5 style1">Available</div></th>             
                            </tr>
                            <?php
              $selBank = $conn->query("select *, sum(amt_cred) as totalCredit, sum(amt_dep) as totalDebit from credit_info where accnt_nmb = '" . $rowUser['acct_nmb'] . "' group by accnt_nmb") or die(mysql_error());

                            if(!$selBank->num_rows){
              ?>
                            <tr>
                            <td height="25" colspan="5" ><span class="style7">Sorry there is no transaction for this account </span></td>
                            </tr>
                            <?php
              }else{
              $rowBank = $selBank->fetch_assoc();
                            ?>
              <tr style="border-bottom:1px solid rgba(0, 0, 0, 0.1); padding-bottom: 4px;">
                            <td ><?php echo $rowBank['cust_name']; ?></td>
                            <td ><?php echo $rowBank['accnt_nmb']; ?></td> 
                 <td >&nbsp;</td> 
                           <td ><span class="balinfo"><?php echo getCurrency($rowcurr['curr_type']); echo number_format($rowBank['totalCredit']-$rowBank['totalDebit'], 2, '.', ','); ?></span></td>
                             <td ><span class="balinfo"><?php echo getCurrency($rowcurr['curr_type']); echo number_format($rowBank['totalCredit']-$rowBank['totalDebit'], 2, '.', ','); ?></span></td>
                           </tr>
                           <?php
               }
               ?>
                            </table>
                                    
              <div style="margin:5px 0px 0px 10px; color:#333333;" ><h5 class="style7">Minin statment</h5> 
                  </div>
                            <div style="margin:5px 0px 0px 10px; color:#333333;" ><span class="style7">Select account</span>
                              <hr /> </div>
                            <div style="padding:9px;">I<span class="style7">tems shown from today's data are subject to confirmation and maybe reversed from your account.
                            </span>
                            <br>
                            </div>
                  
                  


                   <table width="100%" height="98" cellpadding="7" cellspacing="0" class="baltable table-responsive">
                   <tr style="border:1px solid rgba(0, 0, 0, 0.1);">
                    <th height="33" ><div align="left" class="style6 style1">Date</div></th>
                     <th ><div align="left" class="style6 style1">Description</div></th>
                     <th ><div align="left" class="style6 style1">Credit</div></th>             
                     <th ><div align="left" class="style6 style1">Debits</div></th>             
                    </tr>
                            <?php
              $seldel = $conn->query("select * from credit_info where accnt_nmb = '" . $rowUser['acct_nmb'] . "' order by transact_id DESC limit 0, 10") or die(mysql_error());
                            if(!$seldel->num_rows){
              ?>
                            <tr>
                            <td><span class="style7">Sorry there is no transaction for this account </span></td>
                      </tr>
                            <?php
              }else{
              while($rowDel= $seldel->fetch_array()){;
                           $credamt = getCurrency($rowcurr['curr_type']) . number_format($rowDel['amt_cred'], 2, '.', ',');
                           $debitamt = getCurrency($rowcurr['curr_type']) . number_format($rowDel['amt_dep'], 2, '.', ',');
                            ?>
                           <tr>
                            <td style="border-bottom:1px solid rgba(0, 0, 0, 0.1);"><?php echo $rowDel['dat_pay']; ?></td>
                            <td style="border-bottom:1px solid rgba(0, 0, 0, 0.1);"><?php echo $rowDel['narratn']; ?></td> 
                            <td style="border-bottom:1px solid rgba(0, 0, 0, 0.1);"><?php  echo $rowDel['amt_cred'] == 0 ? "" : $credamt; ?></td> 
                            <td style="border-bottom:1px solid rgba(0, 0, 0, 0.1);"><?php echo  $rowDel['amt_dep'] == 0 ? "" : $debitamt; ?></td>
                           </tr>
                           <?php
               }
               }
               ?>
                  </table>
                            
                                   
            </div>
                        </div>
                    
                    </div>
  </div>
          </div>

        <div class="col-lg-1 rdwidt">
          
        </div>
        <div class="col-lg-3">
          <div class="prmain-bd">
            <h4><a href="#">Earn Cash Back Twice</a></h4>
            <div class="box2 text-left">
              <img src="img/new_img/DC_Module.jpg">
              <p>
       Earn 2% cash back on purchases: 1% when you buy and 1% as you pay.
              </p>
              <a href="#" style="color: #0172B9; font-size: 0.7em;">Learn more</a>
            </div>
          </div>
          <div class="prmain-bd">
            <h4><a href="#">Quick tasks</a></h4>
            <div class="box2 text-left">
             <span>What would you like to do ?</span>
             <ul>
            <li><a href="transfer-money">Make transfer </a></li>
            <li><a href="#">Download recent statements </a></li>
            <li><a href="transfer-money">Transfer betweeen my own </a></li>
            <li><a href="#">Review reward balance now </a></li>
             
             </ul>   
            
            </div>
          </div>
          <div class="prmain-bd">
            <h4><a href="#">Financial  Tools</a></h4>
            <div class="box2 text-left">
             <span>&nbsp;</span>
             <ul>
            <li><a href="#">Fx rates </a></li>
             </ul>   
            
            </div>
          </div>
        </div>
      </div>
  </section>
  <!-- /Section: boxes -->
  
  
  

  
    
    

<?php include('footer.php'); ?>

</div>
<a href="#" class="scrollup"><i class="fa fa-angle-up active"></i></a>

  <!-- Core JavaScript Files -->
    <script src="js/jquery.min.js"></script>   
    <script src="script.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.easing.min.js"></script>
  <script src="js/wow.min.js"></script>
  <script src="js/jquery.scrollTo.js"></script>
  <script src="js/jquery.appear.js"></script>
  <script src="js/stellar.js"></script>
  <script src="plugins/cubeportfolio/js/jquery.cubeportfolio.min.js"></script>
  <script src="js/owl.carousel.min.js"></script>
  <script src="js/nivo-lightbox.min.js"></script>
    <script src="js/custom.js"></script>


</body>

</html>
