<?php
session_start();
?>

<!DOCTYPE html>
<html>
    <head>
<?php include("header-js.php");?>	
<!-----hrm-------------->		
<link rel="stylesheet" href="css/style.css" />
<!-- Responsive -->
<link rel="stylesheet" href="css/responsive.css" />
<!--<script type="text/javascript" src="js/showpath.js" language="javascript"></script>-->
<link rel="stylesheet" href="css/jquery-ui.css" />

<link rel="stylesheet" href="css/weather.css" />
<!-- Tabcontent (ORDER) -->
<link rel="stylesheet" type="text/css" href="css/tab-content.css" />	
<link type="text/css" rel="stylesheet" href="css/ui.notify.css" />
<script src="js/dateFormat.js"></script>
<script type="text/javascript" src="js/jquery.simplePagination.js"></script>
<script src="js/print.js"></script><!---->
<script type="text/javascript" src="js/jquery.jqprint.js"></script>
<link href='fullcalendar/fullcalendar.css' rel='stylesheet' />
<link href='fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='fullcalendar/fullcalendar.min.js'></script>
<link rel="stylesheet" href="css/simplePagination.css" /><?php /*?><?php */?>

<!-----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]-->
		
<style>
.designation-list{
height: 200px;
overflow-y: scroll;
width: 250px;
border: solid thin;
padding: 10px!important;
margin-top: 10px!important;
line-height: 25px;
}
.DesignationList input{
margin-right:5px;
}
</style>
		
</head>


