<? if($_SESSION['page'] == '4' and $_SESSION['section'] == '3') {

?>
<link href="../admin.css" rel="stylesheet" type="text/css" />

<table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
      <tr>
        <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td class="Main_Text"><a class="Main_Text">Payments history</a></td>
            <td width="10%" class="Main_Text"><div align="right"><img src="image/more_info.gif" width="32" height="32" border="0" /></a></div></td>
          </tr>
          <tr>
            <td colspan="2">
            
<? if ($_GET['stat'] == '' ) {?>            
            
                
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="image/subheader_icon.gif" width="12" height="12" /><strong class="text2">&nbsp;&nbsp;History of Payments</strong></p>
        
        <br />
	            <table width="95%" border="0" align="center">

                  <tr>
                    <td height="35" class="Main_Text1">Payment date</td>
                    <td class="Main_Text1">Payment Type</td>
                    <td class="Main_Text1">Payment where</td>
                    <td class="Main_Text1">Receipt ( client )</td>
                    <td class="Main_Text1">Recipt No.</td>
                    <td class="Main_Text1">Amount</td>
                    <td class="Main_Text1">Staff ID</td>
                    <td class="Main_Text1">Status</td>
                    <td class="Main_Text1">note</td>
                  </tr>
                  <?
				  $result1 = mysql_query("SELECT * FROM ".$dcm_table_start."call_payment where case_id=".$_SESSION['4_1_case_id']); 
						while($row = mysql_fetch_array($result1)){ 
						//	$query1 = mysql_query("SELECT * FROM ".$dcm_table_start."customer where cus_id = ".$row['cus_id']); 		
						//	$query2 = mysql_query("SELECT * FROM ".$dcm_table_start."client where cli_id = ".$row['cli_id']); 	
						//	$query3 = mysql_query("select * from ".$dcm_table_start."bucket	where bid = ".$row['bid']); 	
				?>
                  <tr>
                    <td class="Main_Text"><? echo $row['payment_date'];?></td>
                    <td class="Main_Text"><? if ( $row['payment_type']== 1 ) { echo "Cash"; }
											 if ( $row['payment_type']== 2 ) { echo "Cheque"; }
					?></td>
                    <td class="Main_Text"><? if ( $row['payment_where'] == 1) { echo "Client";}
											 if ( $row['payment_where'] == 2) { echo "Arig";}?></td>
                    <td class="Main_Text"><div align="center"><? echo $row['receipt'];?></div></td>
                    <td class="Main_Text"><div align="center"><? echo $row['invoice'];?></div></td>
                    <td class="Main_Text"><div align="right"><? echo $row['amount'];?> BD</div></td>
                    <td class="Main_Text"><div align="center"><? echo $row['uid'];?></div></td>
                    <td class="Main_Text"><div align="center"><? if ( $row['status'] == 0 ) { echo "Awaiting Approval"; } 
					 if ( $row['status'] == 1 ) { echo "Approv"; } 
						if ( $row['status'] == 2 ) { echo "Reject"; } 
						if ( $row['status'] == 3 ) { echo "Decline"; } 
					 ?></div></td>
                    <td class="Main_Text"><div align="center"><? echo $row['note'];?></div></td>
                  </tr>
                  <?
				  	}
					?>
                </table>
              <br />
            <? } ?>            </td>
          </tr>
        </table></td>
      </tr>
</table>
 
<? } ?>
