<?php

if ($session->Check ()) {
	
	$uemail = $_SESSION ['email'];
	
	global $uemail;

} else {
	$session->destroy ( 'loginadmin', Admin );

}

?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
			<?php
			$settingcheck = $db->get_count ( "setting" );
			// echo $settingcheck;
			$officecheck = $db->get_count ( "office" );
			// echo $officecheck;
			if ($settingcheck == 1 && $officecheck == 1) {
				echo C_NAME;
			
			}
			?>
		</title>

<meta name="description" content="overview &amp; stats" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!-------------------------------------------------  HOME CSS  ------------------------------------------------->

<!--basic styles-->

<link
	href="<?php echo SITE_URL.'/assets/backend/css/bootstrap.min.css'?>"
	rel="stylesheet" />
<link
	href="<?php echo SITE_URL.'/assets/backend/css/bootstrap-responsive.min.css'?>"
	rel="stylesheet" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/font-awesome.min.css'?>" />

<!--[if IE 7]>
		  <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

<!--page specific plugin styles-->
<?php if ($query2ans == 'payslip'){?>
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend';?>/css/jquery-ui-1.10.3.custom.min.css" />
	<link rel="stylesheet" href="<?php echo SITE_URL.'/assets/backend';?>/css/jquery.gritter.css" />
<?php }?>
<!--fonts-->

<link rel="stylesheet"
	href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />

<!--ace styles-->

<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/ace.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/ace-responsive.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/ace-skins.min.css'?>" />
<?php if($query2ans !='salary_slip' && $query2ans != 'salary_slip_format' && $query2ans != 'payslip' && $query2ans != 'singaporetable'){?>
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script
	src="<?php  echo SITE_URL.'/assets/backend/js/jquery-ui-1.10.3.custom.min.js'?>"></script>
<?php }?> 	
		<?php
		if ($query2ans == 'home' || $query2ans == 'test') {
			?>
				<script
	src="<?php echo SITE_URL.'/assets/backend/js/highcharts.js';?>"></script>
<script src="<?php echo SITE_URL.'/assets/backend/js/exporting.js';?>"></script>
		<?php }?>
		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

<!--inline styles related to this page-->



<!-- ----------------- ---------------------------------END HOME CSS------------------------------------------- -->

<!-- --------------------------------------------------DISPLAY USERS CSS-------------------------------------- -->
	<?php
	if ($query2ans == 'calendar') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/fullcalendar.css';?>" />
	<?php
	}
	?>
<!-- ----------------------------------------------- -----END DISPLAY USER CSS----------------------------------->

<!-- --------------------------------------------------DISPLAY USERS CSS-------------------------------------- -->
	<?php
	if ($query2ans == 'edit_status' || $query2ans == 'singaporetable' || $query2ans == 'incometax_slab') {
		?>
		
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
	<?php
	}
	?>
<!-- ----------------------------------------------- -----END DISPLAY USER CSS----------------------------------->

<!-- -----------------------------------------------------EDIT DISPLAY USER CSS---------------------------------->
			<?php
			if ($query2ans == 'edit_displayuser') {
				?>
				<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
				
			<?php
			}
			?>
<!-- -----------------------------------------------------END EDIT DISPLAY USER CSS--------------------------- -->

<!-- --------------------------------------------------REGISTER PAGE CSS-------------------------------------- -->
	<?php
	if ($query2ans == 'register' || $query2ans == 'salary_slip' || $query2ans == 'salary_slip_format') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
		
	<?php
	}
	?>	
<!-- --------------------------------------------------END REGISTER PAGE CSS---------------------------------- -->
<!-- --------------------------------------------------PAYMENT PAGE CSS--------------------------------------- -->
	<?php
	if ($query2ans == 'payment') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END PAYMENT CSS---------------------------------------- -->
<!-- --------------------------------------------------EDIT PAYMENT DETAILS CSS------------------------------- -->
	<?php
	if ($query2ans == 'edit_paymentdetails') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END EDIT PAYMENT DETAILS CSS--------------------------- -->

