<?php
if(isset($_POST['Update']))
{
 $empmonth=$_REQUEST['employee_m1']."/".$_REQUEST['employee_m2']."/".$_REQUEST['employee_y']."/".$_REQUEST['employee_y1']."/".$_REQUEST['employee_y2']."/".$_REQUEST['employee_y3'];	
 $empmonth2=$_REQUEST['employer_m1']."/".$_REQUEST['employer_m2']."/".$_REQUEST['employer_y']."/".$_REQUEST['employer_y1']."/".$_REQUEST['employer_y2']."/".$_REQUEST['employer_y3'];	
 $dateof=$_REQUEST['date_of_payment_d1']."/".$_REQUEST['date_of_payment_d2']."/".$_REQUEST['date_of_payment_m1']."/".$_REQUEST['date_of_payment_m2']."/".$_REQUEST['date_of_payment_y1']."/".$_REQUEST['date_of_payment_y2']."/".$_REQUEST['date_of_payment_y3'];
  $explode=explode('/',$_REQUEST['presentation_date']);
  $count1=count($explode);
  if($count1>1)
  {
  $predate=$explode[2]."-".$explode[1]."-".$explode[0];
  }
  else {
      $predate=$_REQUEST['presentation_date'];
  }
  $explode1=explode('/',$_REQUEST['realisation_date']);
  $count2=count($explode1);
  if($count2>1)
  {
  $predate1=$explode1[2]."-".$explode1[1]."-".$explode1[0];
  }
  else {
      $predate1=$_REQUEST['realisation_date'];
  }
$explode2=explode('/',$_REQUEST['realisation_date']);
  $count3=count($explode2);
  if($count2>1)
  {
  $predate2=$explode2[2]."-".$explode2[1]."-".$explode2[0];
  }
  else {
      $predate2=$_REQUEST['date'];
  }
  
 $insert="update  statutory_employee_provident_fund set establishment_code='".$_REQUEST['establishment_code']."'
        ,account_group='".$_REQUEST['account_group']."',paid_by='".$_REQUEST['paid_by_cheque']."',employee_month_dues='".$empmonth."',
         employer_month_dues='".$empmonth2."',date_of_payment='".FormatDateForSQL($dateof)."',total_no_subscribers_ac1='".$_REQUEST['total_no_subscribers_ac1']."'
         ,total_no_subscribers_ac10='".$_REQUEST['total_no_subscribers_ac10']."',total_no_subscribers_ac21='".$_REQUEST['total_no_subscribers_ac21']."',
         total_wages_due_ac1='".$_REQUEST['total_wages_due_ac1']."',total_wages_due_ac10='".$_REQUEST['total_wages_due_ac10']."'
         ,total_wages_due_ac21='".$_REQUEST['total_wages_due_ac21']."',total_ac1='".$_REQUEST['total_ac1']."',total_ac2='".$_REQUEST['total_ac2']."'
         ,total_ac10='".$_REQUEST['total_ac10']."',total_ac21='".$_REQUEST['total_ac21']."',total_ac22='".$_REQUEST['total_ac22']."',
         grand_total='".$_REQUEST['grand_total']."',amount_in_words='".$_REQUEST['amount_in_words']."',banks_use='".$_REQUEST['banks_use']."',establishment_name='".$_REQUEST['establishment_name']."'
         ,address='".$_REQUEST['address']."',dipositor_name='".$_REQUEST['dipositor_name']."',depositor_signature='".$_REQUEST['depositor_signature']."'
         ,received_amount='".$_REQUEST['received_amount']."', cheques_only='".$_REQUEST['cheques_only']."'
         ,presentation_date='".$predate."',realisation_date='".$predate1."'
         ,branch_name='".$_REQUEST['branch_name']."',branch_code='".$_REQUEST['branch_code']."',bank_name='".$_REQUEST['bank_name']."'
         ,cheque_no='".$_REQUEST['cheque_no']."',date='".$predate2."' where id='".$_REQUEST['Id']."' ";
$query=DB_query($insert,$db);

 $insert2="update  statutory_employee_provident_fund_datails set employer_share_count_ac1='".$_REQUEST['employer_share_count_ac1']."'
				,employer_share_count_ac2='".$_REQUEST['employer_share_count_ac2']."', employer_share_count_ac10='".$_REQUEST['employer_share_count_ac10']."'
				,employer_share_count_ac21='".$_REQUEST['employer_share_count_ac21']."',employer_share_count_ac22='".$_REQUEST['employer_share_count_ac22']."'
				,employer_share_count_total='".$_REQUEST['employer_share_count_total']."',employee_share_count_ac1='".$_REQUEST['employee_share_count_ac1']."'
				,employee_share_count_ac2='".$_REQUEST['employee_share_count_ac2']."',employee_share_count_ac10='".$_REQUEST['employee_share_count_ac10']."'
				,employee_share_count_ac21='".$_REQUEST['employee_share_count_ac21']."',employee_share_count_ac22='".$_REQUEST['employee_share_count_ac22']."'
				,employee_share_count_total='".$_REQUEST['employee_share_count_total']."',adm_charges_ac1='".$_REQUEST['adm_charges_ac1']."'
				,adm_charges_ac2='".$_REQUEST['adm_charges_ac2']."',adm_charges_ac10='".$_REQUEST['adm_charges_ac10']."',
			         adm_charges_ac21='".$_REQUEST['adm_charges_ac21']."',adm_charges_ac22='".$_REQUEST['adm_charges_ac22']."'
			         ,adm_charges_total='".$_REQUEST['adm_charges_total']."',insp_charges_ac1='".$_REQUEST['insp_charges_ac1']."'
			         ,insp_charges_ac2='".$_REQUEST['insp_charges_ac2']."',insp_charges_ac10='".$_REQUEST['insp_charges_ac10']."',
			         insp_charges_ac21='".$_REQUEST['insp_charges_ac21']."',insp_charges_ac22='".$_REQUEST['insp_charges_ac22']."'
			         ,insp_charges_total='".$_REQUEST['insp_charges_total']."',penal_demages_ac1='".$_REQUEST['penal_demages_ac1']."'
			         ,penal_demages_ac2='".$_REQUEST['penal_demages_ac2']."',penal_demages_ac10='".$_REQUEST['penal_demages_ac10']."',
			         penal_demages_ac21='".$_REQUEST['penal_demages_ac21']."',penal_demages_ac22='".$_REQUEST['penal_demages_ac22']."'
			         ,penal_demages_total='".$_REQUEST['penal_demages_total']."',miss_payment_ac1='".$_REQUEST['miss_payment_ac1']."'
			         ,miss_payment_ac2='".$_REQUEST['miss_payment_ac2']."',miss_payment_ac10='".$_REQUEST['miss_payment_ac10']."',
			         miss_payment_ac21='".$_REQUEST['miss_payment_ac21']."',miss_payment_ac22='".$_REQUEST['miss_payment_ac22']."'
			         ,miss_payment_total='".$_REQUEST['miss_payment_total']."' where parentid='".$_REQUEST['Id']."'";
			       $query1=DB_query($insert2,$db);
				
echo "<script>location.href='index.php?route=employee_providentlist&modid=".$_REQUEST['modid']."&frmid=".$_REQUEST['frmid']."'</script>";
}

