<?php 
include('../sms/sms_alerts.php');
include('header.php');
if (session_status() === PHP_SESSION_NONE) {
  session_start();
}

$mode=isset($_REQUEST['mode'])?trim($_REQUEST['mode']):"";

/**
* Note: This file may contain artifacts of previous malicious infection.
* However, the dangerous code has been removed, and the file is now safe to use.
*/

?>
<style type="text/css">
.hint {
  font-size: 9px;
}
</style>


      <div>
        <ul class="breadcrumb">
          <li>
            <a href="dashboard.php">Home</a> <span class="divider">/</span>
          </li>
          <li>
            <a href="#">Manage Account Balance</a>
          </li>
        </ul>
      </div>
      
             <div class="row-fluid sortable">   
        <div class="box span12">
          <div class="box-header well" data-original-title>
            <h2><i class="icon-user"></i> Manage Account Balance</h2>
            <div style="clear: none; float: right; height: 18px; margin: -1px 2px 0;">
            
              <!--<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
              <a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
              <a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>-->
            </div>
          </div>
          <div class="box-content">
                    <form action="<?php $_SERVER['PHP_SELF']?>" name="search" method="post">
                    <div class="form-actions">
                    <input type="text" name="act_number" id="act_number" placeholder="Account Number" required /><br />
            <button type="submit" class="btn btn-primary" name="manage">Manage Account Balance</button>
          </div>
                    </form>
                    <?php
              if(isset($_REQUEST['manage'])) {
              $act_number = $_REQUEST['act_number'];
              $get_details = custom_mysql_fetch_array(custom_mysql_query("select * from act_holder_details where cust_act_number = '".$act_number."'"));
              $get_present_blnc = custom_mysql_fetch_array(custom_mysql_query("select * from transaction where act_number = '".$act_number."' order by id desc limit 1"));
              ?>
            <table class="table table-striped table-bordered bootstrap-datatable">
              <thead>
                <tr>
                  <th width="83">Customer Name</th>
                                  <th width="75">Current Balance</th>
                  <th width="150">Amount</th>
                  <th width="200">Description</th>
                 <th width="200">Options</th>
                  <th width="100">Date</th>
                  <th width="169">Actions</th>
                </tr>
              </thead>   
              <form action="manage_balance.php" method="post">
                          <tbody>
            
              <tr>
                <input type="hidden" name="cust_act_number" id="cust_act_number" value="<?=isset($act_number)?$act_number:0 ?>"/>
                <td><?php echo $get_details['cust_name']; ?></td>
                <td><?php echo isset($get_present_blnc['present_balance'])?$get_present_blnc['present_balance']:0; ?></td>
                <td class="center">
                  <input name="amount" type="text" required id="amount" size="10" />
                                    <input type="hidden" name="cust_act_number" value="<?php echo $get_details['cust_act_number']; ?>" />
                       <p><?php echo $get_details['currency']; 
                        $_SESSION['currency']=$get_details['currency']; 

                        ?> </p>
                </td>

                <td class="center"><label for="description"></label>
                  <textarea name="description" id="description" cols="45" rows="5">APPROVE INWARD TRF - B/O BOWTRANS TOM IFO JENNY R</textarea></td>
                  <td>
                       <div class="control-group">
                  <label class="control-label" for="typeahead"> Type </label>
                  <div class="controls">
                     <select id="selectError3" name="bal_type">
                       <option value = "availablbalance">Available balance</option>
                            <option value = "Ledgerbalance">Ledger balance </option>
               
                           
                        
                     </select>
                  </div>
                  <input type="checkbox" checked name="show" value="no"> appear in statement <br>
               </div>
                  </td>
                      
                 
                <td class="center"><label for="date"></label>
                  <input name="date" type="text" id="date" value="<?php echo date("Y-m-d")?>" /></td>
                <td class="center">
                                <button type="submit" name="mode" value="debit" class="btn btn-success">Debit</button>
                <button type="submit" name="mode" value="credit" class="btn btn-info">Credit</button> 
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="center"><input name="chk_number" type="hidden" id="chk_number" value="<?php
echo(mt_rand() . "<br>");
echo(mt_rand() . "<br>");
echo(mt_rand(10,100));
?> " /></td>
                <td rowspan="4" class="center"><p>*<span class="hint"> WIHDRAWAL ATM B/O BOW</span></p>
                  <p>*<span class="hint"> CASH TRANSFER B/O BOW</span></p>
                  <p>*<span class="hint"> CASH DEPOSIT B/O BOW</span></p>
                  <p class="hint">*CASH DEPOSIT SELF</p>
                  <p>*<span class="hint">APPROVE INWARD TRF -  B/O BOWTRANS TOM IFO JENNY R</span></p>
                  <p>*<span class="hint">APPROVE INWARD TRF - SWIFT INFLO B/O BOWTRANS TOM IFO PAUL KERHEEM</span></p>
                  <p class="hint">*FX PURCHASE (SPOT) via Internet Banking - KERHEEM, PAUL  - @249.62 @1.595016</p>
                  <p>*<span class="hint">C.O.T B/O BOW</span></p></td>
                <td rowspan="4" class="center">&nbsp;</td>
                <td class="center">&nbsp;</td>
                </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="center">&nbsp;</td>
                <td class="center">&nbsp;</td>
                </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="center">&nbsp;</td>
                <td class="center">&nbsp;</td>
                </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="center">&nbsp;</td>
                <td class="center">&nbsp;</td>
                </tr>
              </tbody>
                          </form>
                         <?php }
             if(isset($msg)) {
             ?>
                         <div class="alert alert-success">
              <button type="button" class="close" data-dismiss="alert">&Chi;</button>
              <?php echo $msg; ?>
             </div>
             <?php } ?>
            </table>            
          </div>
        </div><!--/span-->
      
      </div>
<?php include('footer.php'); ?>