<!-- --------------------------------------------------EMPLOYEES AWARDS CSS------------------------------- -->
	<?php
	if ($query2ans == 'employee_awards') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END EMPLOYEES AWARDS CSS--------------------------- -->

<!-- --------------------------------------------------EARLIER AWARDS CSS------------------------------- -->
	<?php
	if ($query2ans == 'earlier_awards') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END EMPLOYEES AWARDS CSS--------------------------- -->


<!-- --------------------------------------------------GIVE AWAY CSS START------------------------------------ -->
	<?php
	if ($query2ans == 'give_away') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------GIVE AWAY CSS END-------------------------------------- -->
<!-- --------------------------------------------------NEW EMPLOYEES CSS START---------------------------------->
	<?php
	if ($query2ans == 'new_employee' || $query2ans == 'employee_preview') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END EMPLOYEES CSS--------------------------------- -->

<!-- --------------------------------------------------EDIT EMPLOYEES DETAILS CSS START------------------ -->
	<?php
	if ($query2ans == 'edit_employeedetails') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END EDIT EMPLOYEES DETAILS CSS-------------------- -->

<!-- --------------------------------------------------EDIT CLIENT DETAILS START------------------------------ -->
	<?php
	if ($query2ans == 'edit_clientdetails') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------EDIT CLIENT DETAILS CSS ------------------------------- -->
<!-- --------------------------------------------------NEW CLIENT CSS START----------------------------------- -->
	<?php
	if ($query2ans == 'new_client') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	
	<?php
	}
	?>
<!-- --------------------------------------------------END NEW CLIENTS CSS------------------------------------ -->
<!-- --------------------------------------------------DEPARTMENMTS CSS START--------------------------------- -->
	<?php
	if ($query2ans == 'departments') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css';?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END DEPARTMENTS CSS------------------------------------ -->
<!-- --------------------------------------------------NEW DEPARTMENTS CSS START------------------------------ -->
	<?php
	if ($query2ans == 'new_departments') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END NEW DEPARTMENTS CSS-------------------------------- -->
<!-- --------------------------------------------------EDIT DEPARTMENT CSS START------------------------------ -->
	<?php
	if ($query2ans == 'edit_departments') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END EDIT DEPARTMENT CSS-------------------------------- -->
<!-- --------------------------------------------------LEAVES CSS START-------------------------------------- -->
	<?php
	if ($query2ans == 'leaves') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END LEAVE CSS ---------------------------------------- -->
<!-- --------------------------------------------------CHANGE PASSWORD CSS START---------------------------- -->
	<?php
	if ($query2ans == 'change_pass') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END CHANGE PASSWORD CSS------------------------------ -->
<!-- --------------------------------------------------PROFILE CSS START------------------------------------ -->
	<?php
	if ($query2ans == 'profile') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END PROFILE CSS-------------------------------------- -->
<!-- --------------------------------------------------SETTING CSS START------------------------------------ -->
	<?php
	if ($query2ans == 'setting') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
	<?php
	}
	?>
<!-- --------------------------------------------------END SETTING CSS------------------- --------------------->
<!-- --------------------------------------------------OFFICE MANAGEMENT CSS START-------------------------- -->
	<?php
	if ($query2ans == 'office_management') {
		?>
		<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/bootstrap-timepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css';?>" />
		
	<?php
	}
	?>
<!-- --------------------------------------------------END OFFICE MANAGEMENT CSS---------------------------- -->

<!-- --------------------------------------------------EMPATTENDENCE CSS START---------------------------------- -->
	<?php
	if ($query2ans == 'employee_preview' || $query2ans == 'employee_attendence' || $query2ans == 'new_client') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>

<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table1, #example').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
               "copy",
                {
                    "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                    "sExtends": "csv"
                },
                {
                    "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                    "sExtends": "xls"
                },
                {
                    "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                    "sExtends": "pdf"
                },
                "print"
            ]
        }
    } );
} );


</script>	
	<?php
	}
	?>
<!-- --------------------------------------------------END ATTENDENCE CSS------------------------------------ -->

