<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<div id="inshow">
<link rel="stylesheet" href="../css/jquery.ui.all.css">
<link rel="stylesheet" href="../css/jquery.ui.theme.css">

<script src="../js/jquery-1.5.1.js"></script>
<script src="../ui/jquery.ui.datepicker.js"></script>
<script src="../ui/jquery.ui.timepicker.css"></script>
<script src="../ui/jquery.ui.core.js"></script>
<script src="../ui/jquery.ui.timepicker.js"></script>
<script type="text/javascript">
//var jj=$.noConflict();
 //jj(function() {
  
jj(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' ,changeMonth: true,
    changeYear: true,
    yearRange: '-80:+20'});
});
jj('.timepicker').timepicker();
</script>   
<script src="js/function.js" type="text/javascript"></script>
<script src="js/jquery.carouFredSel-5.5.0-packed.js" type="text/javascript"></script>
<script src="js/functions.js" type="text/javascript"></script>
<script type="text/javascript" src="js/form.min.js"></script>
<?php 
//session_start();
//error_reporting(0);
 //include("connection.php");

      //$tds_id=$_REQUEST['tds_id'];
    //  die;
     if(isset($_POST['submit'])){
      $FinempCode1=rand(0,9999);
        if($_FILES['signature']['name']!='')
        {
          $name=$_FILES['signature']['name'];
          $tmp_name=$_FILES['signature']['tmp_name'];
          $name_brk=explode('.',$name);
          $type=$name_brk[1];
          $new_name=$FinempCode1.'.'.$type;
          $path="uploaded_docs/HR/sign_image/".$new_name;
          $file_copy=copy($tmp_name,$path);
          $data['signature']   =$new_name;
      }
      $data['emp_id']                     =$_REQUEST['emp_id']; 
      $data['date_possession']            =FormatDateForSQL($_REQUEST['date_possession']);
      $data['assessee_name']              =$_REQUEST['assessee_name'];   
      $data['date_declaration']           =date("Y-m-d");
      $data['place']                      =$_REQUEST['place']; 
      if(isset($new_name)){
      $data['signature']              =$new_name;
      }
      $data['fin_year']            =$_REQUEST['fin_year']; 
      $data['created_by']            =$_REQUEST['created_by'];
      $data['created_date']          =date("Y-m-d H:i:s"); 
//echo "<pre>";print_r($data);
      $cond="id='".$_REQUEST['tds_id']."'";
     // die;
 $s->RecordEdit('hr_property_declaration', $data,$cond);
 $headdec_id=$_REQUEST['tds_id'];
    if($headdec_id!=""){

        DB_query("Delete from hr_property_dclrtn_details WHERE property_declaration_id='".$headdec_id."'",$db);
          $noofdepends=count($_REQUEST['address']);
            for($dep=0;$dep<$noofdepends;$dep++)
            {
                $data_dep['property_declaration_id'] =$headdec_id; 
                $data_dep['address']      =$_REQUEST['address'][$dep];
                $data_dep['owners_and_ratio']      =$_REQUEST['owners_and_ratio'][$dep]; 
                $data_dep['category']      =$_REQUEST['category'][$dep];
                $data_dep['gross_rent']      =$_REQUEST['gross_rent'][$dep];
                $data_dep['municipal_tax']      =$_REQUEST['municipal_tax'][$dep]; 
                $data_dep['loan_amt']      =$_REQUEST['loan_amt'][$dep];
                $data_dep['loan_provider']      =$_REQUEST['loan_provider'][$dep]; 
                $data_dep['interest_paid']      =$_REQUEST['interest_paid'][$dep]; 
                $data_dep['principal_paid']      =$_REQUEST['principal_paid'][$dep];
                $s->RecordInsert('hr_property_dclrtn_details', $data_dep);
            }
  }
   $s->pageLocation("index.php?route=HRModule/Master/house_property_declaration_add_index".$rurl);
  }
  $sql_prdec="Select * from hr_property_declaration WHERE id='".$_REQUEST['tds_id']."'";
  $query_prdec=DB_query($sql_prdec,$db);
  $prdec_row=DB_fetch_assoc($query_prdec);
   extract($prdec_row);
