<?php
/* Smarty version 3.1.30, created on 2023-05-01 12:05:55
  from "/home/hgsonsc1/hbm.foundbeta.co.in/templates/summary_new.tpl" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.30',
  'unifunc' => 'content_644f5dcb8a53f0_34510244',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'f9feb73851a61dd520c3aedfa3cc4de2a2d02cfa' => 
    array (
      0 => '/home/hgsonsc1/hbm.foundbeta.co.in/templates/summary_new.tpl',
      1 => 1602683942,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:./main.tpl' => 1,
  ),
),false)) {
function content_644f5dcb8a53f0_34510244 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>

<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_595709177644f5dcb841be2_20014461', 'head');
?>

<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_933801481644f5dcb8a2b31_79500276', 'body');
$_smarty_tpl->inheritance->endChild();
$_smarty_tpl->_subTemplateRender("file:./main.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 2, false);
}
/* {block 'head'} */
class Block_595709177644f5dcb841be2_20014461 extends Smarty_Internal_Block
{
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

<?php echo '<script'; ?>
 type="text/javascript">
function getAmt(amountObj)
{
  var row      = $(amountObj).parents('.itemRow'); 
  var kg       = row.find('.kg').val() != '' ? row.find('.kg').val() : 0;
  var rate     = $('.rate').val() != '' ? $('.rate').val() : 0;
  var kgrs     = row.find('.kgrs').val() != '' ? row.find('.kgrs').val() : 0;
  var totalAmt = row.find('.totalAmt').val() != '' ? row.find('.totalAmt').val() : 0;
  var dd   	   = 0;
  var aa       =  parseFloat(kg) * parseFloat(rate);
  row.find('.kgrs').val(aa.toFixed(2));
  
  if(kg > 0  && totalAmt < 0)
  {
	  var xx = Math.abs(totalAmt);
	  dd =  parseFloat(kgrs) - parseFloat(xx);
	  row.find('.finalAmt').val(dd.toFixed(2));
  }
  else if(kg < 0  && totalAmt > 0)
  {
	  var xx = Math.abs(kgrs);
	  dd =  parseFloat(totalAmt) - parseFloat(xx);
	  row.find('.finalAmt').val(dd.toFixed(2));
  }
  else
  {
    var xx = Math.abs(kgrs);
    var yy = Math.abs(totalAmt);
    dd =  parseFloat(xx) + parseFloat(totalAmt);
	row.find('.finalAmt').val(dd.toFixed(2));
  }
  
  
}
<?php echo '</script'; ?>
>
<?php
}
}
/* {/block 'head'} */
/* {block 'body'} */
class Block_933801481644f5dcb8a2b31_79500276 extends Smarty_Internal_Block
{
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

<form action="summary.php" method="POST">
<table align="center" border="2" width="70%"> 
	<h2 align="center">Client Summary</h2>
<thead>
<center>
  <input type="text" class="rate" placeholder="Enter Rate" onBlur="getAmt();">
</center>
	<tr>
		<th class="table1">Party Name</th>
		<th class="table1">Fine</th>
		<th class="table1">Amount</th>
		<th class="table1">Silver Rs</th>
		<th class="table1">Final Amount</th>
    </tr>
</thead>
</tbody>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['pendingArray']->value, 'onerow');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['onerow']->value) {
?>
  <tr class="itemRow">
	<input type="hidden" name="partyId" value="<?php echo $_smarty_tpl->tpl_vars['onerow']->value['partyId'];?>
">
  	<td class="table1" align="center"><?php echo $_smarty_tpl->tpl_vars['onerow']->value['partyName'];?>
</td>
    <td class="table1" align="center">
		<input type="text" class="kg" value="<?php echo sprintf("%.3f",$_smarty_tpl->tpl_vars['onerow']->value['kg']);?>
" style="width:100px;" onBlur="getAmt(this);"">
	</td>
	<td class="table1" align="center"> 
	  <input type="text" value="<?php echo sprintf("%.3f",$_smarty_tpl->tpl_vars['onerow']->value['totalAmt']);?>
" class="totalAmt">
	</td>
	<td class="table1" align="center">
		<input type="text" class="kgrs" style="width:100px;" onBlur="getAmt(this);" readonly>
	</td>
	<td class="table1" align="center">
		<input type="text" class="finalAmt" style="width:100px;" onBlur="getAmt(this);">
	</td>
		

  </tr>
<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

</tbody>
</table>
<br><br><br>
<table align="center" border="1" width="30%">
  <tr>
    <td>Final Weight :- <?php echo sprintf("%.3f",$_smarty_tpl->tpl_vars['kg']->value);?>
</td>
  </tr>
  <tr>
     <td>Total Amount :- <?php echo sprintf("%.3f",$_smarty_tpl->tpl_vars['totalAmt']->value);?>
</td>
  </tr>
  
</table>
</form>
<?php
}
}
/* {/block 'body'} */
}