<?php
if ($query2ans == 'attendence') {
	?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#sample-table-1, #sample-table-2').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
	$pagename = str_replace ( '_', ' ', $query2ans );
	echo $feature->textstyler ( $pagename, '5' );
	?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
	$pagename = str_replace ( '_', ' ', $query2ans );
	echo $feature->textstyler ( $pagename, '5' );
	?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
	$pagename = str_replace ( '_', ' ', $query2ans );
	echo $feature->textstyler ( $pagename, '5' );
	?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );



</script>	
	<?php
}
?>
<!-- -----------------------------------------------------ATTENDENCE JS END =------------------------------------ -->		
		<?php
		if ($query2ans == 'payment_details') {
			?>
		 
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
			$pagename = str_replace ( '_', ' ', $query2ans );
			echo $feature->textstyler ( $pagename, '5' );
			?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
			$pagename = str_replace ( '_', ' ', $query2ans );
			echo $feature->textstyler ( $pagename, '5' );
			?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
			$pagename = str_replace ( '_', ' ', $query2ans );
			echo $feature->textstyler ( $pagename, '5' );
			?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );



</script>	
	<?php
		}
		?>
<!-- ------------------------------------------------------payment_details end------------------------------------ -->

	<?php
	if ($query2ans == 'employee_awards') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>	
	<?php
	}
	?>
	
<!-- ------------------------------------------------------EMPLOYEE AWARDS END------------------------------------ -->

	<?php
	if ($query2ans == 'earlier_awards') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
            }
    } );
} );



</script>
	<?php
	}
	?>	

<!-- ------------------------------------------------------EARLIER AWARDS END------------------------------------ -->

	<?php
	if ($query2ans == 'employee_details') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>
	<?php
	}
	?>	
<!-- ------------------------------------------------------EMPLOYEE DETAILS END------------------------------------ -->	
<!-- ------------------------------------------------------Inventory Start------------------------------------ -->	
	<?php
	if ($query2ans=='view_location' || $query2ans=='view_inventory' || $query2ans=='view_loan' || $query2ans=='previous_payslip') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<?php }