?>
<form method="post" id="housepr_form_edit" action =""  enctype="multipart/form-data">
<input type="hidden" name="fin_year" value="<?php echo $fin_year; ?>"/>
<input type="hidden" name="emp_id" value="<?php echo $emp_id; ?>"/>
<input type="hidden" name="tds_id" value="<?php echo $id; ?>">
<input type="hidden" name="created_by" value="<?php echo $_SESSION['UserID']; ?>">
	<h1>House Property Declaration</h1>
            <div class="row">
                  <table width="100%" border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td width="80%" style="border-top:#c1c1c1 1px solid;"><strong>a) Date of actual possession of property claimed as self-occupied</strong><br>
                            [Mandatory to furnish 'Possession Certificate' issued by builder/municipal authorities etc., if possession is taken after March'15]</td>
                        <td style="border-top:#c1c1c1 1px solid;"><input type="text" name="date_possession" placeholder="Date" class="datepicker" value="<?php echo ConvertSQLDate($date_possession); ?>" /></td>
                      </tr>
                  </table>
            </div>
           <div class="cat">                 
                  <table width="100%" border="1" cellspacing="0" cellpadding="3" style="border:#808080 1px solid;">
                      <tr>
                        <th colspan="10" align="center"><strong>b) Information towards the House Properties held by employee</strong></th>
                      </tr>
                      <tr>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>House Property</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Address</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Owners Name and Ratio of Ownership</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Category (Self occupied/let out/deemed let out)</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Gross Annual Rent/Value*</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Muncipal Taxes paid by employee</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Amount of Loan taken</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Name and Address of lender (Loan Provider)</strong></th>
                        <th width="10%" valign="middle" style="text-align:center;"><strong>Interest portion paid in the Financial Year</strong></th>
                        <th valign="middle" style="text-align:center;"><strong>Principal portion paid in the Financial Year</strong></th>
                      </tr>
                    <?php 
                      $sql_prdc_child="Select * from hr_property_dclrtn_details where property_declaration_id='".$id."'";
                      $query_prdc_child=DB_query($sql_prdc_child,$db);
                      $hp=0;
                      while($prdc_child_row=DB_fetch_array($query_prdc_child))
                      {
                    ?>
                      <tr>
                        <td valign="middle" align="center"><strong><?php echo $hp+1; ?><input type="hidden" name="property_id[]" value="<?php echo $prdc_child_row['id']; ?>" /></strong></td>
                        <td valign="top"><input type="text" name="address[]" value="<?php echo $prdc_child_row['address']; ?>" /></td>
                        <td valign="top"><input type="text" name="owners_and_ratio[]" value="<?php echo $prdc_child_row['owners_and_ratio']; ?>" /></td>
                        <td valign="top"><input type="text" name="category[]" value="<?php echo $prdc_child_row['category']; ?>" /></td>
                        <td valign="top"><input type="text" name="gross_rent[]" value="<?php echo $prdc_child_row['gross_rent']; ?>" /></td>
                        <td valign="top"><input type="text" name="municipal_tax[]" value="<?php echo $prdc_child_row['municipal_tax']; ?>" /></td>
                        <td valign="top"><input type="text" name="loan_amt[]" value="<?php echo $prdc_child_row['loan_amt']; ?>" /></td>
                        <td valign="top"><input type="text" name="loan_provider[]" value="<?php echo $prdc_child_row['loan_provider']; ?>" /></td>
                        <td valign="top"><input type="text" name="interest_paid[]" value="<?php echo $prdc_child_row['interest_paid']; ?>" /></td>
                        <td valign="top"><input type="text" name="principal_paid[]" value="<?php echo $prdc_child_row['principal_paid']; ?>" /></td>
                      </tr> 
                      <?php $hp++; } ?>                
                  </table>
                </div>
                <div class="cat">
                  <table width="100%" border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td align="left" colspan="3" style="border-top:#c1c1c1 1px solid;"><p><strong>Note : 1.</strong> Provisional Interest certificate from bank is COMPULSORY to attach OTHERWISE NO BENEFIT GIVEN FOR INTEREST OR PRINCIPAL REPLAYEMNT.</p></td>
                      </tr>
                      <tr>
                        <td align="left" colspan="3"><p><strong>Note : 2.</strong> Gross Annual Value = HIGHER OF (i) Municipal value or fair rent w.e. is higher subject to maximum of standard rent (ii) Rent actually received or receivable</p></td>
                      </tr>
                      <tr>
                        <td align="left" colspan="3"><p>I, <input type="text" name="assessee_name" value="<?php echo $assessee_name; ?>" style="float:none; border-bottom:#000000 1px solid; border-top:0; border-left:0; border-right:0; width:30%; background:#fff;" /> (Name of the assessee) , do declare that what is stated above is true. It is hereby further declared and confirmed that in the event of any misstatement in above stated financial information  and in consequence thereof if any shortfall in deduction of tax at source is arising by M/s Corona Remedies Pvt.Ltd and if M/s Corona Remedies Pvt.Ltd has to suffer any loss of whatsoever nature under provisions of the Income tax Act, 1961 I shall indemnify the said loss to M/s Corona Remedies Pvt.Ltd immediately on I being called upon by M/s Corona Remedies Pvt. Ltd.</p></td>
                      </tr>
                      <tr>
                        <td align="left" width="30%" valign="bottom"><input type="text" name="place" value="<?php echo $place; ?>"/></td>
                        <td></td>
                        <td width="20%" align="center"><div id="cat-img">
                          <div class="cat-img"> <?php 
                                if($signature!=""){
                                  ?>
                                  <img src="uploaded_docs/HR/sign_image/<?php echo $signature; ?>" height="60" />
                              <?php
                                }
                            ?></div>
                        </div><input type="file" name="signature" width="60%" style="float:left; margin-top:5px;" /></td>
                      </tr>
                      <tr>
                        <td align="left" valign="bottom"><strong>Place</strong></td>
                        <td></td>
                        <td align="center"><strong>(Signature of Employee)</strong></td>
                      </tr>
                      <tr>
                        <td style="text-align:center" colspan="3" height="60" valign="middle"><input type="submit" name="submit" value="Update" class="search" /></td>
                      </tr>
                  </table>
                </div>
            </form>
	</div>
</div>
</div>
</div>