{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
function myFunction()
{
	if(confirm("Are You Sure To Delete")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
<style>
td{
  text-align: center;
  font-weight: bold;
  
}
</style>
{/block}
{block name=body}
<form name="partyForm"action="{$smarty.server.PHP_SELF}" method="POST" onsubmit="return confirm('DO You Want To Submit !!!!!')";>
<input type="hidden" name="partyId" value="{$partyId}">
<h1 align="center"><font size="5px">Client List</font>&nbsp;&nbsp;<a href="clientprint.php?partyId={$partyId}" target="_blank" style="text-decoration:none;"><font size="3px;">Print</font></a>
<a href="cdelete.php?partyId={$partyId}" target="" style="text-decoration:none;"><font size="3px;">Delete</font></a></h1>
<table cellpadding="3" cellspacing="0"  align="center" width=90%>
   <tr>
    <!-- <td>Open Fine : {$openingAmt}</td>
	<td>Open Amount : {$openingFine}</td>-->
    <td colspan="9">Client Name
	  <select name="partyId" onchange="this.form.submit();" autofocus>
	     <option value="0">Select Party</option>
	    {html_options values=$clientArray.partyId output=$clientArray.partyName selected=$partyId}
	  </select>
	</td>
    <td>Opening Fine : {$openingAmt}</td> 
    <td>Opening Amount : {$openingFine}</td>
</table>
<br>
<table cellspacing="0"  width="100%" border="1">
  <tr>
    <td>Delete</td>
    <td>Edit</td>
    <td>Type</td>
    <td>Particular</td>
    <td>Date</td>
    <td>Rate</td>
    <td>Rate Diff</td>
    <td>Total</td>
    <td>K.G.</td>
    <td>Total Amount</td>
  </tr>
  {section name="sec" loop=$clientDetail}
     <td><a href="clientdelete.php?clientId={$clientDetail[sec].clientId}" onclick="return confirm('DO You Want To Delete !!!!!')";><img src="img/delete.png"></a></td>
     <td><a href="client.php?clientId={$clientDetail[sec].clientId}"><img src="img/edit.png"></a></td>
	 {if $clientDetail[sec].cliTransType == 'J'}
	   <td> Javak </td>
	 {else}
	   <td> Aavak </td>
	 {/if}
     <td>{$clientDetail[sec].particular}</td>
     <td>{$clientDetail[sec].cDate}</td>
     <td>{$clientDetail[sec].rate}</td>
     <td>{$clientDetail[sec].diff}{$clientDetail[sec].diffAmt}</td>
     <td>{$clientDetail[sec].total}</td>
     <td>{$clientDetail[sec].kg}</td>
     <td>{$clientDetail[sec].totalAmt}</td>
  </tr>
  {/section}
</table>
<br>
<table align="center" border="">
<tr>
	{if $finalkg < 0}
      <td colspan="3" align="right" style="color:red;">Final Kg : &nbsp;&nbsp; 	{$finalKg|string_format:"%.3f"}</td>
	{else}
	  <td colspan="3" align="right" style="color:green;">Final Kg : &nbsp;&nbsp; {$finalKg|string_format:"%.3f"}</td>
	{/if}
</tr>
<tr>
	{if $finalkg < 0}
      <td colspan="3" align="right" style="color:red;">Final Amount : &nbsp;&nbsp; 	{$finalAmount|string_format:"%.3f"}</td>
	{else}
	  <td colspan="3" align="right" style="color:green;">Final Amount : &nbsp;&nbsp; 	{$finalAmount|string_format:"%.3f"}</td>
	{/if}
  </tr>
</table>
<br>
<!-- <table align="center" border="1">
  <tr>
    <td>Open Fine : {$openingAmt}</td>
  </tr>
  <tr>
    <td>Open Amount : {$openingFine}</td>
  </tr>
  </tr>
</table> -->
</form>
{/block}	