<div class="acg-top-pad10">
<div id="inshow"> 
<?php 
	session_start();
//error_reporting(0);
//include("connection.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['tds_id'])){
	//&& isset($_REQUEST['emp_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);

			DB_query("Delete from hr_declaration_document_updating WHERE hr_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);

}
 ?>
<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">
<link rel="stylesheet" href="css/new_mxerp.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>-->
<h1>PREMIUM CALCULATION <a href="#" onclick="tds();"></a></h1>

<table width="100%" cellpadding="3" cellspacing="0" border="1" style="border:#808080 1px solid; border-collapse:collapse;">
	<tr>
		<th width="10%"><strong>Emp. No.</strong></th>
		<th><strong>Emp. Name</strong></th>
        <th width="10%"><strong>PAN</strong></th>
        <th width="10%"><strong>Status</strong></th>
		<th width="10%"><strong>Finincial Year</strong></th>
		<th width="5%" style="text-align:center;"><strong>Action</strong></th>
      
	</tr>
<?php

     $SQLDEC=DB_query("SELECT * FROM `hr_property_declaration` where emp_id='".$emp_id."' AND status='0' ",$db);
      while($DECOView=DB_fetch_array($SQLDEC)) {?>
	<tr>
        <td><?php echo $s->GetFieldValue("empmaster","id='".$emp_id."' ","emp_code"); ?></td>
		<td><?php echo $s->GetFieldValue("empmaster","id='".$emp_id."' ","emp_name"); ?></td>
        <td><?php echo $s->GetFieldValue("empmaster","id='".$emp_id."' ","pan_no"); ?></td>
        <td><?php if($DECOView['status']==0){echo "Pending";} else{ echo "Confirm";} ?></td>        	
		<td><?php echo $s->GetFieldValue("company_financial_years","id='".$DECOView['fin_year']."'","year(year_start)")."-".$s->GetFieldValue("company_financial_years","id='".$DECOView['fin_year']."'","year(year_end)"); ?></td>
        
        <td><!--<a href="#" onclick="tds_delete(<?php echo $DECOView['id']; ?>,<?php echo $DECOView['emp_id']; ?>)">Delete</a>-->
        		<!--<a href="index.php?route=HRModule/Master/investment_declaration&action=delete_tds&tds_id=<?php echo $DECOView['id']; ?><?php echo $rurl;?>" > Delete</a>-->
        		<?php if($DECOView['status']==0){ ?>
        			<a href="index.php?route=HRModule/Master/premium_calculatin&action=PC&tds_id=<?php echo $DECOView['id']; ?>&emp_id=<?php echo $DECOView['emp_id']; ?>&fin_year=<?php echo $DECOView['fin_year']; ?><?php echo $rurl;?>" ><input type="button" class="search" name="hpd" value="ADD"></a>
        			<?php }else{ ?>
        			<input type="button" class="search" name="hpd" value="Confirmed">
        			<?php } ?>
        		<!--<a href="index.php?route=HRModule/Master/premium_calculatin&action=PC&tds_id=<?php echo $DECOView['id']; ?>&emp_id=<?php echo $DECOView['emp_id']; ?>&fin_year=<?php echo $DECOView['fin_year']; ?><?php echo $rurl;?>" >PC</a>-->

        </td>
	</tr>
<?php }?>
</table>
</div>


</div></div>

<script type="text/javascript" language="javascript">

	function getUsers(group_id){
		$.post("ajax_file.php",{"group_id":group_id},function(data){
			$("#leaduserid").html(data);
		});
	}

function showtodo()
{
	document.getElementById("show").style.display='none';
	document.getElementById("hide").style.display='block';
}

function tds(){
  $.post("tds.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}

function tds_edit(tdsId){
  $.post("tds_edit.php",{'action':'addnew','tds_id':tdsId},function(data){
      $('#dash').html(data);
    });
}
</script>
</div>
</div>