if ($query2ans == 'view_inventory') {
?>	
	
<script type="text/javascript">
			
$(document).ready( function () {
    $('#inventory-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>
	<?php
	}if($query2ans=='view_location'){
	?>
	<script type="text/javascript">
			
$(document).ready( function () {
    $('#location-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>
	
	
	
	
	<?php }if($query2ans=='view_loan'){?>
	<script type="text/javascript">
			
$(document).ready( function () {
    $('#loan-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>
	
	<?php }if($query2ans=='previous_payslip'){?>
	<script type="text/javascript">
			
$(document).ready( function () {
    $('#payslip-table').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>
<?php }?>	
<!-- ------------------------------------------------------ Inventory End------------------------------------ -->	

<!-- ------------------------------------------------------Client Details Start------------------------------------ -->

	<?php
	if ($query2ans == 'client_details') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table1').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>
	<?php
	}
	?>	
	
<!-- ------------------------------------------------------CLIENT DETAILS END------------------------------------ -->

	<?php
	if ($query2ans == 'departments') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table1').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
        
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );


</script>
	<?php
	}
	?>	
<!-- ------------------------------------------------------DEPARTMENTS END-------------------------------------- -->
	

	<?php
	if ($query2ans == 'displayuser') {
		?>
		
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery-ui-1.10.3.custom.min.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/jquery.gritter.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/daterangepicker.css'?>" />
<link rel="stylesheet"
	href="<?php echo SITE_URL.'/assets/backend/css/datepicker.css';?>" />

<link rel="stylesheet" type="text/css"
	href="<?php echo SITE_URL.'/assets/backend/css/dataTables.tableTools.css';?>">
<script type="text/javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/site.js?_=0de0e1537b385e5f374a75ddebb8f409';?>"></script>
<script type="text/javascript" language="javascript"
	src="<?php echo SITE_URL.'/assets/backend/js/dataTables.tableTools.js';?>"></script>
<script type="text/javascript">
			
$(document).ready( function () {
    $('#example-table1').dataTable( {
       
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "sSwfPath": "<?php echo SITE_URL.'/assets/backend/js/pdf/copy_csv_xls_pdf.swf';?>",
            "aButtons": [
                         "copy",
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "csv"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "xls"
                          },
                          {
                              "sTitle":"<?php
		$pagename = str_replace ( '_', ' ', $query2ans );
		echo $feature->textstyler ( $pagename, '5' );
		?>",
                              "sExtends": "pdf"
                          },
                          "print"
                      ]
        }
    } );
} );

</script>	
	<?php
	}
	?>
<?php

	$checkbrowser = $os->getOS ();
	if ($checkbrowser == 'Ubuntu' || $checkbrowser == 'iPhone' || $checkbrowser == 'iPod' || $checkbrowser == 'iPad' || $checkbrowser == 'Android' || $checkbrowser == 'BlackBerry' || $checkbrowser == 'Mobile') {
		?>
<style>
.dataTables_filter {
	margin-top: 8px;
	text-align: right;
}
</style>
<?php }else{?>
<style>
.dataTables_filter {
	margin-top: -30px;
	margin-left: 55%;
}
</style>



<?php }?>
</head>

<body>
<?php

if (isset ( $_POST ['datepost'] )) {
	$getid = $db->get_col ( "employees", array ("email" => $uemail ), 'e_id' );
	$date = $_POST ['datepost'];
	$insert = $db->insert ( "attendence", array ("e_id" => $getid [0], "firsthalf" => '0.00', 'secondhalf' => '0.00', 'date' => $date ) );
}
if (isset ( $_POST ['dateleavepost'] )) {
	$getid = $db->get_col ( "employees", array ("email" => $uemail ), 'e_id' );
	$date = $_POST ['dateleavepost'];
	$insert = $db->insert ( "attendence", array ("e_id" => $getid [0], "firsthalf" => '0.50', 'secondhalf' => '0.50', 'date' => $date ) );
}
?>

<script>
   /* $(document).ready(
            function() {
                setInterval(function() {
                    
                    //$('#show').text(randomnumber);
                }, 3000);
            });*/
</script>
	<script> 
<?php
$usertype = $db->get_col ( "users", array ("email" => $uemail ), 'type' );
if ($usertype [0] == 1) {
	?>
	$(document).ready(function(){
		$(".attendence").click(function(){
			var getdate= $(this).attr('id');
				
				$.ajax({
					type:'POST',
					url:'',
					data: 'datepost=' +getdate,
					success:function(){
						
						var num= $(".showed").text();
						var remain= num-1;
						$(".showed").html(remain);
						$("#notification").html(remain+" Notifications");
					$("#"+getdate).remove();
						}
					});
				    return false;	
			});
			$(".leave").click(function(){
				var getdate= $(this).attr('id');
				$.ajax({
					type:'POST',
					url:'',
					data:'dateleavepost='+getdate,
					success:function(){
							var num= $(".showed").text();
							var remain= num-1;
							if(remain == 0)
							{
								$(".purple").remove();
							}
							else
							{
								$('.showed').html(remain);
								$('#notification').html(remain+" Notifications");
								$("#"+getdate).remove();
							}	
						}
					});
				return false;
				});	
	});
	<?php }?>
</script>
	<div class="navbar">
		<div class="navbar-inner">
			<div class="container-fluid">
				<a href="<?php echo $session->redirect('',Admin);?>" class="brand"padding:0px;>
					<small>
			
							
							<?php
							$settingcheck = $db->get_count ( "setting" );
							// echo $settingcheck;
							$officecheck = $db->get_count ( "office" );
							// echo $officecheck;
							if ($settingcheck == 1 && $officecheck == 1) {
								echo C_NAME;
							}
							?>
						</small>
				</a>
				<!--/.brand-->

				<ul class="nav ace-nav pull-right">
					<?php
					
					if ($usertype [0] == 1) {
						$joining_date = $db->get_row ( "employees", array ("email" => $uemail ) );
						$now = time (); // or your date as well
						$your_date = strtotime ( $joining_date ['j_date'] );
						$datediff = $now - $your_date;
						$totaldays = ceil ( $datediff / (60 * 60 * 24) );
						$i = 0;
						$a = 1;
						while ( $i <= $totaldays - 1 ) {
							$date = $joining_date ['j_date'];
							$date1 = str_replace ( '-', '/', $date );
							$tomorrow = date ( 'Y-m-d', strtotime ( $date1 . "+$i days" ) );
							$exist = $db->exists ( "attendence", array ("e_id" => $joining_date ['e_id'], "date" => $tomorrow ) );
							if (! $exist) {
								$find = $a;
								$a ++;
							}
							$i ++;
						
						}
						// echo "bhangi".$find;
						if ($find) {
							?>
					<li class="purple"><a data-toggle="dropdown"
						class="dropdown-toggle" href="#"> <i
							class="icon-bell-alt icon-animated-bell"></i> <span
							class="badge badge-important showed">
									<?php echo $find; ?>
								</span>
					</a>

						<ul
							class="pull-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-closer">
							<li class="nav-header" id="notification"><i
								class="icon-warning-sign"></i>
									<?php echo $find;?> Notifications
								</li>
								<?php
							$today = date ( "Y-m-d" );
							
							$i = 0;
							while ( $i <= $totaldays - 1 ) {
								$date = $joining_date ['j_date'];
								$date1 = str_replace ( '-', '/', $date );
								$tomorrow = date ( 'Y-m-d', strtotime ( $date1 . "+$i days" ) );
								$exist = $db->exists ( "attendence", array ("e_id" => $joining_date ['e_id'], "date" => $tomorrow ) );
								if (! $exist) {
									?>
											<li id="<?php echo $tomorrow;?>"><a href="#">

									<div class="clearfix">

										<span class="pull-left"> <i
											class="btn btn-mini no-hover btn-pink icon-comment"></i>
															Attendence Mark For <?php echo $tomorrow; ?>
														</span>

										<div class="space"></div>
										<div class="row-fluid">
											<div class="span6">
												<span class="attendence badge badge-success"
													id="<?php echo $tomorrow; ?>">Mark Attendence</span>
											</div>
											<div class="span6">
												<span class="leave badge badge-important"
													id="<?php echo $tomorrow; ?>">Mark Leave</span>
											</div>
										</div>
									</div>
							</a></li>
										<?php
								
}
								
								$i ++;
							}
							?>
								
								<li></li>

						</ul></li>
					<?php }}?>
					<?php
					$user = $db->get_col ( 'users', array ('email' => $uemail ), 'photo' );
					?>

						<li class="light-blue"><a data-toggle="dropdown" href="#"
						class="dropdown-toggle">
							<?php
							if ($user [0] != '') {
								?>
								<img class="nav-user-photo"
							src="<?php echo SITE_URL.'/uploads/users/'.$user[0];?>"
							alt="Jason's Photo" />
							<?php
							} else {
								?>
									<img class="nav-user-photo"
							src="<?php echo SITE_URL.'/assets/backend/avatars/user.jpg'?>"
							alt="Jason's Photo" />
								<?php
							
							}
							?>
							<?php
							$name = $db->get_col ( "users", array ("email" => $uemail ), 'name' );
							?>
								<span class="user-info"> <small>Welcome,</small>
									<?php echo $name[0];?>
								</span> <i class="icon-caret-down"></i>
					</a>

						<ul
							class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-closer">
							<li><a href="<?php echo $link->link('profile', Admin);?>"> <i
									class="icon-user"></i> Profile
							</a></li>
<?php
							if ($user [0] != '') {
								?>

							<li><a href="<?php echo $link->link('setting', Admin);?>"> <i
									class="icon-cog"></i> Settings
							</a></li>

							<li><a
								href="<?php echo $link->link('office_management', Admin);?>"> <i
									class="icon-desktop"></i> Office Management
							</a></li>

							<li class="divider"></li><?php } ?>

							<li><a href="<?php echo $link->link('logout', Admin,'');?>"> <i
									class="icon-off"></i> Logout
							</a></li>
						</ul></li>
				</ul>
				<!--/.ace-nav-->
			</div>
			<!--/.container-fluid-->
		</div>
		<!--/.navbar-inner-->
	</div>

	<div class="main-container container-fluid">
		<a class="menu-toggler" id="menu-toggler" href="#"> <span
			class="menu-text"></span>
		</a>