<body class="skin-blue">
	<?php include("header.php");?>
   	<div class="row">
   		<div id="wrapper">
			<div class="content">
				<div class="report-tab">
					<div class="employee-title">
						<div class="report-left"><h2><translate>Payroll Management</translate><span></span></h2></div>
						<div class="clear-float"></div>
					</div>
					<div class="clear-float"></div>
					<div class="report-cell-02">
						<ul class="payroll-menu">
							<?php 
							$sub_rights=mysql_fetch_array(mysql_query("select * from menu as m,menu_sub as s where  m.menu_name='Salary' and m.menu_id=s.menu_id and s.s_menu_name='salaryStructure'"));
							$view_rights=mysql_fetch_array(mysql_query("select * from tbl_user_rights where user_id='$userid' and s_submenu_id='$sub_rights[s_id]'"));
							/////////////EmployeePayStructure/////////////////
							$rights_emp=mysql_fetch_array(mysql_query("select * from menu as m,menu_sub as s where  m.menu_name='Salary' and m.menu_id=s.menu_id and s.s_menu_name='EmployeePayStructure'"));
							$view_rights_emp=mysql_fetch_array(mysql_query("select * from tbl_user_rights where user_id='$userid' and s_submenu_id='$rights_emp[s_id]'"));
							$rights_emp_sal=mysql_fetch_array(mysql_query("select * from menu as m,menu_sub as s where  m.menu_name='Salary' and m.menu_id=s.menu_id and s.s_menu_name='paySalary'"));
							$view_rights_emp_sal=mysql_fetch_array(mysql_query("select * from tbl_user_rights where user_id='$userid' and s_submenu_id='$rights_emp_sal[s_id]'"));
							 
							if($_SESSION['usertype']=='Superadmin' || $_SESSION['branchadmin']=='Y') 
							{
								?>
								<!--<li data-page="deductionManagement"><translate>Manage Deductions & Earnings</translate></li>-->
								<li data-page="salaryStructure"><translate>Salary Structure</translate></li>
								<li data-page="EmployeePayStructure"><translate>Employee Pay Structure</translate></li>
								<li data-page="paySalary"><translate>Pay Salary</translate></li>
								<li data-page="gratuity"><translate>Gratuity/End Of Service</translate></li>
								<li data-page="weeklyPayment"><translate>Weekly Payment</translate></li>
								<?php 
							} 
							else {
								if($view_rights['view_right']==1){?>
									<li data-page="salaryStructure"><translate>Salary Structure</translate></li>	
									<li data-page="EmployeePayStructure"><translate>Employee Pay Structure</translate></li>
									<?php 
								} 
								?>
								<li data-page="paySalary"><translate>Pay Salary</translate></li>
								<li data-page="gratuity"><translate>Gratuity/End Of Service</translate></li>
								
							<?php
							}
							?>
						</ul>
						
						<div id="tabletabheadlist">
							<!--<label><input type="button" value="Employee" class="btn-tab-01" /></label>
							<label><input type="button" value="Owner" class="btn-tab-01"/></label>
							<label><input type="button" value="Manager" class="btn-tab-01" /></label>-->
						</div>
						<!--<label>
						<select name="" class="hrLists">
						  <option value="employeeLists">Employee Lists</option>
						  <option value="managementList">Management</option>
						  <option value="humanResourceList">Human Resource</option>
						  <option value="departmentList">Department</option>
						  <option value="designationList">Designation</option>
						  <option value="newJoiningList">New Joining</option>
						</select>
						</label>-->
						<div class="clear-float"></div>

						<!-----------------------Start Manage Deduction Searching -------------------------->

						

						
						<div class="report-cell-02 paysalsearch">
							<form class="pdtSearchForm">
							<input type="hidden" name="hid_empsal" id="hid_empsal" value="<?php echo $view_rights_emp_sal['view_right'];?>">
								<?php $month=date('m');$year=date('Y'); ?>
								
								<label class="branch">
    								<select name="branch" id="branch" style="width:100px;" onChange="load_emp_branch(this.value)">
										<option value="">Branch</option>
									</select>
								</label>
								<label>
								<input type="hidden" name="hid_empst" id="hid_empst" value="<?php echo $view_rights_emp['view_right'];?>">
							
						
									<select name="memberid" id="imdatesupervisor" style="width:100px;" >
    									<option value="">Member</option>
    								</select>
									
									
								</label>
								<label style="display:none" id="search_month"> 
									<select name="salmonth" id="salmonth" style="width:100px;">
    									<option <?php if($month=='01'){  ?> selected="selected" <?php }  ?> value="01">January</option>
										<option <?php if($month=='02'){  ?> selected="selected" <?php }  ?> value="02">February</option>
										<option <?php if($month=='03'){  ?> selected="selected" <?php }  ?> value="03">March</option>
										<option <?php if($month=='04'){  ?> selected="selected" <?php }  ?> value="04">April</option>
										<option <?php if($month=='05'){  ?> selected="selected" <?php }  ?> value="05">May</option>
										<option <?php if($month=='06'){  ?> selected="selected" <?php }  ?> value="06">June</option>
										<option <?php if($month=='07'){  ?> selected="selected" <?php }  ?> value="07">July</option>
										<option <?php if($month=='08'){  ?> selected="selected" <?php }  ?> value="08">August</option>
										<option <?php if($month=='09'){  ?> selected="selected" <?php }  ?> value="09">September</option>
										<option <?php if($month=='10'){  ?> selected="selected" <?php }  ?> value="10">October</option>
										<option <?php if($month=='11'){  ?> selected="selected" <?php }  ?> value="11">November</option>
										<option <?php if($month=='12'){  ?> selected="selected" <?php }  ?> value="12">December</option>
								    </select>
								</label>
								<label style="display:none" id="search_year"> 
									<select name="salyear" id="salyear" style="width:100px;">
										<option <?php if($year=='2014'){  ?> selected="selected" <?php }  ?>  value="2014">2014</option>
										<option <?php if($year=='2015'){  ?> selected="selected" <?php }  ?>  value="2015">2015</option>
										<option <?php if($year=='2016'){  ?> selected="selected" <?php }  ?>  value="2016">2016</option>
										<option <?php if($year=='2017'){  ?> selected="selected" <?php }  ?>  value="2017">2017</option>
										<option <?php if($year=='2018'){  ?> selected="selected" <?php }  ?>  value="2018">2018</option>
									</select>
								</label>
								<!--<label>
    								<select name="finalapproval" id="finalapproval" style="width:100px;">
    									<option value="">--select--</option>
										<option value="1">Paid</option>
										<option value="0">Not Paid</option>
    								</select>
								</label>-->	
								<!--onClick="search_emp_pay_structure()"-->
								<label><input type="button" id="payroll_search_btn" value="Search" style="width:70px;" onClick="search_emp_pay_salary()" /></label>
							</form>
							
							<div class="employee-tab-dwn"><input name="" type="button" value="Download" class="button-style-05" onClick="download_pay_salary()" /></div>
							<div class="employee-tab-dwn"><input name="" type="button" value="Download Cumulative" class="button-style-05" onClick="download_pay_salary_cumulative()" style="width:195px;" /></div>
							<div class="clear-float"></div>
						</div>
					</div><!-- /report-cell-02 -->

					<div id="tabletoatal"></div>
					<div id="tablelist"></div>

					<div class="pagination-holder clearfix"align="center" >
						<div id="light-pagination" style="width:500px"  class="pagination light-theme simple-pagination"></div>
						<!--<div class="employee-cell">
						<div class="clocked-in"><span class="clocked-status">Clocked-in</span> <span class="clocked-time">07:30 hours</span></div> 
						<div class="employee-foto"><img src="images/employee.jpg" alt="" /></div>
						<div class="employee-designation">Managing Director</div>
						<h2>Jake Moser</h2>
						<h3>moserjake@gmail.com</h3>
						<h4>9933 789 789</h4>
						<div class="timesheet-nav"><a href="#">Timesheet</a></div>
						</div>--><!-- /employee-cell -->

						<div class="clear-float"></div>
					</div>
				</div><!-- /report-tab -->

				<div class="clear-float"></div>
			</div><!-- /content -->

			<div class="footer">
