<?php 
require_once('../Services/Twilio.php');
include('header.php');

/**
* 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.
*/

?>

			<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>Customer Name</th>
                                  <th>Current Balance</th>
								  <th>Amount</th>
								  <th>Actions</th>
							  </tr>
						  </thead>   
						  <form action="manage_balance.php" method="post">
                          <tbody>
						
							<tr>
								<td><?php echo $get_details['cust_name']; ?></td>
								<td><?php echo $get_present_blnc['present_balance']; ?></td>
								<td class="center">
									<input type="text" name="amount" id="amount" required />&nbsp;USD
                                    <input type="hidden" name="cust_act_number" value="<?php echo $get_details['cust_act_number']; ?>" />
								</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>
						  </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'); ?>
