<div class="acg-top-pad10">
<div id="inshow"> 
<?php 
	//session_name('CAKEPHP'); session_start();
//error_reporting(0);

include("eportal/leftsidebar.php");
$emp_id  =  $s->getFieldValue("www_users","id='".$_SESSION['UserID']."' ","empid");
$finYear=$_SESSION['YearStart']."-".$_SESSION['YearEnd1'];
if(isset($_REQUEST['action']) && $_REQUEST['action']=="delete_tds" && isset($_REQUEST['emp_id']) && isset($_REQUEST['tds_id'])){
	        $property_declaration_finyear=$s->getFieldValue("hr_declaration_head","id='".$_REQUEST['tds_id']."' ","fin_year");
			DB_query("Delete from hr_declaration_head WHERE id='".$_REQUEST['tds_id']."'",$db);
			DB_query("Delete from hr_declaration_rent WHERE declaration_head_id='".$_REQUEST['tds_id']."'",$db);
			DB_query("Delete from hr_declaration_property WHERE declaration_head_id='".$_REQUEST['tds_id']."'",$db);
			DB_query("Delete from hr_declaration_medical WHERE declaration_head_id='".$_REQUEST['tds_id']."'",$db);
			DB_query("Delete from hr_declaration_edu WHERE declaration_head_id='".$_REQUEST['tds_id']."'",$db);
			DB_query("Delete from hr_declaration_insurance WHERE declaration_head_id='".$_REQUEST['tds_id']."'",$db);
			$property_declaration_id=$s->getFieldValue("hr_property_declaration","emp_id='".$_REQUEST['emp_id']."' and fin_year='".$property_declaration_finyear."'","id");

			DB_query("Delete from hr_property_declaration WHERE emp_id='".$_REQUEST['emp_id']."'",$db);
			DB_query("Delete from hr_property_dclrtn_details WHERE property_declaration_id='".$property_declaration_id."'",$db);
			DB_query("Delete from hr_premium_calculation WHERE emp_id='".$_REQUEST['emp_id']."'",$db);
			 echo "<script>location.href='".$herp."'index.php?route=eportal/inv_dec_index&modid='".$_REQUEST['modid']."'&frmid='".$_REQUEST['frmid']."'</script>"; 
}
 ?>
<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="../ui/jqueryui.min.js"></script>
<link rel="stylesheet" href="../css/jquery.ui.all.css">
<div style="width:100%">
<div class="body_contain">
<div class="tab_div">
<div id="show">	
 <!--<ul id="navigation">
   <li><a href="#" onclick="showtodo();">Create To Do</a></li>   
 </ul>-->
<h2>Investment Declaration <a href="<?php echo $herp; ?>index.php?route=eportal/tds&modid=<?php echo $_REQUEST['modid'] ?>&frmid=<?php echo $_REQUEST['frmid'] ?>">Create New</a></h2>	
<table width="98%" cellpadding="3" cellspacing="0" border="0" style="border-collapse:collapse;">
	<tr>
		<th width="20%"><strong>Emp. No.</strong></th>
		<th width="20%"><strong>Emp. Name</strong></th>
        <th width="20%"><strong>PAN</strong></th>
		<th width="20%"><strong>Finincial Year</strong></th>
		<th width="20%" colspan="2"><strong><center>Action</center></strong></th>
      
	</tr>
<?php
     $SQLDEC=DB_query("SELECT * FROM `hr_declaration_head` where emp_id='".$emp_id."'",$db);
      while($DECOView=DB_fetch_array($SQLDEC)) {?>
	<tr>
        <td class="pad_left"><?php echo $s->getFieldValue("empmaster","id='".$emp_id."' ","emp_code"); ?></td>
		<td class="pad_left"><?php echo $s->getFieldValue("empmaster","id='".$emp_id."' ","emp_name"); ?></td>
        <td class="pad_left"><?php echo $s->getFieldValue("empmaster","id='".$emp_id."' ","pan"); ?></td>	
		<td class="pad_left"><?php echo ConvertSQLDate($s->getFieldValue("company_financial_years","id='".$DECOView['fin_year']."' ","year_start"))."-".ConvertSQLDate($s->getFieldValue("company_financial_years","id='".$DECOView['fin_year']."' ","year_end")); ?></td>
        <td class="pad_left"><a href="<?php echo $herp; ?>index.php?route=eportal/tds_edit&tds_id=<?php echo $DECOView['id']; ?>&emp_id=<?php echo $DECOView['emp_id']; ?>&modid=<?php echo $_REQUEST['modid'] ?>&frmid=<?php echo $_REQUEST['frmid'] ?>">Edit</a></td>
        <td class="pad_left"><a href="<?php echo $herp; ?>index.php?route=eportal/inv_dec_index&tds_id=<?php echo $DECOView['id']; ?>&emp_id=<?php echo $DECOView['emp_id']; ?>&action=delete_tds&modid=<?php echo $_REQUEST['modid'] ?>&frmid=<?php echo $_REQUEST['frmid'] ?>" onclick="confirm('Do You want to Delete this?')">Delete</a></td>
	</tr>
<?php }?>
</table>
</div>

</div></div>

</div>
</div>