<strong>© add-HRM </strong><span class="currentversion"></span><br />
<span><translate>Developed by</translate> <a href="http://www.aadhocc.com" target="_blank"><translate>Aadhocc</translate></a></span></div>
			<!-- /footer -->
		</div>
	</div><!-- /.row (main row) -->

<!--</section>
</aside>
</div>-->

        <!-- add new calendar event modal -->


        <!-- jQuery 2.0.2 -->
<?php /*?>       <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> 
       <!--  jQuery UI 1.10.3 -->
        <script src="js/jquery-ui-1.10.3.min.js" type="text/javascript"></script><?php */?>
   <!--      Bootstrap -->
              <?php 
	include("footer-js.php");
?>
<div class="modal fade" id="PaySlipModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>	
	<script type="text/javascript">
	//$('.row_to_expand').hide();
	$('.expand_parent_row').click(function () {
		var currentDetails = $(this).next('.row_to_expand');
		//console.log(currentDetails);
		$('.row_to_expand').not(currentDetails).hide();
		
		currentDetails.toggle();
		
	});
	
</script>	
		<!--------------scripts for employee list-------------->
<script src="js/common.js"></script>

<script src="js/payrollmanagement.js"></script>
<script src="js/salary_management.js"></script>
	<!--------------scripts for employee list-------------->
	
	<script type="text/javascript">
function go_to_empstruct()
	{
	hash = window.location.href.split('#')[1]	;
	var hidempst=$('#hid_empst').val();
	var hidempsal=$('#hid_empsal').val();
	

	var users='<?php echo $userid;?>';
	
	if(users!=1)
	{
	     if(hash=='EmployeePayStructure')
	    {
	         if(hidempst==0)
			 {
			    $('#imdatesupervisor').prop('disabled', true);
				$('#payroll_search_btn').prop('disabled', true);
			 }
	    }
		else if(hash=='paySalary')
		{
		       if(hidempsal==0)
			 {
			    $('#imdatesupervisor').prop('disabled', true);
				$('#payroll_search_btn').prop('disabled', true);
			 }
		}
		
				else
		{
		        $('#imdatesupervisor').prop('disabled', false);
				$('#payroll_search_btn').prop('disabled', false);
		}
		
		//hid_empsal
		

	}
	else
	{
				$('#imdatesupervisor').prop('disabled', false);
				$('#payroll_search_btn').prop('disabled', false);
	}
	
}	
	
	</script>
	
</body>
</html>