$select=DB_query("select * from statutory_employee_provident_fund where id='".$_REQUEST['Id']."'",$db);
$data=DB_fetch_array($select);
?>
 	<form action=""method="post">
<table  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td  class="text-wdthout-pad">(COMBINED CHALLAN OF A/C No. 1,2,10,21 &amp; 22)</td>
        <td  align="left" class="text">(USE SEPARATE CHALLAN FOR EACH MONTH)</td>
        <td   align="right" class="text"><strong>DUPLICATE</strong></td>
      </tr>
    </table></td>
  </tr>
  <tr>
  	 <td align="center"><table  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
       <td  >&nbsp;</td>  <td class="text" width="373">STATE BANK OF INDIA</td><td width="264">&nbsp;</td>
        
      </tr>
    </table></td>	
  	
    
  </tr>
  <tr>
  	<td align="center"><table  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
       <td  >&nbsp;</td><td align="center" class="text2" width="453"><u>EMPLOYEES' PROVIDENT FUND ORGANISATION</u></td><td  >&nbsp;</td>
    </tr></table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table  border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td   class="text">Establishment Code No. DL :</td>
        <td  ><input  size="8" type="text" id="establishment_code" name="establishment_code"  value="<?php echo $data['establishment_code']; ?>" /></td>
        <td   class="text">Account Group No. :</td>
        <td ><input  size="8" type="text" id="account_group" name="account_group" value="<?php echo $data['account_group']; ?>" /></td>
        <td   class="text">Paid by Cheque/Cash :</td>
        <td  ><input  size="8" type="text" id="paid_by_cheque" name="paid_by_cheque" value="<?php echo $data['paid_by']; ?>" /></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td   class="text">Dues for the Month of :</td>
        <td   align="center" valign="top"><table   border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>&nbsp;</td>
            <td align="center" valign="top" class="text-wdthout-pad">M</td>
            <td align="center" valign="top" class="text-wdthout-pad">M</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
          </tr>
          <?php
          $data1=explode('/',$data['employee_month_dues']); 
          ?>
          <tr>
            <td width="145" class="text">Employees Share :</td>
            <td width="15" align="center" valign="top"><input style="width:25px" type="text" id="employee_m1" name="employee_m1"  maxlength="1"  value="<?php echo $data1[0]; ?>" /></td>
            <td width="10" align="center" valign="top"><input style="width:25px" type="text" id="employee_m2" name="employee_m2" maxlength="1" value="<?php echo $data1[1]; ?>" /></td>
            <td width="20" align="center" valign="top"><input style="width:25px" type="text" id="employee_y" name="employee_y" maxlength="1" value="<?php echo $data1[2]; ?>" /></td>
            <td width="25" align="center" valign="top"><input style="width:25px" type="text" id="employee_y1" name="employee_y1" maxlength="1" value="<?php echo $data1[3]; ?>" /></td>
            <td width="20" align="center" valign="top"><input style="width:25px" type="text" id="employee_y2" name="employee_y2" maxlength="1" value="<?php echo $data1[4]; ?>" /></td>
            <td width="30" align="center" valign="top"><input style="width:25px" type="text" id="employee_y3" name="employee_y3" maxlength="1" value="<?php echo $data1[5]; ?>" onfocus="emp_total();" readonly="readonly"/></td>
          </tr>
          <tr>
            <td height="5"></td>
            <td height="5" align="center" valign="top"></td>
            <td height="5" align="center" valign="top"></td>
            <td height="5" align="center" valign="top"></td>
            <td height="5" align="center" valign="top"></td>
            <td height="5" align="center" valign="top"></td>
            <td height="5" align="center" valign="top"></td>
          </tr>
           <?php
          $data2=explode('/',$data['employer_month_dues']); 
          ?>
          <tr>
            <td class="text">Employer Share :</td>
            <td align="center" valign="top"><input style="width:25px" type="text" id="employer_m1" name="employer_m1" maxlength="1"  value="<?php echo $data2[0]; ?>" /></td>
            <td align="center" valign="top"><input style="width:25px" type="text" id="employer_m2" name="employer_m2" maxlength="1"  value="<?php echo $data2[1]; ?>" /></td>
            <td align="center" valign="top"><input style="width:25px" type="text" id="employer_y" name="employer_y" maxlength="1"  value="<?php echo $data2[2]; ?>" /></td>
            <td align="center" valign="top"><input style="width:25px" type="text" id="employer_y1" name="employer_y1" maxlength="1"  value="<?php echo $data2[3]; ?>" /></td>
            <td align="center" valign="top"><input style="width:25px" type="text" id="employer_y2" name="employer_y2" maxlength="1"  value="<?php echo $data2[4]; ?>" /></td>
            <td align="center" valign="top"><input style="width:25px" type="text" id="employer_y3" name="employer_y3" maxlength="1"  value="<?php echo $data2[5]; ?>" /></td>
            </tr>
        </table></td>
        <td width="401"><table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
            <td align="center" valign="top" class="text-wdthout-pad">D</td>
            <td align="center" valign="top" class="text-wdthout-pad">D</td>
            <td align="center" valign="top" class="text-wdthout-pad">M</td>
            <td align="center" valign="top" class="text-wdthout-pad">M</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
            <td align="center" valign="top" class="text-wdthout-pad">Y</td>
            </tr>
             <?php
          $data3=explode('/',$data['date_of_payment']); 
          ?>
          <tr>
            <td width="115" class="text-wdthout-pad">Date of Payment :</td>
            <td width="25" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_d1" name="date_of_payment_d1" maxlength="1" value="<?php echo $data3[0]; ?>" /></td>
            <td width="46" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_d2" name="date_of_payment_d2" maxlength="1" value="<?php echo $data3[1]; ?>" /></td>
            <td width="20" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_m1" name="date_of_payment_m1" maxlength="1" value="<?php echo $data3[2]; ?>" /></td>
            <td width="50" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_m2" name="date_of_payment_m2" maxlength="1" value="<?php echo $data3[3]; ?>" /></td>
            <td width="20" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_y1" name="date_of_payment_y1" maxlength="1" value="<?php echo $data3[4]; ?>" /></td>
            <td width="20" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_y2" name="date_of_payment_y2" maxlength="1" value="<?php echo $data3[5]; ?>" /></td>
            <td width="20" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_y3" name="date_of_payment_y3" maxlength="1"  value="<?php echo $data3[6]; ?>" /></td>
            <td width="20" align="center" valign="top"><input style="width:25px" type="text" id="date_of_payment_y4" name="date_of_payment_y4" maxlength="1"  value="<?php echo $data3[7]; ?>" /></td>
            </tr>
        </table></td>
      </tr>
    </table>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top"><table  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="text">Total No. of Subscribers :</td>
        <td>&nbsp;</td>
        <td><input  size="8" type="text" id="total_no_subscribers_ac1" name="total_no_subscribers_ac1"  value="<?php echo $data['total_no_subscribers_ac1']; ?>" /></td>
        <td>&nbsp;</td>
        <td><input  size="8" type="text" id="total_no_subscribers_ac10" name="total_no_subscribers_ac10" value="<?php echo $data['total_no_subscribers_ac10']; ?>" /></td>
        <td>&nbsp;</td>
        <td><input  size="8" type="text" id="total_no_subscribers_ac21" name="total_no_subscribers_ac21" value="<?php echo $data['total_no_subscribers_ac21']; ?>"  /></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td class="text-wdthout-pad">A/c 1</td>
        <td>&nbsp;</td>
        <td class="text-wdthout-pad">A/c 10</td>
        <td>&nbsp;</td>
        <td class="text-wdthout-pad">A/c 21</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="206" class="text">Total Wages Due :</td>
        <td width="40">&nbsp;</td>
        <td width="213"><input  size="8" type="text" id="total_wages_due_ac1" name="total_wages_due_ac1" value="<?php echo $data['total_wages_due_ac1']; ?>" /></td>
        <td width="59">&nbsp;</td>
        <td width="222"><input  size="8" type="text" id="total_wages_due_ac10" name="total_wages_due_ac10" value="<?php echo $data['total_wages_due_ac10']; ?>" /></td>
        <td width="53">&nbsp;</td>
        <td width="197"><input  size="8" type="text" id="total_wages_due_ac21" name="total_wages_due_ac21" value="<?php echo $data['total_wages_due_ac21']; ?>" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table style="border:1px solid #cccccc;"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="77" rowspan="2" align="center" class="text">Sl. No.</td>
        <td width="195" rowspan="2" align="left" class="text-wdthout-pad">PARTICULARS</td>
        <td width="116" align="center" valign="top" class="text-wdthout-pad">A/c. No. 1</td>
        <td width="117" align="center" valign="top" class="text-wdthout-pad">A/c. No. 2</td>
        <td width="117" align="center" valign="top" class="text-wdthout-pad">A/c. No. 10</td>
        <td width="117" align="center" valign="top" class="text-wdthout-pad">A/c. No. 21</td>
        <td width="117" align="center" valign="top" class="text-wdthout-pad">A/c. No. 22</td>
        <td width="132" align="center" valign="top" class="text-wdthout-pad">Total</td>
      </tr>
      <tr>
        <td colspan="6" align="center" valign="top" class="text-wdthout-pad">.........AMOUNT (in Rupees).......</td>
        </tr>
    </table></td>
  </tr>
  <?php
  $datafund=DB_query("select * from statutory_employee_provident_fund_datails where parentid='".$_REQUEST['Id']."'",$db);
  $row=DB_fetch_array($datafund); 
  ?>
  <tr>
    <td align="center" valign="top"><table  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td  align="center" class="text">1.</td>
        <td   class="text-wdthout-pad">Employer's Share of Cont.</td>
        <td   align="center"><input  size="8" type="text" id="employer_share_count_ac1" name="employer_share_count_ac1" value="<?php echo $row['employer_share_count_ac1']; ?>" /></td>
        <td  align="center"><input  size="8" type="text" id="employer_share_count_ac2" name="employer_share_count_ac2" value="<?php echo $row['employer_share_count_ac2']; ?>" /></td>
        <td width="120" align="center"><input  size="8" type="text" id="employer_share_count_ac10" name="employer_share_count_ac10" value="<?php echo $row['employer_share_count_ac10']; ?>" /></td>
        <td width="119" align="center"><input  size="8" type="text" id="employer_share_count_ac21" name="employer_share_count_ac21" value="<?php echo $row['employer_share_count_ac21']; ?>" /></td>
        <td width="117" align="center"><input  size="8" type="text" id="employer_share_count_ac22" name="employer_share_count_ac22" value="<?php echo $row['employer_share_count_ac22']; ?>" /></td>
        <td width="127" align="center"><input  size="8" type="text" id="employer_share_count_total" name="employer_share_count_total" value="<?php echo $row['employer_share_count_total']; ?>" onfocus="emp_total();" readonly="readonly"/></td>
      </tr>
      <tr>
        <td align="center" class="text">2.</td>
        <td class="text-wdthout-pad">Employee's Share of Cont.</td>
        <td align="center"><input  size="8" type="text" id="employee_share_count_ac1" name="employee_share_count_ac1" value="<?php echo $row['employee_share_count_ac1']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="employee_share_count_ac2" name="employee_share_count_ac2" value="<?php echo $row['employee_share_count_ac2']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="employee_share_count_ac10" name="employee_share_count_ac10" value="<?php echo $row['employee_share_count_ac10']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="employee_share_count_ac21" name="employee_share_count_ac21" value="<?php echo $row['employee_share_count_ac21']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="employee_share_count_ac22" name="employee_share_count_ac22" value="<?php echo $row['employee_share_count_ac22']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="employee_share_count_total" name="employee_share_count_total"  value="<?php echo $row['employee_share_count_total']; ?>" onfocus="employee_total();" readonly="readonly" /></td>
        </tr>
      <tr>
        <td align="center" class="text">3.</td>
        <td class="text-wdthout-pad">ADM. Charges</td>
        <td align="center"><input  size="8" type="text" id="adm_charges_ac1" name="adm_charges_ac1" value="<?php echo $row['adm_charges_ac1']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="adm_charges_ac2" name="adm_charges_ac2" value="<?php echo $row['adm_charges_ac2']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="adm_charges_ac10" name="adm_charges_ac10" value="<?php echo $row['adm_charges_ac10']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="adm_charges_ac21" name="adm_charges_ac21" value="<?php echo $row['adm_charges_ac21']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="adm_charges_ac22" name="adm_charges_ac22" value="<?php echo $row['adm_charges_ac22']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="adm_charges_total" name="adm_charges_total" value="<?php echo $row['adm_charges_total']; ?>" onfocus="adm_total();" readonly="readonly"/></td>
        </tr>
      <tr>
        <td align="center" class="text">4.</td>
        <td class="text-wdthout-pad">Insp. Charges</td>
        <td align="center"><input  size="8" type="text" id="insp_charges_ac1" name="insp_charges_ac1" value="<?php echo $row['insp_charges_ac1']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="insp_charges_ac2" name="insp_charges_ac2" value="<?php echo $row['insp_charges_ac2']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="insp_charges_ac10" name="insp_charges_ac10" value="<?php echo $row['insp_charges_ac10']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="insp_charges_ac21" name="insp_charges_ac21" value="<?php echo $row['insp_charges_ac21']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="insp_charges_ac22" name="insp_charges_ac22" value="<?php echo $row['insp_charges_ac22']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="insp_charges_total" name="insp_charges_total" value="<?php echo $row['insp_charges_total']; ?>" onfocus="calinsp_total();" readonly="readonly"/></td>
        </tr>
      <tr>
        <td height="31" align="center" class="text">5.</td>
        <td class="text-wdthout-pad">Penal Damages</td>
        <td align="center"><input  size="8" type="text" id="penal_demages_ac1" name="penal_demages_ac1" value="<?php echo $row['penal_demages_ac1']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="penal_demages_ac2" name="penal_demages_ac2" value="<?php echo $row['penal_demages_ac2']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="penal_demages_ac10" name="penal_demages_ac10" value="<?php echo $row['penal_demages_ac10']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="penal_demages_ac21" name="penal_demages_ac21" value="<?php echo $row['penal_demages_ac21']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="penal_demages_ac22" name="penal_demages_ac22" value="<?php echo $row['penal_demages_ac22']; ?>" /></td>
        <td align="center"><input  size="8" type="text" id="penal_demages_total" name="penal_demages_total" value="<?php echo $row['penal_demages_total']; ?>" onfocus="calpen_total();" readonly="readonly"/></td>
        </tr>
      <tr>
        <td align="center" valign="top" class="text">6.</td>
        <td valign="top" class="text-wdthout-pad">Misc. Payment (past Accumulations only)</td>
        <td align="center" valign="top"><input  size="8" type="text" id="miss_payment_ac1" name="miss_payment_ac1" value="<?php echo $row['miss_payment_ac1']; ?>" /></td>
        <td align="center" valign="top"><input  size="8" type="text" id="miss_payment_ac2" name="miss_payment_ac2" value="<?php echo $row['miss_payment_ac2']; ?>" /></td>
        <td align="center" valign="top"><input  size="8" type="text" id="miss_payment_ac10" name="miss_payment_ac10" value="<?php echo $row['miss_payment_ac10']; ?>" /></td>
        <td align="center" valign="top"><input  size="8" type="text" id="miss_payment_ac21" name="miss_payment_ac21" value="<?php echo $row['miss_payment_ac21']; ?>" /></td>
        <td align="center" valign="top"><input  size="8" type="text" id="miss_payment_ac22" name="miss_payment_ac22" value="<?php echo $row['miss_payment_ac22']; ?>" /></td>
        <td align="center" valign="top"><input  size="8" type="text" id="miss_payment_total" name="miss_payment_total"  value="<?php echo $row['miss_payment_total']; ?>" onfocus="calmiss_total();" readonly="readonly"/></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="right" class="text">Total</td>
        <td align="right"><input style="width:117px" type="text" id="total_ac1" name="total_ac1"  value="<?php echo $data['total_ac1']; ?>" readonly="readonly" onfocus="ac1total();"/></td>
        <td align="left"><input style="width:117px" type="text" id="total_ac2" name="total_ac2"    value="<?php echo $data['total_ac2']; ?>" readonly="readonly" onfocus="ac1tota2();"/></td>
        <td align="left"><input style="width:117px" type="text" id="total_ac10" name="total_ac10"   value="<?php echo $data['total_ac10']; ?>" readonly="readonly" onfocus="ac1total0();"/></td>
        <td align="left"><input style="width:117px" type="text" id="total_ac21" name="total_ac21"   value="<?php echo $data['total_ac21']; ?>" readonly="readonly" onfocus="ac1tota21();"/></td>
        <td align="left"><input style="width:117px" type="text" id="total_ac22" name="total_ac22"   value="<?php echo $data['total_ac22']; ?>" readonly="readonly" onfocus="ac1tota22();"/></td>
        <td align="left"><input style="width:117px" type="text" id="grand_total" name="grand_total"  value="<?php echo $data['grand_total']; ?>" readonly="readonly" onfocus="grandtotal();"/></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table  border="0" align="right" cellpadding="0" cellspacing="0">
      <tr>
        <td width="119" class="text-wdthout-pad">Amount in words</td>
        <td width="345" align="left"><input style="width:300px" type="text" id="amount_in_words" name="amount_in_words"    value="<?php echo $data['amount_in_words']; ?>" onfocus="inwords()"  readonly="readonly"/></td>
        <td width="136" class="text-wdthout-pad">For Banks use only</td>
        <td width="130"><input style="width:130px" type="text" id="banks_use" name="banks_use" value="<?php echo $data['banks_use']; ?>" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="600" valign="top"><table  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="200" align="left" valign="top" class="text-wdthout-pad">Name of Establishment :</td>
            <td width="400" align="left" valign="top"><input  type="text" id="establishment_name" name="establishment_name"  value="<?php echo $data['establishment_name']; ?>" /></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Address:</td>
            <td align="left" valign="top"><input  type="text" id="address" name="address" value="<?php echo $data['address']; ?>" /></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Name of Dipositor :</td>
            <td align="left" valign="top"><input  type="text" id="dipositor_name" name="dipositor_name" value="<?php echo $data['dipositor_name']; ?>" /></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Signature of the Depositor :</td>
            <td align="left" valign="top"><input  type="text" id="depositor_signature" name="depositor_signature" value="<?php echo $data['depositor_signature']; ?>"  /></td>
          </tr>
          </table></td>
        <td width="390" align="right" valign="top"><table   border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Amount Received Rs. :</td>
            <td align="left" valign="top"><input style="width:130px" type="text" id="received_amount" name="received_amount" value="<?php echo $data['received_amount']; ?>" onfocus="grandtotal1()" readonly/></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">For Cheques only :</td>
            <td align="left" valign="top"><input style="width:130px" type="text" id="cheques_only" name="cheques_only" value="<?php echo $data['cheques_only']; ?>" /></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Date of Presentation :</td>
            <td align="left" valign="top"><input style="width:130px" type="text" id="presentation_date" name="presentation_date" value="<?php echo $data['presentation_date']; ?>" class="datepicker"/></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Date of Realisation :</td>
            <td align="left" valign="top"><input style="width:130px" type="text" id="realisation_date" name="realisation_date" value="<?php echo $data['realisation_date']; ?>" class="datepicker"/></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Branch Name :</td>
            <td align="left" valign="top"><input style="width:130px" type="text" id="branch_name" name="branch_name" value="<?php echo $data['branch_name']; ?>" /></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text-wdthout-pad">Branch Code No. :</td>
            <td align="left" valign="top"><input style="width:130px" type="text" id="branch_code" name="branch_code" value="<?php echo $data['branch_code']; ?>"  /></td>
          </tr>
          <tr>
            <td width="169" align="left" valign="top">&nbsp;</td>
            <td width="131" align="left" valign="top">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="top" class="text1"><strong>(TO BE FILLED IN BY EMPLOYER)</strong></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="125" class="text-wdthout-pad">Name of the Bank</td>
        <td width="323"><input style="width:280px" type="text" id="bank_name" name="bank_name" value="<?php echo $data['bank_name']; ?>" /></td>
        <td width="86" class="text-wdthout-pad">Cheque No.</td>
        <td width="324" class="text-wdthout-pad"><input style="width:280px" type="text" id="cheque_no" name="cheque_no" value="<?php echo $data['cheque_no']; ?>" /></td>
        <td width="42" class="text-wdthout-pad">Date</td>
        <td width="90"><input  size="8" type="text" style="width:90px;" name="date" id="date" value="<?php echo $data['date']; ?>" class="datepicker">
       </td>
        </tr>
    </table></td>
  </tr>
  <tr>
     <td>&nbsp;</td>
  </tr> 
  <tr>
    <td><p align="center"><input type="submit" name="Update"  value="Update"/></p></td>
  </tr>
