{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function() {
	$('#example').dataTable();
});
function myFunction()
{
	if(confirm("Are You Sure To Delete")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

</script>
<style>
td{
  border: none;
  font-weight: bold;
  text-align: center;
}
</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></h1>
<table align="center">
	<tr>
	<td colspan="8">Client Name
	  <select name="partyId" onchange="this.form.submit();">
		 <option value="0">Select Party</option>
		{html_options values=$clientArray.partyId output=$clientArray.partyName selected=$partyId}
	  </select>
	</td>
	</tr>
</table>
<table id="example" class="cell-border" cellspacing="0" width="100%">
  <thead>
  <tr>
    <td>Edit</td>
    <td>Particular</td>
    <td>Date</td>
    <td>Rate</td>
    <td>Diff</td>
    <td>Diff Amount</td>
    <td>Total</td>
    <td>K.G.</td>
    <td>Total Amount</td>
    <td>Javak Fine</td>
    <td>Javak Amount</td>
  </tr>
  </thead>
  <tbody>
  {section name="sec" loop=$clientDetail}
  {if $clientDetail[sec].cliTransType == 'J'}
   <tr style="color:red;">
     <td><a href="client.php?clientId={$clientDetail[sec].clientId}"><img src="img/edit.png"></a></td>
     <td>{$clientDetail[sec].particular}</td>
     <td>{$clientDetail[sec].cDate}</td>
     <td>{$clientDetail[sec].rate}</td>
     <td>{$clientDetail[sec].diff}</td>
     <td>{$clientDetail[sec].diffAmt}</td>
     <td>{$clientDetail[sec].total}</td>
     <td>{$clientDetail[sec].kg}</td>
     <td>{$clientDetail[sec].clientDetail}</td>
     <td>{$clientDetail[sec].javakFine}</td>
     <td>{$clientDetail[sec].javakAmount}</td>
  </tr>
  {else}
   <tr style="color:green;">
     <td><a href="client.php?clientId={$clientDetail[sec].clientId}"><img src="img/edit.png"></a></td>
     <td>{$clientDetail[sec].particular}</td>
     <td>{$clientDetail[sec].cDate}</td>
     <td>{$clientDetail[sec].rate}</td>
     <td>{$clientDetail[sec].diff}</td>
     <td>{$clientDetail[sec].diffAmt}</td>
     <td>{$clientDetail[sec].total}</td>
     <td>{$clientDetail[sec].kg}</td>
     <td>{$clientDetail[sec].totalAmt}</td>
     <td></td>
     <td></td>
  </tr>
  {/if}
  {/section}
  </tbody>
</table>
<br>
<table align="center" border="" cellspacing="5" cellpadding="5"> 
  <tr>
    <td>Total Kg : </td>
	{if $finalKg > 0}
		<td style="color:green;">{$finalKg}</td>
	{else}
		<td style="color:red;">{$finalKg}</td>
	{/if}
  </tr>
  <tr>
    <td>Total Amount : </td>
	{if $finalAmount > 0}
		<td style="color:green;">{$finalAmount}</td>
	{else}
		<td style="color:red;">{$finalAmount}</td>
	{/if}
  </tr>
</table>
</form>
{/block}