<?php
session_start();
include "connect.php";



		$branchmid  = intval($_REQUEST['id']);
		
		 
				
		

?>

						<!--begin::Input group-->
							<div class="row row-cols-1 row-cols-sm-2 rol-cols-md-1 row-cols-lg-2" id="">
							<div class="col-md-6 fv-row">
							<h3>Branch Got</h3>
							<table class="table align-middle table-row-dashed fs-6 gy-5 mb-0">
                <tr>
				<th>Date</th>
				
				<th>Amount In</th>
				<th>Remark</th>
				</tr>
				<?php
				
				$eve = "SELECT tcaddedon,tctransferamount,tcremark FROM res_transfercash_detail where branchmid = $branchmid ";
	$re = mysqli_query($conn, $eve);	
	
	if(mysqli_num_rows($re) > 0)
	{
		$i=1;
		 while($rt = mysqli_fetch_assoc($re))
		 {
			 
				$tcaddedon=date("d-m-Y",strtotime($rt['tcaddedon']));
				$tctransferamount=$rt['tctransferamount'];
				$tcremark=$rt['tcremark'];
				
				
				
				
		
				?>
                <tr>
                 
                  <td>
                    <?php echo $tcaddedon;?>
                  </td>
				   <td>
				   <div class="badge badge-light-success">
                    <?php echo $tctransferamount;?>
					</div>
                  </td>
				   <td>
                    <?php echo $tcremark;?>
                  </td>
				  </tr>
		 <?php }
	}
	?>
				  </table>
				  </div>
				  <div class="col-md-6 fv-row">
				  <h3>Branch Gave</h3>
				  <table class="table align-middle table-row-dashed fs-6 gy-5 mb-0">
                <tr>
				<th>Date</th>
				<th>Expense</th>
				<th>Amount Out</th>
				<th>Remark</th>
				</tr>
				<?php
				
				$eve = "SELECT paydate,payamount,premark,expensetypemid FROM res_pettycash_detail where branchmid = $branchmid;";
	$re = mysqli_query($conn, $eve);	
	
	if(mysqli_num_rows($re) > 0)
	{
		$i=1;
		 while($rt = mysqli_fetch_assoc($re))
		 {
			 
				$paydate=date("d-m-Y",strtotime($rt['paydate']));
				$payamount=$rt['payamount'];
				$premark=$rt['premark'];
				$expensetypemid=$rt['expensetypemid'];
				$eveag1 = "select * from res_expensetype_master where expensetypemid=$expensetypemid";
				$reag1 = mysqli_query($conn, $eveag1);
				if(mysqli_num_rows($reag1) > 0)
				{
					while($rtag1 = mysqli_fetch_assoc($reag1))
					{
						$expensetypename=$rtag1['expensetypename'];
					}
				}
				else
				{
					$expensetypename="";
				}
				
				
				
				
		
				?>
                <tr>
                 
                  <td>
                    <?php echo $paydate;?>
                  </td>
				  <td>
                    <?php echo $expensetypename;?>
                  </td>
				  <td>
				  <div class="badge badge-light-danger">
                    <?php echo $payamount;?>
					</div>
                  </td> <td>
                    <?php echo $premark;?>
                  </td>
				  </tr>
				   <?php }
	}
	?>
				  </table>
				
				  </div>
				  </div>
	
																
																	
																