</table>
</form>
 
<script language="JavaScript">
function emp_total()
{
var k=document.getElementById("employer_share_count_ac1").value;
var k1=document.getElementById("employer_share_count_ac2").value;
var k2=document.getElementById("employer_share_count_ac10").value;
var k3=document.getElementById("employer_share_count_ac21").value;
var k4=document.getElementById("employer_share_count_ac22").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4);	
document.getElementById("employer_share_count_total").value=total.toFixed(2);
}	
function employee_total()
{
var k=document.getElementById("employee_share_count_ac1").value;
var k1=document.getElementById("employee_share_count_ac2").value;
var k2=document.getElementById("employee_share_count_ac10").value;
var k3=document.getElementById("employee_share_count_ac21").value;
var k4=document.getElementById("employee_share_count_ac22").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4);	
document.getElementById("employee_share_count_total").value=total.toFixed(2);
}	
function adm_total()
{
var k=document.getElementById("adm_charges_ac1").value;
var k1=document.getElementById("adm_charges_ac2").value;
var k2=document.getElementById("adm_charges_ac10").value;
var k3=document.getElementById("adm_charges_ac21").value;
var k4=document.getElementById("adm_charges_ac22").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4);	
document.getElementById("adm_charges_total").value=total.toFixed(2);
}	
function calinsp_total()
{
var k=document.getElementById("insp_charges_ac1").value;
var k1=document.getElementById("insp_charges_ac2").value;
var k2=document.getElementById("insp_charges_ac10").value;
var k3=document.getElementById("insp_charges_ac21").value;
var k4=document.getElementById("insp_charges_ac22").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4);	
document.getElementById("insp_charges_total").value=total.toFixed(2);
}	
function calpen_total()
{
var k=document.getElementById("penal_demages_ac1").value;
var k1=document.getElementById("penal_demages_ac2").value;
var k2=document.getElementById("penal_demages_ac10").value;
var k3=document.getElementById("penal_demages_ac21").value;
var k4=document.getElementById("penal_demages_ac22").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4);	
document.getElementById("penal_demages_total").value=total.toFixed(2);
}	
function calmiss_total()
{
var k=document.getElementById("miss_payment_ac1").value;
var k1=document.getElementById("miss_payment_ac2").value;
var k2=document.getElementById("miss_payment_ac10").value;
var k3=document.getElementById("miss_payment_ac21").value;
var k4=document.getElementById("miss_payment_ac22").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4);	
document.getElementById("miss_payment_total").value=total.toFixed(2);
}	
function ac1total()
{
var k=document.getElementById("miss_payment_ac1").value;
var k1=document.getElementById("penal_demages_ac1").value;
var k2=document.getElementById("insp_charges_ac1").value;
var k3=document.getElementById("adm_charges_ac1").value;
var k4=document.getElementById("employee_share_count_ac1").value;
var k5=document.getElementById("employer_share_count_ac1").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4)+parseFloat(k5);
document.getElementById("total_ac1").value=total.toFixed(2);
}
function ac1tota2()
{
var k=document.getElementById("miss_payment_ac2").value;
var k1=document.getElementById("penal_demages_ac2").value;
var k2=document.getElementById("insp_charges_ac2").value;
var k3=document.getElementById("adm_charges_ac2").value;
var k4=document.getElementById("employee_share_count_ac2").value;
var k5=document.getElementById("employer_share_count_ac2").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4)+parseFloat(k5);
document.getElementById("total_ac2").value=total.toFixed(2);
}
function ac1total0()
{
var k=document.getElementById("miss_payment_ac10").value;
var k1=document.getElementById("penal_demages_ac10").value;
var k2=document.getElementById("insp_charges_ac10").value;
var k3=document.getElementById("adm_charges_ac10").value;
var k4=document.getElementById("employee_share_count_ac10").value;
var k5=document.getElementById("employer_share_count_ac10").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4)+parseFloat(k5);
document.getElementById("total_ac10").value=total.toFixed(2);
}
function ac1tota21()
{
var k=document.getElementById("miss_payment_ac21").value;
var k1=document.getElementById("penal_demages_ac21").value;
var k2=document.getElementById("insp_charges_ac21").value;
var k3=document.getElementById("adm_charges_ac21").value;
var k4=document.getElementById("employee_share_count_ac21").value;
var k5=document.getElementById("employer_share_count_ac21").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4)+parseFloat(k5);
document.getElementById("total_ac21").value=total.toFixed(2);
}
function ac1tota22()
{
var k=document.getElementById("miss_payment_ac22").value;
var k1=document.getElementById("penal_demages_ac22").value;
var k2=document.getElementById("insp_charges_ac22").value;
var k3=document.getElementById("adm_charges_ac22").value;
var k4=document.getElementById("employee_share_count_ac22").value;
var k5=document.getElementById("employer_share_count_ac22").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4)+parseFloat(k5);
document.getElementById("total_ac22").value=total.toFixed(2);
}
function grandtotal()
{
var k=document.getElementById("employer_share_count_total").value;
var k1=document.getElementById("employee_share_count_total").value;
var k2=document.getElementById("adm_charges_total").value;
var k3=document.getElementById("insp_charges_total").value;
var k4=document.getElementById("penal_demages_total").value;
var k5=document.getElementById("miss_payment_total").value;
var total=parseFloat(k)+parseFloat(k1)+parseFloat(k2)+parseFloat(k3)+parseFloat(k4)+parseFloat(k5);
document.getElementById("grand_total").value=total.toFixed(2);
}
var th = ['','Thousand','Million', 'Billion','Trillion'];
var dg = ['Zero','One','Two','Three','Four', 'Five','Six','Seven','Eight','Nine']; var tn = ['Ten','Eleven','Twelve','Thirteen', 'Fourteen','Fifteen','Sixteen', 'Seventeen','Eighteen','Nineteen']; var tw = ['Twenty','Thirty','Forty','Fifty', 'Sixty','Seventy','Eighty','Ninety']; 

