3651 lines
138 KiB
PHP
3651 lines
138 KiB
PHP
<?php include('techsyn_header.php');
|
|
$non_emp = getTableFieldValue('patient_category', 'patient_cat_id', 'patient_cat_name', '"Non Employee"');
|
|
|
|
?>
|
|
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
|
|
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
|
|
|
<!-- page specific plugin styles -->
|
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
|
<link rel="stylesheet" href="assets/css/jquery.gritter.min.css" />
|
|
<link rel="stylesheet" href="assets/css/select2.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-editable.min.css" />
|
|
<!-- text fonts -->
|
|
<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />
|
|
<!-- ace styles -->
|
|
<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
|
|
<!--[if lte IE 9]>
|
|
<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
|
|
<![endif]-->
|
|
<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
|
|
<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
|
|
<!--[if lte IE 9]>
|
|
<link rel="stylesheet" href="assets/css/ace-ie.min.css" />
|
|
<![endif]-->
|
|
<!-- inline styles related to this page -->
|
|
<!-- ace settings handler -->
|
|
<script src="assets/js/ace-extra.min.js"></script>
|
|
|
|
<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->
|
|
<!--[if lte IE 8]>
|
|
<script src="assets/js/html5shiv.min.js"></script>
|
|
<script src="assets/js/respond.min.js"></script>
|
|
<![endif]-->
|
|
<!-- Main Content Container for side bar and body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) {}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
<li class="active">Patient</li>
|
|
<li class="active">Add Patient Info</li>
|
|
</ul>
|
|
</div>
|
|
<div class="page-content">
|
|
<div class="box box-primary" style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%;">
|
|
<form class="form-horizontal" id="employee_form" name="employee_form" enctype="multipart/form-data" action="#" method="post">
|
|
<input type="hidden" id="questionnaire_section_ids" name="questionnaire_section_ids[]"> <input type="hidden" name="flex_docs_id" id="flex_docs_id" />
|
|
|
|
<div class="tabbable">
|
|
<ul class="nav nav-tabs padding-18">
|
|
<li id="basic" class="active"><a data-toggle="tab" href="#edit-basic"> <i class="green ace-icon fa fa-user bigger-120"></i> Basic Info
|
|
</a></li>
|
|
|
|
<!-- <li id="contactTab"><a data-toggle="tab" href="#contacts"> <i
|
|
class="blue ace-icon fa fa-phone bigger-120"></i>Contacts
|
|
</a></li>
|
|
|
|
<li id="familyTab"><a data-toggle="tab" href="#edit-settings"> <i
|
|
class="blue ace-icon fa fa-users bigger-120"></i> Family
|
|
Members
|
|
</a></li>
|
|
|
|
|
|
<li id="adviceTab"><a data-toggle="tab" href="#edit-password"> <i
|
|
class="pink ace-icon fa fa-picture-o bigger-120"></i> Advices
|
|
& Risks
|
|
</a></li>
|
|
<li id="vacTab"><a data-toggle="tab" href="#vac"> <i
|
|
class="blue ace-icon fa fa-eyedropper bigger-120"></i>Vaccination
|
|
</a></li>
|
|
<li id="questionnaireTab"><a data-toggle="tab"
|
|
href="#questionnaire"> <i
|
|
class="red ace-icon fa fa-question-circle bigger-120"></i>Employee
|
|
Questionnaire
|
|
</a></li>
|
|
<li id="docsTab"><a data-toggle="tab" href="#uploadDocs"> <i
|
|
class="red ace-icon fa fa-upload bigger-120"></i> Documents
|
|
</a></li> -->
|
|
|
|
</ul>
|
|
</div>
|
|
<div class="box-header with-border"></div>
|
|
<div class="tab-content profile-edit-tab-content">
|
|
<div id="edit-basic" class="tab-pane in active">
|
|
<div id="user-profile-2">
|
|
|
|
<div class="box-body">
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-2">
|
|
<span class="profile-picture">
|
|
<?php if (isset($row['photo']) && $row['photo'] != null) { ?>
|
|
<img class="editable img-responsive" id="avatar" src="data:<?= $row['image_type'] ?>;base64,<?= base64_encode($row['photo']) ?>" style="display: block; width: 180px; height: 200px;" />
|
|
|
|
<?php } else { ?>
|
|
<img class="editable img-responsive" style="width: 120px; height: 120px" alt="Patient Profile Pic" id="avatar" src="images/male-profile.png" />
|
|
</span>
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
<div class="space space-4"></div>
|
|
|
|
<div class="hide" id="uploadForm"></div>
|
|
|
|
</div>
|
|
<!-- <div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Patient Category</label>
|
|
<div class="col-sm-10">
|
|
<select onchange="showOrHideForDiv(this.value)" class="form-control" name="patient_category" id="patient_category">
|
|
<option value="" disabled selected>Please select an option
|
|
</option>
|
|
<?php echo generateOption('patient_category', 'patient_cat_name', 'patient_cat_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-first">Patient Name</label>
|
|
|
|
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input class="form-control" style="text-transform: uppercase;" type="text" name="patient_name" id="patient_name" placeholder="Patient Name" value="<?php echo $patient_name; ?>"> <input type="hidden" class="form-control" name="patient_id" id="patient_id" value="<?php echo $_REQUEST['emp_id']; ?>" />
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-username">Father's/Spouse Name</label>
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input class="form-control" style="text-transform: uppercase;" type="text" name="father_name" id="father_name" placeholder="Father's or Husband Name" value="<?= $father_name; ?>">
|
|
|
|
</div>
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-username"> Surname</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input class="form-control" style="text-transform: uppercase;" type="text" name="father_surname" id="father_surname" placeholder="Father's or Spouse Surname" value="<?= $father_surname; ?>">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Age/Birth Date</label>
|
|
|
|
<div class="col-sm-4">
|
|
<div class="input-group">
|
|
|
|
<input class="form-control col-sm-2 date-picker" id="dob" name="dob" type="text" readonly onChange="calculateAge('dob','emp_age')" data-date-format="dd/mm/yyyy" placeholder="Date of Birth(dd/mm/yyyy)" value="<?php echo date("d/m/Y", strtotime($dob)); ?>">
|
|
<span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i>
|
|
</span> <input class="col-xs-12 col-sm-2 form-control" type="number" id="emp_age" name="emp_age" onChange="checkAge('emp_age','dob')" placeholder="Age if DOB unknown">
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="gender" style="vertical-align: top"></label>
|
|
|
|
<div class="col-sm-4" style="vertical-align: top">
|
|
|
|
<label class="inline"> <input name="gender" id="gender" type="radio" class="ace" value="M" <?php if ($gender == 'M' || empty($gender)) {
|
|
echo "checked";
|
|
} ?>>
|
|
<span class="lbl middle"> Male</span>
|
|
</label> <label class="inline"> <input name="gender" id="gender" value="F" <?php if ($gender == 'F') {
|
|
echo "checked";
|
|
} ?> type="radio" class="ace"> <span class="lbl middle">
|
|
Female</span>
|
|
</label> <label class="inline"> <input name="gender" id="gender" value="O" type="radio" <?php if ($gender == 'O') {
|
|
echo "checked";
|
|
} ?> class="ace">
|
|
<span class="lbl middle"> Others</span>
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Employee ID</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input class="form-control" type="text" id="emp_code" value="<?php echo $emp_code; ?>" name="emp_code" placeholder="Employee Code" onchange="check_existing_emp(this, 'ecode',this.value);showMail(this.value)">
|
|
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Department</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="dept" id="dept">
|
|
<option value="" selected disabled></option>
|
|
<?php echo generateOption('department', 'dept_name', 'dept_id', '1', ""); ?>
|
|
</select>
|
|
|
|
</div>
|
|
<!-- <label id="emp_con_label" class="col-sm-2 control-label no-padding-right" for="form-field-comment">Employer/Contractor <span style="color: red">*</span></label>
|
|
<div class="col-sm-4" id="emp_con">
|
|
<div class="input-group">
|
|
<select class="form-control select2" name="employer_contractor_id" style="width: 83%" id="employer_contractor_id">
|
|
<?php echo generateOption('employer_contractor', 'employer_contractor_name', 'id', '1', ''); ?>
|
|
</select>
|
|
<span class="input-group-addon"><a href="#"></a> <i class="ace-icon fa fa-plus" id="new_employee_contractor"></i></a>
|
|
</span>
|
|
</div>
|
|
</div> -->
|
|
</div>
|
|
</div>
|
|
|
|
<div id="employee_div" style="display: block">
|
|
<!-- <div class="col-sm-10 col-sm-2"></div> -->
|
|
|
|
<!-- <div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Division</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="bussiness_unit" id="bussiness_unit">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('bussiness_unit', 'bu_name', 'bu_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div> -->
|
|
|
|
|
|
<!-- <div class="col-sm-10 col-sm-2"></div> -->
|
|
<!-- <div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Area/Section</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="sub_section" id="sub_section">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('sub_section', 'sub_section_name', 'sub_section_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Section</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="section" id="section">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('section', 'section_name', 'section_id', '', ''); ?>
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Emp Cadre</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="emp_cadre" id="emp_cadre">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('emp_cadre', 'emp_cadre', 'emp_cadre_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Blood Group</label>
|
|
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2" name="blood_group" id="blood_group">
|
|
<option disabled selected>Please select option</option>
|
|
<?php echo generateOption('blood_group', 'type', 'type', ' ', ''); ?>
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<label id="desig_label1" class="col-sm-2 control-label no-padding-right" for="form-field-comment">Designation </label>
|
|
<div class="col-sm-4" id="designation1">
|
|
|
|
<select class="form-control select2" name="emp_designation" id="emp_designation">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('designation', 'designation_name', 'designation_id', '', ''); ?>
|
|
</select>
|
|
|
|
</div>
|
|
<!-- <label class="col-sm-2 control-label no-padding-right" for="form-field-username">Supervisor</label>
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select class="select2 form-control" name="manager_emp_id" id="manager_emp_id">
|
|
<?php $sql_emp_1 = "SELECT id,patient_name, emp_code FROM patient_master order by patient_name"; ?>
|
|
<option value="" disabled selected>Please select an
|
|
option</option>
|
|
<?php echo getEmployeeOptions() ?>
|
|
</select>
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- <div class="col-sm-10 col-sm-2"></div> -->
|
|
<!-- <div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Is First Aider</label>
|
|
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2" name="has_first_aid" id="has_first_aid">
|
|
<option disabled selected>Please select option</option>
|
|
<option value="0">
|
|
No</option>
|
|
<option value="1">
|
|
Yes</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div> -->
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Joining Date</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
<input class="form-control date-picker " id="doj" name="doj" type="text" data-date-format="dd/mm/yyyy" placeholder="Date of Joining(dd/mm/yyyy)"> <span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">National Identity <span style="color: red">*</span></label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="aadhar_no" name="aadhar_no" onchange="check_existing_emp(this,'aadhar',this.value)" maxlength="12" placeholder="Enter National Identity">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Client Name </label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="client_id" id="client_id">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php
|
|
$ohc_type = $_SESSION['current_ohcttype'];
|
|
|
|
|
|
echo generateOptionWithWhereClause('client_master', 'client_name', 'id', '', '', 'ohc_type', $ohc_type);
|
|
|
|
|
|
?>
|
|
</select>
|
|
|
|
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Client Location</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="client_location" id="client_location">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Phone Number</label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="number" id="primary_phone" name="primary_phone" placeholder="Enter Phone No">
|
|
|
|
|
|
</div>
|
|
<label id="mail_label" class="col-sm-2 control-label no-padding-right" for="form-field-comment">Official Email</label>
|
|
|
|
<div class="col-sm-4" id="mail">
|
|
|
|
<input class="form-control" id="offiial_email" name="offiial_email" type="text" placeholder="Offiial Email">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- <div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Is hazardous process</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
|
|
<select class="form-control select2" id="hazardous_process" name="hazardous_process" onchange="showField(this.value)">
|
|
<option value="" disabled selected>Please select an
|
|
option</option>
|
|
<option value="Y">Yes</option>
|
|
<option value="N">No</option>
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<label id="danger_label" class="col-sm-2 control-label no-padding-right" for="form-field-comment">Dangerous process/operation</label>
|
|
|
|
<div class="col-sm-4" id="danger">
|
|
|
|
<input class="form-control" id="dangerous_process" name="dangerous_process" type="text" placeholder="Dangerous process">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div> -->
|
|
|
|
|
|
<!-- <div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label id="raw_materials_label" class="col-sm-2 control-label no-padding-right" for="form-field-comment">Raw materials or by-products to be
|
|
likely exposed to</label>
|
|
|
|
<div class="col-sm-4" id="raw_materials">
|
|
|
|
|
|
<input class="form-control" id="raw_materials_exposed" name="raw_materials_exposed" type="text" placeholder="Raw materials exposed to">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<label id="nature_label" class="col-sm-2 control-label no-padding-right" for="form-field-comment">Nature of job</label>
|
|
|
|
<div class="col-sm-4" id="nature">
|
|
|
|
|
|
<input class="form-control" id="nature_job" name="nature_job" type="text" placeholder="Nature of job">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> -->
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Status </label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="status" onchange="" id="status">
|
|
<option disabled selected>Please select option
|
|
</option>
|
|
<option value="Inactive" <?php { ?> selected <?php } ?>>
|
|
Inactive </option>
|
|
<option value="Active" <?php { ?> selected <?php } ?>>
|
|
Active
|
|
</option>
|
|
</select>
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Is OHC Staff</label>
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2" name="is_ohc_staff" id="is_ohc_staff">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<option value="1">
|
|
Yes
|
|
</option>
|
|
<option value="0">
|
|
No
|
|
</option>
|
|
|
|
</select>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Identity Mark</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
|
|
<input class="form-control" id="identity" name="identity" value="<?php echo getTableFieldValue('patient_master', 'identity', 'id', $_REQUEST['emp_id']) ?>" type="text" placeholder="Please add Identity Mark ">
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">OHC Location</label>
|
|
|
|
<div class="form-group col-sm-4" style="margin-left: -1px;">
|
|
<select class="form-control" id="ohc_type_id" name="ohc_type_id" data-placeholder="OHC Type">
|
|
<option disabled selected>Please select option</option>
|
|
<?php echo generateOptionWithWhereClause('ohc_type', 'ohc_type_name', 'ohc_type_id', '', '','ohc_category','"OHC"'); ?>
|
|
</select>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Passport Number</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
|
|
<input class="form-control" type="text" id="passport" name="passport" placeholder="Enter Passport Number" onchange="check_existing_emp(this,'passport',this.value)">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- END OF EMPLOYEE DIV -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row" style="margin: 5px;">
|
|
|
|
<h5 class="header blue bolder smaller" style="margin: 10px 20px;">
|
|
Address</h5>
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Residing Village</label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="village" name="village" placeholder="Enter Village" value="<?= $village ?>">
|
|
|
|
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Post </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="post" value="<?= $post ?>" name="post" placeholder="Enter Post">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<!-- <div class="col-sm-10 col-sm-2"></div> -->
|
|
<!-- <div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">PS</label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="ps" name="ps" value="<?= $ps ?>" placeholder="Enter PS">
|
|
|
|
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Tehsil </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="tehsil" value="<?= $tehsil ?>" name="tehsil" placeholder="Enter Tehsil ">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div> -->
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">District </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="district" value="<?= $district ?>" name="district" placeholder="Enter District">
|
|
|
|
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">State </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="state" value="<?= $state ?>" name="state" placeholder="Enter State">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<!-- <label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Pin Code </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="tel" id="pin_code" name="pin_code" maxlength="6" placeholder="Enter Pin Code" value="<?= $pin_code ?>">
|
|
<input type="hidden" id="task" name="task" value="<?= $_REQUEST['task'] ?>">
|
|
</div> -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- hiddeing below data -->
|
|
<div style=" display :none">
|
|
<!-- vaccination tab start -->
|
|
<div id="vac" class="tab-pane">
|
|
|
|
<div class="row">
|
|
|
|
<div class="space"></div>
|
|
|
|
<h4 class="header blue bolder smaller">Vaccination Details</h4>
|
|
|
|
<div class="space"></div>
|
|
|
|
<!-- <div class="box box-primary"
|
|
style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%; "> -->
|
|
<form id="ambulance_form" method="post">
|
|
<!-- box-body-->
|
|
<div class="box-body">
|
|
<div class="row">
|
|
<div class="col-sm-10">
|
|
<table id="myTable" class="table table-bordered order-list">
|
|
<thead>
|
|
<tr>
|
|
<th>S.No.</th>
|
|
<th>Vaccine Name</th>
|
|
<th>1st Dose</th>
|
|
<th>2nd Dose</th>
|
|
<th>3rd Dose</th>
|
|
<th>Remarks</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
|
|
<?php
|
|
|
|
$i = 0;
|
|
$s_no = 1;
|
|
$row = null;
|
|
if (isset($_REQUEST['flex_ambulance_id'])) {
|
|
$sql = "select * from vaccination_details where emp_id='" . $_REQUEST['id'] . "'";
|
|
$result = @mysqli_query($conn, $sql);
|
|
$num_rows = @mysqli_num_rows($result);
|
|
$row = @mysqli_fetch_array($result);
|
|
}
|
|
do {
|
|
?>
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td style="width: 2%"><input type="hidden" name="vac_id<?= $i ?>" id="vac_id<?= $i ?>" value="<?= $row['id'] ?>" />
|
|
<div class="input-group">
|
|
<label><?= $s_no; ?></label>
|
|
</div>
|
|
</td>
|
|
|
|
<td style="width: 8%"><select class="form-control" name="vac_name<?= $i ?>" id="vac_name<?= $i ?>" value="<?= $row['vac_id'] ?>">
|
|
<?php
|
|
|
|
$sql_vac = "SELECT id, CONCAT(vaccine_name, ' - ', vaccine_company) as vaccine_details FROM vaccine_master order by vaccine_name";
|
|
$sql_vac_result = @mysqli_query($conn, $sql_vac);
|
|
$vac_row = @mysqli_fetch_assoc($sql_vac_result);
|
|
do {
|
|
if ($vac_row['id'] == $row['vac_id']) {
|
|
?>
|
|
|
|
<option value="<?= $vac_row['id'] ?>" selected="selected">
|
|
<?= $vac_row['vaccine_details'] ?>
|
|
</option><?php
|
|
} else {
|
|
?>
|
|
|
|
<option value="<?= $vac_row['id'] ?>">
|
|
<?= $vac_row['vaccine_details'] ?>
|
|
</option><?php
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
} while ($vac_row = @mysqli_fetch_assoc($sql_vac_result)) ?>
|
|
|
|
|
|
</select></td>
|
|
|
|
|
|
<td style="width: 8%"><input type="date" name="dose1_<?= $i ?>" value="<?= $row['vac_d1'] ?>" id="dose1_<?= $i ?>" class="form-control" />
|
|
</td>
|
|
<td style="width: 8%"><input type="date" name="dose2_<?= $i ?>" value="<?= $row['vac_d2'] ?>" id="dose2_<?= $i ?>" class="form-control" />
|
|
</td>
|
|
<td style="width: 8%"><input type="date" name="dose3_<?= $i ?>" value="<?= $row['vac_d3'] ?>" id="dose3_<?= $i ?>" class="form-control" />
|
|
</td>
|
|
<td style="width: 14%"><input type="text" name="remarks_<?= $i ?>" value="<?= $row['remarks'] ?>" id="remarks_<?= $i ?>" class="form-control" />
|
|
</td>
|
|
|
|
|
|
<td style="width: 10%"><input type="button" class="btn btn-sm btn-block " id="addrow" value="Add Row" /></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
<?php
|
|
$i++;
|
|
$s_no++;
|
|
} while ($row = @mysqli_fetch_array($result)) ?>
|
|
// end of while
|
|
<input type="hidden" name="count_items" id="count_items" value="<?= $i ?>" />
|
|
<input type="hidden" name="s_no" id="s_no" value="<?= $s_no ?>" />
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
</tr>
|
|
</tfoot>
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<!-- End box-body-->
|
|
<!--box-footer-->
|
|
|
|
<!--End box-footer-->
|
|
|
|
</form>
|
|
</div>
|
|
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- vaccination tab end -->
|
|
|
|
|
|
<div id="contacts" class="tab-pane">
|
|
|
|
<div class="row">
|
|
|
|
<div class="space"></div>
|
|
|
|
<h4 class="header blue bolder smaller">Contact</h4>
|
|
|
|
|
|
|
|
<div class="col-lg-12 form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-email">Email</label>
|
|
|
|
|
|
|
|
<div class="col-lg-4">
|
|
<span class="input-icon input-icon-right"> <input class="form-control" type="email" id="email" name="email" value=""> <i class="ace-icon fa fa-envelope"></i>
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-phone">Personal Phone</label>
|
|
|
|
|
|
|
|
<div class="col-md-4">
|
|
<span class="input-icon input-icon-right"> <input class="input-medium input-mask-mobile" type="text" name="personal_phone" id="personal_phone"> <i class="ace-icon fa fa-phone fa-flip-horizontal"></i>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="space"></div>
|
|
|
|
<h4 class="header blue bolder smaller">Emergency Contact</h4>
|
|
|
|
|
|
|
|
<div class="col-sm-10 form-group">
|
|
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-phone">Primary Contact Person</label>
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<span class="input-icon input-icon-right"> <input class="form-control input-mask-mobile col-sm-4" type="text" name="primary_contact_person" id="primary_contact_person">
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-phone">Primary Contact No </label>
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<span class="input-icon input-icon-right"> <input class="form-control input-mask-mobile" type="text" name="primary_contact_no" id="primary_contact_no"> <i class="ace-icon fa fa-phone fa-flip-horizontal"></i>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class=" col-sm-10 form-group">
|
|
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-phone">Secondary Contact Person</label>
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<span class="input-icon input-icon-right"> <input class="form-control input-mask-mobile" type="text" name="secondary_contact_person" id="secondary_contact_person">
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-phone">Secondary Contact No </label>
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<span class="input-icon input-icon-right"> <input class="form-control input-mask-mobile" type="text" name="secondary_contact_no" id="secondary_contact_no"> <i class="ace-icon fa fa-phone fa-flip-horizontal"></i>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="edit-settings" class="tab-pane">
|
|
|
|
<div class="space-10"></div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
Family Members
|
|
|
|
<div class="btn-group" style="margin-left: 900px">
|
|
|
|
<button type="button" class="btn btn-info" onclick="addFamilyMembersRow()" id="addButton">
|
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
</button>
|
|
<input type="hidden" name="rowCount" id="rowCount" value="1" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table table-bordered table-hover" id="familyMembersTable">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>Sr</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Age</th>
|
|
|
|
<th>Gender</th>
|
|
|
|
<th>Relation Type</th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>1</td>
|
|
|
|
<td><input type="text" name="name0" id="name0" onkeyup="this.value = this.value.toUpperCase();" class="form-control" /></td>
|
|
|
|
<td><input type="number" id="age0" name="age0" class="form-control" /></td>
|
|
|
|
<td><select class="form-control" name="gender0" id="gender0">
|
|
|
|
<option value="" selected disabled>--Select Gender
|
|
</option>
|
|
|
|
<option value="M">Male</option>
|
|
|
|
<option value="F">Female</option>
|
|
|
|
<option value="O">Others</option>
|
|
|
|
|
|
|
|
|
|
|
|
</select></td>
|
|
|
|
<td><select class="form-control" name="relation_type0" id="relation_type0">
|
|
<option disabled>--Select Relation--</option>
|
|
<option value="Spouse">Spouse</option>
|
|
<option value="Son">Son</option>
|
|
<option value="Daughter">Daughter</option>
|
|
<option value="Mother">Mother</option>
|
|
<option value="Father">Father</option>
|
|
</select></td>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="edit-password" class="tab-pane">
|
|
|
|
<div class="space-10"></div>
|
|
|
|
|
|
|
|
<div id="edit-password" class="tab-pane">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
Known Health Advices And Health Risks
|
|
|
|
<div class="btn-group" style="margin-left: 750px">
|
|
|
|
<button type="button" class="btn btn-info" onclick="addHealthAdvicesAndRisksRow()">
|
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table table-bordered table-hover" id="health_advices_and_risks">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th width="50%">Known Health Advices</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th width="50%">Known Health Risks</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="questionnaire" class=" tab-pane">
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<?php
|
|
|
|
$sql_questionnaire_sections = "select * from questionnaire_section";
|
|
|
|
// echo $sql_questionnaire_sections;
|
|
|
|
$result_questionnaire_sections = @mysqli_query($conn, $sql_questionnaire_sections);
|
|
|
|
$countSection = 0;
|
|
|
|
$count = 0;
|
|
|
|
while ($row_questionnaire_sections = @mysqli_fetch_array($result_questionnaire_sections)) {
|
|
|
|
$section_id = $row_questionnaire_sections['section_id'];
|
|
|
|
$sql_questionnaire = "select * from questionnaire where question_section_id='$section_id'";
|
|
|
|
// echo $sql_questionnaire;
|
|
|
|
$result_questionnaire = @mysqli_query($conn, $sql_questionnaire);
|
|
|
|
$no_of__question_rows = mysqli_num_rows($result_questionnaire);
|
|
|
|
$srNo = 0;
|
|
|
|
if ($no_of__question_rows != 0) {
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class=" col-sm-10">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$sql_all_questionnaire = "select * from questionnaire ";
|
|
|
|
$result_all_questionnaire = @mysqli_query($conn, $sql_all_questionnaire);
|
|
|
|
$no_of_all_question_rows = mysqli_num_rows($result_all_questionnaire);
|
|
|
|
?>
|
|
|
|
<table width="80%" border=1 id="familyMembersTable" class="table-hover">
|
|
|
|
<caption>
|
|
<b><?php echo $row_questionnaire_sections['section_name'] ?></b>
|
|
</caption>
|
|
|
|
<tbody>
|
|
|
|
<tr bgcolor="#d3d3d3">
|
|
|
|
<th>Sr</th>
|
|
|
|
<th>Question</th>
|
|
|
|
<th>Answer</th>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
if ($no_of__question_rows > 0) {
|
|
|
|
?>
|
|
|
|
<input type="hidden" name="querowCount" id="querowCount" value="<?php echo $no_of_all_question_rows; ?>" />
|
|
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
<input type="hidden" name="querowCount" id="querowCount" value="1" />
|
|
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if ($no_of__question_rows > 0) {
|
|
|
|
while ($row_questionnaire = @mysqli_fetch_array($result_questionnaire)) {
|
|
|
|
$ques_id = $row_questionnaire['question_id'];
|
|
|
|
?>
|
|
|
|
<tr id="queTableRow<?= $count; ?>">
|
|
|
|
<td> <?= $srNo + 1; ?></td>
|
|
|
|
<td><?php echo $row_questionnaire['question_name'] ?>
|
|
<input name="que_id<?= $count; ?>" value="<?= $row_questionnaire['question_id'] ?>" type="hidden">
|
|
</td>
|
|
|
|
<td align="center">
|
|
<?php if ($row_questionnaire['question_type'] == "Input") { ?><input name="ans<?= $count; ?>" type="text"><?php
|
|
} else {
|
|
?><input type="checkbox" name="ans<?= $count; ?>" value="Yes">
|
|
|
|
<?php } ?></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
++$count;
|
|
|
|
++$srNo;
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<?php }
|
|
$countSection++;
|
|
} ?>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div id="uploadDocs" class=" tab-pane">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="table-responsive" style="align: center; text-align: center; width: 50%; margin: 50px;">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label for="file">Upload File:</label>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input type="file" class="form-control" name="userfile" id="file" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$docs_select_query = "select * from employee_docs where emp_id=$emp_id";
|
|
|
|
$docs_result = @mysqli_query($conn, $docs_select_query);
|
|
|
|
$no_of_docs = @mysqli_num_rows($docs_result);
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="table-responsive" style="align: center; text-align: center; width: 90%;">
|
|
|
|
|
|
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">Uploaded
|
|
Documents</h4>
|
|
|
|
<table class="table table-bordered" style="width: 100%">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>S.No.</th>
|
|
|
|
<th>Document Name</th>
|
|
|
|
<th>Uploaded Date</th>
|
|
|
|
<th>Download link</th>
|
|
|
|
<th>Edit/Delete</th>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
|
|
|
|
<?php if ($no_of_docs == 0) { ?>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td align='center' colspan='5'>No Files Found</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$count = 0;
|
|
|
|
while ($row_docs = mysqli_fetch_array($docs_result)) {
|
|
|
|
?>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
<td align="left"><?= $count + 1 ?></td>
|
|
|
|
<td align="left"><?= $row_docs['doc_name'] ?></td>
|
|
|
|
<td align="left">
|
|
<?= date("d-F-Y", filemtime('files/' . $thelist[$count])) ?>
|
|
</td>
|
|
|
|
<?php
|
|
|
|
echo '<td align="center"><a href="data:image/jpeg;base64,' . base64_encode($row_docs['document']) . '" download><span
|
|
|
|
class="glyphicon glyphicon-download-alt"></span></a></td>';
|
|
|
|
?>
|
|
|
|
<!-- <td align="center" > <a
|
|
|
|
href="" download><span
|
|
|
|
class="glyphicon glyphicon-download-alt"></span></a></td> -->
|
|
|
|
<td align="center"> <a onclick="deletedocs(<?= $row_docs['doc_id'] ?>);"><span class="glyphicon glyphicon-trash"></span></a></td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<?php $count++;
|
|
} ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="assets/js/jquery-ui.custom.min.js"></script>
|
|
|
|
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
|
|
|
|
<script src="assets/js/jquery.gritter.min.js"></script>
|
|
|
|
<script src="assets/js/bootbox.js"></script>
|
|
|
|
<script src="assets/js/jquery.easypiechart.min.js"></script>
|
|
|
|
<script src="assets/js/bootstrap-datepicker.min.js"></script>
|
|
|
|
<script src="assets/js/jquery.hotkeys.index.min.js"></script>
|
|
|
|
<script src="assets/js/bootstrap-wysiwyg.min.js"></script>
|
|
|
|
<script src="assets/js/select2.min.js"></script>
|
|
|
|
<script src="assets/js/spinbox.min.js"></script>
|
|
|
|
<script src="assets/js/bootstrap-editable.min.js"></script>
|
|
|
|
<script src="assets/js/ace-editable.min.js"></script>
|
|
|
|
<script src="assets/js/jquery.maskedinput.min.js"></script>
|
|
|
|
|
|
|
|
<!-- ace scripts -->
|
|
|
|
<script src="assets/js/ace-elements.min.js"></script>
|
|
|
|
<script src="assets/js/ace.min.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(document).on('change', '#client_id', function() {
|
|
let client_id = $("#client_id").val();
|
|
$('#client_location').html(" ");
|
|
$('#client_location').append('<option value=""> </option>');
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_location.php',
|
|
data: {
|
|
client_id: client_id
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
if (data != '' && data != null) {
|
|
// alert(data);
|
|
$("#client_location").append(data);
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
})
|
|
});
|
|
$(document).ready(function() {
|
|
var counter = $("#count_items").val();
|
|
var s_no = $("#s_no").val();
|
|
//alert (counter);
|
|
$("#addrow").on("click", function() {
|
|
var newRow = $("<tr>");
|
|
var cols = "";
|
|
|
|
|
|
cols += '<td><label>' + s_no + '</label></td>';
|
|
// cols += '<td><input type="text" class="form-control" id="vac_name' + counter + '" name="vac_name' + counter + '"/></td>';
|
|
cols += '<td><select class="form-control" name="vac_name' + counter +
|
|
'" id="vac_name' + counter +
|
|
'"><?php $sql_vac = "SELECT id, CONCAT(vaccine_name, ' - ', vaccine_company) as vaccine_details FROM vaccine_master order by vaccine_name";
|
|
$sql_vac_result = @mysqli_query($conn, $sql_vac);
|
|
$vac_row = @mysqli_fetch_assoc($sql_vac_result);
|
|
do { ?><option value="<?= $vac_row['id'] ?>"><?= $vac_row['vaccine_details'] ?></option><?php } while ($vac_row = @mysqli_fetch_assoc($sql_vac_result)) ?></select></td>';
|
|
cols += '<td><input type="date" class="form-control" id="dose1_' + counter +
|
|
'" name="dose1_' + counter + '"/></td>';
|
|
cols += '<td><input type="date" class="form-control" id="dose2_' + counter +
|
|
'" name="dose2_' + counter + '"/></td>';
|
|
cols += '<td><input type="date" class="form-control" id="dose3_' + counter +
|
|
'" name="dose3_' + counter + '"/></td>';
|
|
cols += '<td><input type="text" class="form-control" id="remarks_' + counter +
|
|
'" name="remarks_' + counter + '"/></td>';
|
|
cols +=
|
|
'<td align="center"><a href="#" class="btn-lg" data-toggle="tooltip" id="deletebtn" title="Delete"><span class="glyphicon glyphicon-trash"></span></a></td>';
|
|
|
|
newRow.append(cols);
|
|
$("#myTable").append(newRow);
|
|
/*$('#item_id'+counter).chosen({allow_single_deselect:true});
|
|
$('#item_id'+counter).next().css({'width': $('#item_id'+counter).parent().width()});*/
|
|
counter++;
|
|
s_no++;
|
|
$('.select2').select2()
|
|
$("#count_items").val(counter);
|
|
$("#s_no").val(s_no);
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#myTable").on("click", "#deletebtn", function(event) {
|
|
$(this).closest("tr").remove();
|
|
counter -= 1
|
|
$("#count_items").val(counter);
|
|
});
|
|
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
<!-- inline scripts related to this page -->
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
addHealthAdvicesAndRisksRow();
|
|
|
|
function addHealthAdvicesAndRisksRow() {
|
|
|
|
var table = document.getElementById("health_advices_and_risks");
|
|
|
|
|
|
|
|
var rowCount = table.rows.length;
|
|
|
|
var newRow = table.insertRow(rowCount);
|
|
|
|
var health_advices =
|
|
"<?php echo generateOption('health_advice', 'health_advice_name', 'health_advice_id', '', ''); ?>"
|
|
|
|
var health_risks =
|
|
"<?php echo generateOption(' health_risk', 'health_risk_name', 'health_risk_id', '', ''); ?>"
|
|
|
|
var content = ""
|
|
|
|
content +=
|
|
"<td><select multiple=\"\" name=\"known_health_advices[]\" id=\"known_health_advices\" class=\"chosen-select form-control\">"
|
|
|
|
content += "<option value=\"\" disabled> Select Health Advices </option>";
|
|
|
|
content += health_advices;
|
|
|
|
content += "</select></td>"
|
|
|
|
content +=
|
|
"<td><select multiple=\"\" id=\"known_health_risks\" name=\"known_health_risks[]\" class=\"chosen-select form-control\">"
|
|
|
|
content += "<option value=\"\" disabled> Select Health Risks </option>";
|
|
|
|
content += health_risks;
|
|
|
|
content += "</select></td>"
|
|
|
|
|
|
|
|
|
|
|
|
$(newRow).append(content);
|
|
|
|
$('#known_health_advices').chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
|
|
$('#known_health_advices').next().css({
|
|
'width': '100%'
|
|
});
|
|
|
|
$('#known_health_risks').chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
|
|
$('#known_health_risks').next().css({
|
|
'width': '100%'
|
|
});
|
|
|
|
|
|
|
|
var heath_advice_array = <?php echo json_encode($advices) ?>;
|
|
|
|
|
|
|
|
var element = document.getElementById('known_health_advices');
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < element.options.length; i++) {
|
|
if (heath_advice_array != null)
|
|
element.options[i].selected = heath_advice_array.indexOf(element.options[i]
|
|
.value) >=
|
|
0;
|
|
|
|
}
|
|
|
|
$('#known_health_advices').trigger('chosen:updated');
|
|
|
|
|
|
|
|
var heath_risk_array = <?php echo json_encode($risks) ?>;
|
|
|
|
|
|
|
|
var element1 = document.getElementById('known_health_risks');
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < element1.options.length; i++) {
|
|
if (heath_risk_array != null)
|
|
element1.options[i].selected = heath_risk_array.indexOf(element1.options[i]
|
|
.value) >=
|
|
0;
|
|
|
|
}
|
|
|
|
$('#known_health_risks').trigger('chosen:updated');
|
|
|
|
|
|
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jQuery(function($) {
|
|
|
|
|
|
|
|
//editables on first profile page
|
|
|
|
$.fn.editable.defaults.mode = 'inline';
|
|
|
|
$.fn.editableform.loading =
|
|
"<div class='editableform-loading'><i class='ace-icon fa fa-spinner fa-spin fa-2x light-blue'></i></div>";
|
|
|
|
$.fn.editableform.buttons =
|
|
'<button type="submit" class="btn btn-info editable-submit"><i class="ace-icon fa fa-check"></i></button>' +
|
|
|
|
'<button type="button" class="btn editable-cancel"><i class="ace-icon fa fa-times"></i></button>';
|
|
|
|
|
|
|
|
//editables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// *** editable avatar *** //
|
|
|
|
try { //ie8 throws some harmless exceptions, so let's catch'em
|
|
|
|
|
|
|
|
//first let's add a fake appendChild method for Image element for browsers that have a problem with this
|
|
|
|
//because editable plugin calls appendChild, and it causes errors on IE at unpredicted points
|
|
|
|
try {
|
|
|
|
document.createElement('IMG').appendChild(document.createElement('B'));
|
|
|
|
} catch (e) {
|
|
|
|
Image.prototype.appendChild = function(el) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
var last_gritter
|
|
|
|
$('#avatar').editable({
|
|
|
|
type: 'image',
|
|
|
|
name: 'avatar',
|
|
|
|
value: null,
|
|
|
|
//onblur: 'ignore', //don't reset or hide editable onblur?!
|
|
|
|
image: {
|
|
|
|
//specify ace file input plugin's options here
|
|
|
|
btn_choose: 'Change Image',
|
|
|
|
droppable: true,
|
|
|
|
|
|
|
|
maxSize: 660000, //~600Kb
|
|
|
|
|
|
|
|
//and a few extra ones here
|
|
|
|
name: 'photo', //put the field name here as well, will be used inside the custom plugin
|
|
|
|
on_error: function(
|
|
error_type
|
|
) { //on_error function will be called when the selected file has a problem
|
|
|
|
if (last_gritter) $.gritter.remove(last_gritter);
|
|
|
|
if (error_type == 1) { //file format error
|
|
|
|
last_gritter = $.gritter.add({
|
|
|
|
title: 'File is not an image!',
|
|
|
|
text: 'Please choose a jpg|gif|png image!',
|
|
|
|
class_name: 'gritter-error gritter-center'
|
|
|
|
});
|
|
|
|
} else if (error_type == 2) { //file size rror
|
|
|
|
last_gritter = $.gritter.add({
|
|
|
|
title: 'File too big!',
|
|
|
|
text: 'Image size should not exceed 600Kb!',
|
|
|
|
class_name: 'gritter-error gritter-center'
|
|
|
|
});
|
|
|
|
} else { //other error
|
|
|
|
}
|
|
|
|
},
|
|
|
|
on_success: function() {
|
|
|
|
$.gritter.removeAll();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
url: function(params) {
|
|
|
|
// ***UPDATE AVATAR HERE*** //
|
|
|
|
//for a working upload example you can replace the contents of this function with
|
|
|
|
//examples/profile-avatar-update.js
|
|
|
|
|
|
|
|
var deferred = new $.Deferred
|
|
|
|
|
|
|
|
var value = $('#avatar').next().find('input[type=hidden]:eq(0)').val();
|
|
|
|
if (!value || value.length == 0) {
|
|
|
|
deferred.resolve();
|
|
|
|
return deferred.promise();
|
|
|
|
}
|
|
|
|
var formData_object = new FormData();
|
|
|
|
var avatar = '#avatar';
|
|
|
|
var $form = $(avatar).next().find('.editableform:eq(0)')
|
|
|
|
var file_input = $form.find('input[type=file]:eq(0)');
|
|
|
|
$form.find('input[type=file]').each(function() {
|
|
|
|
var field_name = $(this).attr('name');
|
|
|
|
var files = $(this).data('ace_input_files');
|
|
|
|
if (files && files.length > 0) {
|
|
|
|
var clone = $(this).clone();
|
|
|
|
clone.attr('name', 'photo');
|
|
|
|
$("#uploadForm").html(clone);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
//dummy upload
|
|
|
|
setTimeout(function() {
|
|
|
|
if ("FileReader" in window) {
|
|
|
|
//for browsers that have a thumbnail of selected image
|
|
|
|
var thumb = $('#avatar').next().find('img').data(
|
|
'thumb');
|
|
|
|
if (thumb) $('#avatar').get(0).src = thumb;
|
|
|
|
}
|
|
|
|
|
|
|
|
deferred.resolve({
|
|
'status': 'OK'
|
|
});
|
|
|
|
|
|
|
|
if (last_gritter) $.gritter.remove(last_gritter);
|
|
|
|
last_gritter = $.gritter.add({
|
|
|
|
title: 'Image Updated!',
|
|
|
|
text: '',
|
|
|
|
class_name: 'gritter-info gritter-center'
|
|
|
|
});
|
|
|
|
|
|
|
|
}, parseInt(Math.random() * 800 + 800))
|
|
|
|
|
|
|
|
return deferred.promise();
|
|
|
|
|
|
|
|
// ***END OF UPDATE AVATAR HERE*** //
|
|
|
|
},
|
|
|
|
|
|
|
|
success: function(response, newValue) {
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} catch (e) {}
|
|
|
|
|
|
|
|
|
|
|
|
//let's display edit mode by default?
|
|
|
|
var blank_image = true;
|
|
|
|
<?php if (!isset($row['photo']) || $row['photo'] == null) { ?>
|
|
|
|
blank_image = false;
|
|
|
|
<?php } ?>
|
|
|
|
//somehow you determine if image is initially blank or not, or you just want to display file input at first
|
|
|
|
/*if(blank_image) {
|
|
|
|
$('#avatar').editable('show').on('hidden', function(e, reason) {
|
|
|
|
if(reason == 'onblur') {
|
|
|
|
$('#avatar').editable('show');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
$('#avatar').off('hidden');
|
|
|
|
})
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
//another option is using modals
|
|
|
|
/*$('#avatar2').on('click', function(){
|
|
|
|
var modal = '<div class="modal fade">\
|
|
|
|
<div class="modal-dialog">\
|
|
|
|
<div class="modal-content">\
|
|
|
|
<div class="modal-header">\
|
|
|
|
<button type="button" class="close" data-dismiss="modal">×</button>\
|
|
|
|
<h4 class="blue">Change Profile Image</h4>\
|
|
|
|
</div>\
|
|
|
|
\
|
|
|
|
<form class="no-margin">\
|
|
|
|
<div class="modal-body" style="width:100%; height:100%;">\
|
|
|
|
<div class="space-4"></div>\
|
|
|
|
<div style="width:75%; height:80%; margin-left:12%;">';
|
|
|
|
modal+=$("#fileUploadDiv").html();
|
|
|
|
modal+= '</div>\
|
|
|
|
</div>\
|
|
|
|
\
|
|
|
|
<div class="modal-footer center">\
|
|
|
|
<button type="submit" class="btn btn-sm btn-success"><i class="ace-icon fa fa-check"></i> Submit</button>\
|
|
|
|
<button type="button" class="btn btn-sm" data-dismiss="modal"><i class="ace-icon fa fa-times"></i> Cancel</button>\
|
|
|
|
</div>\
|
|
|
|
</form>\
|
|
|
|
</div>\
|
|
|
|
</div>\
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
|
|
|
|
var modal = $(modal);
|
|
|
|
modal.modal("show").on("hidden", function(){
|
|
|
|
modal.remove();
|
|
|
|
});
|
|
|
|
|
|
|
|
var working = false;
|
|
|
|
|
|
|
|
var form = modal.find('form:eq(0)');
|
|
|
|
var file = form.find('input[type=file]').eq(0);
|
|
|
|
file.ace_file_input({
|
|
|
|
style:'well',
|
|
|
|
btn_choose:'Click to choose new Image',
|
|
|
|
btn_change:null,
|
|
|
|
no_icon:'ace-icon fa fa-picture-o',
|
|
|
|
thumbnail:'large',
|
|
|
|
before_remove: function() {
|
|
|
|
//don't remove/reset files while being uploaded
|
|
|
|
return !working;
|
|
|
|
},
|
|
|
|
allowExt: ['jpg', 'jpeg', 'png', 'gif'],
|
|
|
|
allowMime: ['image/jpg', 'image/jpeg', 'image/png', 'image/gif']
|
|
|
|
});
|
|
|
|
|
|
|
|
form.on('submit', function(){
|
|
|
|
if(!file.data('ace_input_files')) return false;
|
|
|
|
|
|
|
|
file.ace_file_input('disable');
|
|
|
|
form.find('button').attr('disabled', 'disabled');
|
|
|
|
form.find('.modal-body').append("<div class='center'><i class='ace-icon fa fa-spinner fa-spin bigger-150 orange'></i></div>");
|
|
|
|
|
|
|
|
var deferred = new $.Deferred;
|
|
|
|
working = true;
|
|
|
|
deferred.done(function() {
|
|
|
|
form.find('button').removeAttr('disabled');
|
|
|
|
form.find('input[type=file]').ace_file_input('enable');
|
|
|
|
form.find('.modal-body > :last-child').remove();
|
|
|
|
|
|
|
|
modal.modal("hide");
|
|
|
|
|
|
|
|
var thumb = file.next().find('img').data('thumb');
|
|
|
|
if(thumb){
|
|
|
|
$('#avatar2').get(0).src = thumb;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
working = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
|
deferred.resolve();
|
|
|
|
} , parseInt(Math.random() * 800 + 800));
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
});*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////
|
|
|
|
|
|
|
|
//right & left position
|
|
|
|
//show the user info on right or left depending on its position
|
|
|
|
$('#user-profile-2 .memberdiv').on('mouseenter touchstart', function() {
|
|
|
|
var $this = $(this);
|
|
|
|
var $parent = $this.closest('.tab-pane');
|
|
|
|
|
|
|
|
var off1 = $parent.offset();
|
|
|
|
var w1 = $parent.width();
|
|
|
|
|
|
|
|
var off2 = $this.offset();
|
|
|
|
var w2 = $this.width();
|
|
|
|
|
|
|
|
var place = 'left';
|
|
|
|
if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) place = 'right';
|
|
|
|
|
|
|
|
$this.find('.popover').removeClass('right left').addClass(place);
|
|
|
|
}).on('click', function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////
|
|
|
|
//change profile
|
|
|
|
$('[data-toggle="buttons"] .btn').on('click', function(e) {
|
|
|
|
var target = $(this).find('input[type=radio]');
|
|
|
|
var which = parseInt(target.val());
|
|
|
|
$('.user-profile').parent().addClass('hide');
|
|
|
|
$('#user-profile-' + which).parent().removeClass('hide');
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////
|
|
|
|
$(document).one('ajaxloadstart.page', function(e) {
|
|
|
|
//in ajax mode, remove remaining elements before leaving page
|
|
|
|
try {
|
|
|
|
$('.editable').editable('destroy');
|
|
|
|
} catch (e) {}
|
|
|
|
$('[class*=select2]').remove();
|
|
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
<script>
|
|
$('.select2').select2()
|
|
</script>
|
|
|
|
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
|
|
<?php include('common_ace.php'); ?>
|
|
|
|
<script>
|
|
function check_existing_emp(field, key_name, value) {
|
|
|
|
if (value == '0' && value == '')
|
|
return;
|
|
|
|
$.ajax({
|
|
url: 'select_patient.php',
|
|
type: 'POST',
|
|
data: {
|
|
key: key_name,
|
|
'key_val': value
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
if (data.length != 0 && data.id != 0 && data.id != null) {
|
|
BootstrapDialog.confirm(
|
|
'Employee Record already exists with given ECode or Aadhar. Press OK to edit existing. Press cancel to change the Aadhar',
|
|
function(result) {
|
|
if (result) {
|
|
var newForm = jQuery('<form>', {
|
|
'action': 'edit_employee_details.php',
|
|
'target': '_top',
|
|
'method': 'POST'
|
|
}).append(jQuery('<input>', {
|
|
'name': 'emp_id',
|
|
'value': data.id,
|
|
'type': 'hidden'
|
|
}));
|
|
newForm.appendTo(document.body)
|
|
newForm.submit();
|
|
|
|
} else {
|
|
field.value = '';
|
|
/*
|
|
$("#update_button").show();
|
|
$("#save_button").hide();
|
|
$("#patient_id").val(data.id);
|
|
$("#father_name").val(data.father_name);
|
|
|
|
$("#patient_name").val(data.patient_name);
|
|
if(data.patient_cat_id==1){
|
|
$("#employee_div").show();
|
|
}else{
|
|
$("#employee_div").hide();
|
|
}
|
|
if(data.emp_cat_id==2){
|
|
$("#emp_sub_category_div").show();
|
|
}else{
|
|
$("#emp_sub_category_div").hide();
|
|
}
|
|
// $("#gender").val(data.gender);
|
|
|
|
|
|
$('input:radio[id=gender][value='+data.gender+']').prop('checked', true);
|
|
|
|
|
|
$("#patient_category").val(data.patient_cat_id);
|
|
$("#emp_code").val(data.emp_code);
|
|
|
|
$("#emp_cadre").val(data.emp_cadre);
|
|
$("#dept").val(data.dept_id);
|
|
// $("#emp_sub_cat").val(data.emp_sub_cat_id);
|
|
$("#employer_contractor_id").val(data.employer_contractor_id);
|
|
$("#emp_designation").val(data.designation_id)
|
|
$("#blood_group").val(data.blood_group);
|
|
$("#manager_emp_id").val(data.emp_mgr_cd);
|
|
$("#has_first_aid").val(data.is_first_aid);
|
|
$("#primary_phone").val(data.primary_phone);
|
|
$("#aadhar_no").val(data.aadhar_no);
|
|
$("#village").val(data.village);
|
|
$("#post").val(data.post);
|
|
$("#ps").val(data.ps);
|
|
$("#tehsil").val(data.tehsil);
|
|
$("#district").val(data.district);
|
|
$("#state").val(data.state);
|
|
$("#pin_code").val(data.pin_code);
|
|
$("#dob").val(myDateFormater(data.dob))
|
|
$("#doj").val(myDateFormater(data.doj))
|
|
$('#employer_contractor_id').select2();
|
|
$('#emp_designation').select2();
|
|
$("#manager_emp_id").select2();*/
|
|
}
|
|
});
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert(" Error Updated Aadhar Details ");
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
function checkAge(ageField, dobField) {
|
|
var age = $("#" + ageField).val();
|
|
|
|
// if($("#"+dobField).val()==''){
|
|
var dobCal = getCalculatedDOBFromAge(age);
|
|
$("#" + dobField).datepicker('setDate', dobCal);
|
|
// }
|
|
}
|
|
|
|
function calculateAge(dobField, ageField) {
|
|
var dob = $("#" + dobField).val();
|
|
|
|
//if(dob!=''){
|
|
var age = getAge(age);
|
|
|
|
$("#" + ageField).val(age);
|
|
|
|
// }
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
// showOrHideForDiv($("#patient_category").val());
|
|
|
|
// function showOrHideForDiv(value) {
|
|
|
|
// // if (value == "1") {
|
|
// // $("#emp_con").hide();
|
|
// // $("#emp_con_label").hide();
|
|
// // }
|
|
|
|
// if (value == "2")
|
|
// $("#employee_div").hide();
|
|
// else
|
|
// $("#employee_div").show();
|
|
|
|
// }
|
|
|
|
function showAndHideDivForSubCat(value) {
|
|
|
|
if (value == 1)
|
|
$("#emp_sub_category_div").hide();
|
|
else
|
|
$("#emp_sub_category_div").show();
|
|
|
|
}
|
|
|
|
|
|
function showField(value) {
|
|
if (value == 'N') {
|
|
$("#danger").hide();
|
|
$("#danger_label").hide();
|
|
|
|
$("#raw_materials").hide();
|
|
$("#raw_materials_label").hide();
|
|
|
|
$("#nature").hide();
|
|
$("#nature_label").hide();
|
|
}
|
|
if (value == 'Y') {
|
|
$("#danger").show();
|
|
$("#danger_label").show();
|
|
|
|
$("#raw_materials").show();
|
|
$("#raw_materials_label").show();
|
|
|
|
$("#nature").show();
|
|
$("#nature_label").show();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function showMail(value) {
|
|
let id = value;
|
|
|
|
if (id.startsWith("5")) {
|
|
$("#mail_label").hide();
|
|
$('#mail').hide();
|
|
}
|
|
if (id.startsWith("6") || id.startsWith("7")) {
|
|
$("#mail_label").show();
|
|
$('#mail').show();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function myDateFormater(myDate) {
|
|
|
|
var d = new Date(myDate);
|
|
|
|
var m = d.getMonth() + 1;
|
|
|
|
var y = d.getFullYear();
|
|
|
|
var date = d.getDate();
|
|
|
|
// alert(date+"/"+m+"/"+y);
|
|
|
|
return date + "/" + m + "/" + y;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* $(document).ready(function(e){
|
|
|
|
$("#employee_form").on('submit', function(e){
|
|
|
|
e.preventDefault();
|
|
|
|
$.ajax({
|
|
|
|
type: 'POST',
|
|
|
|
url: 'save_patient.php',
|
|
|
|
data: new FormData(this),
|
|
|
|
contentType: false,
|
|
|
|
cache: false,
|
|
|
|
processData:false,
|
|
|
|
beforeSend: function(){
|
|
|
|
// $('.submitBtn').attr("disabled","disabled");
|
|
|
|
//$('#fupForm').css("opacity",".5");
|
|
|
|
},
|
|
|
|
success: function(msg){
|
|
|
|
|
|
if(msg=="success")
|
|
BootstrapDialog.alert('Patient Saved Successfully.');
|
|
|
|
|
|
|
|
$('.close').click();
|
|
|
|
|
|
|
|
return;
|
|
|
|
},
|
|
|
|
error : function(data) {
|
|
|
|
BootstrapDialog.alert('Error Saving Patient');
|
|
|
|
$('.close').click();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});*/
|
|
|
|
|
|
|
|
function save_employee() {
|
|
|
|
var patient_name = $('#patient_name').val();
|
|
|
|
if (patient_name == '') {
|
|
|
|
BootstrapDialog.alert('Please Enter Patient Name.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var dob = $('#dob').val();
|
|
|
|
|
|
|
|
if (dob == '01/01/1970') {
|
|
|
|
BootstrapDialog.alert('Please Enter Date Of Birth.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
// var emp_code = $('#emp_code').val();
|
|
|
|
// if (emp_code == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Emp Code.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// if ($('#aadhar_no').val().length != 0) {
|
|
// if ($('#aadhar_no').val().length != 12) {
|
|
// BootstrapDialog.alert('Please Enter 12 Digit Aadhar no.!!!');
|
|
// return false;
|
|
// }
|
|
// }
|
|
var aadhar_no = $('#aadhar_no').val();
|
|
|
|
if (aadhar_no == '') {
|
|
|
|
BootstrapDialog.alert('Please Enter National Identity.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
// var primary_phone = $('#primary_phone').val();
|
|
|
|
// if (primary_phone == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Phone number.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
// if ($('#primary_phone').val().length != 0) {
|
|
// if ($('#primary_phone').val().length != 10) {
|
|
// BootstrapDialog.alert('Please Enter 10 Digit Phone no.!!!');
|
|
// return false;
|
|
// }
|
|
// }
|
|
|
|
// var patient_category = $('#patient_category').val();
|
|
var primary_patient = $('#primary_patient').val();
|
|
|
|
// if(patient_category == <?= $non_emp ?>){
|
|
// if(primary_patient=='' || primary_patient== NULL){
|
|
// BootstrapDialog.alert('Please Select Associated Employee');
|
|
// return false;
|
|
// }
|
|
// }
|
|
// var offiial_email = $('#offiial_email').val();
|
|
|
|
// if (offiial_email == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Official Email.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
// if ($('#aadhar_no').val() == '') {
|
|
// BootstrapDialog.alert('Please Enter Aadhar no.!!!');
|
|
// return false;
|
|
// }
|
|
|
|
// if ($('#primary_phone').val() == '') {
|
|
// BootstrapDialog.alert('Please Enter Phone no.!!!');
|
|
// return false;
|
|
// }
|
|
|
|
|
|
// var fathername = $('#father_name').val();
|
|
|
|
// if (fathername == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Patient Father Name.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// var dob = $('#dob').val();
|
|
|
|
// if (dob == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter DOB.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// var doj = $('#doj').val();
|
|
|
|
// if (doj == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter DOJ.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// var designationid = $('#designationid').val();
|
|
|
|
// if (designationid == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Designation Id.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// var emp_code = $('#emp_code').val();
|
|
|
|
// if (emp_code == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Employee Code.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// var emp_type_id = $('#emp_type_id').val();
|
|
|
|
// if (emp_type_id == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Employee Type Id.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
/* var bu_id = $('#bu_id').val();
|
|
|
|
if(bu_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Bu Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var sbu_id = $('#sbu_id').val();
|
|
|
|
if(sbu_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter SBU Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var section_id = $('#section_id').val();
|
|
|
|
if(section_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Section Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var sub_section_id = $('#sub_section_id').val();
|
|
|
|
if(sub_section_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Sub Section Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var mgr_emp_id = $('#mgr_emp_id').val();
|
|
|
|
if(mgr_emp_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Manager.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var gender = $('#gender').val();
|
|
|
|
if(gender == ''){
|
|
|
|
BootstrapDialog.alert('Please Select Gender.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var address = $('#address').val();
|
|
|
|
if(address == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Address.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(aadhar_no == ''){
|
|
|
|
BootstrapDialog.alert('Please Aadhar No.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var blood_group = $('#blood_group').val();
|
|
|
|
if(blood_group == ''){
|
|
|
|
BootstrapDialog.alert('Please Select Blood Group.!!!');
|
|
|
|
return false;
|
|
|
|
}*/
|
|
var checkup_header = []
|
|
var checup_headers = "";
|
|
$(".chk:checked").each(function() {
|
|
checup_headers = checup_headers.concat($(this).val(), ",");
|
|
checkup_header.push($(this).val());
|
|
|
|
});
|
|
$("#checkup_header_val").val(checup_headers.substring(0, checup_headers.length - 1));
|
|
|
|
$.ajax({
|
|
|
|
type: 'POST',
|
|
|
|
url: 'save_patient.php',
|
|
|
|
data: new FormData(document.getElementById("employee_form")),
|
|
contentType: false,
|
|
processData: false,
|
|
|
|
|
|
success: function(data) {
|
|
// alert(data);
|
|
data = JSON.parse(data);
|
|
if (data.id != "" && data.id != null) {
|
|
BootstrapDialog.confirm(
|
|
'Patient Record Added Successfully. Press OK to add additional details.',
|
|
function(result) {
|
|
if (result) {
|
|
var newForm = jQuery('<form>', {
|
|
'action': 'edit_employee_details.php',
|
|
'target': '_top',
|
|
'method': 'POST'
|
|
}).append(jQuery('<input>', {
|
|
'name': 'emp_id',
|
|
'value': data.id,
|
|
'type': 'hidden'
|
|
}));
|
|
newForm.appendTo(document.body)
|
|
newForm.submit();
|
|
}
|
|
});
|
|
} else if (data.patient_id != "" && data.patient_id != null) {
|
|
$("#patient_id").val(data.patient_id)
|
|
BootstrapDialog.confirm(
|
|
'Patient Record Added Successfully. Press OK to add additional details.',
|
|
function(result) {
|
|
if (result) {
|
|
var newForm = jQuery('<form>', {
|
|
'action': 'edit_employee_details.php',
|
|
'target': '_top',
|
|
'method': 'POST'
|
|
}).append(jQuery('<input>', {
|
|
'name': 'emp_id',
|
|
'value': data.patient_id,
|
|
'type': 'hidden'
|
|
}));
|
|
newForm.appendTo(document.body)
|
|
newForm.submit();
|
|
}
|
|
});
|
|
}
|
|
|
|
//$("#flex1").flexReload();
|
|
|
|
$('.close').click();
|
|
|
|
return;
|
|
|
|
},
|
|
|
|
error: function(data) {
|
|
|
|
BootstrapDialog.alert('Error In Saving Patient');
|
|
|
|
$('.close').click();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#doj').datepicker({
|
|
|
|
autoclose: true,
|
|
|
|
|
|
|
|
format: 'dd/mm/yyyy',
|
|
|
|
//startDate: '1d/1m/2000y',
|
|
|
|
endDate: 'current',
|
|
|
|
todayHighlight: true,
|
|
|
|
|
|
|
|
}).next().on(ace.click_event, function() {
|
|
|
|
$(this).prev().focus();
|
|
|
|
});
|
|
|
|
$('#dob').datepicker({
|
|
|
|
autoclose: true,
|
|
|
|
format: 'dd/mm/yyyy',
|
|
|
|
//startDate: '1d/1m/1970y',
|
|
|
|
|
|
}).next().on(ace.click_event, function() {
|
|
|
|
$(this).prev().focus();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
function reloadDocsTable() {
|
|
|
|
$("#uploadDocs").load(location.href + " #uploadDocs");
|
|
}
|
|
|
|
function deletedocs(docsId) {
|
|
$("#flex_docs_id").val(docsId);
|
|
var id = $("#flex_docs_id").val();
|
|
//alert(id);
|
|
BootstrapDialog.confirm('Are you sure to delete the Docs?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_docs.php?docsId=' + docsId + ' ',
|
|
type: "POST",
|
|
|
|
success: function(data) {
|
|
|
|
if (data = "Docs Saved") {
|
|
BootstrapDialog.alert('Docs Deleted Successfully.');
|
|
$("#uploadDocs").load(location.href + " #uploadDocs");
|
|
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting Docs');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting Docs');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
</script>
|
|
<script>
|
|
var questionnaire_section_name = [];
|
|
|
|
function get_section_id() {
|
|
|
|
<?php
|
|
$sql_section = "select * from questionnaire_section order by section_id asc";
|
|
$result_section = mysqli_query($conn, $sql_section);
|
|
$i = 0;
|
|
while ($row_section = mysqli_fetch_assoc($result_section)) {
|
|
?>
|
|
|
|
if (document.getElementById('<?php echo $row_section['section_description'] ?>').checked) {
|
|
questionnaire_section_name.push(document.getElementById(
|
|
'<?php echo $row_section['section_description'] ?>').name);
|
|
//alert(checkup_section_name);
|
|
}
|
|
<?php $i++;
|
|
} ?>
|
|
$("#questionnaire_section_ids").val(questionnaire_section_name);
|
|
//alert(questionnaire_section_name);
|
|
/* checkup_section_name.push(section_name);
|
|
$("#checkup_section_ids").val(checkup_section_name);
|
|
alert(checkup_section_name); */
|
|
}
|
|
|
|
active_questionnaire();
|
|
|
|
function active_questionnaire() {
|
|
var page =
|
|
<?php if ($_REQUEST['page'] != null or $_REQUEST['page'] != "") {
|
|
echo $_REQUEST['page'];
|
|
} else {
|
|
echo "2";
|
|
} ?>;
|
|
//alert(page);
|
|
if (page == "checkup") {
|
|
$("#questionnaire").addClass("in active");
|
|
$("#edit-basic").removeClass("in active");
|
|
$("#questionnaireTab").addClass("active");
|
|
$("#basic").removeClass("active");
|
|
}
|
|
|
|
}
|
|
|
|
function checkPatient() {
|
|
if ($("#patient_id").val() == '') {
|
|
// $("#fieldsetBtn").prop("disabled", true);
|
|
//}else{
|
|
//$("#fieldsetBtn").prop("disabled", false);
|
|
}
|
|
}
|
|
/*function navigateReceptionist(){
|
|
|
|
|
|
var task=$("#task").val();
|
|
var patientId=$("#patient_id").val();
|
|
if(task!=null && task!='' ){
|
|
if(task=='opd' && patientId!=null && patientId!=''){
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'opd_form.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if(task=='injury' && patientId!=null && patientId!=''){
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'injury_form.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if((task=='ime_long' ||task=='ime_short' || task== 'pme' || task== 'shutdown' || task=='ame_greater_40' || task=='semi_annual') && patientId!=null && patientId!=''){
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
if(task=='pme'){
|
|
$("#employee_form").attr('action', 'add_patient_details_pme.php');
|
|
}else if(task=='ame_greater_40'){
|
|
$("#employee_form").attr('action', 'add_patient_details.php');
|
|
}else if(task=='ime_short'){
|
|
$("#employee_form").attr('action', 'add_patient_details_short_term.php');
|
|
}else if(task=='ime_long'){
|
|
$("#employee_form").attr('action', 'add_patient_details_ime_long_term.php');
|
|
}else if(task=='semi_annual'){
|
|
$("#employee_form").attr('action', 'add_patient_details_ame_less_40.php');
|
|
}else if(task=='shutdown'){
|
|
$("#employee_form").attr('action', 'add_patient_details.php');
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#employee_form").submit();
|
|
}
|
|
if(task=='sickness' && patientId!=null && patientId!=''){
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'sickness.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
|
|
if(task=='fitness' && patientId!=null && patientId!=''){
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'sickness.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
}
|
|
|
|
}*/
|
|
|
|
|
|
$('#new_employee_contractor').click(function() {
|
|
$("#employee_form").submit(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
|
|
$(".save_button").show();
|
|
$("#id").val("");
|
|
$("#employer_contractor").val("");
|
|
|
|
$("#remarks").val("");
|
|
|
|
$('#modal-add-employer-contractor').modal("show");
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
function save_employer_contractor() {
|
|
|
|
$.ajax({
|
|
url: 'save_employer_contractor.php',
|
|
type: "POST",
|
|
data: $("#employer-contractor_form").serialize(),
|
|
success: function(data) {
|
|
setEmployeeContractorList();
|
|
BootstrapDialog.alert('employer / Contractor Saved Successfully.');
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Saving employer / Contractor');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
function setEmployeeContractorList() {
|
|
|
|
$.ajax({
|
|
url: 'select_employee_contractor_list.php',
|
|
type: "POST",
|
|
async: 'false',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var content = "";
|
|
if (data != null && data != "") {
|
|
for (var i = 0; i < data.length; i++) {
|
|
content = content + "<option value=" + data[i].id + ">" + data[i]
|
|
.employer_contractor_name + "</option>"
|
|
}
|
|
$("#employer_contractor_id").html(content);
|
|
$('.select2').select2()
|
|
}
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Fetching Employeer Contractor ');
|
|
return;
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function open_employer_contractor(id, action) {
|
|
|
|
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url: 'select_employer_contrator.php',
|
|
type: 'POST',
|
|
data: {
|
|
id: id
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
|
|
$("#id").val(data.id);
|
|
$("#employer_contractor").val(data.employer_contractor_name);
|
|
|
|
$("#remarks").val(data.employer_contractor_desc);
|
|
|
|
|
|
|
|
$('#modal-add-employer-contractor').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Patient Category');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
$('#new_employee_designation').click(function() {
|
|
$("#employee_form").submit(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
$(".save_button").show();
|
|
$("#designation_id").val("");
|
|
$("#designation_name").val("");
|
|
$("#designation_desc").val("");
|
|
|
|
$('#modal-add-designation').modal("show");
|
|
});
|
|
|
|
function save_designation() {
|
|
$.ajax({
|
|
url: 'save_designation.php',
|
|
type: "POST",
|
|
data: $("#designation_form").serialize(),
|
|
success: function(data) {
|
|
setDesignationList();
|
|
BootstrapDialog.alert('Designation Saved Successfully.');
|
|
|
|
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Designation');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
function setDesignationList() {
|
|
|
|
$.ajax({
|
|
url: 'select_designation_list.php',
|
|
type: "POST",
|
|
async: 'false',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var content = "";
|
|
if (data != null && data != "") {
|
|
for (var i = 0; i < data.length; i++) {
|
|
content = content + "<option value=" + data[i].designation_id + ">" + data[
|
|
i]
|
|
.designation_name + "</option>"
|
|
}
|
|
$("#emp_designation").html(content);
|
|
$('.select2').select2()
|
|
}
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Fetching Employeer Contractor ');
|
|
return;
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function addFamilyMembersRow() {
|
|
|
|
$("#employee_form").submit(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
|
|
var count = parseInt($("#rowCount").val());
|
|
|
|
|
|
|
|
var table = document.getElementById("familyMembersTable");
|
|
|
|
|
|
|
|
var rowCount = table.rows.length;
|
|
|
|
var newRow = table.insertRow(rowCount);
|
|
|
|
|
|
|
|
var content = "";
|
|
|
|
content += "<td>" + (count + 1) + "</td>"
|
|
|
|
+
|
|
"<td><input type=\"text\" name=\"name" + count + "\" id=\"name" + count +
|
|
"\" onkeyup=\"this.value = this.value.toUpperCase();\" class=\"form-control\"/></td>"
|
|
|
|
+
|
|
"<td><input type=\"number\" id=\"age" + count + "\" name=\"age" + count +
|
|
"\" class=\"form-control\"/></td>"
|
|
|
|
+
|
|
"<td><select class=\"form-control\" name=\"gender" + count + "\" id=\"gender" + count + "\">"
|
|
|
|
+
|
|
"<option selected disabled>--Select Gender</option>"
|
|
|
|
+
|
|
" <option value=\"M\">Male</option>"
|
|
|
|
+
|
|
" <option value=\"F\">Female</option>"
|
|
|
|
+
|
|
" <option value=\"O\">Others</option>"
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
"</select></td><td><select class=\"form-control\" name=\"relation_type" + count +
|
|
"\" id=\"relation_type" + count + "\" >"
|
|
|
|
|
|
+
|
|
"<option selected disabled>--Select Relation--</option><option value=\"Spouse\">Spouse</option><option value=\"Son\">Son</option><option value=\"Daughter\">Daughter</option>" +
|
|
"<option value=\"Mother\">Mother</option><option value=\"Father\">Father</option></select></td>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
"<td><a href=\"#\" onclick=\"deleteFamilyMembersRow(" + count +
|
|
")\"><span class=\"glyphicon glyphicon-trash\"></span> </a></td>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(newRow).append(content);
|
|
|
|
$(newRow).attr("id", "familyMembersTableRow" + count);
|
|
|
|
$("#rowCount").val(++count);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteFamilyMembersRow(count) {
|
|
|
|
$("#familyMembersTableRow" + count).remove();
|
|
|
|
$("#rowCount").val(count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function myDateFormater(myDate) {
|
|
|
|
var d = new Date(myDate);
|
|
|
|
var m = d.getMonth() + 1;
|
|
|
|
var y = d.getFullYear();
|
|
|
|
var date = d.getDate();
|
|
|
|
// alert(date+"/"+m+"/"+y);
|
|
|
|
return date + "/" + m + "/" + y;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
function open_medical_pdf(page, medical_exam_id) {
|
|
$("#medical_exam_id").val(medical_exam_id);
|
|
$("#flex_medical_form_pdf").attr('method', 'POST');
|
|
$("#flex_medical_form_pdf").attr('action', page);
|
|
$("#flex_medical_form_pdf").submit();
|
|
}
|
|
|
|
function open_appointment_pdf(page, appointtment_id) {
|
|
$("#appointment_id_pdf").val(appointtment_id);
|
|
$("#flex_opd_injury_pdf").attr('method', 'POST');
|
|
$("#flex_opd_injury_pdf").attr('action', page);
|
|
$("#flex_opd_injury_pdf").submit();
|
|
}
|
|
</script>
|
|
<form style="display: none" name="flex_medical_form_pdf" method="post" action="" target="_blank" id="flex_medical_form_pdf">
|
|
|
|
<input type="hidden" name="medical_exam_id" id="medical_exam_id">
|
|
</form>
|
|
|
|
<form style="display: none" name="flex_opd_injury_pdf" method="post" action="" target="_blank" id="flex_opd_injury_pdf">
|
|
|
|
<input type="hidden" name="appointment_id_pdf" id="appointment_id_pdf">
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php include('form/add_designation.php'); ?>
|
|
<?php include('form/employer_contractor_form.php'); ?>
|