<?php
if (isset ( $id [1] )) {
	$query = $db->get_row ( 'employees', array ('e_id' => $id [1] ) );
	
	// ----------------------------------extra get
	// values------------------------------------------//
	
	$getemail = $db->get_col ( "employees", array ("e_id" => $id [1] ), 'email' );
	
	// echo $getemail[0];
	$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
	$string = preg_replace ( '/\s+/', '', $total [0] );
	$totalconvert = explode ( ",", $string );
	// ------------------------------------END-----------------------------------------------------//
	
	if ($_POST ['drd']) {
		$foo = $_POST ['drd'];
		$query = $db->update ( 'employees', array ('highschool' => $foo ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_inter']) {
		$inter = $_POST ['v_inter'];
		$query = $db->update ( 'employees', array ('intermediate' => $inter ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_graduation']) {
		$graduation = $_POST ['v_graduation'];
		$query = $db->update ( 'employees', array ('graduation' => $graduation ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_pgraduation']) {
		$pgraduation = $_POST ['v_pgraduation'];
		$query = $db->update ( 'employees', array ('p_graduation' => $pgraduation ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_extraa']) {
		$extraa = $_POST ['v_extraa'];
		$query = $db->update ( 'employees', array ('extraas' => $extraa ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_father']) {
		$father = $_POST ['v_father'];
		$query = $db->update ( 'employees', array ('f_name' => $father ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_email']) {
		$email = $_POST ['v_email'];
		$query = $db->update ( 'users', array ('email' => $email ), array ('e_id' => $id [1] ) );
		$query = $db->update ( 'employees', array ('email' => $email ), array ('email' => $getemail [0] ) );
	}
	if ($_POST ['v_address']) {
		$address = $_POST ['v_address'];
		$query = $db->update ( 'employees', array ('address' => $address ), array ("e_id" => $id [1] ) );
	}
	if ($_POST ['v_bank']) {
		$bank = $_POST ['v_bank'];
		$query = $db->update ( 'employees', array ("b_name" => $bank ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_account']) {
		$account = $_POST ['v_account'];
		$query = $db->update ( "employees", array ('a_number' => $account ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_branch']) {
		$branch = $_POST ['v_branch'];
		$query = $db->update ( 'employees', array ('branch' => $branch ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_city']) {
		$city = $_POST ['v_city'];
		$query = $db->update ( 'employees', array ('city' => $city ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_ifsccode']) {
		$ifsccode = $_POST ['v_ifsccode'];
		$query = $db->update ( 'employees', array ('ifsccode' => $ifsccode ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_salary']) {
		$salary = $_POST ['v_salary'];
		$query = $db->update ( 'employees', array ('salary' => $salary ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['v_remarks']) {
		$remarks = $_POST ['v_remarks'];
		$query = $db->update ( 'employees', array ('remarks' => $remarks ), array ('e_id' => $id [1] ) );
	}
	
	if ($_POST ['v_idproof']) {
		$idproof = $_POST ['v_idproof'];
		$query = $db->update ( 'employees', array ('idproof' => $idproof ), array ('e_id' => $id [1] ) );
	}
	
	if ($_POST ['v_idproof1']) {
		$idproof1 = $_POST ['v_idproof1'];
		$query = $db->update ( 'employees', array ('idproof1' => $idproof1 ), array ('e_id' => $id [1] ) );
	}
	
	if ($_POST ['v_idproof2']) {
		$idproof2 = $_POST ['v_idproof2'];
		$query = $db->update ( 'employees', array ('idproof2' => $idproof2 ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['emp_name']) {
		$empname = $_POST ['emp_name'];
		$query = $db->update ( 'employees', array ('e_name' => $empname ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['dep_name']) {
		$depname = $_POST ['dep_name'];
		$query = $db->update ( 'employees', array ('department' => $depname ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['dob_name']) {
		$dobname = $_POST ['dob_name'];
		$query = $db->update ( 'employees', array ('dob' => $dobname ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['empcode']) {
		$ecode = $_POST ['empcode'];
		$query = $db->update ( 'employees', array ('e_code' => $ecode ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['mobile']) {
		$mobile = $_POST ['mobile'];
		$query = $db->update ( 'employees', array ('mobile' => $mobile ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['telephone']) {
		$telephone = $_POST ['telephone'];
		$query = $db->update ( 'employees', array ('telephone' => $telephone ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['appoint']) {
		$appoint = $_POST ['appoint'];
		$query = $db->update ( 'employees', array ('appointment_date' => $appoint ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['joining']) {
		$join1 = explode ( '-', $_POST ['joining'] );
		$joining = $join1 [2] . "-" . $join1 [1] . "-" . $join1 [0];
		$query = $db->update ( 'employees', array ('j_date' => $joining ), array ('e_id' => $id [1] ) );
	}
	if ($_POST ['final_displayuser']) {
		$finaldisplayuser = $_POST ['final_displayuser'];
		$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
		$query = $db->update ( "users", array ("privilege" => $total [0] . $finaldisplayuser . ',' ), array ("email" => $getemail [0] ) );
	}
	
	if ($_POST ['final_displayuser']) {
		$final_displayuser = $_POST ['final_displayuser'];
		if ($final_displayuser == 'displayuser') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_displayuser . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_displayuser == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_displayuser = str_replace ( 'displayuser', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_displayuser . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_newregister']) {
		$final_newregister = $_POST ['final_newregister'];
		if ($final_newregister == 'newregister') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_newregister . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_newregister == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_newregister = str_replace ( 'newregister', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_newregister . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_paymentdetails']) {
		$final_paymentdetails = $_POST ['final_paymentdetails'];
		if ($final_paymentdetails == 'paymentdetails') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_paymentdetails . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_paymentdetails == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_paymentdetails = str_replace ( 'paymentdetails', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_paymentdetails . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_newpayments']) {
		$final_newpayments = $_POST ['final_newpayments'];
		if ($final_newpayments == 'newpayments') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_newpayments . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_newpayments == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_newpayments = str_replace ( 'newpayments', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_newpayments . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_mostawarded']) {
		$final_mostawarded = $_POST ['final_mostawarded'];
		if ($final_mostawarded == 'mostawarded') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_mostawarded . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_mostawarded == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_mostawarded = str_replace ( 'mostawarded', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_mostawarded . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_earlierawards']) {
		$final_earlierawards = $_POST ['final_earlierawards'];
		if ($final_earlierawards == 'earlierawards') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_earlierawards . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_earlierawards == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_earlierawards = str_replace ( 'earlierawards', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_earlierawards . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_giveanawards']) {
		$final_giveanawards = $_POST ['final_giveanawards'];
		if ($final_giveanawards == 'giveanawards') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_giveanawards . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_giveanawards == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_giveanawards = str_replace ( 'giveanawards', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_giveanawards . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_employeesdetails']) {
		$final_employeesdetails = $_POST ['final_employeesdetails'];
		if ($final_employeesdetails == 'employeesdetails') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_employeesdetails . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_employeesdetails == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_employeesdetails = str_replace ( 'employeesdetails', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_employeesdetails . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_newemployees']) {
		$final_newemployees = $_POST ['final_newemployees'];
		if ($final_newemployees == 'newemployees') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_newemployees . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_newemployees == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_newemployees = str_replace ( 'newemployees', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_newemployees . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_clientdetails']) {
		$final_clientdetails = $_POST ['final_clientdetails'];
		if ($final_clientdetails == 'clientdetails') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_clientdetails . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_clientdetails == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_clientdetails = str_replace ( 'clientdetails', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_clientdetails . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_newclient']) {
		$final_newclient = $_POST ['final_newclient'];
		if ($final_newclient == 'newclient') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_newclient . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_newclient == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_newclient = str_replace ( 'newclient', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_newclient . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_departments']) {
		$final_departments = $_POST ['final_departments'];
		if ($final_departments == 'departments') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_departments . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_departments == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_departments = str_replace ( 'departments', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_departments . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_newdepartments']) {
		$final_newdepartments = $_POST ['final_newdepartments'];
		if ($final_newdepartments == 'newdepartments') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_newdepartments . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_newdepartments == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_newdepartments = str_replace ( 'newdepartments', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_newdepartments . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_singaporetable']) {
		$final_singaporetable = $_POST ['final_singaporetable'];
		if ($final_singaporetable == 'singaporetable') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_singaporetable . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_singaporetable == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_singaporetable = str_replace ( 'singaporetable', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_singaporetable . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	
	if ($_POST ['final_payslip']) {
		$final_payslip = $_POST ['final_payslip'];
		if ($final_payslip == 'payslip') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_payslip . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_payslip == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_payslip = str_replace ( 'payslip', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_payslip . ',' ), array ("email" => $getemail [0] ) );
		}
	} 
	
	if ($_POST ['final_incometax_slab']) {
		$final_incometax_slab = $_POST ['final_incometax_slab'];
		if ($final_incometax_slab == 'incometax_slab') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_incometax_slab . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_incometax_slab == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_incometax_slab = str_replace ( 'incometax_slab', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_incometax_slab . ',' ), array ("email" => $getemail [0] ) );
		}
	} 
	
	if ($_POST ['final_attendence']) {
		$final_attendence = $_POST ['final_attendence'];
		if ($final_attendence == 'attendence1') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_attendence . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_attendence == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_attendence = str_replace ( 'attendence1', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_attendence . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_changepasswords']) {
		$final_changepasswords = $_POST ['final_changepasswords'];
		if ($final_changepasswords == 'changepasswords') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_changepasswords . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_changepasswords == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_changepasswords = str_replace ( 'changepasswords', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_changepasswords . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	if ($_POST ['final_employeeattendence']) {
		$final_employeeattendence = $_POST ['final_employeeattendence'];
		if ($final_employeeattendence == 'empattend') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$query = $db->update ( "users", array ("privilege" => $total [0] . $final_employeeattendence . ',' ), array ("email" => $getemail [0] ) );
		}
		if ($final_employeeattendence == 'delete') {
			$total = $db->get_col ( "users", array ("email" => $getemail [0] ), 'privilege' );
			$final_employeeattendence = str_replace ( 'empattend', '', $total [0] );
			$query = $db->update ( "users", array ("privilege" => $final_employeeattendence . ',' ), array ("email" => $getemail [0] ) );
		}
	}
	?>
<div id="example" class="modal hide fade in" style="display: none;">

	<div class="modal-header">
		<a class="close"
			href="<?php echo $link->link('employee_preview',Admin, '?id='.$id[1]);?>">x</a>


		<div class="modal-body">
			<form class="form-horizontal" method="post" action=""
				enctype="multipart/form-data">

				<div class="control-group">

					<div class="controls">
						<select name="set" id="set">

							<option value="present" selected="selected">Present</option>
							<option value="absent" id="absent">Absent</option>
						</select>
					</div>
					<!-- /controls -->
				</div>
				<!-- /control-group -->

				<div class="control-group" id="date">
					<label class="control-label" for="amount">Date</label>
					<div class="controls">
						<span> <input class="span1 date-picker" id="id-date-picker-1"
							type="text" data-date-format="dd-mm-yyyy" name="date1" />
						</span> <span> <input class="span1 date-picker"
							id="id-date-picker-1" type="text" data-date-format="dd-mm-yyyy"
							name="date2" />
						</span>
						<!-- <input type="text" name="date" id="id-date-range-picker-2" > -->
					</div>
					<!-- /controls -->
				</div>
				<!-- /control-group -->

				<div class="second" style="display: none;">
					<div class="control-group">
						<label class="control-label" for="amount">Type Of Leaves</label>
						<div class="controls">
							<select name="t_leave">
								<option value="" selected="selected" disabled="disabled">Type Of
									Leave</option>
								<option value="casual">Casual Leave</option>
								<option value="sick">Sick Leave</option>
								<option value="maternity">Maternity Leave</option>
								<option value="other">Other Leave</option>
							</select>
						</div>
						<!-- /controls -->
					</div>
					<!-- /control-group -->

					<div class="control-group">
						<label class="control-label" for="amount">Range Of Leaves</label>
						<div class="controls">
							<select name="r_leave">
								<option value="" selected="selected" disabled="disabled">Range
									Of Leaves</option>
								<option value="firsthalf">First Half Leave</option>
								<option value="secondhalf">Second Half Leave</option>
								<option value="fullday">Full Day Leave(s)</option>
							</select>
						</div>
						<!-- /controls -->
					</div>
					<!-- /control-group -->

					<div class="control-group">
						<label class="control-label" for="amount">Application</label>
						<div class="controls">
							<input type="file" name="application">
						</div>
						<!-- /controls -->
					</div>
					<!-- /control-group -->

				</div>
				<!-- .second -->
		
		</div>
		<!-- .modal body -->

		<div class="row-fluid">
			<div class="span5"></div>
			<div class="span4">
				<div class="control-group">
					<div class="controls">
						<span class="span12"> <input type="hidden" name="id"
							value="<?php echo $id[1];?>">
							<button type="submit" name="submit"
								class="btn btn-small btn-primary">Save</button>
						</span>
					</div>
					<!-- .control -->
				</div>
				<!-- .control group -->
			</div>
		</div>
		</form>
	</div>

</div>
<!-- .example -->
<br>
<div class="row-fluid">
	<div class="span8">
		<div class="pull-left alert alert-success inline no-margin">
			<button type="button" class="close" data-dismiss="alert">
				<i class="icon-remove"></i>
			</button>

			<i class="icon-umbrella bigger-120 blue"></i> Click on the image
			below or on profile fields to edit them

		</div>
	</div>
	<!-- span8 -->
	<div class="span4">
		<div class="control-group">
			<div class="controls">
				<p data-toggle="modal" href="#example" class="btn btn-primary"
					id='edit'>Mark Attendence</p>
			</div>
			<!-- /controls -->
		</div>
		<!-- /control-group -->
	</div>
	<!-- .span4 -->

</div>
<!-- .row-fluid -->


<div class="page-content">
	<div class="page-header position-relative"></div>
	<!--/.page-header-->




	<div class="row-fluid">
		<div class="span12">
			<!--PAGE CONTENT BEGINS-->
			<script type="text/javascript"
				src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
			<script type="text/javascript">
										$(document).ready(function() {
										$('.higher').click(function()
												{
											$('#result').show();
                                              var del_id = $('#ip').val();
                                             
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'drd=' + del_id, // changed
										    success: function(){
										
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.inter_submit').click(function()
												{
											$('#result').show();
                                              var inter = $('#interpv').val();
                                             
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_inter=' + inter, // changed
										    success: function(){
										    	$('#result').hide(1000); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.graduation_submit').click(function()
												{
											$('#result').show();
                                              var graduation = $('#graduationpv').val();
                                             
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_graduation=' + graduation, // changed
										    success: function(){
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.p_graduation_submit').click(function()
												{
											$('#result').show();
                                              var p_graduation = $('#p_graduationpv').val();
                                             
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_pgraduation=' + p_graduation, // changed
										    success: function(){
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.extraa_submit').click(function(){
											$('#result').show();
                                              var extraa = $('#extraapv').val();
                                             
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_extraa=' + extraa, // changed
										    success: function(){
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.father_submit').click(function(){
											$('#result').show();
                                              var father = $('#fatherpv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_father=' + father, // changed
										    success: function(){
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>
									<?php
	$totalemail = $db->get_all ( "users" );
	?>
									<script type="text/javascript">
										$(document).ready(function() {
										$('.email_submit').click(function(){
											
											$('#result').show();
                                              var father = $('#emailpv').val();
                                            <?php foreach ($totalemail as $key){?>
                                             if(father=="<?php echo $key['email']?>")
                                              {
                                                  alert("This email is already exists");
                                              }
                                                <?php }?>
                                               else{
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_email=' + father, // changed
										    success: function(){
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										}
										  
										    return false;
										
											    
												});
										});
									</script>
			<script type="text/javascript">
										$(document).ready(function() {
										$('.address_submit').click(function(){
											$('#result').show();
                                              var address = $('#addresspv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_address=' + address, // changed
										    success: function(){
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>




			<script type="text/javascript">
										$(document).ready(function() {
										$('.bank_submit').click(function(){
											$('#result').show();
											
                                              var bank = $('#bankpv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_bank=' + bank, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.account_submit').click(function(){
											$('#result').show();
											
                                              var account = $('#accountpv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_account=' + account, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.branch_submit').click(function(){
											$('#result').show();
                                              var branch = $('#branchpv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_branch=' + branch, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.city_submit').click(function(){
											$('#result').show();
                                              var city = $('#citypv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_city=' + city, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.ifsccode_submit').click(function(){
											$('#result').show();
                                              var ifsccode = $('#ifsccodepv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_ifsccode=' + ifsccode, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.salary_submit').click(function(){
											$('#result').show();
                                              var salary = $('#salarypv').val();
                                              
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_salary=' + salary, // changed
										   
										    success: function(){
										
												
										    	$('#result').hide(); 
										    	window.location='';
										    	
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.remarks_submit').click(function(){
											$('#result').show();
                                              var remarks = $('#remarkspv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_remarks=' + remarks, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.idproof_submit').click(function(){
											$('#result').show();
                                              var idproof = $('#idproofpv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_idproof=' + idproof, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.idproof1_submit').click(function(){
											$('#result').show();
                                              var idproof1 = $('#idproof1pv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_idproof1=' + idproof1, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.idproof2_submit').click(function(){
											$('#result').show();
                                              var idproof2 = $('#idproof2pv').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'v_idproof2=' + idproof2, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>


			<script type="text/javascript">
										$(document).ready(function() {
										$('.empsubmit').click(function(){
											$('#result').show();
                                              var empname = $('#empname').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'emp_name=' + empname, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.depsubmit').click(function(){
											$('#result').show();
                                              var departmentname = $('#departmentname').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'dep_name=' + departmentname, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.dobsubmit').click(function(){
											$('#result').show();
                                              var dateofbirth = $('.dateofbirth').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'dob_name=' + dateofbirth, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.ecodesubmit').click(function(){
											$('#result').show();
                                              var e_code = $('#e_code').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'empcode=' + e_code, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.mobilesubmit').click(function(){
											$('#result').show();
                                              var mob = $('#mob').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'mobile=' + mob, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.telephonesubmit').click(function(){
											$('#result').show();
                                              var tele = $('#tele').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'telephone=' + tele, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.adatesubmit').click(function(){
											$('#result').show();
                                              var adate = $('.appointment_date').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'appoint=' + adate, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('.jdatesubmit').click(function(){
											$('#result').show();
                                              var jdate = $('.j_date').val();
										    $.ajax({
										    type: "POST", //changed
										    url: "",
										    data: 'joining=' + jdate, // changed
										    success: function(){
										
												
										    	$('#result').hide(); 
										    		
										    			window.location='';
											    		
										        }
										    });
										    
										  
										    return false;
										
											    
												});
										});
									</script>





			<script type="text/javascript">
										$(document).ready(function() {
										$('#displayuser').click(function(){
											if($('#displayuser').prop('checked') == true)
											{
												$('#result').show();
	                                              var duser = $('#displayuser').val();
	                                              //alert(duser);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_displayuser=' + duser, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var duser = 'delete';
	                                              //alert(duser);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_displayuser=' + duser, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#newregister').click(function(){
											if($('#newregister').prop('checked') == true)
											{
												$('#result').show();
	                                              var register = $('#newregister').val();
	                                              //alert(register);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newregister=' + register, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var register = 'delete';
	                                              //alert(register);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newregister=' + register, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#paymentdetails').click(function(){
											if($('#paymentdetails').prop('checked') == true)
											{
												$('#result').show();
	                                              var payment = $('#paymentdetails').val();
	                                              //alert(payment);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_paymentdetails=' + payment, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var payment = 'delete';
	                                              //alert(payment);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_paymentdetails=' + payment, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#newpayments').click(function(){
											if($('#newpayments').prop('checked') == true)
											{
												$('#result').show();
	                                              var npayment = $('#newpayments').val();
	                                              //alert(npayment);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newpayments=' + npayment, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var npayment = 'delete';
	                                              //alert(npayment);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newpayments=' + npayment, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#mostawarded').click(function(){
											if($('#mostawarded').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#mostawarded').val();
	                                             // alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_mostawarded=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_mostawarded=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#earlierawards').click(function(){
											if($('#earlierawards').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#earlierawards').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_earlierawards=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_earlierawards=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#giveanawards').click(function(){
											if($('#giveanawards').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#giveanawards').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_giveanawards=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_giveanawards=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#employeesdetails').click(function(){
											if($('#employeesdetails').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#employeesdetails').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_employeesdetails=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_employeesdetails=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#newemployees').click(function(){
											if($('#newemployees').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#newemployees').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newemployees=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newemployees=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#clientdetails').click(function(){
											if($('#clientdetails').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#clientdetails').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_clientdetails=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_clientdetails=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#newclient').click(function(){
											if($('#newclient').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#newclient').val();
	                                             // alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newclient=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newclient=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#departments').click(function(){
											if($('#departments').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#departments').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_departments=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_departments=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#newdepartments').click(function(){
											if($('#newdepartments').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#newdepartments').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newdepartments=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                             // alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_newdepartments=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>
									
									<script type="text/javascript">
										$(document).ready(function() {
										$('#singaporetable').click(function(){
											if($('#singaporetable').prop('checked') == true)
											{
												$('#result').show();
	                                              var msingaporetable = $('#singaporetable').val();
	                                             // alert(msingaporetable);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_singaporetable=' + msingaporetable, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var msingaporetable = 'delete';
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_singaporetable=' + msingaporetable, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>
									
									<script type="text/javascript">
										$(document).ready(function() {
										$('#payslip').click(function(){
											if($('#payslip').prop('checked') == true)
											{
												$('#result').show();
	                                              var mpayslip = $('#payslip').val();
	                                             // alert(msingaporetable);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_payslip=' + mpayslip, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mpayslip = 'delete';
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_payslip=' + mpayslip, // changed
											    success: function(){
												
		 									    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>
									
									<script type="text/javascript">
										$(document).ready(function() {
										$('#incometax_slab').click(function(){
											if($('#incometax_slab').prop('checked') == true)
											{
												$('#result').show();
	                                              var mincometax_slab = $('#incometax_slab').val();
	                                             // alert(msingaporetable);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_incometax_slab=' + mincometax_slab, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mincometax_slab = 'delete';
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_incometax_slab=' + mincometax_slab, // changed
											    success: function(){
												
		 									    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>

			<script type="text/javascript">
										$(document).ready(function() {
										$('#changepasswords').click(function(){
											if($('#changepasswords').prop('checked') == true)
											{
												$('#result').show();
	                                              var mawarded = $('#changepasswords').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_changepasswords=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mawarded = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_changepasswords=' + mawarded, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>
								<script type="text/javascript">
										$(document).ready(function() {
										$('#attendence').click(function(){
											if($('#attendence').prop('checked') == true)
											{
												$('#result').show();
	                                              var mattendence = $('#attendence').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_attendence=' + mattendence, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var mattendence = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_attendence=' + mattendence, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>	

									<script type="text/javascript">
										$(document).ready(function() {
										$('#employeeattendence').click(function(){
											if($('#employeeattendence').prop('checked') == true)
											{
												$('#result').show();
	                                              var memployeeattendence = $('#employeeattendence').val();
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_employeeattendence=' + memployeeattendence, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;
											}
											else
											{
												$('#result').show();
	                                              var memployeeattendence = 'delete';
	                                              //alert(mawarded);
											    $.ajax({
											    type: "POST", //changed
											    url: "",
											    data: 'final_employeeattendence=' + memployeeattendence, // changed
											    success: function(){
												
											    	//alert(final_displayuser);
											    	$('#result').hide(); 
											    		
											    			window.location='';
												    		
											        }
											    });
											    
											  
											    return false;			
											}
										
											    
												});
										});
									</script>
			<div class="row-fluid">
				<div class="span2">

					<form method="post" action="" enctype="multipart/form-data"
						id="form2">
						<div class="abhi" title="Click Image To Change">
												<?php
	if ($query ['p_photograph'] == '') {
		echo '<h6>No Image</h6>';
	} else {
		?>
							      					
									      		<img
								src="<?php echo SITE_URL. '/uploads/employees/'.$query['e_id'].'/'.$query['p_photograph']; ?>">
							<br> <br>
							<div
								class="width-80 label label-info label-large arrowed-in arrowed-in-right">
								<div class="inline position-relative">
									&nbsp; <span class="white middle bigger-150">&nbsp;&nbsp;Profile
										Pic</span> &nbsp;
								</div>
							</div>
							<h6 class="red">
								<i>Click Image To Change</i>
							</h6>
		<?php } ?>
								      		</div>
						<!-- abhi -->

						<div class="choose" id="upllnk" style="display: none;">
							<div class="ace-file-input ace-file-multiple"
								style="width: 150px;">

								<label data-title="Change Avatar"> <span> <i
										class="icon-picture"></i>
								</span>
								</label>

							</div>
						</div>
						<!-- choose -->
						<div style='opacity: 0; display: none;'>
							<input type='file' size="32" name="my_field[]" id='ufile1' />
						</div>

						<div class="select span12" style="display: none;">
							<img id="blahh" src="#" alt="your image" class="span8" /><br> <input
								type="hidden" name="id" value="<?php echo $id[1];?>"> <input
								type="hidden" name="action" value="multiple">
							<button class="btn btn-minier btn-yellow" name="upload">Upload</button>
							<button class="btn btn-minier btn-danger" id="cancel1">Cancel</button>
						</div>
					</form>

				</div>
				<!-- span2 -->
				<div class="space-12"></div>
				<div class="span10">




					<span class="infobox infobox-black infobox-big infobox-dark">
						<div id="employee">
					<?php echo $query['e_name'];?> 

						<br> <span class="smaller-90 tooltip-error" data-rel="tooltip"
								data-placement="top" title="Click to change it"> Employee Name
							</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class=" icon-group bigger-230"></i>
						</div>
						<div class="emp" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="empname"
											name="c_high" placeholder="<?php echo $query['e_name'];?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  empsubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_emp"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>
					</span> <span class="infobox infobox-pink infobox-big infobox-dark">
						<div id="department">
													<?php
	$d_value = $db->get_row ( 'departments', array ('id' => $query ['department'] ) );
	echo $d_value ['name'];
	?>
						 <br> <span class="smaller-90 tooltip-error" data-rel="tooltip"
								data-placement="top" title="Click to change it"> Department </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class=" icon-cogs bigger-230"></i>
						</div>
						<div class="dep" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
									<?php
	$d_value = $db->get_all ( 'departments' );
	?>
									<select name="depar" class="input-medium span12"
											id="departmentname">
											<option value="" selected="selected">Department</option>
										<?php
	foreach ( $d_value as $row ) {
		?>
											<option value="<?php echo $row['id'];?>"><?php echo $row['name'];?></option>
										<?php }?> 
									</select> <span class="editable-clear-x" style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  depsubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_dep"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>
					</span> <span class="infobox infobox-red infobox-big infobox-dark">
						<div id="dob">
						 <?php echo $query['dob'];?> 

						<br> <span class="smaller-90 tooltip-error" data-rel="tooltip"
								data-placement="top" title="Click to change it"> Date Of Birth
							</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class=" icon-beaker bigger-230"></i>
						</div>

						<div class="dob" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input class="span12 date-picker dateofbirth"
											id="id-date-picker-1" type="text"
											data-date-format="dd-mm-yyyy" name="employee[dob]"
											placeholder="<?php echo $query['dob'];?>" /> <span
											class="editable-clear-x" style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  dobsubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_dob"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>
					</span> <span
						class="infobox infobox-orange infobox-big infobox-dark">
						<div id="ecode">
						 <?php echo $query['e_code'];?>

						<br> <span class="smaller-90 tooltip-error" data-rel="tooltip"
								data-placement="top" title="Click to change it"> Employee Code
							</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class=" icon-barcode bigger-230"></i>
						</div>

						<div class="ecode" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="e_code"
											name="c_high" placeholder="<?php echo $query['e_code'];?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  ecodesubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_ecode"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>
					</span> <br> <br> <span
						class="infobox infobox-red infobox-big infobox-dark">
						<div id="mobile">
							<?php echo $query['mobile'];?>
						      							
													<br> <span class="smaller-90 tooltip-error"
								data-rel="tooltip" data-placement="top"
								title="Click to change it"> Mobile </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-large icon-phone bigger-230"></i>
						</div>
						<div class="mobile" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="mob" name="c_high"
											placeholder="<?php echo $query['mobile'];?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  mobilesubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_mobile"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>
					</span> <span class="infobox infobox-blue infobox-big infobox-dark">
						<div id="telephone">
						<?php echo $query['telephone'];?>
					      							
												 <br> <span class="smaller-90 tooltip-error"
								data-rel="tooltip" data-placement="top"
								title="Click to change it"> Telephone </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-large icon-phone bigger-230"></i>
						</div>
						<div class="telephone" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="tele"
											placeholder="<?php echo $query['telephone'];?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  telephonesubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_telephone"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>

					</span> <span class="infobox infobox-pink infobox-big infobox-dark">
						<div id="adate">
						<?php
	if ($query ['appointment_date'] != '') {
		echo $query ['appointment_date'];
	} else {
		echo "NILL";
	}
	?>
					      							
												 <br> <span class="smaller-90 tooltip-error"
								data-rel="tooltip" data-placement="top"
								title="Click to change it"> Appointment Date </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class=" icon-bookmark-empty bigger-230"></i>
						</div>
						<div class="adate" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input class="span12 date-picker appointment_date"
											id="id-date-picker-1" type="text"
											data-date-format="dd-mm-yyyy" name="employee[dob]"
											placeholder="<?php echo $query['appointment_date'];?>" /> <span
											class="editable-clear-x" style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  adatesubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_adate"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>
					</span> <span
						class="infobox infobox-green infobox-big infobox-dark">
						<div id="jdate"><?php
	if ($query ['j_date'] != '') {
		echo $query ['j_date'];
	} else {
		echo 'NILL';
	}
	?>
					      						 <br> <span class="smaller-90 tooltip-error"
								data-rel="tooltip" data-placement="top"
								title="Click to change it"> Joining Date </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-bookmark bigger-230"></i>
						</div>
						<div class="jdate" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input class="span12 date-picker j_date" id="id-date-picker-1"
											type="text" data-date-format="dd-mm-yyyy"
											name="employee[dob]"
											placeholder="<?php echo $query['j_date'];?>" /> <span
											class="editable-clear-x" style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  jdatesubmit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_jdate"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>
					</span>
				</div>
				<!-- span10 -->
			</div>
			<!-- row fluid -->
									
									
									
									
									<?php
	$photo = explode ( "___", $query ['p_photograph'] );
	$resume = explode ( '___', $query ['resume'] );
	$file = explode ( ',', $query ['qualification_files'] );
	$file1 = array_pop ( $file );
	?>
				                    
				     <div class="row-fluid" id="result" style="display: none;">
				<div class="span4"></div>
				<div class="span4" style="text-align: center;">
					<!--  <div class="bootbox modal fade in" tabindex="-1" style="overflow:hidden;" aria-hidden="false"> -->
					<div>
						<img src="<?php echo SITE_URL.'/assets/backend/images/299.GIF';?>">
					</div>
					<!-- </div> -->

				</div>
				<div class="span4"></div>
				<!-- .result -->
			</div>
			<div class="space-12"></div>
			<div class="row-fluid">
				<div class="span2"></div>
				<div class="span9" style="background: #f2f2f2; border: 1px solid #CCC; text-align: justify;">
					<h4 class="red">
						&nbsp; <i class="icon-star orange"></i> Employement Contract &amp; Declaration
					</h4>
					<div class="hr hr32 hr-dotted"></div>
					<div class="row-fluid">
						<div class="span2"></div>
						<div class="span6">
							<div class="row-fluid">
								<form method="POST" action="" enctype="multipart/form-data">
									<div class="span6">
										<input type="file" name="my_field[]">	
									</div>
									<div class="span6">
										<input type="file" name="my_field[]">
									</div>
									<br><br><br>
									<div class="row-fluid">
										<div class="span4"></div>
										<div class="span8">
											<button type="submit" name="submitdeclaration" class="btn btn-small btn-primary">Small</button> 
										</div>
									</div>
								</form>
							</div>
						</div>
						<div class="span4 center">
							<?php 
								$getdeclaration= $db->get_col("employees", array("e_id"=>$id[1]), "declaration");
								$explodedata=  explode(",", $getdeclaration[0]);
								if($explodedata[0] !='')
								{
									$getfilename= explode("___", $explodedata[0]);
								}
								if ($explodedata[1] !='')
								{
									$getfilename1= explode("___", $explodedata[1]);
								}
							?>
							<div class="row-fluid">
								<div class="span12">
									<span id="declaration">
										<span class="visible-desktop action-buttons">
											<?php 
											echo '<a href="' . $link->link ( 'downloads', Admin, '?load=' . $explodedata[0] . '&path=' . 'uploads/employees/'.$id[1] . '/' ) . ' ">' . $getfilename[1] . '</a>';
											if ($explodedata[0]!=''){
											?>
											<a class="red" href="<?php echo $link->link("employee_preview?declaration_image=".$id[1].'&&&'.$explodedata[0], Admin);?>">
												<i class="icon-trash bigger-130"></i>
											</a>
											<?php }else{ echo "N-A";}?>
											<a class="green" href="#" id="declaration1">
												<i class="icon-edit bigger-130"></i>
											</a>
										</span>
									</span>
									<form method="POST" action="" enctype="multipart/form-data">
										<div class="declaration1" style="display: none;">
											<div class="control-group">
											<div class="editable-input" style="position: relative;">
														<input type="file" name="my_field1"
															style="padding-right: 24px;"> <span class="editable-clear-x"
															style="display: none;"></span>
											</div>
													<div class="editable-buttons">
														<input type="hidden" name="declaration1image" value="<?php echo $explodedata[0];?>">
														<button type="submit" name="declaration1" class="btn btn-info declaration1_submit">
															<i class="icon-ok icon-white"></i>
														</button>
														<button type="button" id="cancel_declaration1"
															class="btn editable-cancel">
															<i class="icon-remove"></i>
														</button>
													</div>
												<div class="editable-error-block help-block"
													style="display: none;"></div>
											</div>
										</div><!-- ./address -->
									</form>
								</div>
							</div>
							<div class="row-fluid">
								<div class="span12">
									<span id="last_declaration">
										<span class="visible-desktop action-buttons">
											<?php 
											echo '<a href="' . $link->link ( 'downloads', Admin, '?load=' . $explodedata[1] . '&path=' . 'uploads/employees/'.$id[1] . '/' ) . ' ">' . $getfilename1[1] . '</a>';
											if ($explodedata[1]!=''){
											?>
											<a class="red" href="<?php echo $link->link("employee_preview?declaration_image=".$id[1].'&&&'.$explodedata[1], Admin);?>">
												<i class="icon-trash bigger-130"></i>
											</a>
											<?php }else{ echo "N-A";}?>
											<a class="green" href="#">
												<i class="icon-edit bigger-130" id="last_declaration1"></i>
											</a>
										</span>
									</span>
									<form method="POST" action="" enctype="multipart/form-data">
										<div class="last_declaration1" style="display: none;">
											<div class="control-group">
												<div>
					
													<div class="editable-input" style="position: relative;">
														<input type="file" name="my_field2"
															style="padding-right: 24px;"> <span class="editable-clear-x"
															style="display: none;"></span>
													</div>
													<div class="editable-buttons">
														<input type="hidden" name="last_declaration1image" value="<?php echo $explodedata[1];?>">
														<button type="submit" name="last_declaration1" class="btn btn-info last_declaration1_submit">
															<i class="icon-ok icon-white"></i>
														</button>
														<button type="button" id="cancel_last_declaration1"
															class="btn editable-cancel">
															<i class="icon-remove"></i>
														</button>
													</div>
					
												</div>
												<div class="editable-error-block help-block"
													style="display: none;"></div>
											</div>
										</div><!-- ./address -->
									</form>
								</div>
							</div>
							<?php 
								echo "<br>";
								
							?>
						</div>
					</div>
				</div>
			</div>
			<div class="space-12"></div>
			<div class="row-fluid">
				<div class="span2" style="background: #f2f2f2; text-align: justify;">

					<h3 class="red tooltip-error" data-rel="tooltip"
						data-placement="top" title="Click to change it">Email</h3>

					<p class="blue tooltip-error" data-rel="tooltip"
						data-placement="top" title="Click to change it">
												<?php echo $query['email'];?>
												&nbsp;&nbsp;<i class=" icon-cog"></i>
					</p>
					<div class="email" style="display: none;">
						<div class="control-group">
							<div>

								<div class="editable-input" style="position: relative;">
									<input type="text" class="input-medium span11" id="emailpv"
										name="c_high" placeholder="<?php echo $query['email']; ?>"
										style="padding-right: 24px;"> <span class="editable-clear-x"
										style="display: none;"></span>
								</div>
								<div class="editable-buttons">
									<div class="btn btn-info email_submit">
										<i class="icon-ok icon-white"></i>
									</div>
									<button type="button" id="cancel_email"
										class="btn editable-cancel">
										<i class="icon-remove"></i>
									</button>
								</div>

							</div>
							<div class="editable-error-block help-block"
								style="display: none;"></div>
						</div>
					</div>


					<h3 class="red tooltip-error" data-rel="tooltip"
						data-placement="top" title="Click to change it">Father's name</h3>

					<p class="blue" id="father">
												<?php echo $query['f_name'];?>
												&nbsp;&nbsp;<i class="icon-bullhorn"></i>
					</p>
					<div class="father" style="display: none;">
						<div class="control-group">
							<div>

								<div class="editable-input" style="position: relative;">
									<input type="text" class="input-medium span11" id="fatherpv"
										name="c_high" placeholder="<?php echo $query['f_name']; ?>"
										style="padding-right: 24px;"> <span class="editable-clear-x"
										style="display: none;"></span>
								</div>
								<div class="editable-buttons">
									<div class="btn btn-info father_submit">
										<i class="icon-ok icon-white"></i>
									</div>
									<button type="button" id="cancel_father"
										class="btn editable-cancel">
										<i class="icon-remove"></i>
									</button>
								</div>

							</div>
							<div class="editable-error-block help-block"
								style="display: none;"></div>
						</div>
					</div>

					<h3 class="red tooltip-error" data-rel="tooltip"
						data-placement="top" title="Click to change it">Address</h3>
					<p class="blue" id="address">
												<?php echo $query['address'];?>
												&nbsp;&nbsp;&nbsp;&nbsp;
												<i class="icon-home"></i>
					</p>
					<div class="address" style="display: none;">
						<div class="control-group">
							<div>

								<div class="editable-input" style="position: relative;">
									<input type="text" class="input-medium span11" id="addresspv"
										name="c_high" placeholder="<?php echo $query['address']; ?>"
										style="padding-right: 24px;"> <span class="editable-clear-x"
										style="display: none;"></span>
								</div>
								<div class="editable-buttons">
									<div class="btn btn-info address_submit">
										<i class="icon-ok icon-white"></i>
									</div>
									<button type="button" id="cancel_address"
										class="btn editable-cancel">
										<i class="icon-remove"></i>
									</button>
								</div>

							</div>
							<div class="editable-error-block help-block"
								style="display: none;"></div>
						</div>
					</div>


					<h3 class="red tooltip-error" data-rel="tooltip"
						data-placement="top" title="Click to change it">Resume</h3>
					<p>
					
					
					<form action="" method="post" enctype="multipart/form-data">
				      	  						<?php
	$resume = explode ( '___', $query ['resume'] );
	$id = 201;
	$main = 211;
	$field = 221;
	$cbuttonid = 231;
	$sbuttonid = 241;
	$inputid = 251;
	$name = $query ['resume'];
	
	$p = 1;
	if ($resume [1] != '') {
		echo '<div id= "' . $main . '"><div class="hidden-phone visible-desktop action-buttons">
				      	  								<a href="' . $link->link ( 'downloads', Admin, '?resumename=' . $query ['resume'] . '&path=' . 'uploads/employees' . '/' . $query [e_id] . '/' ) . ' ">' . $resume [1] . '</a>' . '&nbsp' . '<a class="red"  href="' . $link->link ( 'employee_preview', Admin, '?resume=' . $query [e_id] . "___" . $query ['resume'] ) . '" >
				      	  								<i class="icon-trash bigger-130"></i>
				      	  								
				      	  								</a><i class="icon-edit bigger-130 green ' . $main . '" ></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="icon-desktop blue"></i>
				      	  								</div></div>
				      	  								
				      	  								<div class="avin" style="display:none;" id="' . $field . '">
									                   				<input  type="file"  name="photo' . $id . '" size="32" class=' . $inputid . '>
									                   				<input type="hidden" name=' . $main . ' value=' . $query ['resume'] . '>
									                   				<input type="hidden" name=' . $id . ' value=' . $query [e_id] . '>
									                   				<button class="btn btn-minier btn-danger ' . $sbuttonid . '" name="' . $sbuttonid . '">
																		<i class="icon-ok icon-white"></i>
																	</button>
																	<button class="btn btn-minier btn-danger" id="' . $cbuttonid . '">
																		<i class="icon-remove"></i>
																	</button>
									                   			</div>';
	} else {
		echo '<p id="' . $main . '">N-A
												                    <i class="icon-edit bigger-130 green ' . $main . '" id="' . $query [e_id] . "___" . $row . '"></i></p>
												                    <div class="avin1" style="display:none;" id="' . $field . '">
																        <input  type="file"  name="photo' . $id . '" size="32" class=' . $inputid . '>
																        <input type="hidden" name=' . $main1 . ' value=' . $getname [$z] . '>
																        <input type="hidden" name=' . $id . ' value=' . $query [e_id] . '>
																        <button class="btn btn-minier btn-danger ' . $sbuttonid . '" name="' . $sbuttonid . '">
																        <i class="icon-ok icon-white"></i>
																        </button>
																        <button class="btn btn-minier btn-danger" id="' . $cbuttonid . '">
																        <i class="icon-remove"></i>
																        </button>
															        </div>';
	}
	?>
				      	  						</form>
					</p>

				</div>





				<div class="span9"
					style="background: #f2f2f2; border: 1px solid #CCC; text-align: justify;">
					<h4 class="red">
						&nbsp; <i class="icon-star orange"></i> Qualification
					</h4>
					<div class="hr hr32 hr-dotted"></div>
					<div class="span3">
						<h3 class="green">Type</h3>
						<h4 data-rel="tooltip" data-placement="top"
							title="Click to change it">High School</h4>

						<h4 data-rel="tooltip" data-placement="top"
							title="Click to change it">Intermediate</h4>
						<h4 data-rel="tooltip" data-placement="top"
							title="Click to change it">Graduation</h4>
						<h4 data-rel="tooltip" data-placement="top"
							title="Click to change it">Post Graduation</h4>
						<h4 data-rel="tooltip" data-placement="top"
							title="Click to change it">Extras</h4>
					</div>
					<!-- span3 -->

					<div class="span4">
						<h3 class="green">Details</h3>
						<h4 id="high"><?php
	
	if ($query ['highschool'] != '') {
		echo $query ['highschool'];
	} else {
		?> <i class="icon-edit bigger-130 green 61"></i><?php }?></h4>
						<!-- <table><tr claspan="2"><td><input type="text" name="high"></td><td></td></tr></table> -->
						<div class="high" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="ip" name="c_high"
											placeholder="<?php echo $query['highschool']; ?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  higher">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_high"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
						</div>



						<h4 id="inter"><?php
	
	if ($query ['intermediate'] != '') {
		echo $query ['intermediate'];
	} else {
		?> <i class="icon-edit bigger-130 green 61"></i><?php }?></h4>
						<div class="inter" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="interpv"
											name="c_high"
											placeholder="<?php echo $query['intermediate']; ?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  inter_submit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_inter"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
							<!-- .control- group -->
						</div>
						<!-- .inter -->

						<h4 id="graduation"><?php
	
	if ($query ['graduation'] != '') {
		echo $query ['graduation'];
	} else {
		?> <i class="icon-edit bigger-130 green 61"></i><?php }?></h4>
						<div class="graduation" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="graduationpv"
											placeholder="<?php echo $query['graduation']; ?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  graduation_submit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_graduation"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
							<!-- .control- group -->
						</div>
						<!-- .graduation -->

						<h4 id="p_graduation"><?php
	
	if ($query ['p_graduation'] != '') {
		echo $query ['p_graduation'];
	} else {
		?> <i class="icon-edit bigger-130 green 61"></i><?php }?></h4>
						<div class="p_graduation" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="p_graduationpv"
											placeholder="<?php echo $query['p_graduation']; ?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  p_graduation_submit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_pgraduation"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
							<!-- .control- group -->
						</div>
						<!-- .p_graduation -->

						<h4 id="extraa"><?php
	
	if ($query ['extraas'] != '') {
		echo $query ['extraas'];
	} else {
		?> <i class="icon-edit bigger-130 green 61"></i><?php }?></h4>
						<div class="extraa" style="display: none;">
							<div class="control-group">
								<div>
									<div class="editable-input" style="position: relative;">
										<input type="text" class="input-medium" id="extraapv"
											placeholder="<?php echo $query['extraas']; ?>"
											style="padding-right: 24px;"> <span class="editable-clear-x"
											style="display: none;"></span>
									</div>
									<div class="editable-buttons">
										<div class="btn btn-info  extraa_submit">
											<i class="icon-ok icon-white"></i>
										</div>
										<button type="button" id="cancel_extra"
											class="btn editable-cancel">
											<i class="icon-remove"></i>
										</button>
									</div>
								</div>
								<div class="editable-error-block help-block"
									style="display: none;"></div>
							</div>
							<!-- .control- group -->
						</div>
						<!-- .extraa -->

					</div>
					<!-- span3 -->


					<div class="span4">
						<h3 class="green">Files</h3>
						<h6>
							<form action="" method="post" enctype="multipart/form-data"
								class="span12">
							                     <?php
	$id = 1;
	$main = 11;
	$field = 21;
	$cbuttonid = 31;
	$sbuttonid = 41;
	$inputid = 51;
	$name = $query ['qualification_files'];
	$getname = explode ( ',', $name );
	
	$store = array_pop ( $getname );
	$i = 0;
	foreach ( $file as $row ) {
		$getfile = strchr ( $row, "___" );
		
		$filename = explode ( '___', $getfile );
		
		if ($filename [1] != '') {
			echo '<div  id="' . $main . '" ><div class="action-buttons">
									                   			<h6><a href="' . $link->link ( 'downloads', Admin, '?filename=' . $row . '&path=' . 'uploads/employees' . '/' . $query [e_id] . '/' ) . '">' . $filename [1] . '</a>' . '&nbsp' . '<a class="red"  href="' . $link->link ( employee_preview, Admin, '?qualification_files=' . $query [e_id] . "___" . $row ) . '">
									                   			<i class="icon-trash bigger-130"></i>
									                   			
									                   			</a><i class="icon-edit bigger-130 green ' . $main . '" id="' . $query [e_id] . "___" . $row . '"></i></h6>
									                   			
									                   			</div></div>
									                   			
									                   			<div class="avin" style="display:none;" id="' . $field . '">
									                   				<input  type="file"  name="photo' . $id . '" size="32" class=' . $inputid . '>
									                   				<input type="hidden" name=' . $main . ' value=' . $getname [$i] . '>
									                   				<input type="hidden" name=' . $id . ' value=' . $query [e_id] . '>
									                   				<button class="btn btn-minier btn-danger ' . $sbuttonid . '" name="' . $sbuttonid . '">
																		<i class="icon-ok icon-white"></i>
																	</button>
																	<button class="btn btn-minier btn-danger" id="' . $cbuttonid . '">
																		<i class="icon-remove"></i>
																	</button>
									                   			</div>';
		} else {
			
			echo '<p id="' . $main . '">N-A
												                    <i class="icon-edit bigger-130 green ' . $main . '" id="' . $query [e_id] . "___" . $row . '"></i></p>
												                    <div class="avin1" style="display:none;" id="' . $field . '">
																        <input  type="file"  name="photo' . $id . '" size="32" class=' . $inputid . '>
																        <input type="hidden" name=' . $main1 . ' value=' . $getname [$z] . '>
																        <input type="hidden" name=' . $id . ' value=' . $query [e_id] . '>
																        <button class="btn btn-minier btn-danger ' . $sbuttonid . '" name="' . $sbuttonid . '">
																        <i class="icon-ok icon-white"></i>
																        </button>
																        <button class="btn btn-minier btn-danger" id="' . $cbuttonid . '">
																        <i class="icon-remove"></i>
																        </button>
															        </div>';
		}
		$try1 = explode ( '___', $try );
		$id ++;
		$main ++;
		$field ++;
		$sbuttonid ++;
		$cbuttonid ++;
		$i ++;
	
	}
	?> 
	
							                	</form>
						</h6>
					</div>
					<!-- span3 -->
				</div>
				<!-- span9 -->
			</div>
			<!-- row fluid -->

			<br> <br>
									
									<?php
	
	?>
									<div class="row-fluid">
				<div class="span2" style="background: #f2f2f2; text-align: justify;">
					<h3 class="red">Leaves</h3>
					<h6><?php
	$office = $db->get_row ( 'office', array ('id' => '1' ) );
	$fiscal = $db->get_row ( 'setting', array ('id' => '1' ) );
	
	$getyear = date ( Y );
	if ($fiscal ['fiscal'] != '') {
		$fiscal_date = explode ( '-', $fiscal ['fiscal'] );
		$fiscaldate = $fiscal_date [1] . '-' . $fiscal_date [0] . '-' . $getyear;
		
		// echo $query ['j_date']= '2013-11-15';
		// ---earned leave process start------
		$jdate = strtotime ( $query ['j_date'] );
		
		$f_date = strtotime ( $fiscaldate );
		$daylen = 60 * 60 * 24;
		
		// ---earned leave process end--------
		// echo "j".$query['j_date'];
		$getyear = explode ( '-', $query ['j_date'] );
		$joiningyear = $getyear [0];
		$currentyear = date ( 'Y' );
		
		if ($currentyear > $joiningyear) {
			$joiningdate = ($currentyear - 1) . "-" . $fiscal_date [0] . "-" . $fiscal_date [1];
		} else {
			$joiningdate = $query ['j_date'];
		}
		
		$earned = $office ['e_leave'];
		$daylen = 60 * 60 * 24;
		$jdate = strtotime ( $joiningdate );
		$tdate = strtotime ( date ( 'Y-m-d' ) );
		
		$calculatedays = ($tdate - $jdate) / $daylen;
		
		if ($earned != 0) {
			$month = floor ( $calculatedays / 30 );
		
		} else {
			$month = 0;
		}
		
		$permonthearned = $earned / 12;
		$monthautoearn = $month * $permonthearned;
		
		// echo $monthautoearn;
		$id = $query ['e_id'];
		$firsthalfsick = $db->run ( "SELECT SUM( firsthalf )FROM attendence WHERE e_id = $id 
																	and t_leave= 'sick'" )->fetchColumn ();
		$secondhalfsick = $db->run ( "SELECT SUM( secondhalf )FROM attendence WHERE e_id = $id
																	and t_leave= 'sick'" )->fetchColumn ();
		
		$firsthalfcasual = $db->run ( "SELECT SUM( firsthalf )FROM attendence WHERE e_id = $id
																	and t_leave= 'casual'" )->fetchColumn ();
		$secondhalfcasual = $db->run ( "SELECT SUM( secondhalf )FROM attendence WHERE e_id = $id
																	and t_leave= 'casual'" )->fetchColumn ();
		
		$firsthalfmaternity = $db->run ( "SELECT SUM( firsthalf )FROM attendence WHERE e_id = $id
																	and t_leave= 'maternity'" )->fetchColumn ();
		$secondhalfmaternity = $db->run ( "SELECT SUM( secondhalf )FROM attendence WHERE e_id = $id
																	and t_leave= 'maternity'" )->fetchColumn ();
		
		$firsthalfother = $db->run ( "SELECT SUM( firsthalf )FROM attendence WHERE e_id = $id
																	and t_leave= 'other'" )->fetchColumn ();
		$secondhalfother = $db->run ( "SELECT SUM( secondhalf )FROM attendence WHERE e_id = $id
																	and t_leave= 'other'" )->fetchColumn ();
	
	}
	
	if ($office ['c_leave'] != '') {
		$casualdiff = $office ['c_leave'] - ($firsthalfcasual + $secondhalfcasual);
		$tcasual = $office ['c_leave'] + $monthautoearn;
		if ($tcasual > $office ['e_leave'] + $office ['c_leave']) {
			$tcasual = $office ['c_leave'];
		}
		if ($casualdiff >= 0) {
			echo '<h5><b>Casual :</b> ' . $casualdiff . ' out of ' . $tcasual . '</h5>';
		} else {
			echo '<h5><b>Casual :</b> NILL</h5>';
		}
	} else {
		echo '<h5><b>Casual :</b> NILL</h5>';
	}
	if ($office ['s_leave'] != '') {
		$sickdiff = $office ['s_leave'] - ($firsthalfsick + $secondhalfsick);
		if ($sickdiff >= '0') {
			echo '<h5><b>Sick :</b> ' . $sickdiff . ' out of ' . $office ['s_leave'] . '</h5>';
		} else {
			echo '<h5><b>Sick :</b> NILL</h5>';
		}
	} else {
		echo '<h5><b>Sick :</b> NILL</h5>';
	}
	if ($office ['e_leave'] != '') {
		if ($fiscal ['fiscal'] != '') {
			if ($earned != 0) {
				
				$earneddiff = $office ['e_leave'];
				
				$earneddiff = $earned - $monthautoearn;
				if ($earneddiff >= 0) {
					echo '<h5><b>Leaves To Be Earned :</b>  ' . $earneddiff . '</h5>';
				} else {
					echo '<h5><b>NIll</b></h5>';
				}
			} else {
				echo '<h5><b>No Leave</b></h5>';
			}
		} else {
			echo '<h5><b>Leaves To Be Earned :</b> Fiscal date not Selected</h5>';
		}
	} else {
		echo '<h5><b>Earned :</b> NILL</h5>';
	}
	if ($office ['m_leave'] != '') {
		$maternitydiff = $office ['m_leave'] - ($firsthalfmaternity + $secondhalfmaternity);
		if ($maternitydiff >= '0') {
			echo '<h5><b>Maternity :</b> ' . $maternitydiff . ' out of ' . $office ['m_leave'] . '</h5>';
		} else {
			echo '<h5><b>Maternity :</b> NILL</h5>';
		}
	} else {
		echo '<h5><b>Maternity :</b> NILL</h5>';
	}
	if ($office ['o_leave'] != '') {
		$otherdiff = $office ['o_leave'] - ($firsthalfother + $secondhalfother);
		if ($otherdiff >= 0) {
			echo '<h5><b>Other :</b> ' . $otherdiff . ' out of ' . $office ['o_leave'] . '</h5>';
		} else {
			echo '<h5><b>Other :</b> NILL</h5>';
		}
	} else {
		echo '<h5><b>Other :</b> NILL</h5>';
	}
	?>
							      	  		</h6>
				</div>

				<div class="span9">
					<div class="widget-box">
						<div class="widget-header">

							<h4 class="smaller">
								<i class="icon-eye-open bigger-160 orange"></i>
								Identification(s)
							</h4>

						</div>

						<div class="widget-body">

							<div class="widget-main">
								<div class="row-fluid">
									<div class="span4">
										<h4 class="green">Identity Type :</h4>
										<h4 id="idproof"><?php if($query['idproof'] != ''){echo $query['idproof'];} else{?><i
												class="icon-edit bigger-130 green 114"></i><?php } ?></h4>
										<div class="idproof" style="display: none;">
											<div class="control-group">
												<div>
													<div class="editable-input" style="position: relative;">
														<input type="text" class="input-medium" id="idproofpv"
															placeholder="<?php echo $query['idproof']; ?>"
															style="padding-right: 24px;"> <span
															class="editable-clear-x" style="display: none;"></span>
													</div>
													<div class="editable-buttons">
														<div class="btn btn-info  idproof_submit">
															<i class="icon-ok icon-white"></i>
														</div>
														<button type="button" id="cancel_idproof"
															class="btn editable-cancel">
															<i class="icon-remove"></i>
														</button>
													</div>
												</div>
												<div class="editable-error-block help-block"
													style="display: none;"></div>
											</div>
											<!-- .control- group -->
										</div>
										<!-- .idproof -->

										<h4 id="idproof1"><?php if($query['idproof1'] != ''){echo $query['idproof1'];} else{?><i
												class="icon-edit bigger-130 green 114"></i><?php } ?></h4>
										<div class="idproof1" style="display: none;">
											<div class="control-group">
												<div>
													<div class="editable-input" style="position: relative;">
														<input type="text" class="input-medium" id="idproof1pv"
															placeholder="<?php echo $query['idproof1']; ?>"
															style="padding-right: 24px;"> <span
															class="editable-clear-x" style="display: none;"></span>
													</div>
													<div class="editable-buttons">
														<div class="btn btn-info  idproof1_submit">
															<i class="icon-ok icon-white"></i>
														</div>
														<button type="button" id="cancel_idproof1"
															class="btn editable-cancel">
															<i class="icon-remove"></i>
														</button>
													</div>
												</div>
												<div class="editable-error-block help-block"
													style="display: none;"></div>
											</div>
											<!-- .control- group -->
										</div>
										<!-- .idproof1 -->

										<h4 id="idproof2"><?php if($query['idproof2'] != ''){echo $query['idproof2'];} else{?><i
												class="icon-edit bigger-130 green 114"></i><?php } ?></h4>
										<div class="idproof2" style="display: none;">
											<div class="control-group">
												<div>
													<div class="editable-input" style="position: relative;">
														<input type="text" class="input-medium" id="idproof2pv"
															placeholder="<?php echo $query['idproof2']; ?>"
															style="padding-right: 24px;"> <span
															class="editable-clear-x" style="display: none;"></span>
													</div>
													<div class="editable-buttons">
														<div class="btn btn-info  idproof2_submit">
															<i class="icon-ok icon-white"></i>
														</div>
														<button type="button" id="cancel_idproof2"
															class="btn editable-cancel">
															<i class="icon-remove"></i>
														</button>
													</div>
												</div>
												<div class="editable-error-block help-block"
													style="display: none;"></div>
											</div>
											<!-- .control- group -->
										</div>
										<!-- .idproof2 -->
									</div>
									<div class="span7">
										<h4 class="green">Submitted Documents :</h4>
										<h6>
											<form action="" method="post" enctype="multipart/form-data">
															<?php
	$photo = explode ( "___", $query ['p_photograph'] );
	$file = explode ( ',', $query ['idproof_files'] );
	
	$id1 = 101;
	$main1 = 111;
	$field1 = 121;
	$cbuttonid1 = 131;
	$sbuttonid1 = 141;
	$inputid1 = 151;
	$name1 = $query ['idproof_files'];
	$getname1 = explode ( ',', $name1 );
	
	$store1 = array_pop ( $file );
	// print_r($file);
	$z = 0;
	
	foreach ( $file as $row ) {
		$getfile = strchr ( $row, "___" );
		
		$filename = explode ( '___', $getfile );
		
		if ($filename [1] != '') {
			echo '<div  id="' . $main1 . '" ><div class=" action-buttons">
														                    		<a href="' . $link->link ( 'downloads', Admin, '?filename=' . $row . '&path=' . 'uploads/employees' . '/' . $query [e_id] . '/' ) . '">' . $filename [1] . '</a>' . '&nbsp' . '<a class="red"  href="' . $link->link ( employee_preview, Admin, '?idproof_files=' . $query [e_id] . "___" . $row ) . '" >
														                    		<i class="icon-trash bigger-130">
															                    	</i>
															                    	
														                    		</a><i class="icon-edit bigger-130 green ' . $main1 . '" id="' . $query [e_id] . "___" . $row . '"></i>
														                    		</div></div>
													                    	
															                    	<div class="avin1" style="display:none;" id="' . $field1 . '">
															                    	<input  type="file"  name="photo' . $id1 . '" size="32" class=' . $inputid1 . '>
															                    	<input type="hidden" name=' . $main1 . ' value=' . $getname1 [$z] . '>
															                    	<input type="hidden" name=' . $id1 . ' value=' . $query [e_id] . '>
															                    	<button class="btn btn-minier btn-danger ' . $sbuttonid1 . '" name="' . $sbuttonid1 . '">
															                    	<i class="icon-ok icon-white"></i>
															                    	</button>
															                    	<button class="btn btn-minier btn-danger" id="' . $cbuttonid1 . '">
															                    	<i class="icon-remove"></i>
															                    	</button>
															                    	</div>';
		} else {
			echo '<p id="' . $main1 . '">N-A
												                    				<i class="icon-edit bigger-130 green ' . $main1 . '" id="' . $query [e_id] . "___" . $row . '"></i></p>
												                    				<div class="avin1" style="display:none;" id="' . $field1 . '">
															                		<input  type="file"  name="photo' . $id1 . '" size="32" class=' . $inputid1 . '>
															                		<input type="hidden" name=' . $main1 . ' value=' . $getname1 [$z] . '>
															                    	<input type="hidden" name=' . $id1 . ' value=' . $query [e_id] . '>
															                    	<button class="btn btn-minier btn-danger ' . $sbuttonid1 . '" name="' . $sbuttonid1 . '">
															                    	<i class="icon-ok icon-white"></i>
															                    	</button>
															                    	<button class="btn btn-minier btn-danger" id="' . $cbuttonid1 . '">
															                    	<i class="icon-remove"></i>
															                    	</button>
															                    	</div>';
		}
		$try1 = explode ( '___', $try );
		$id1 ++;
		$main1 ++;
		$field1 ++;
		$sbuttonid1 ++;
		$cbuttonid1 ++;
		
		$z ++;
	}
	
	?>

												         </form>
										</h6>
									</div>
									<!-- span8 -->
								</div>
								<!-- row fluid -->
							</div>
							<!-- widget main -->
						</div>
						<!-- widget-body -->
					</div>
					<!-- widget-box -->
					<br>

					<div class="widget-box">
						<div class="widget-header">
							<h4 class="smaller">
								<i class="icon-briefcase bigger-160 orange"></i> Bank Details
							</h4>
						</div>

						<div class="widget-body">

							<div class="widget-main">
								<div class="row-fluid" style="overflow: scroll;">
									<table class="table table-striped table-bordered ">
										<thead>
											<tr style="background: #f2f2f2;">
												<th>
													<p data-rel="tooltip" data-placement="top"
														title="Click to change it">Bank Name</p>
												</th>
												<th>
													<p data-rel="tooltip" data-placement="top"
														title="Click to change it">Account Number</p>
												</th>
												<th>
													<p data-rel="tooltip" data-placement="top"
														title="Click to change it">Branch</p>
												</th>
												<th>
													<p data-rel="tooltip" data-placement="top"
														title="Click to change it">City</p>
												</th>
												<th>
													<p data-rel="tooltip" data-placement="top"
														title="Click to change it">IFSC Code</p>
												</th>
												<th>
													<p data-rel="tooltip" data-placement="top"
														title="Click to change it">Salary</p>
												</th>
												<th>
													<p data-rel="tooltip" data-placement="top"
														title="Click to change it">Remark</p>
												</th>
											</tr>
										</thead>
										<tbody>

											<tr>
												<td>
													<p id="bank"><?php if($query['b_name'] != ''){echo $query['b_name'];} else{?><i
															class="icon-edit bigger-130 green 114"></i><?php } ?></p>
													<div class="bank" style="display: none;">
														<div class="control-group">
															<div>

																<div class="editable-input" style="position: relative;">
																	<input type="text" class="input-medium span11"
																		id="bankpv" name="c_high"
																		placeholder="<?php echo $query['b_name']; ?>"
																		style="padding-right: 24px;"> <span
																		class="editable-clear-x" style="display: none;"></span>
																</div>
																<div class="editable-buttons">
																	<div class="btn btn-info bank_submit">
																		<i class="icon-ok icon-white"></i>
																	</div>
																	<button type="button" id="cancel_bank"
																		class="btn editable-cancel">
																		<i class="icon-remove"></i>
																	</button>
																</div>

															</div>
															<div class="editable-error-block help-block"
																style="display: none;"></div>
														</div>
													</div>
												</td>

												<td>
													<p id="account"><?php if($query['a_number'] != ''){echo $query['a_number'];} else{?><i
															class="icon-edit bigger-130 green 114"></i><?php } ?></p>
													<div class="account" style="display: none;">
														<div class="control-group">
															<div>

																<div class="editable-input" style="position: relative;">
																	<input type="text" class="input-medium span11"
																		id="accountpv" name="c_high"
																		placeholder="<?php echo $query['a_number']; ?>"
																		style="padding-right: 24px;"> <span
																		class="editable-clear-x" style="display: none;"></span>
																</div>
																<div class="editable-buttons">
																	<div class="btn btn-info account_submit">
																		<i class="icon-ok icon-white"></i>
																	</div>
																	<button type="button" id="cancel_account"
																		class="btn editable-cancel">
																		<i class="icon-remove"></i>
																	</button>
																</div>

															</div>
															<div class="editable-error-block help-block"
																style="display: none;"></div>
														</div>
													</div>

												</td>
												<td>
													<p id="branch"><?php if($query['branch'] != ''){echo $query['branch'];} else{?><i
															class="icon-edit bigger-130 green 114"></i><?php } ?></p>
													<div class="branch" style="display: none;">
														<div class="control-group">
															<div>

																<div class="editable-input" style="position: relative;">
																	<input type="text" class="input-medium span11"
																		id="branchpv" name="c_high"
																		placeholder="<?php echo $query['branch']; ?>"
																		style="padding-right: 24px;"> <span
																		class="editable-clear-x" style="display: none;"></span>
																</div>
																<div class="editable-buttons">
																	<div class="btn btn-info branch_submit">
																		<i class="icon-ok icon-white"></i>
																	</div>
																	<button type="button" id="cancel_branch"
																		class="btn editable-cancel">
																		<i class="icon-remove"></i>
																	</button>
																</div>

															</div>
															<div class="editable-error-block help-block"
																style="display: none;"></div>
														</div>
													</div>
												</td>
												<td>
													<p id="city"><?php if($query['city'] != ''){echo $query['city'];} else{?><i
															class="icon-edit bigger-130 green 114"></i><?php } ?></p>
													<div class="city" style="display: none;">
														<div class="control-group">
															<div>

																<div class="editable-input" style="position: relative;">
																	<input type="text" class="input-medium span11"
																		id="citypv" name="c_high"
																		placeholder="<?php echo $query['city']; ?>"
																		style="padding-right: 24px;"> <span
																		class="editable-clear-x" style="display: none;"></span>
																</div>
																<div class="editable-buttons">
																	<div class="btn btn-info city_submit">
																		<i class="icon-ok icon-white"></i>
																	</div>
																	<button type="button" id="cancel_city"
																		class="btn editable-cancel">
																		<i class="icon-remove"></i>
																	</button>
																</div>

															</div>
															<div class="editable-error-block help-block"
																style="display: none;"></div>
														</div>
													</div>
												</td>
												<td>
													<p id="ifsccode"><?php if($query['ifsccode'] != ''){echo $query['ifsccode'];} else{?><i
															class="icon-edit bigger-130 green 114"></i><?php } ?></p>
													<div class="ifsccode" style="display: none;">
														<div class="control-group">
															<div>

																<div class="editable-input" style="position: relative;">
																	<input type="text" class="input-medium span11"
																		id="ifsccodepv" name="c_high"
																		placeholder="<?php echo $query['ifsccode']; ?>"
																		style="padding-right: 24px;"> <span
																		class="editable-clear-x" style="display: none;"></span>
																</div>
																<div class="editable-buttons">
																	<div class="btn btn-info ifsccode_submit">
																		<i class="icon-ok icon-white"></i>
																	</div>
																	<button type="button" id="cancel_ifsccode"
																		class="btn editable-cancel">
																		<i class="icon-remove"></i>
																	</button>
																</div>

															</div>
															<div class="editable-error-block help-block"
																style="display: none;"></div>
														</div>
													</div>
												</td>
												<td>
													<p id="salary"><?php if($query['salary'] != ''){echo $query['salary'];} else{?><i
															class="icon-edit bigger-130 green 114"></i><?php } ?></p>
													<div class="salary" style="display: none;">
														<div class="control-group">
															<div>

																<div class="editable-input" style="position: relative;">
																	<input type="text" class="input-medium span11"
																		id="salarypv" name="c_high"
																		placeholder="<?php echo $query['salary']; ?>"
																		style="padding-right: 24px;"> <span
																		class="editable-clear-x" style="display: none;"></span>
																</div>
																<div class="editable-buttons">
																	<div class="btn btn-info salary_submit">
																		<i class="icon-ok icon-white"></i>
																	</div>
																	<button type="button" id="cancel_salary"
																		class="btn editable-cancel">
																		<i class="icon-remove"></i>
																	</button>
																</div>

															</div>
															<div class="editable-error-block help-block"
																style="display: none;"></div>
														</div>
													</div>
												</td>
												<td>
													<p id="remarks"><?php if($query['remarks'] != ''){echo $query['remarks'];} else{?><i
															class="icon-edit bigger-130 green 114"></i><?php } ?></p>
													<div class="remarks" style="display: none;">
														<div class="control-group">
															<div>

																<div class="editable-input" style="position: relative;">
																	<input type="text" class="input-medium span11"
																		id="remarkspv" name="c_high"
																		placeholder="<?php echo $query['remarks']; ?>"
																		style="padding-right: 24px;"> <span
																		class="editable-clear-x" style="display: none;"></span>
																</div>
																<div class="editable-buttons">
																	<div class="btn btn-info remarks_submit">
																		<i class="icon-ok icon-white"></i>
																	</div>
																	<button type="button" id="cancel_remarks"
																		class="btn editable-cancel">
																		<i class="icon-remove"></i>
																	</button>
																</div>

															</div>
															<div class="editable-error-block help-block"
																style="display: none;"></div>
														</div>
													</div>
												</td>
											</tr>
										</tbody>
									</table>

								</div>
								<!-- row fluid -->
							</div>
							<!-- widget main -->
						</div>
						<!-- widget-body -->
					</div>
					<!-- widget-box -->
				</div>
				<!-- span9 -->
			</div>
			<!-- row-fluid -->
			<br>

			<div class="row-fluid">
				<div class="span2"></div>
				<div class="span9">
					<div class="widget-box">
						<div class="widget-header">
							<h4 class="smaller">
								<i class="icon-legal bigger-160 orange"></i> PRIVILEGES
							</h4>
						</div>

						<div class="widget-body">
							<div class="widget-main">
								<div class="row-fluid">
									<div class="span6">

										<table class="table table-striped table-bordered">
											<tbody>
												<!-- <tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Users</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[displayuser]" value="displayuser"
																id="displayuser"
																<?php
	if (in_array ( "displayuser", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Display Admin Members</span>
														</div>
														<div class="span6">
															<input name="employee[newregister]" value="newregister"
																id="newregister"
																<?php
	if (in_array ( "newregister", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> New Admin Member</span>
														</div>
													</td>
												</tr> -->
												<!-- <tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Payments</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[paymentdetails]"
																value="paymentdetails" id="paymentdetails"
																<?php
	if (in_array ( "paymentdetails", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Payment Details</span>
														</div>
														<div class="span5">
															<input name="employee[newpayments]" value="newpayments"
																id="newpayments"
																<?php
	if (in_array ( "newpayments", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> New Payments</span>
														</div>
													</td>
												</tr>-->
												<tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Awards</b>
														</p>
													</td>
													<td>
														<div class="span4">
															<input name="employee[mostawarded]" value="mostawarded"
																id="mostawarded"
																<?php
	if (in_array ( "mostawarded", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Most Awarded</span>
														</div>
														<div class="span4">
															<input name="employee[earlierawards]"
																value="earlier_awards" id="earlierawards"
																<?php
	if (in_array ( "earlierawards", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Earlier Awards</span>
														</div>
														<div class="span4">
															<input name="employee[giveanawards]" value="give_away"
																id="giveanawards"
																<?php
	if (in_array ( "giveanawards", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Give An Awards</span>
														</div>
													</td>
												</tr>
												<tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Employees</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[employeesdetails]"
																value="employeesdetails" id="employeesdetails"
																<?php
	if (in_array ( "employeesdetails", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Employees Details</span>
														</div>
														<div class="span6">
															<input name="employee[newemployees]" value="new_employee"
																id="newemployees"
																<?php
	if (in_array ( "newemployees", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> New Employees</span>
														</div>
													</td>
												</tr>
											</tbody>
										</table>
									</div>
									<div class="span6">
										<table class="table table-striped table-bordered">
											<tbody>
												<!-- 	<tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Clients</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[clientdetails]"
																value="clientdetails" id="clientdetails"
																<?php
	if (in_array ( "clientdetails", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Client Details</span>
														</div>
														<div class="span5">
															<input name="employee[newclient]" value="newclient"
																id="newclient"
																<?php
	if (in_array ( "newclient", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> New Client</span>
														</div>
													</td>
												</tr> -->
												<tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Departments</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[displayuser]" value="departments"
																id="departments"
																<?php
	if (in_array ( "departments", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Departments</span>
														</div>
														<div class="span6">
															<input name="employee[displayuser]"
																value="newdepartments" id="newdepartments"
																<?php
	if (in_array ( "newdepartments", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> New Departments</span>
														</div>
													</td>
												</tr>
												<tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Attendence</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[displayuser]" value="attendence1"
																id="attendence"
																<?php
	if (in_array ( "attendence1", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Attendence</span>
														</div>
														<div class="span6">
															<input name="employee[displayuser]"
																value="empattend" id="employeeattendence"
																<?php
	if (in_array ( "empattend", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Employee Attendence</span>
														</div>
													</td>
												</tr>
												<!-- <tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Pay Roll</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[singaporetable]" value="singaporetable"
																id="singaporetable"
																<?php
	if (in_array ( "singaporetable", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Payroll Config</span>
														</div>
														<div class="span6">
															<input name="employee[payslip]"
																value="payslip" id="payslip"
																<?php
	if (in_array ( "payslip", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Payslip Generator</span>
														</div>
													</td>
												</tr>
												<tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Incometax Slab</b>
														</p>
													</td>
													<td>
														<div class="span6">
															<input name="employee[incometax_slab]" value="incometax_slab"
																id="incometax_slab"
																<?php
	if (in_array ( "incometax_slab", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Incometax Slab</span>
														</div>
														</td>
												</tr> -->
												<!-- 	<tr>
													<td style="background: #f2f2f2;">
														<p data-rel="tooltip" data-placement="top"
															title="Click to change it">
															<b>Attendence</b>
														</p>
													</td>
													<td>
														<div class="span5">
															<input name="employee[displayuser]" value="attendence"
																id="attendence"
																<?php
	if (in_array ( "attendence", $totalconvert )) {
		echo "checked";
	}
	?>
																class="ace-checkbox-2" type="checkbox"> <span
																class="lbl"> Attendence</span>
														</div>

													</td>
												</tr> -->
												<!-- <tr>
																	<td style="background: #f2f2f2;">
																		<p data-rel="tooltip" data-placement="top"
																			title="Click to change it"><b>Change Passwords</b></p>
																	</td>
																	<td>
																		<div class="span8">
																			<input name="employee[changepasswords]" value="changepasswords" id="changepasswords"
																			<?php
	/*
	 * if (in_array("changepasswords", $totalconvert)) { echo "checked"; }
	 */
	?>
																			class="ace-checkbox-2" type="checkbox"> <span class="lbl"> Change Passwords</span>
																		</div>
																		
																	</td>
																</tr>-->
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--PAGE CONTENT ENDS-->
		</div>
		<!--/.span-->
	</div>
	<!--/.row-fluid-->
</div>
<!--/.page-content-->


</div>
<!--/.main-content-->
<?php

} else {
	$session->redirect ( 'employee_details', Admin );
}

?>