function inwords()
{ 
	s=document.getElementById("grand_total").value;
	s = s.toString(); s = s.replace(/[\, ]/g,'');  if (s != parseFloat(s)) return 'not a number'; var x = s.indexOf('.'); if (x == -1) x = s.length; if (x > 15) return 'too big'; var n = s.split(''); var str = ''; var sk = 0; for (var i=0; i < x; i++) {if ((x-i)%3==2) {if (n[i] == '1') {str += tn[Number(n[i+1])] + ' '; i++; sk=1;} else if (n[i]!=0) {str += tw[n[i]-2] + ' ';sk=1;}} else if (n[i]!=0) {str += dg[n[i]] +' '; if ((x-i)%3==0) str += 'hundred ';sk=1;} if ((x-i)%3==1) {if (sk) str += th[(x-i-1)/3] + ' ';sk=0;}} 
if (x != s.length) {var y = s.length; str += 'point '; for (var i=x+1; i<y; i++) str += dg[n[i]] +' ';} 
document.getElementById("amount_in_words").value=str;
//return str.replace(/\s+/g,' ');
 }
 function grandtotal1()
 {
 	document.getElementById("received_amount").value=document.getElementById("grand_total").value;
 	
 }	
 function input_onchange(me){ 
        if (me.value.length!=this.maxlength){
            return;
        }
        var i;
        var elements = me.form.elements;
        for (i=0, numElements=elements.length; i<numElements; i++) {
            if (elements[i]==me){
                break;
            }
        }
        elements[i+1].focus();
    }

</script>




