<?php
session_start();
?>
<!DOCTYPE html>
<html>
    <head>
         <?php include("header-js.php");?>	
		<!-----hrm-------------->		
		<link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="css/responsive.css" />
		<link rel="stylesheet" href="css/jquery-ui.css" />
		<!-- Responsive -->
		<script src="js/jquery-ui.js"></script>
		<script language="javascript" src="js/css3-mediaqueries.js" type="text/javascript"></script>
		
		
		<!-----hrm-------------->
        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
    </head>
	<?php 
	include_once("class/class.MySQL.php");
	$db		= new MySQL();
	$userid = $_SESSION['admin_id'];
	?>	
	<body class="skin-blue" >
    <?php 
	include("header.php");
	$userdetails    = $db->fetchQuery("SELECT *,CONCAT(e_fname,e_lname) as emp_name FROM employee"); 
	$financial_year = $db->fetchQuery("SELECT * FROM  `financial_year` WHERE `default`='1'"); 
	?>
     <!-- Main row -->
    <div class="row">
    	<div id="wrapper">
			<div class="content">
				<form name="frm" id="frm" method="post" enctype="multipart/form-data">
				<div class="report-tab">
					<div class="employee-title">
					  <h2><translate>IT Declaration for the period Apr 2014 to Mar 2015</translate><span></span></h2>
					  <div class="clear-float"></div>
					</div>
					<div class="clear-float"></div>
					<div class="report-cell-03" style="color:#000000">
						<span>Employees</span>
						<select id="emp_id" name="emp_id">
						<option value="">Select an employee</option>
						<?php
						foreach ($userdetails as $details) { ?>
							<option value="<?php echo $details['e_id']?>"><?php echo $details['emp_name']?></option>
						<?php } ?>	
						</select>
						<span>Financial Year</span>
						<select id="financial_year" name="financial_year">
						<option value="">Select Financial Year</option>
						<?php
						foreach ($financial_year as $details) { ?>
							<option value="<?php echo $details['id']?>"><?php echo $details['financial_year']?></option>
						<?php } ?>	
						</select>
						<div id="emp_dtl"></div>
					<div class="clear-float"></div>

					</div><!-- /report-cell-03 -->
					
					<!--/employee-tab-01-->
					<div class="employee-tabcells">
					  <div class="employee-col-01"></div><!-- /employee-col-01 -->
					 <!-- Navigation--> 
					 <div class="tabbable" style="margin-bottom: 18px;">
					  <ul class="nav nav-tabs">
						<li class="active"><a href="#tab1" data-toggle="tab">Declarations</a></li>
						<li><a href="#tab2" data-toggle="tab">Rent Details</a></li>
						<li ><a href="#tab3" data-toggle="tab">Section 24</a></li>
						<li ><a href="#tab4" data-toggle="tab">Previous Employment Salary</a></li>
						<li ><a href="#tab5" data-toggle="tab">Other Income</a></li>
					  </ul>
					 
					  <div class="tab-content" style="padding-bottom: 9px; margin-top: 22px;">
					  	<div class="clear-float"></div>
					  	<!-- Declarations -->
						<div class="tab-pane active" id="tab1">
						  <table  class="list-table form-group" width="70%">
						  	<tr>
							  <td>Sl No.</td>
							  <td>Particulars</td>
							  <td>Amount (Rs.)</td>
							</tr>
							<tr>
							  <td colspan="3"><h3 style="border-top:0px solid #bdbdbd;">Deduction Under Chapter VI A</h3></td>
							</tr>
							<?php
							$i = 1;
							$deductions = $db->fetchQuery("SELECT * FROM income_tax_deduction WHERE ded_type=1"); 
							foreach($deductions as $result)
							{
							?>
							<tr>
							  <td style="text-align:center;"><?php echo $i++;?></td>
							  <td><?php echo $result['deductions'];?><input type="hidden" name="ded_id[]" id="ded_id" value="<?php echo $result['id'];?>"/></td>
							  <td><input type="text" name="ded_amnt[]" id="ded_amnt" value="" class="numbersOnly"/></td>
							</tr>
							<?php
							}
							?>
						  </table>
						  
						  <table  class="list-table" width="70%">
						  	<tr>
							  <td>Sl No.</td>
							  <td>Particulars</td>
							  <td>Max Limit</td>
							  <td>Amount (Rs.)</td>
							</tr>
							<tr>
							  <td colspan="4"><h3 style="border-top:0px solid #bdbdbd;">Other Deduction Under Chapter VI A</h3></td>
							</tr>
							<?php
							$m = 1;
							$deductions = $db->fetchQuery("SELECT * FROM income_tax_deduction WHERE ded_type=2"); 
							foreach($deductions as $result)
							{
							?>
							<tr>
							  <td style="text-align:center;"><?php echo $m++;?></td>
							  <td><?php echo $result['deductions'];?><input type="hidden" name="ded_id[]" id="ded_id" value="<?php echo $result['id'];?>"/></td>
							  <td><?php echo $result['max_limit'];?></td>
							  <td>
							  <input type="text" name="ded_amnt[]" id="ded_amnt<?php echo $m;?>" value="" class="numbersOnly" onBlur="check_max_limit('<?php echo $result['max_limit'];?>',this.value,'<?php echo $m;?>');"/>
							  </td>
							</tr>
							<?php
							}
							?>
						  </table>
						  <div class="guest-details">
						  <label>Note:</label><br>
						  <textarea name="declaration_note" id="declaration_note" style="width:60%"></textarea>
						  <p>
						  <input type="button" id="tab1Button" class="color-button2" value="Next">
						  </p>
						  </div>
						</div>
						<!-- /Declarations -->
						
						<!-- Rent Details-->
						<div class="tab-pane" id="tab2">
						   <table  class="list-table form-group" width="70%">
						  	<tr>
							  <td>Sl No.</td>
							  <td>Particulars</td>
							  <td>Amount (Rs.)</td>
							</tr>
							<tr>
							  <td colspan="3"><h3 style="border-top:0px solid #bdbdbd;">Deduction Under Chapter VI A</h3></td>
							</tr>
							<?php
						
							$rent = $db->fetchQuery("SELECT * FROM income_tax_deduction WHERE ded_type=3"); 
							foreach($rent as $result)
							{
							?>
							<tr>
							  <td style="text-align:center;" valign="top">1</td>
							  <td><?php echo  $result['deductions'];?><input type="hidden" name="ded_id[]" id="ded_id" value="<?php echo $result['id'];?>"/><br>
								<p class="text-danger"><strong><translate>If annual rent paid by the employee exceed Rs 1,00,000 per annum,
								it is mandatory for the employee to report PAN of the landlord to employer.</translate></strong> </p>
								
								<p class="text-danger" id="ld_dec">
								<strong><translate>Landlord information is not declared : </translate></strong><a href="#" class="lnd_dcl">Declare</a></p>
								<p class="text-danger" id="ld_mdfy" style="display:none;">
								<strong><translate>Landlord information is  updated : </translate></strong><a href="#" class="lnd_dcl">View/Modify </a></p>
							  </td>
							  <td valign="top" style="padding-top:5px;"><input type="text" name="ded_amnt[]" id="ded_amnt" value="" class="numbersOnly"/></td>
							</tr>
							<?php } ?>
						  </table>
						  
						  <table width="70%" border="0" cellspacing="0" cellpadding="0" style="background:#F4F4F4; display:none;"  id="lnd_inf">
							  <tbody>
							  <tr>
							    <td width="20%"  style="padding:15px 0px 0px 20px;"><translate> Does your landlord has PAN ?</translate> </td>
							    <td width="50%" style="padding-top:15px;">
								<input type="radio" name="landlord_has_pan" value="Yes">Yes
								<input type="radio" name="landlord_has_pan" value="No" checked="checked"> No
								</td>
							  </tr>
							  <tr height="40" >
							    <td  style="padding-left:20px;"><translate>Landlord Name</translate></td>
							    <td><input type="text" name="landlord_name" id="landlord_name"></td>
							  </tr>
							  <tr>
							    <td  style="padding-left:20px;"><translate>Address</translate></td>
							    <td><textarea name="landlord_address" id="landlord_address" cols="45" rows="4" style="height:60px;"></textarea></td>
							  </tr>
							  
							   <tr id="not_pan">
							    <td colspan="2"  style="padding-left:20px;"><table>
								   <tr>
								   		<td  colspan="2"><p class="text-danger"><translate><strong>Since Landlord does not have PAN,a declaration to this effect from the landlord along with name and address of the landlord should be filled by the employee</strong></translate></p></td>
									</tr>
									<tr>
										<td valign="top"> <p><translate>Declaration</translate></p></td>
										<td>
											<p><translate>Step 1: Download the <a id="dec_frm" style="cursor:pointer;">declaration form</a> and get it signed by the landlord.</translate></p>
											<p><translate>Step 2: Scan the signed declaration form and upload the scan copy below.</translate></p>
										</td>
									</tr>
									<tr>
										<td><input type="file" name="fileupload" id="fileupload"></td>
										<td></td>
									</tr>		
								</table>
								</td>
							  </tr>	
							  <tr id="pan" style="display:none;">
							  	<td style="padding-left:20px;"><translate>PAN Number</translate></td>
							    <td><input type="text" name="landlord_pan_number" id="landlord_pan_number"></td>
							  </tr>	
							   <tr>
							    <td>&nbsp;</td>
							    <td>&nbsp;</td>
							  </tr>
							  <tr>
							    <td>&nbsp;</td>
							    <td><input type="button" name="button" class="color-button" id="landlord_save" value="Save">
							    <input type="button" name="button" class="color-button" id="cancel-button" value="Cancel">
								</td>
							  </tr>
							  <tr>
							    <td>&nbsp;</td>
							    <td>&nbsp;</td>
							  </tr>
						  </tbody>
						  </table>
						  <div class="guest-details">
						  <label>Note:</label><br>
						  <textarea name="rental_note" id="rental_note" style="width:60%"></textarea>
						  <p>
						  <input type="button" id="tab2Button" class="color-button2" value="Next">
						  </p>
						  </div>
						</div>
						<!-- /Rent Details-->
						
						<!-- Section24-->
						<div class="tab-pane" id="tab3">
						  <table  class="list-table form-group" width="70%">
						  	<tr>
							  <td>Sl No.</td>
							  <td>Particulars</td>
							  <td>Amount (Rs.)</td>
							</tr>
							<tr>
							  <td colspan="3"><h3 style="border-top:0px solid #bdbdbd;">Deduction Under Section 24</h3></td>
							</tr>
							<?php
							$section = $db->fetchQuery("SELECT * FROM income_tax_deduction WHERE ded_type=4"); 
							foreach($section as $result)
							{
							?>
							<tr>
							  <td style="text-align:center;">1</td>
							  <td><?php echo  $result['deductions'];?><input type="hidden" name="ded_id[]" id="ded_id" value="<?php echo $result['id'];?>"/></td>
							  <td><input type="text" name="ded_amnt[]" id="ded_amnt" value="" class="numbersOnly"/></td>
							</tr>
							<?php 
							}
							?>
						  </table>
						  <div class="guest-details">
						  <label>Note:</label><br>
						  <textarea name="section_note" id="section_note" style="width:60%"></textarea>
						  <p>
						 <input type="button" id="tab3Button" class="color-button2" value="Next">
						  </p>
						  </div>
						</div>
						<!-- /Section24-->
						
						<!-- Previous Employment Salary-->
						<div class="tab-pane" id="tab4">
						  <table  class="list-table form-group" width="70%">
						  	<tr>
							  <td>Sl No.</td>
							  <td>Particulars</td>
							  <td>Amount (Rs.)</td>
							</tr>
							<?php
							$k	= 1;
							$pre_sal = $db->fetchQuery("SELECT * FROM income_tax_deduction WHERE ded_type=5"); 
							foreach($pre_sal as $result)
							{
							?>
							<tr>
							  <td style="text-align:center;"><?php echo $k++;?></td>
							  <td><?php echo  $result['deductions'];?><input type="hidden" name="ded_id[]" id="ded_id" value="<?php echo $result['id'];?>"/></td>
							  <td><input type="text" name="ded_amnt[]" id="ded_amnt" value="" class="numbersOnly"/></td>
							</tr>
							<?php 
							}
							?>
						  </table>
						  <div class="guest-details">
						  <label>Note:</label><br>
						  <textarea name="pre_emp_note" id="pre_emp_note" style="width:60%"></textarea>
						  <p>
						 <input type="button" id="tab4Button" class="color-button2" value="Next">
						  </p>
						  </div>
						</div>
						<!-- /Previous Employment Salary-->
						
						<!-- Other Income-->
						<div class="tab-pane" id="tab5">
						  <table  class="list-table form-group" width="70%">
						  	<tr>
							  <td>Sl No.</td>
							  <td>Particulars</td>
							  <td>Amount (Rs.)</td>
							</tr>
							
							<tr>
							  <td style="text-align:center;">1</td>
							  <td><input type="text" name="other_income1" id="other_income1" value=""/></td>
							  <td><input type="text" name="other_income1_amount" id="other_income1_amount" value="" class="numbersOnly"/></td>
							</tr>
							<tr>
							  <td style="text-align:center;">2</td>
							  <td><input type="text" name="other_income2" id="other_income2" value=""/></td>
							  <td><input type="text" name="other_income2_amount" id="other_income2_amount" value="" class="numbersOnly"/></td>
							</tr>
							
						  </table>
						  <div class="guest-details">
						  <label>Note:</label><br>
						  <textarea name="other_income_note" id="other_income_note" style="width:60%"></textarea>
						  <p>
						 <input type="button" class="color-button2" id="tax_submit" value="Submit">
						  </p>
						  </div>
						</div>
						<!-- /Other Income-->
					  </div>
					</div><!-- /Navigation-->
					</div><!--/employee-tabcells-->
					<div class="clear-float"></div>
				</div><!-- /report-tab -->
				</form>
				<div class="clear-float"></div>
			 </div><!-- /content -->
			<div class="footer">
			<strong>© add-HRM</strong><br />
			<span>Developed by <a href="http://www.aadhocc.com" target="_blank">Aadhocc</a></span>
			</div><!-- /footer -->
		</div>
	</div><!-- /.row (main row) -->
	</section><!-- /.content -->
    </aside><!-- /.right-side -->
    </div><!-- ./wrapper -->
    <?php 
	include("footer-js.php");
     ?>
	 <script type="text/javascript" src="js/income_tax.js"></script>
	 <script type="text/javascript">
	 	jQuery('.numbersOnly').keyup(function () { 
    	this.value = this.value.replace(/[^0-9\.]/g,'');
		});
	 </script>
    </body>
</html>