4880 lines
268 KiB
PHP
4880 lines
268 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>
|
|
<!-- End of breadcrumb -->
|
|
<?php
|
|
$emp_id = $_REQUEST['emp_id'];
|
|
// echo $id;
|
|
$query = "select * from patient_master where id = " . $emp_id . " ";
|
|
//echo $query;
|
|
if (!$result = @mysqli_query($conn, $query)) {
|
|
exit(mysqli_error($conn));
|
|
} else {
|
|
$row = @mysqli_fetch_array($result);
|
|
@extract($row);
|
|
}
|
|
?>
|
|
<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" <?php if ($_REQUEST['active'] == '' || $_REQUEST['active'] == null || $_REQUEST['active'] == 'edit-basic') echo '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> Mediclaim
|
|
</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="docsTab" <?php if ($_REQUEST['active'] == 'docsTab') echo 'class="active"'; ?>><a data-toggle="tab" href="#uploadDocs"> <i class="red ace-icon fa fa-upload bigger-120"></i> Documents
|
|
</a></li>
|
|
<li id="medicalExaminationHistroyTab" <?php if ($_REQUEST['active'] == 'medicalExaminationHistroyTab') echo 'class="active"'; ?>><a data-toggle="tab" href="#medicalExaminationHistroy"> <i class="red ace-icon fa fa-upload bigger-120"></i> Medical Exam
|
|
History
|
|
</a></li>
|
|
<!-- <li id="pastAndPresentIllnessTab"><a data-toggle="tab" href="#pastAndPresentIllness"> <i class="red ace-icon fa fa-upload bigger-120"></i>Past &
|
|
Present Illness History
|
|
</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="opdandinjuryTab"><a data-toggle="tab" href="#opdandinjury"> <i class="red ace-icon fa fa-upload bigger-120"></i>Illness & Injury
|
|
</a></li>
|
|
|
|
<!-- <li id="sicknessTab"><a data-toggle="tab" href="#sickness"> <i class="red ace-icon fa fa-bed bigger-130"></i>Sickness
|
|
</a>
|
|
</li> -->
|
|
|
|
<li id="problemdetailTab"><a data-toggle="tab" href="#problemdetail"> <i class="red ace-icon fa fa-exclamation-triangle bigger-130"></i>Chronic Illness
|
|
</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 <?php if ($_REQUEST['active'] == '' || $_REQUEST['active'] == null || $_REQUEST['active'] == 'edit-basic') echo 'in active'; ?> ">
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
<!--
|
|
<button align="center" type="button" id="printPageButton"
|
|
class="btn btn-success" onClick="printDiv('edit-basic')">Print</button> -->
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-2" style="display: flex;">
|
|
<span class="profile-picture">
|
|
<?php if (isset($row['emp_photo']) && $row['emp_photo'] != null) { ?>
|
|
<img class="editable img-responsive" id="avatar" src="data:<?php echo $row['emp_image_type'] ?>;base64,<?php echo base64_encode($row['emp_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 <span style="color: red">*</span></label>
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
</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>
|
|
|
|
<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" checked> <span class="lbl middle">
|
|
Male</span>
|
|
</label> <label class="inline"> <input name="gender" id="gender" value="F" type="radio" class="ace">
|
|
<span class="lbl middle"> Female</span>
|
|
</label> <label class="inline"> <input name="gender" id="gender" value="O" type="radio" 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">Age/Birth Date <span style="color: red">*</span></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="form-field-comment">Is Disabled Person</label>
|
|
|
|
<div class="col-sm-4">
|
|
<select class="form-control" name="has_disabled" id="has_disabled">
|
|
<option disabled selected>Please select option</option>
|
|
<option value="0" <?php if ($row['is_disabled'] == "0") echo 'selected' ?>>
|
|
No</option>
|
|
<option value="1" <?php if ($row['is_disabled'] == "1") echo 'selected' ?>>
|
|
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">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">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', $blood_group, ''); ?>
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- <label id="emp_con_label" class="col-sm-2 control-label no-padding-right" for="form-field-comment">Employer/Contractor </label>
|
|
<div class="col-sm-4" id="emp_con"> -->
|
|
<!-- <div class="input-group" class="col-sm-2"> -->
|
|
<!-- <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', $employer_contractor_id, ''); ?>
|
|
</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', $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">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 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', $employer_contractor_id, ''); ?>
|
|
</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" name="bussiness_unit"
|
|
id="bussiness_unit">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('bussiness_unit', 'bu_name', 'bu_id', $bu_id, ''); ?>
|
|
</select>
|
|
</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" name="dept" id="dept">
|
|
<option value="" selected disabled></option>
|
|
<?php echo generateOption('department', 'dept_name', 'dept_id', $dept_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" name="sub_section"
|
|
id="sub_section">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('sub_section', 'sub_section_name', 'sub_section_id', $sub_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" name="emp_cadre"
|
|
id="emp_cadre">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('emp_cadre', 'emp_cadre', 'emp_cadre_id', $emp_cadre, ''); ?>
|
|
</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">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('section', 'section_name', 'section_id', $section_id, ''); ?>
|
|
|
|
</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', $designation_id, ''); ?>
|
|
</select>
|
|
|
|
</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', $dept_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">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">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" <?php if ($row['is_first_aid'] == "0") echo 'selected' ?>>
|
|
No</option>
|
|
<option value="1" <?php if ($row['is_first_aid'] == "1") echo 'selected' ?>>
|
|
Yes</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<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">
|
|
|
|
<?php error_log("JOINING DATE:" . $doj);
|
|
|
|
$joining_date = "";
|
|
|
|
if ($doj == "0000-00-00") {
|
|
$joining_date = "NA";
|
|
} else {
|
|
$joining_date = date("d/m/Y", strtotime($doj));
|
|
} ?>
|
|
|
|
<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)" value="<?php echo $joining_date; ?>"> <span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
</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">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" value="<?php echo $aadhar_no; ?>">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<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="tel" id="primary_phone" name="primary_phone" placeholder="Enter Phone No" value="<?php echo $primary_phone; ?>">
|
|
|
|
|
|
</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="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" value="<?php echo $offiial_email_id; ?>">
|
|
|
|
</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" <?php if ($row['is_ohc_staff'] == "1") echo "selected" ?>>
|
|
Yes
|
|
</option>
|
|
<option value="0" <?php if ($row['is_ohc_staff'] == "0") echo "selected" ?>>
|
|
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">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 if ($row['status'] == "Inactive") echo 'selected' ?>>
|
|
Inactive </option>
|
|
<option value="Active" <?php if ($row['status'] == "Active") echo 'selected' ?>>
|
|
Active </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">OHC Location</label>
|
|
|
|
<div class="col-sm-4">
|
|
<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>
|
|
|
|
<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" value="<?php echo $row['passport']?>" placeholder="Enter Passport Number" onchange="check_existing_emp(this,'passport',this.value)">
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<!-- END OF EMPLOYEE DIV -->
|
|
|
|
|
|
<div class="row" style="margin: 5px;">
|
|
|
|
<div id="user-profile-3">
|
|
|
|
<h5 class="header blue bolder smaller" style="margin: 10px 20px;">
|
|
Signature</h5>
|
|
<div id="user-profile-1" class="user-profile row">
|
|
<div class="col-xs-12 center">
|
|
<span class="profile-picture">
|
|
<?php if (isset($row['emp_sign']) && $row['emp_sign'] != null) { ?>
|
|
<img class="editable img-responsive" id="avatar2" src="data:<?php echo $row['image_type'] ?>;base64,<?php echo base64_encode($row['emp_sign']) ?>" style="display: block; width: 180px; height: 100px;" />
|
|
|
|
<?php } else { ?>
|
|
<img class="editable img-responsive" alt="Doctor Signature" id="avatar2" src="images/no_image.png" style="display: block; width: 180px; height: 100px;" />
|
|
<?php } ?>
|
|
</span>
|
|
<div class="space space-4"></div>
|
|
<div class="hide" id="uploadForm2"></div>
|
|
</div>
|
|
|
|
</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="<?php echo $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="<?php echo $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="<?php echo $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="<?php echo $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="<?php echo $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="<?php echo $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="number" id="pin_code" name="pin_code" placeholder="Enter Pin Code" value="<?php echo $pin_code ?>"> <input type="hidden" id="task" name="task" value="<?php echo $_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>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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>
|
|
|
|
<form id="ambulance_form" method="post">
|
|
|
|
<div class="box-body">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<table id="myTable" class="table table-bordered order-list" style=" border-bottom: hidden;">
|
|
<thead>
|
|
<tr>
|
|
<th style="display:none">S.No.</th>
|
|
<th>Disease Name</th>
|
|
<th style="border-top:hidden;border-bottom:hidden;;background-color: white;">
|
|
</th>
|
|
<th>1st Dose</th>
|
|
<th> Vaccine center
|
|
<th style="border-top:hidden;border-bottom:hidden;;background-color: white;">
|
|
</th>
|
|
<th>2nd Dose</th>
|
|
<th> Vaccine center
|
|
<th style="border-top:hidden;border-bottom:hidden; background-color: white;">
|
|
</th>
|
|
<th>3rd Dose</th>
|
|
<th>Vaccine center
|
|
<th style="border-top:hidden;border-bottom:hidden;;background-color: white;">
|
|
</th>
|
|
<th>Remarks</th>
|
|
<th style="border-top:hidden;border-bottom:hidden;border-right:hidden ;background-color: white;">
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr>
|
|
<td style="width: 2%;display:none"><input type="text" name="vac_id0" id="vac_id0" value="" />
|
|
<div class="input-group">
|
|
<label></label>
|
|
</div>
|
|
</td>
|
|
<td style="width: 8%"><select class="form-control" name="vac_name0" id="vac_name0" value="">
|
|
<option value="" disabled selected>
|
|
Select
|
|
</option>
|
|
<?php echo generateOption('vaccine_master', 'vaccine_name', 'id', '', ''); ?>
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td style="width: 1%;border-top:hidden;border-bottom:hidden;">
|
|
</td>
|
|
<td style="width: 8%"><input type="date" name="dose1_0" value="" id="dose1_0" class="form-control" />
|
|
</td>
|
|
<td style="width: 10%"><input type="text" name="vac_center1_0" value="" id="vac_center1_0" class="form-control" />
|
|
</td>
|
|
|
|
<td style="width: 1% ;border-top:hidden;border-bottom:hidden;">
|
|
</td>
|
|
<td style="width: 8%"><input type="date" name="dose2_0" value="" id="dose2_0" class="form-control" />
|
|
</td>
|
|
<td style="width: 10%"> <input type="text" name="vac_center2_0" value="" id="vac_center2_0" class="form-control" />
|
|
</td>
|
|
|
|
<td style="width: 1%;border-top:hidden;border-bottom:hidden;">
|
|
</td>
|
|
<td style="width: 8%"><input type="date" name="dose3_0" value="" id="dose3_0" class="form-control" />
|
|
</td>
|
|
<td style="width: 10%"><input type="text" name="vac_center3_0" value="" id="vac_center3_0" class="form-control" />
|
|
</td>
|
|
|
|
|
|
<td style="width: 1% ;border-top:hidden;border-bottom:hidden;">
|
|
</td>
|
|
<td style="width: 10%"><input type="text" name="remarks0" value="" id="remarks0" class="form-control" />
|
|
</td style="">
|
|
|
|
<td style="width: 10%;border-top:hidden;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" class="btn btn-sm btn-block " id="addrow" value="Add Row" />
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<input type="hidden" name="vaccine_count_items" id="vaccine_count_items" value="1" />
|
|
<input type="hidden" name="s_no" id="s_no" value="" />
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
<div class="box-footer" style="text-align: center">
|
|
<button class="btn btn-primary" style="margin-right: 150px;" 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>
|
|
|
|
</div>
|
|
<form id="vac_form" method="post">
|
|
|
|
<div class="table-responsive" align='center' style=" text-align: center; width: 90%;">
|
|
<?php $vac_select_query = "select * from vaccination_details where emp_id=" . $_REQUEST['emp_id'] . " ";
|
|
$vac_result = @mysqli_query($conn, $vac_select_query);
|
|
$no_of_vac = @mysqli_num_rows($vac_result);
|
|
?>
|
|
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">
|
|
Vaccination's
|
|
</h4>
|
|
<table class="table table-bordered" id='vaccination_details_table' style="width: 100%">
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:center">S.No.</th>
|
|
<th style="text-align:center">Disease Name</th>
|
|
<th style="text-align:center">1st Vaccine Dose</th>
|
|
<th style="text-align:center">1st Vaccine Center</th>
|
|
<th style="text-align:center">2nd Vaccine Dose</th>
|
|
<th style="text-align:center">2nd Vaccine Center</th>
|
|
<th style="text-align:center">3rd Vaccine Dose</th>
|
|
<th style="text-align:center">3rd Vaccine Center</th>
|
|
<th style="text-align:center">Remarks</th>
|
|
<th style="text-align:center"></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
|
|
<?php if ($no_of_vac == 0) { ?>
|
|
|
|
|
|
<tr>
|
|
<td align='center' colspan='9'>No Files Found</td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
<?php
|
|
|
|
$count = 0;
|
|
while ($row_vac = mysqli_fetch_array($vac_result)) {
|
|
?>
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="center"><?php echo $count + 1 ?>
|
|
</td>
|
|
<td align="left">
|
|
<?php echo getTableFieldValue('vaccine_master', 'vaccine_name', 'id', $row_vac['vac_id']) ?>
|
|
</td>
|
|
<td align="center">
|
|
<?php if ($row_vac['vac_d1'] == '0000-00-00') {
|
|
echo '';
|
|
} else {
|
|
$dose1 = new DateTime($row_vac['vac_d1']);
|
|
$dose1_result = $dose1->format('d-m-Y');
|
|
echo $dose1_result;
|
|
} ?>
|
|
</td>
|
|
<td align="left">
|
|
<?php echo $row_vac['vac_center1'] ?>
|
|
|
|
</td>
|
|
<td align="center">
|
|
<?php if ($row_vac['vac_d2'] == '0000-00-00') {
|
|
echo '';
|
|
} else {
|
|
$dose2 = new DateTime($row_vac['vac_d2']);
|
|
$dose2_result = $dose2->format('d-m-Y');
|
|
echo $dose2_result;
|
|
} ?>
|
|
</td>
|
|
<td align="left">
|
|
<?php echo $row_vac['vac_center2'] ?>
|
|
|
|
</td>
|
|
<td align="center">
|
|
<?php if ($row_vac['vac_d3'] == '0000-00-00') {
|
|
echo '';
|
|
} else {
|
|
$dose3 = new DateTime($row_vac['vac_d3']);
|
|
$dose3_result = $dose3->format('d-m-Y');
|
|
echo $dose3_result;
|
|
} ?>
|
|
</td>
|
|
<td align="left">
|
|
<?php echo $row_vac['vac_center3'] ?>
|
|
|
|
</td>
|
|
|
|
<td align="left">
|
|
<?php echo $row_vac['remarks'] ?>
|
|
|
|
</td>
|
|
|
|
<td align="center">
|
|
<div style="text-align: left; width: 117.99px;">
|
|
<a href="#" class="green" onclick="open_vaccine_details('<?= $row_vac['id'] ?>','V');">
|
|
<i class="ace-icon fa fa-search-plus bigger-130">
|
|
</i>
|
|
</a>
|
|
|
|
<a href="#" class="blue" onclick="open_vaccine_details('<?= $row_vac['id'] ?>','E');">
|
|
<i class="ace-icon fa fa-pencil bigger-130">
|
|
</i>
|
|
</a>
|
|
|
|
<a href="#" class="red" onclick="delete_vaccine_details('<?= $row_vac['id'] ?>','E');">
|
|
|
|
<i style="font-size: 20px;" class="ace-icon fa fa-trash-o bigger-130">
|
|
</i>
|
|
</a>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php $count++;
|
|
} ?>
|
|
</table>
|
|
<table style="width: 50%;" class="table table-bordered">
|
|
|
|
|
|
|
|
<tr style="border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="sort" value="sort" onclick="showFilter(this.value)" />
|
|
</td>
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="search" value="search" onclick="showFilter(this.value)" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" style="border-bottom:hidden;border-right:hidden;border-left:hidden">
|
|
<h4 align='center' id="selected_filter" style="display:none">
|
|
<strong>Please
|
|
Select For<input type='text' name='filterOf' id="filterOf" style="border:hidden;text-align:left;font-size: 15px;width: 70px;">
|
|
|
|
</strong>
|
|
</h4>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr style=" border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<td colspan="3" style="width: 8%;border-top:hidden;border-bottom:hidden; border-left:hidden;border-right:hidden">
|
|
<select class="form-control" onchange="getShowingData()" name="sort_filter" style="display: none;" id="sort_filter">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="vaccine_name">
|
|
Vaccine Name</option>
|
|
<option value="vac_center1">
|
|
1st Vaccine Center</option>
|
|
<option value="vac_center2">
|
|
2nd Vaccine Center</option>
|
|
<option value="vac_center3">
|
|
3rd Vaccine Center</option>
|
|
<option value="vac_d1">
|
|
1st vaccination date</option>
|
|
<option value="vac_d2">
|
|
2nd vaccination date</option>
|
|
<option value="vac_d3">
|
|
3rd vaccination date</option>
|
|
|
|
</select>
|
|
<select class="form-control" name="search_filter" style="display: none;" id="search_filter">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="vac_name">
|
|
Vaccine Name</option>
|
|
<option value="vac_center">
|
|
Vaccine Center</option>
|
|
<option value="vac_date">
|
|
vaccination date (DD/MM/YYY)</option>
|
|
<option value="vac_date_between">
|
|
Vaccination Betwen (DD/MM/YYY-DD/MM//YYYY)
|
|
</option>
|
|
|
|
</select>
|
|
</td>
|
|
<td colspan="4" style="width: 5%;border-top:hidden;border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<input type="text" class="form-control" style="display: none;" name="search_input" id="search_input" value="" />
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!-- vaccination tab end -->
|
|
<!-- /#home -->
|
|
<div id="contacts" class="tab-pane">
|
|
<div class="row">
|
|
<div class="space"></div>
|
|
<h4 class="header blue bolder smaller">Contact</h4>
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-email">Email</label>
|
|
<div class="col-sm-4">
|
|
<span class="input-icon input-icon-right"> <input class="form-control" type="email" id="email" name="email" value="<?php echo $email_id ?>"> <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-sm-4">
|
|
<span class="input-icon input-icon-right"> <input class="form-control input-mask-mobile" type="text" name="personal_phone" id="personal_phone" value="<?php echo $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>
|
|
<div class="row">
|
|
<div class="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" type="text" name="primary_contact_person" id="primary_contact_person" value="<?php echo $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" value="<?php echo $primary_contact_no ?>"> <i class="ace-icon fa fa-phone fa-flip-horizontal"></i>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-phone">Sec
|
|
Contact Person</label>
|
|
<div class="col-sm-4">
|
|
<span class="input-icon input-icon-right"> <input class="input-mask-mobile form-control" type="text" name="secondary_contact_person" id="secondary_contact_person" value="<?php echo $secondary_contact_person; ?>">
|
|
</span>
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-phone">Sec
|
|
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" value="<?php echo $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>
|
|
|
|
</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
|
|
|
|
<button class="btn btn-minier btn-primary" onclick="addFamilyMembersRow()" id="addButton" style="float: right">
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
</button>
|
|
|
|
</div>
|
|
<div class="panel-body">
|
|
<table class="table table-bordered table-hover" id="familyMembersTable">
|
|
<tbody>
|
|
<tr>
|
|
<th>Sr</th>
|
|
<th>Name</th>
|
|
<th>DOB</th>
|
|
<th>Gender</th>
|
|
<th>Relation Type</th>
|
|
<th></th>
|
|
</tr>
|
|
<?php
|
|
$count = 0;
|
|
$sql_family_members = "select * from emp_family_members where emp_id=$emp_id ";
|
|
$result_family_members = @mysqli_query($conn, $sql_family_members);
|
|
$no_of_rows = mysqli_num_rows($result_family_members);
|
|
if ($no_of_rows > 0) {
|
|
?>
|
|
<input type="hidden" name="rowCount" id="rowCount" value="<?php echo $no_of_rows; ?>" />
|
|
<?php } else { ?>
|
|
<input type="hidden" name="rowCount" id="rowCount" value="1" />
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
if ($no_of_rows > 0) {
|
|
while ($row_family_members = @mysqli_fetch_array($result_family_members)) {
|
|
?>
|
|
<tr id="familyMembersTableRow<?php echo $count; ?>">
|
|
<td><?php echo $count + 1; ?>
|
|
</td>
|
|
<td><input type="text" name="name<?php echo $count; ?>" id="name<?php echo $count; ?>" value="<?php echo $row_family_members['name'] ?>" class="form-control" /></td>
|
|
|
|
|
|
<td>
|
|
|
|
<div class="input-group">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<input class="form-control col-sm-2 date-picker" id="dobb<?php echo $count; ?>" name="dobb<?php echo $count; ?>" type="text" readonly onChange="calculateAge1('dobb<?php echo $count; ?>','age1')" data-date-format="dd/mm/yyyy" placeholder="Date of Birth(dd/mm/yyyy)" value="<?php echo date("d/m/Y", strtotime($row_family_members['dob'])); ?>">
|
|
<span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i>
|
|
</span> <label class="form-control" id="age1" name="age1"><?php echo isset($row_family_members['dob']) ? date_diff(date_create($row_family_members['dob']), date_create('today'))->y : ""; ?></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</td>
|
|
|
|
<td><select class="form-control" name="gender<?php echo $count ?>" id="gender<?php echo $count ?>">
|
|
<option value="" disabled>--Select Gender
|
|
</option>
|
|
<option value="M" <?php if ($row_family_members['gender'] == "M") echo "selected" ?>>
|
|
Male</option>
|
|
<option value="F" <?php if ($row_family_members['gender'] == "F") echo "selected" ?>>
|
|
Female</option>
|
|
<option value="O" <?php if ($row_family_members['gender'] == "O") echo "selected" ?>>
|
|
Others</option>
|
|
</select></td>
|
|
<td><select class="form-control" name="relation_type<?php echo $count ?>" id="relation_type<?php echo $count ?>">
|
|
<option value="" disabled>--Select Gender
|
|
</option>
|
|
<option value="Spouse" <?php if ($row_family_members['relation_type'] == "Spouse" || $row_family_members['relation_type'] == "SPOUSE") echo "selected" ?>>
|
|
Spouse</option>
|
|
<option value="Son" <?php if ($row_family_members['relation_type'] == "Son" || $row_family_members['relation_type'] == "SON") echo "selected" ?>>
|
|
Son</option>
|
|
<option value="Daughter" <?php if ($row_family_members['relation_type'] == "Daughter" || $row_family_members['relation_type'] == "DAUGHTER") echo "selected" ?>>
|
|
Daughter</option>
|
|
<option value="Mother" <?php if ($row_family_members['relation_type'] == "Mother" || $row_family_members['relation_type'] == "MOTHER") echo "selected" ?>>
|
|
Mother</option>
|
|
<option value="Father" <?php if ($row_family_members['relation_type'] == "Father" || $row_family_members['relation_type'] == "FATHER") echo "selected" ?>>
|
|
Father</option>
|
|
</select></td>
|
|
<td><a href="#" onclick="deleteFamilyMembersRow(<?php echo $count ?>)"><span class="glyphicon glyphicon-trash"></span>
|
|
</a></td>
|
|
</tr>
|
|
<?php
|
|
++$count;
|
|
}
|
|
} else {
|
|
?>
|
|
<td>1</td>
|
|
<td><input type="text" name="name0" id="name0" class="form-control" />
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<input class="form-control col-sm-2 date-picker" id="dobb0" name="dobb0" type="text" readonly onChange="calculateAge1('dobb0','age0')" data-date-format="dd/mm/yyyy" placeholder="Date of Birth(dd/mm/yyyy)" value="<?php echo date("d/m/Y", strtotime($row_family_members['dob'])); ?>">
|
|
<span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i>
|
|
</span> <label class="form-control" id="age1" name="age1"><?php echo isset($row_family_members['dob']) ? date_diff(date_create($row_family_members['dob']), date_create('today'))->y : ""; ?></label>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</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 value="" 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(0)"><span class="glyphicon glyphicon-trash"></span> </a>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-10"></div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
Payable Mediclaim
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table table-bordered table-hover" id="paymedclaimTable">
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="10%">Financial Year</th>
|
|
<th width="10%">Mediclaim Limit</th>
|
|
<th width="12%">Approved Buffer Limit</th>
|
|
<th width="10%">Total Limit</th>
|
|
<th width="10%">Utilized Amount</th>
|
|
<th width="10%">Balance</th>
|
|
<th width="30%">Remarks</th>
|
|
</tr>
|
|
|
|
|
|
|
|
<?php $fy_inclause = "";
|
|
$mediclaim_years = getConfigKey('COUNT_YEARS_MEDICLAIM');
|
|
error_log("COUNT_YEARS_MEDICLAIM:" . $mediclaim_years);
|
|
$i = 0;
|
|
$month = date('n');
|
|
$year = date('Y');
|
|
$year1 = $year + 1;
|
|
|
|
if ($month > 3) {
|
|
$year = $year;
|
|
} else {
|
|
$year = $year - 1;
|
|
$year1 = date('Y');
|
|
}
|
|
|
|
$current_fy = $year . '-' . $year1;
|
|
|
|
if ($mediclaim_years <= 1) {
|
|
$fy_inclause = "('" . $current_fy . "')";
|
|
} else {
|
|
$fy_inclause = "(";
|
|
//error_log("financial_year11".$fy_inclause);
|
|
|
|
for ($i = 0; $i < $mediclaim_years; $i++) {
|
|
$fy = $year . '-' . $year1;
|
|
//error_log("financialyear".$fy);
|
|
if ($i == ($mediclaim_years - 1)) {
|
|
$fy_inclause .= "'" . $fy . "')";
|
|
//error_log("financial_year1".$fy_inclause);
|
|
|
|
} else {
|
|
$fy_inclause .= "'" . $fy . "',";
|
|
//error_log("financial_year2".$fy_inclause);
|
|
|
|
}
|
|
$year--;
|
|
$year1--;
|
|
}
|
|
|
|
//error_log("financial_year".$fy_inclause);
|
|
|
|
}
|
|
//pull the configuration and master details
|
|
|
|
$sql_mediclaim = "select * from mediclaim where emp_id = $emp_id and financial_year in $fy_inclause";
|
|
|
|
|
|
$result_mediclaim = mysqli_query($conn, $sql_mediclaim);
|
|
$num_row_mediclaim = mysqli_num_rows($result_mediclaim);
|
|
if ($num_row_mediclaim > 0) {
|
|
$i = 0;
|
|
while ($row_mediclaim = mysqli_fetch_array($result_mediclaim)) {
|
|
//configuration and master details
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td><label style="font-weight: 800"><?php echo $row_mediclaim['financial_year'] ?></label>
|
|
|
|
<?php $fys = $row_mediclaim['financial_year']; ?>
|
|
|
|
<input type="hidden" id="fy<?php echo $i ?>" name="fy<?php echo $i ?>" value="<?php echo $fys ?>">
|
|
|
|
</td>
|
|
|
|
<?php $sql_med = "select e.mediclaim from emp_cadre e left join patient_master p on e.emp_cadre_id=p.emp_cadre where p.id=" . $_REQUEST['emp_id'] . "";
|
|
|
|
|
|
|
|
$result_med = mysqli_query($conn, $sql_med);
|
|
|
|
$row_med = mysqli_fetch_array($result_med); ?>
|
|
|
|
|
|
<td><input style="width: 100%" type="number" id="med_limit<?php echo $i ?>" name="med_limit<?php echo $i ?>" value="<?php echo $row_med['mediclaim'] ?>" readonly>
|
|
</td>
|
|
|
|
<td><input onchange="cal_total(<?php echo $i ?>)" style="width: 100%" type="number" id="approved_buffer<?php echo $i ?>" name="approved_buffer<?php echo $i ?>" value="<?php echo $row_mediclaim['approved_buffer_limit'] ?>">
|
|
</td>
|
|
|
|
<td><input style="width: 100%" type="number" name="total_limit<?php echo $i ?>" id="total_limit<?php echo $i ?>" value="<?php echo $row_mediclaim['total_limit'] ?>" readonly>
|
|
</td>
|
|
|
|
<td><input onchange="cal_balance(<?php echo $i ?>)" style="width: 100%" type="number" name="utilized_amount<?php echo $i ?>" id="utilized_amount<?php echo $i ?>" value="<?php echo $row_mediclaim['utilized_amount'] ?>">
|
|
</td>
|
|
|
|
<td><input style="width: 100%" type="number" name="balance<?php echo $i ?>" id="balance<?php echo $i ?>" value="<?php echo $row_mediclaim['balance'] ?>" readonly>
|
|
</td>
|
|
|
|
<td><input style="width: 100%" type="text" name="remarks<?php echo $i ?>" id="remarks<?php echo $i ?>" value="<?php echo $row_mediclaim['remarks'] ?>">
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<?php $i++;
|
|
}
|
|
} else {
|
|
$month = date('n');
|
|
$year = date('Y');
|
|
$year1 = $year + 1;
|
|
|
|
if ($month > 3) {
|
|
$year = $year;
|
|
} else {
|
|
$year = $year - 1;
|
|
$year1 = date('Y');
|
|
}
|
|
$i = 0;
|
|
while ($i < $mediclaim_years) {
|
|
|
|
//blank entry
|
|
//set configuration and master details
|
|
?>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td><label style="font-weight: 800"><?php echo (($year - $i)) ?>-<?php echo (($year1 - $i)) ?></label>
|
|
|
|
<?php $fys = (($year - $i)) . '-' . (($year1 - $i)); ?>
|
|
|
|
<input type="hidden" id="fy<?php echo $i ?>" name="fy<?php echo $i ?>" value="<?php echo $fys ?>">
|
|
|
|
</td>
|
|
|
|
<?php $sql_med = "select e.mediclaim from emp_cadre e left join patient_master p on e.emp_cadre_id=p.emp_cadre where p.id=" . $_REQUEST['emp_id'] . "";
|
|
|
|
|
|
|
|
$result_med = mysqli_query($conn, $sql_med);
|
|
|
|
$row_med = mysqli_fetch_array($result_med); ?>
|
|
|
|
|
|
<td><input style="width: 100%" type="number" id="med_limit<?php echo $i ?>" name="med_limit<?php echo $i ?>" value="<?php echo $row_med['mediclaim'] ?>" readonly>
|
|
</td>
|
|
|
|
<td><input onchange="cal_total(<?php echo $i ?>)" style="width: 100%" type="number" id="approved_buffer<?php echo $i ?>" name="approved_buffer<?php echo $i ?>"></td>
|
|
|
|
<td><input style="width: 100%" type="number" name="total_limit<?php echo $i ?>" id="total_limit<?php echo $i ?>" readonly></td>
|
|
|
|
<td><input onchange="cal_balance(<?php echo $i ?>)" style="width: 100%" type="number" name="utilized_amount<?php echo $i ?>" id="utilized_amount<?php echo $i ?>"> </td>
|
|
|
|
<td><input style="width: 100%" type="number" name="balance<?php echo $i ?>" id="balance<?php echo $i ?>" readonly></td>
|
|
|
|
<td><input style="width: 100%" type="text" name="remarks<?php echo $i ?>" id="remarks<?php echo $i ?>">
|
|
</td>
|
|
|
|
<?php $i++;
|
|
}
|
|
} ?>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<input type="hidden" name="med_count_items" id="med_count_items" value="<?php echo $i ?>" />
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="space-10"></div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
Non-Payable Mediclaim
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table table-bordered table-hover" id="paymedclaimTable">
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="10%">Financial Year</th>
|
|
<th width="15%">Non-payable Mediclaim Limit</th>
|
|
<!-- <th>Approved Buffer Limit</th>
|
|
<th>Total Limit</th> -->
|
|
<th width="15%">Utilized Amount</th>
|
|
<th width="15%">Balance</th>
|
|
<th width="30%">Remarks</th>
|
|
</tr>
|
|
|
|
|
|
|
|
<?php $fy_inclause = "";
|
|
$mediclaim_years = (int)getConfigKey('COUNT_YEARS_MEDICLAIM_NONPAYABLE');
|
|
error_log("fsggs" . $mediclaim_years);
|
|
$i = 0;
|
|
$month = date('n');
|
|
$year = date('Y');
|
|
$year1 = $year + 1;
|
|
|
|
if ($month > 3) {
|
|
$year = $year;
|
|
} else {
|
|
$year = $year - 1;
|
|
$year1 = date('Y');
|
|
}
|
|
|
|
$current_fy = $year . '-' . $year1;
|
|
|
|
if ($mediclaim_years <= 1) {
|
|
$fy_inclause = "('" . $current_fy . "')";
|
|
} else {
|
|
$fy_inclause = "(";
|
|
//error_log("financial_year11".$fy_inclause);
|
|
|
|
for ($i = 0; $i < $mediclaim_years; $i++) {
|
|
$fy = $year . '-' . $year1;
|
|
//error_log("financialyear".$fy);
|
|
if ($i == ($mediclaim_years - 1)) {
|
|
$fy_inclause .= "'" . $fy . "')";
|
|
//error_log("financial_year1".$fy_inclause);
|
|
|
|
} else {
|
|
$fy_inclause .= "'" . $fy . "',";
|
|
//error_log("financial_year2".$fy_inclause);
|
|
|
|
}
|
|
$year--;
|
|
$year1--;
|
|
}
|
|
|
|
//error_log("financial_year".$fy_inclause);
|
|
|
|
}
|
|
//pull the configuration and master details
|
|
|
|
$sql_npmediclaim = "select * from non_payable_mediclaim where emp_id = $emp_id and financial_year in $fy_inclause";
|
|
|
|
|
|
$result_npmediclaim = mysqli_query($conn, $sql_npmediclaim);
|
|
$num_row_npmediclaim = mysqli_num_rows($result_npmediclaim);
|
|
if ($num_row_npmediclaim > 0) {
|
|
$i = 0;
|
|
while ($row_npmediclaim = mysqli_fetch_array($result_npmediclaim)) {
|
|
//configuration and master details
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td><label style="font-weight: 800"><?php echo $row_npmediclaim['financial_year'] ?></label>
|
|
|
|
<?php $fys = $row_npmediclaim['financial_year']; ?>
|
|
|
|
<input type="hidden" id="npfy<?php echo $i ?>" name="npfy<?php echo $i ?>" value="<?php echo $fys ?>">
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td><input style="width: 100%" type="number" id="nonpay_med_limit<?php echo $i ?>" value="<?php echo $row_npmediclaim['nonpay_med_limit'] ?>" name="nonpay_med_limit<?php echo $i ?>" readonly>
|
|
</td>
|
|
|
|
|
|
<td><input onchange="cal_npbalance(<?php echo $i ?>)" style="width: 100%" type="number" name="nputilized_amount<?php echo $i ?>" id="nputilized_amount<?php echo $i ?>" value="<?php echo $row_npmediclaim['utilized_amount'] ?>">
|
|
</td>
|
|
|
|
<td><input style="width: 100%" type="number" name="npbalance<?php echo $i ?>" id="npbalance<?php echo $i ?>" value="<?php echo $row_npmediclaim['balance'] ?>" readonly>
|
|
</td>
|
|
|
|
<td><input style="width: 100%" type="text" name="npremarks<?php echo $i ?>" id="npremarks<?php echo $i ?>" value="<?php echo $row_npmediclaim['remarks'] ?>">
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<?php $i++;
|
|
}
|
|
} else {
|
|
$month = date('n');
|
|
$year = date('Y');
|
|
$year1 = $year + 1;
|
|
|
|
if ($month > 3) {
|
|
$year = $year;
|
|
} else {
|
|
$year = $year - 1;
|
|
$year1 = date('Y');
|
|
}
|
|
$i = 0;
|
|
while ($i < $mediclaim_years) {
|
|
|
|
//blank entry
|
|
//set configuration and master details
|
|
?>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td><label style="font-weight: 800"><?php echo (($year - $i)) ?>-<?php echo (($year1 - $i)) ?></label>
|
|
|
|
<?php $fys = (($year - $i)) . '-' . (($year1 - $i)); ?>
|
|
|
|
<input type="hidden" id="npfy<?php echo $i ?>" name="npfy<?php echo $i ?>" value="<?php echo $fys ?>">
|
|
</td>
|
|
|
|
<?php (int)$np_medclaim = getFieldFromTable('value', 'config', 'key_name', 'MEDICLAIM_NON_PAYABLE_LIMIT'); ?>
|
|
|
|
|
|
<td><input style="width: 100%" type="number" id="nonpay_med_limit<?php echo $i ?>" value="<?php echo $np_medclaim ?>" name="nonpay_med_limit<?php echo $i ?>" readonly>
|
|
</td>
|
|
|
|
|
|
<td><input onchange="cal_npbalance(<?php echo $i ?>)" style="width: 100%" type="number" name="nputilized_amount<?php echo $i ?>" id="nputilized_amount<?php echo $i ?>"></td>
|
|
|
|
<td><input style="width: 100%" type="number" name="npbalance<?php echo $i ?>" id="npbalance<?php echo $i ?>" readonly></td>
|
|
|
|
<td><input style="width: 100%" type="text" name="npremarks<?php echo $i ?>" id="npremarks<?php echo $i ?>">
|
|
</td>
|
|
|
|
<?php $i++;
|
|
}
|
|
} ?>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<input type="hidden" name="npmed_count_items" id="npmed_count_items" value="<?php echo $i ?>" />
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="space-10"></div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
Mediclaim For Diseases Not Covered
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table table-bordered table-hover" id="paymedclaimTable">
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="10%">Financial Year</th>
|
|
<th width="15%">Non-payable Mediclaim Limit</th>
|
|
<!-- <th>Approved Buffer Limit</th>
|
|
<th>Total Limit</th> -->
|
|
<th width="15%">Utilized Amount</th>
|
|
<th width="15%">Balance</th>
|
|
<th width="30%">Remarks</th>
|
|
</tr>
|
|
|
|
|
|
|
|
<?php $fy_inclause = "";
|
|
$mediclaim_years = (int)getConfigKey('COUNT_YEARS_NOTCOVERED_DISEASE');
|
|
error_log("fsggs" . $mediclaim_years);
|
|
$i = 0;
|
|
$month = date('n');
|
|
$year = date('Y');
|
|
$year1 = $year + 1;
|
|
|
|
if ($month > 3) {
|
|
$year = $year;
|
|
} else {
|
|
$year = $year - 1;
|
|
$year1 = date('Y');
|
|
}
|
|
|
|
$current_fy = $year . '-' . $year1;
|
|
|
|
if ($mediclaim_years <= 1) {
|
|
$fy_inclause = "('" . $current_fy . "')";
|
|
} else {
|
|
$fy_inclause = "(";
|
|
//error_log("financial_year11".$fy_inclause);
|
|
|
|
for ($i = 0; $i < $mediclaim_years; $i++) {
|
|
$fy = $year . '-' . $year1;
|
|
//error_log("financialyear".$fy);
|
|
if ($i == ($mediclaim_years - 1)) {
|
|
$fy_inclause .= "'" . $fy . "')";
|
|
//error_log("financial_year1".$fy_inclause);
|
|
|
|
} else {
|
|
$fy_inclause .= "'" . $fy . "',";
|
|
//error_log("financial_year2".$fy_inclause);
|
|
|
|
}
|
|
$year--;
|
|
$year1--;
|
|
}
|
|
|
|
//error_log("financial_year".$fy_inclause);
|
|
|
|
}
|
|
//pull the configuration and master details
|
|
|
|
$sql_dismediclaim = "select * from mediclaim_disease_not_covered where emp_id = $emp_id and financial_year in $fy_inclause";
|
|
|
|
|
|
$result_dismediclaim = mysqli_query($conn, $sql_dismediclaim);
|
|
$num_row_dismediclaim = mysqli_num_rows($result_dismediclaim);
|
|
if ($num_row_dismediclaim > 0) {
|
|
$i = 0;
|
|
while ($row_dismediclaim = mysqli_fetch_array($result_dismediclaim)) {
|
|
//configuration and master details
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td><label style="font-weight: 800"><?php echo $row_dismediclaim['financial_year'] ?></label>
|
|
|
|
<?php $fys = $row_dismediclaim['financial_year']; ?>
|
|
|
|
<input type="hidden" id="disfy<?php echo $i ?>" name="disfy<?php echo $i ?>" value="<?php echo $fys ?>">
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td><input style="width: 100%" type="number" id="dismed_limit<?php echo $i ?>" value="<?php echo $row_dismediclaim['nonpay_medclaim_limit'] ?>" name="dismed_limit<?php echo $i ?>" readonly>
|
|
</td>
|
|
|
|
|
|
<td><input onchange="cal_disbalance(<?php echo $i ?>)" style="width: 100%" type="number" name="disutilized_amount<?php echo $i ?>" id="disutilized_amount<?php echo $i ?>" value="<?php echo $row_dismediclaim['utilized_amount'] ?>">
|
|
</td>
|
|
|
|
<td><input style="width: 100%" type="number" name="disbalance<?php echo $i ?>" id="disbalance<?php echo $i ?>" value="<?php echo $row_dismediclaim['balance'] ?>" readonly>
|
|
</td>
|
|
|
|
<td><input style="width: 100%" type="text" name="disremarks<?php echo $i ?>" id="disremarks<?php echo $i ?>" value="<?php echo $row_dismediclaim['remarks'] ?>">
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<?php $i++;
|
|
}
|
|
} else {
|
|
$i = 0;
|
|
$month = date('n');
|
|
$year = date('Y');
|
|
$year1 = $year + 1;
|
|
|
|
if ($month > 3) {
|
|
$year = $year;
|
|
} else {
|
|
$year = $year - 1;
|
|
$year1 = date('Y');
|
|
}
|
|
while ($i < $mediclaim_years) {
|
|
|
|
//blank entry
|
|
//set configuration and master details
|
|
?>
|
|
<tr>
|
|
|
|
|
|
<td><label style="font-weight: 800"><?php echo (($year - $i)) ?>-<?php echo (($year1 - $i)) ?></label>
|
|
|
|
<?php $fys = (($year - $i)) . '-' . (($year1 - $i)); ?>
|
|
|
|
<input type="hidden" id="disfy<?php echo $i ?>" name="disfy<?php echo $i ?>" value="<?php echo $fys ?>">
|
|
</td>
|
|
|
|
<?php (int)$dis_medclaim = getFieldFromTable('value', 'config', 'key_name', 'MEDICLAIM_DISEASE_NOTCOVERD_LIMIT'); ?>
|
|
|
|
|
|
<td><input style="width: 100%" type="number" id="dismed_limit<?php echo $i ?>" name="dismed_limit<?php echo $i ?>" value="<?php echo $dis_medclaim ?>" readonly>
|
|
</td>
|
|
<!--
|
|
<td><input type="number" id="approved_buffer" name="approved_buffer" readonly></td>
|
|
|
|
<td><input type="number" name="total_limit" id="total_limit" ></td> -->
|
|
|
|
<td><input onchange="cal_disbalance(<?php echo $i ?>)" style="width: 100%" type="number" name="disutilized_amount<?php echo $i ?>" id="disutilized_amount<?php echo $i ?>"></td>
|
|
|
|
<td><input style="width: 100%" type="number" name="disbalance<?php echo $i ?>" id="disbalance<?php echo $i ?>" readonly></td>
|
|
|
|
<td><input style="width: 100%" type="text" name="disremarks<?php echo $i ?>" id="disremarks<?php echo $i ?>"></td>
|
|
|
|
<?php $i++;
|
|
}
|
|
} ?>
|
|
|
|
</tr>
|
|
|
|
|
|
<input type="hidden" name="dismed_count_items" id="dismed_count_items" value="<?php echo $i ?>" />
|
|
|
|
|
|
</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>
|
|
|
|
</div>
|
|
</div>
|
|
<!-- end of family -->
|
|
|
|
<!-- End Of Health Advices and Health Risk -->
|
|
<div id="medicalExaminationHistroy" class=" tab-pane <?php if ($_REQUEST['active'] == 'medicalExaminationHistroyTab') echo 'in active'; ?>">
|
|
<div class="table-responsive" style="text-align: center; text-align: center; width: 90%;">
|
|
<div class="row">
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">
|
|
Medical
|
|
Examination History</h4>
|
|
<table style="width: 50%;" class="table table-bordered">
|
|
|
|
|
|
|
|
<tr style="border-bottom:hidden;border-top:hidden;border-right:hidden; border-left:hidden">
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="sort_meh" value="sort" onclick="showFilter_meh(this.value)" />
|
|
</td>
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="search_meh" value="search" onclick="showFilter_meh(this.value)" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" style="border-bottom:hidden;border-right:hidden;border-left:hidden">
|
|
<h4 align='left' id="selected_filter_meh" style="display:none">
|
|
<strong>Please
|
|
Select For<input type='text' name='filterOf_meh' id="filterOf_meh" style="border:hidden;text-align:left;font-size: 15px;width: 70px;">
|
|
|
|
</strong>
|
|
</h4>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr style=" border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<td colspan="3" style="width: 8%;border-top:hidden;border-bottom:hidden; border-left:hidden;border-right:hidden">
|
|
<select class="form-control" onchange="getShowingData_meh()" name="sort_filter_meh" style="display: none;" id="sort_filter_meh">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="checkup_type_name">
|
|
CHECKUP TYPE</option>
|
|
<option value="checkup_date">
|
|
CHECKUP DATE</option>
|
|
|
|
</select>
|
|
<select class="form-control" name="search_filter_meh" style="display: none;" id="search_filter_meh">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="checkup_type_name">
|
|
CHECKUP TYPE</option>
|
|
<option value="checkup_date">
|
|
CHECKUP DATE (DD/MM/YYY)</option>
|
|
<option value="checkup_date_between">
|
|
CHECKUP BETWEEN (DD/MM/YYY-DD/MM//YYYY)
|
|
</option>
|
|
|
|
</select>
|
|
</td>
|
|
<td colspan="4" style="width: 5%;border-top:hidden;border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<input type="text" class="form-control" style="display: none;" name="search_input_meh" id="search_input_meh" value="" />
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
<table class="table table-bordered" id="medical_exam_history_table" style="width: 100%">
|
|
<thead>
|
|
<tr align="center">
|
|
<th width="15%" style="text-align: center">S.No.</th>
|
|
<th width="15%" style="text-align: center">Medical
|
|
Examination Type</th>
|
|
<th width="15%" style="text-align: center">Medical
|
|
Examination Date</th>
|
|
<th width="15%" style="text-align: center">Review By Doctor
|
|
</th>
|
|
<th width="15%" style="text-align: center">Medical forms
|
|
</th>
|
|
<th width="15%" style="text-align: center">Other Supporting
|
|
Documents
|
|
</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$count = 1;
|
|
$sql_for_medical_examination = "select * from checkup_form where emp_id=$emp_id";
|
|
error_log("med history" . $sql_for_medical_examination);
|
|
$result_for_medical_examination = mysqli_query($conn, $sql_for_medical_examination);
|
|
while ($row_for_medical_examination = mysqli_fetch_assoc($result_for_medical_examination)) {
|
|
$checkup_id = $row_for_medical_examination['checkup_id'];
|
|
?>
|
|
<tr>
|
|
<td align="center"><?php echo $count; ?>
|
|
</td>
|
|
<td align="center"><?php
|
|
|
|
$chechup_type = $checkup_name = getFieldFromTable('checkup_type_name', 'checkup_type', 'checkup_type_id', $row_for_medical_examination['checkup_type_id']);;
|
|
echo $chechup_type;
|
|
?>
|
|
</td>
|
|
<td align="center">
|
|
<?php echo strtoupper(date_format(date_create($row_for_medical_examination['checkup_date']), "d-M-Y ")); ?>
|
|
</td>
|
|
<td align="center"><?php
|
|
|
|
echo getTableFieldValue('patient_master', 'patient_name', 'id', $row_for_medical_examination['doc_attend']);
|
|
?>
|
|
</td>
|
|
<td align="center"><?php
|
|
// $row_for_medical_examination['task']= getTableFieldValue('checkup_type','checkup_type_code','checkup_type_id',$row_for_medical_examination['checkup_type_id']);
|
|
$space = " ";
|
|
// if ($row_for_medical_examination['task'] == 'pme' || $row_for_medical_examination['task'] == 'pme_short')
|
|
// echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_medical_pdf('peme_card.php','" . $row_for_medical_examination['medical_exam_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
// else if ($row_for_medical_examination['task'] == 'pohc' || $row_for_medical_examination['task'] == 'pohc_half')
|
|
// echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_medical_pdf('pohc_card.php','" . $row_for_medical_examination['medical_exam_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
|
|
// else if ($row_for_medical_examination['task'] == 'eye_check')
|
|
// echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_medical_pdf('eye_checkup_pdf.php','" . $row_for_medical_examination['medical_exam_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
|
|
// else if ($row_for_medical_examination['task'] == 'foodhand_exam')
|
|
// echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_medical_pdf('food_handler_exam_pdf.php','" . $row_for_medical_examination['medical_exam_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
|
|
// $sql_form = "select form_id,form_type,medical_exam_id from form_data where medical_exam_id = (select max(medical_exam_id) from medical_examination where patient_id = " . $_REQUEST['emp_id'] . ")";
|
|
|
|
// error_log("formmmmm" . $sql_form);
|
|
// $result_form = mysqli_query($conn, $sql_form);
|
|
|
|
// $row_form = mysqli_fetch_array($result_form);
|
|
|
|
// if (isset($row_form['form_id'])) {
|
|
// if ($row_form['form_type'] == 'form_25') {
|
|
// echo $space . "<a target=\"_blank\" class=\"red\" href=\"form_25_pdf.php?medical_exam_id=" . $row_form['medical_exam_id'] . "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Form 32\" ><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a> (Form 25)";;
|
|
// } else if ($row_form['form_type'] == 'form_O') {
|
|
// echo $space . "<a target=\"_blank\" class=\"red\" href=\"form_o_pdf.php?medical_exam_id=" . $row_form['medical_exam_id'] . "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Form 32\" ><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a> (Form O)";
|
|
// }
|
|
// }
|
|
echo $space . "<a href=\"checkup_form_pdf.php?checkup_id=" . $checkup_id . "\"class=\"red\" target=\"_blank\"><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a>";
|
|
if ($row_for_medical_examination['checkup_type_id'] == 40 || $row_for_medical_examinationp['checkup_type_id'] == '40') {
|
|
echo $space . "<a href=\"food_handler_cirtificate.php?checkup_id=" . $checkup_id . "\"class=\"green\" target=\"_blank\"><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a>";
|
|
}
|
|
|
|
|
|
$form_type = getTableFieldValue('form_data', 'form_type', 'checkup_id', $checkup_id);
|
|
|
|
$form_type_32 = getTableFieldValue('form_32', 'id', 'checkup_id', $checkup_id);
|
|
error_log("form type 32 query " . $form_type_32);
|
|
|
|
|
|
if ($form_type != null && $form_type != "") {
|
|
if ($form_type == 'form_33') {
|
|
echo $space . "<a target=\"_blank\" class=\"brown\" href=\"form_33_pdf.php?checkup_id=" . $checkup_id . "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Form 33\" ><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a> (Form 33)";
|
|
} else if ($form_type == 'form_O') {
|
|
|
|
echo $space . "<a target=\"_blank\" class=\"brown\" href=\"form_o_pdf.php?checkup_id=" . $checkup_id . "\" data-placement=\"top\" title=\"Form O\"><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a> (Form O)";
|
|
}
|
|
}
|
|
if ($form_type_32 != null && $form_type_32 != '') {
|
|
echo $space . "<a target=\"_blank\" class=\"brown\" href=\"form_32_pdf.php?checkup_id=" . $checkup_id . "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Form 32\" ><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a> (Form 32)";
|
|
|
|
echo $space . "<a target=\"_blank\" class=\"brown\" href=\"form_32_combined_pdf.php?checkup_id=" . $checkup_id . "\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Form 32\" ><i class=\"fa fa-file-pdf-o\" style=\"font-size: 20px;\"></i></a> (Form 32 Combined)";
|
|
} else {
|
|
$form32pdf_link = "";
|
|
$form32CombinePdf_link = "";
|
|
}
|
|
?>
|
|
|
|
</td>
|
|
|
|
<?php
|
|
// $sql_id = "select medical_exam_id from medical_examination where patient_id = '".$_REQUEST['emp_id']."'";
|
|
|
|
// $result_id = mysqli_query($conn,$sql_id);
|
|
|
|
// $row_id = mysqli_fetch_array($result_id);
|
|
|
|
$sql_medical_doc = "select * from medical_document where checkup_id='" . $row_for_medical_examination['checkup_id'] . "' ";
|
|
|
|
error_log("MEDICAL DOCUMENT QUERY::" . $sql_medical_doc);
|
|
|
|
//echo $emp_id;
|
|
|
|
|
|
$result_medical_doc = @mysqli_query($conn, $sql_medical_doc);
|
|
|
|
$sql_medical_doc1 = "select * from checkup_section_medical_document where checkup_id='" . $row_for_medical_examination['checkup_id'] . "' ";
|
|
|
|
error_log("MEDICAL DOCUMENT QUERY1::" . $sql_medical_doc1);
|
|
|
|
//echo $emp_id;
|
|
|
|
|
|
$result_medical_doc1 = @mysqli_query($conn, $sql_medical_doc1); ?>
|
|
<td>
|
|
|
|
|
|
<?php while ($row_medical_doc = @mysqli_fetch_array($result_medical_doc)) {
|
|
if ($row_medical_doc['medical_doc_type'] == 'application/pdf') { ?>
|
|
<a href='#'><img src='images/pdf.png' width='35' height='35' onclick='$("#med_doc_<?php echo $row_medical_doc['id'] ?>").click()'></a>
|
|
<img id="med_doc_<?php echo $row_medical_doc['id'] ?>" style='display:none' <?php
|
|
echo ' src = "data:' . $row_medical_doc['medical_doc_type'] . ';base64,' . base64_encode($row_medical_doc['medical_doc']) . '"' ?> alt="pdf" onclick="pdf_preview(this,'<?php echo $row_medical_doc['medical_doc_desc'] ?>')" />
|
|
|
|
<?php } else { ?>
|
|
<img width="50" height="50" <?php
|
|
echo ' src = "data:' . $row_medical_doc['medical_doc_type'] . ';base64,' . base64_encode($row_medical_doc['medical_doc']) . '"' ?> alt="new image" onclick="image(this,'<?php echo $row_medical_doc['medical_doc_desc'] ?>')" />
|
|
|
|
<?php }
|
|
} ?>
|
|
|
|
<!-- //// -->
|
|
<?php while ($row_medical_doc1 = @mysqli_fetch_array($result_medical_doc1)) {
|
|
if ($row_medical_doc1['medical_doc_type'] == 'application/pdf') { ?>
|
|
<a href='#'><img src='images/pdf.png' width='35' height='35' onclick='$("#med_doc_<?php echo $row_medical_doc1['id'] ?>").click()'></a>
|
|
<img id="med_doc_<?php echo $row_medical_doc1['id'] ?>" style='display:none' <?php
|
|
echo ' src = "data:' . $row_medical_doc1['medical_doc_type'] . ';base64,' . base64_encode($row_medical_doc1['medical_doc']) . '"' ?> alt="pdf" onclick="pdf_preview(this,'<?php echo $row_medical_doc1['medical_doc_desc'] ?>')" />
|
|
|
|
<?php } else { ?>
|
|
<img width="50" height="50" <?php
|
|
echo ' src = "data:' . $row_medical_doc1['medical_doc_type'] . ';base64,' . base64_encode($row_medical_doc1['medical_doc']) . '"' ?> alt="new image" onclick="image(this,'<?php echo $row_medical_doc1['medical_doc_desc'] ?>')" />
|
|
|
|
<?php }
|
|
} ?>
|
|
|
|
</td>
|
|
|
|
<tr>
|
|
<?php
|
|
$count++;
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<script type="text/javascript">
|
|
function image(value) {
|
|
var src = value.src;
|
|
var content = "";
|
|
|
|
var content =
|
|
'<div class="modal fade" id="modal-img" role="dialog" aria-hidden="true">'
|
|
content += '<div class="modal-dialog modal-lg">'
|
|
|
|
content += '<div class="modal-content">'
|
|
content += '<div class="modal-header">'
|
|
content +=
|
|
'<h5 class="modal-title" style="text-align: center">Image '
|
|
content +=
|
|
'<button type="button" class="close" data-dismiss="modal"'
|
|
content += 'aria-label="Close">'
|
|
content += '<span aria-hidden="true">×</span>'
|
|
content += '</button></h5>'
|
|
content += '</div>'
|
|
content += '<div class="modal-body">'
|
|
content += '<div class="row"><a href=' + src +
|
|
' download><div class="form-group col-sm-12">'
|
|
|
|
content += '</div><img height="300" weight="300" src=' + src +
|
|
' alt="new image"/></a></div>'
|
|
content += '</div>'
|
|
content += '</div><div><div>'
|
|
|
|
|
|
|
|
$("#image_div").html(content);
|
|
$('#modal-img').modal("show");
|
|
|
|
}
|
|
|
|
function pdf_preview(value, title) {
|
|
var src = value.src;
|
|
var content = "";
|
|
|
|
var content =
|
|
'<div class="modal fade" id="modal-img" role="dialog" aria-hidden="true">'
|
|
content +=
|
|
'<div class="modal-dialog modal-lg" style="width:80%;height:100%" >'
|
|
|
|
content +=
|
|
'<div class="modal-content" style="width:100%;height:100%">'
|
|
content += '<div class="modal-header">'
|
|
content += '<h5 class="modal-title" style="text-align: center">' +
|
|
title
|
|
content +=
|
|
'<button type="button" class="close" data-dismiss="modal"'
|
|
content += 'aria-label="Close">'
|
|
content += '<span aria-hidden="true">×</span>'
|
|
content += '</button></h5>'
|
|
content += '</div>'
|
|
content += '<div class="modal-body" style="width:100%;height:100%">'
|
|
content += '<div class="form-group col-sm-12">'
|
|
|
|
content +=
|
|
'</div style="width:100%;height:100%" ><object type="application/pdf" style="width:100%;height:100%" data=' +
|
|
src + ' alt="new image"/></object></div>'
|
|
// content+='</div>'
|
|
content += '</div><div><div>'
|
|
|
|
|
|
|
|
$("#image_div").html(content);
|
|
$('#modal-img').modal("show");
|
|
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<?php include 'image_popup.php' ?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="opdandinjury" class=" tab-pane">
|
|
<div class="table-responsive" style="text-align: center; text-align: center; width: 90%;">
|
|
<div class="row">
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">
|
|
ILLNESS
|
|
AND INJURY</h4>
|
|
<table style="width: 50%;" class="table table-bordered">
|
|
|
|
|
|
|
|
<tr style="border-bottom:hidden;border-top:hidden;border-right:hidden; border-left:hidden">
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="sort_opd" value="sort" onclick="showFilter_opd(this.value)" />
|
|
</td>
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="search_opd" value="search" onclick="showFilter_opd(this.value)" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" style="border-bottom:hidden;border-right:hidden;border-left:hidden">
|
|
<h4 align='left' id="selected_filter_opd" style="display:none">
|
|
<strong>Please
|
|
Select For<input type='text' name='filterOf_opd' id="filterOf_opd" style="border:hidden;text-align:left;font-size: 15px;width: 70px;">
|
|
|
|
</strong>
|
|
</h4>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr style=" border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<td colspan="3" style="width: 8%;border-top:hidden;border-bottom:hidden; border-left:hidden;border-right:hidden">
|
|
<select class="form-control" onchange="getShowingData_opd()" name="sort_filter_opd" style="display: none;" id="sort_filter_opd">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="appointment_type">
|
|
APPOINTMENT TYPE </option>
|
|
<option value="appointment_date">
|
|
APPOINTMENT DATE</option>
|
|
|
|
</select>
|
|
<select class="form-control" name="search_filter_opd" style="display: none;" id="search_filter_opd">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="appointment_type">
|
|
APPOINTMENT TYPE(O / I)</option>
|
|
<option value="appointment_date">
|
|
APPOINTMENT DATE (DD/MM/YYY)</option>
|
|
<option value="appointment_date_between">
|
|
APPOINTMENT BETWEEN (DD/MM/YYY-DD/MM//YYYY)
|
|
</option>
|
|
|
|
</select>
|
|
</td>
|
|
<td colspan="4" style="width: 5%;border-top:hidden;border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<input type="text" class="form-control" style="display: none;" name="search_input_opd" id="search_input_opd" value="" />
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
<table class="table table-bordered" id="opd_injury_table" style="width: 100%">
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align: center">Sr No</th>
|
|
<th style="text-align: center">IllnessChronic Illness
|
|
/Injury</th>
|
|
<th style="text-align: center">Appointment Date</th>
|
|
<th style="text-align: center">Attended By</th>
|
|
<th style="text-align: center">Prescription</th>
|
|
<th style="text-align: center;">Other Supporting Documents
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<?php
|
|
$count = 1;
|
|
$sql_for_employee_appointment = "select * from employee_appointment where emp_id=" . $_REQUEST['emp_id'] . " ";
|
|
|
|
error_log("OPD QUERY::" . $sql_for_employee_appointment);
|
|
|
|
$result_for_employee_appointment = mysqli_query($conn, $sql_for_employee_appointment);
|
|
while ($row_for_employee_appointment = mysqli_fetch_assoc($result_for_employee_appointment)) {
|
|
?>
|
|
<tr>
|
|
<td align="center"><?php echo $count; ?>
|
|
</td>
|
|
<td align="center"><?php
|
|
if ($row_for_employee_appointment['appointment_type'] == 'O')
|
|
echo "OPD";
|
|
else if ($row_for_employee_appointment['appointment_type'] == 'I')
|
|
echo "INJURY";
|
|
?>
|
|
</td>
|
|
<td align="center">
|
|
<?php echo strtoupper(date_format(date_create($row_for_employee_appointment['appointment_date']), "d-M-Y ")); ?>
|
|
</td>
|
|
<td align="center"><?php
|
|
$emp_id = getTableFieldValue('tbl_users', 'emp_id', 'user_id', $row_for_employee_appointment['doctor_last_attended']);
|
|
error_log("ATTENDED BY:" . $emp_id);
|
|
echo getTableFieldValue('patient_master', 'patient_name', 'id', $emp_id);
|
|
?>
|
|
</td>
|
|
<td align="center"><?php
|
|
if ($row_for_employee_appointment['appointment_type'] == 'O')
|
|
echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_appointment_pdf('opd_form_pdf.php','" . $row_for_employee_appointment['appointment_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
else if ($row_for_employee_appointment['appointment_type'] == 'I')
|
|
echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_appointment_pdf('injury_form_pdf.php','" . $row_for_employee_appointment['appointment_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
?>
|
|
</td>
|
|
|
|
|
|
<?php
|
|
$count = 1;
|
|
|
|
// $sql_id = "select appointment_id from employee_appointment where emp_id = '".$_REQUEST['emp_id']."'";
|
|
|
|
// error_log("OPD ID::" .$sql_id);
|
|
|
|
// $result_id = mysqli_query($conn,$sql_id);
|
|
|
|
// $row_id = mysqli_fetch_array($result_id);
|
|
|
|
$sql_medical_doc_opd = "select * from medical_document where appointment_id='" . $row_for_employee_appointment["appointment_id"] . "' ";
|
|
|
|
error_log("OPD DOCUMENT:" . $sql_medical_doc_opd);
|
|
|
|
//echo $emp_id;
|
|
|
|
|
|
$result_medical_doc_opd = @mysqli_query($conn, $sql_medical_doc_opd);
|
|
?>
|
|
|
|
<td>
|
|
|
|
<?php while ($row_medical_doc_opd = @mysqli_fetch_array($result_medical_doc_opd)) {
|
|
?>
|
|
<a href="data:<?= $row_medical_doc_opd['medical_doc_type'] ?>;base64,<?= base64_encode($row_medical_doc_opd['medical_doc']) ?>" download><img src='images/pdf.png' width='35' height='35'></a>
|
|
|
|
|
|
<?php } ?>
|
|
|
|
</td>
|
|
<tr>
|
|
<?php
|
|
$count++;
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<?php include 'image_popup_opd.php' ?>
|
|
|
|
|
|
<div id="sickness" class=" tab-pane">
|
|
<div class="table-responsive" style="text-align: center; text-align: center; width: 90%;">
|
|
|
|
<div class="row">
|
|
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">
|
|
Sickness
|
|
</h4>
|
|
|
|
<table style="width: 50%;" class="table table-bordered">
|
|
|
|
|
|
|
|
<tr style="border-bottom:hidden;border-top:hidden;border-right:hidden; border-left:hidden">
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="sort_sickness" value="sort" onclick="showFilter_sickness(this.value)" />
|
|
</td>
|
|
<td style="width: 2%;border-bottom:hidden;border-right:hidden">
|
|
<input type="button" style="background-color: #414fcd87 !important;" class="btn btn-sm btn-block " id="search_sickness" value="search" onclick="showFilter_sickness(this.value)" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" style="border-bottom:hidden;border-right:hidden;border-left:hidden">
|
|
<h4 align='left' id="selected_filter_sickness" style="display:none">
|
|
<strong>Please
|
|
Select For<input type='text' name='filterOf_sickness' id="filterOf_sickness" style="border:hidden;text-align:left;font-size: 15px;width: 70px;">
|
|
|
|
</strong>
|
|
</h4>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr style=" border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<td colspan="3" style="width: 8%;border-top:hidden;border-bottom:hidden; border-left:hidden;border-right:hidden">
|
|
<select class="form-control" onchange="getShowingData_sickness()" name="sort_filter_sickness" style="display: none;" id="sort_filter_sickness">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="ailment_name">
|
|
AILMENT NAME </option>
|
|
<option value="sickness_date">
|
|
SICKNESS DATE</option>
|
|
|
|
</select>
|
|
<select class="form-control" name="search_filter_opd" style="display: none;" id="search_filter_sickness">
|
|
<option value="" selected disabled>--Select option--
|
|
</option>
|
|
<option value="ailment_name">
|
|
AILMENT NAME</option>
|
|
<option value="sickness_date">
|
|
SICKNESS DATE (DD/MM/YYY)</option>
|
|
<option value="sickness_date_between">
|
|
APPOINTMENT BETWEEN (DD/MM/YYY-DD/MM//YYYY)
|
|
</option>
|
|
|
|
</select>
|
|
</td>
|
|
<td colspan="4" style="width: 5%;border-top:hidden;border-bottom:hidden;border-right:hidden; border-left:hidden">
|
|
|
|
<input type="text" class="form-control" style="display: none;" name="search_input_sickness" id="search_input_sickness" value="" />
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
<table class="table table-bordered" id="sickness_table" style="width: 100%">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th style="text-align:center">Sr No</th>
|
|
<th style="text-align:center">sicknes Date</th>
|
|
<th style="text-align:center">Ailment Name</th>
|
|
<th style="text-align:center">Attended Doctor</th>
|
|
<th style="text-align:center"></th>
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<?php $count = 1;
|
|
$sql_for_sickness = "select * from sickness where emp_id=" . $_REQUEST['emp_id'] . " ";
|
|
|
|
//echo $sql_for_sickness;
|
|
$result_for_sickness = mysqli_query($conn, $sql_for_sickness);
|
|
while ($row_for_sickness = mysqli_fetch_assoc($result_for_sickness)) { ?>
|
|
<tr>
|
|
<td align="center"><?php echo $count; ?>
|
|
</td>
|
|
<td align="center">
|
|
<?php echo strtoupper(date_format(date_create($row_for_sickness['sickness_date']), "d-M-Y ")); ?>
|
|
</td>
|
|
<td align="center">
|
|
<?php echo getTableFieldValue('ailment', 'ailment_name', 'ailment_id', $row_for_sickness['ailment_name']); ?>
|
|
</td>
|
|
<td align="center">
|
|
<?php
|
|
//$emp_sickness_id=getTableFieldValue('tbl_users','emp_id','user_id',$row_for_sickness['doctor_last_attended']);
|
|
|
|
echo getTableFieldValue('patient_master', 'patient_name', 'id', $row_for_sickness['doctor_last_attended']); ?>
|
|
</td>
|
|
<td align="center">
|
|
<?php
|
|
if ($row_for_sickness['fitness_status'] == 'APPROVED') {
|
|
echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_pdf_fitness('fitness_certificate.php','" . $row_for_sickness['sickness_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
} else {
|
|
echo "<a href=\"#\"><i class=\"fa fa-file-pdf-o\" onclick=\"open_pdf_fitness('unfit_certificate.php','" . $row_for_sickness['sickness_id'] . "')\" style=\"font-size: 20px;\"></i></a>";
|
|
}
|
|
?>
|
|
</td>
|
|
<tr>
|
|
<?php $count++;
|
|
}
|
|
?>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="problemdetail" class=" tab-pane">
|
|
<div class="table-responsive" style="text-align: center; text-align: center; width: 90%;">
|
|
<div class="row">
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">
|
|
Chronic Illness</h4>
|
|
|
|
|
|
</div>
|
|
<table class="table table-bordered" id="opd_injury_table" style="width: 100%">
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align: center">Sr No</th>
|
|
<th style="text-align: center">Chronic Illness</th>
|
|
<th style="text-align: center">Diagnosis Date</th>
|
|
<th style="text-align: center">Remission Date</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<?php
|
|
$count = 1;
|
|
$sql_problem = "SELECT a.* , b.pid ,b.patient_id FROM problem_response_details a INNER JOIN problem_response b ON a.rid = b.rid WHERE b.patient_id =" . $_REQUEST['emp_id'] . " and a.remission_date is NULL ORDER by `pid` DESC,diagnosis_date";
|
|
|
|
error_log("get problem::" . $sql_problem);
|
|
|
|
$result_problem = mysqli_query($conn, $sql_problem);
|
|
while ($row_for_problem = mysqli_fetch_assoc($result_problem)) {
|
|
if (!empty($row_for_problem['diagnosis_date'])) {
|
|
$diagnosis_date = date('d-m-Y', strtotime($row_for_problem['diagnosis_date']));
|
|
}
|
|
if (!empty($row_for_problem['remission_date'])) {
|
|
$remission_date = date('d-m-Y', strtotime($row_for_problem['remission_date']));
|
|
}
|
|
|
|
$problem_detail = getFieldFromTable('allergy_name', 'allergies', 'allergy_id', $row_for_problem['rvalue']);
|
|
?>
|
|
<tr>
|
|
<td align="center"><?php echo $count; ?></td>
|
|
<td align="center"><?php echo $problem_detail ?></td>
|
|
<td align="center"><?php echo $diagnosis_date ?></td>
|
|
<td align="center"><?php echo $remission_date ?></td>
|
|
|
|
|
|
<tr>
|
|
<?php
|
|
$count++;
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="uploadDocs" class="tab-pane <?php if ($_REQUEST['active'] == 'docsTab') echo 'in active'; ?>">
|
|
|
|
<div class="table-responsive" style="text-align: center; text-align: center; width: 70%; margin: 50px;">
|
|
|
|
|
|
<div class="row">
|
|
<!-- <div class=" col-sm-5 form-group"> -->
|
|
|
|
<!-- <div> -->
|
|
<!-- <label for="has_first_aid">Select File Type</label> -->
|
|
<!-- </div> -->
|
|
<!-- <select class="form-control" name="has_first_aid" -->
|
|
<!-- id="has_first_aid"> -->
|
|
<!-- <option value="1">Questionnaire</option> -->
|
|
<!-- <option value="2">Others</option> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- </select> -->
|
|
|
|
<!-- </div> -->
|
|
|
|
|
|
<div class="col-sm-8 form-group">
|
|
|
|
<div>
|
|
<label for="file">Upload File:</label>
|
|
</div>
|
|
|
|
<table class="table table-bordered" width="100%">
|
|
|
|
<tr>
|
|
<th>File</th>
|
|
<th>File Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><input type="file" class="form-control" name="userfile" id="file" />
|
|
</td>
|
|
<td><input type="text" class="form-control" name="file_name" id="file_name"></td>
|
|
<td><input type="text" class="form-control" name="file_desc" id="file_desc"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="form-group"></div>
|
|
</div>
|
|
|
|
</div>
|
|
<?php
|
|
$docs_select_query = "select * from employee_docs where emp_id=" . $_REQUEST['emp_id'] . " ";
|
|
//echo $docs_select_query;
|
|
$docs_result = @mysqli_query($conn, $docs_select_query);
|
|
$no_of_docs = @mysqli_num_rows($docs_result);
|
|
?>
|
|
|
|
<div class="table-responsive" style="text-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 style="text-align:center">S.No.</th>
|
|
<th style="text-align:center">Document Name</th>
|
|
<th style="text-align:center">Document Description</th>
|
|
<th style="text-align:center">Uploaded Date</th>
|
|
<th style="text-align:center">Download link</th>
|
|
<th style="text-align:center">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="center"><?php echo $count + 1 ?>
|
|
</td>
|
|
<td align="center"><?php echo $row_docs['doc_name'] ?>
|
|
</td>
|
|
<td align="center"><?php echo $row_docs['doc_desc'] ?>
|
|
</td>
|
|
<td align="center">
|
|
<?php echo date_format(date_create($row_docs['last_modified']), "d-M-Y ") ?>
|
|
|
|
</td>
|
|
<?php
|
|
echo '<td align="center"><a href="data:' . ($row_docs['doc_type']) . ';base64,' . base64_encode($row_docs['document']) . '" download><span
|
|
class="glyphicon glyphicon-download-alt"></span></a></td>';
|
|
?>
|
|
|
|
<td align="center"> <a href="#" onclick="deletedocs(<?php echo $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>
|
|
|
|
|
|
<?php // include('support_medical_document.php')
|
|
?>
|
|
<?php //include 'image_popup.php'
|
|
?>
|
|
<?php //include('techsyn_footer.php');
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.page-content -->
|
|
</div>
|
|
<!-- /.main-content -->
|
|
<!-- page specific plugin scripts -->
|
|
<!--[if lte IE 8]>
|
|
<script src="assets/js/excanvas.min.js"></script>
|
|
<![endif]-->
|
|
<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).ready(function() {
|
|
var counter = $("#vaccine_count_items").val();
|
|
var s_no = $("#s_no").val();
|
|
//alert (counter);
|
|
$("#addrow").on("click", function() {
|
|
var newRow = $("<tr>");
|
|
var cols = "";
|
|
|
|
cols +=
|
|
'<td style="width: 2%;display:none"><input type="hidden" class="form-control" id="vac_id' +
|
|
counter + '" name="vac_id' + counter + '"/></td>';
|
|
cols += '<td><select class="form-control" name="vac_name' + counter + '" id="vac_name' +
|
|
counter +
|
|
'"><option value="" disabled selected>Select</option><?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="<?php echo $vac_row['id'] ?>"><?php echo $vac_row['vaccine_details'] ?></option><?php } while ($vac_row = @mysqli_fetch_assoc($sql_vac_result)) ?></select></td>';
|
|
cols +=
|
|
'<td style="width: 1%;border-top:hidden;border-bottom:hidden;"> </td><td><input type="date" class="form-control" id="dose1_' +
|
|
counter +
|
|
'" name="dose1_' + counter +
|
|
'"/></td> <td style="width: 8%"><input type="text" name="vac_center1_' + counter +
|
|
'" value="<?php echo $row['vac_center1'] ?>" id="vac_center1_' + counter +
|
|
'" class="form-control" /></td>';
|
|
cols +=
|
|
'<td style="width: 1%;border-top:hidden;border-bottom:hidden;"> </td><td><input type="date" class="form-control" id="dose2_' +
|
|
counter +
|
|
'" name="dose2_' + counter +
|
|
'"/></td><td style="width: 8%"><input type="text"name="vac_center2_' + counter +
|
|
'" value="<?php echo $row['vac_center2'] ?>" id="vac_center2_' + counter +
|
|
'" class="form-control" /></td>';
|
|
cols +=
|
|
'<td style="width: 1%;border-top:hidden;border-bottom:hidden;"> </td><td><input type="date" class="form-control" id="dose3_' +
|
|
counter +
|
|
'" name="dose3_' + counter +
|
|
'"/></td> <td style="width: 8%"><input type="text"name="vac_center3_' + counter +
|
|
'" value="<?php echo $row['vac_center3'] ?>" id="vac_center3_' + counter +
|
|
'" class="form-control" /></td>';
|
|
cols +=
|
|
'<td style="width: 1%;border-top:hidden;border-bottom:hidden;"><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()
|
|
$("#vaccine_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
|
|
// $("#vaccine_count_items").val(counter);
|
|
});
|
|
|
|
//set supervisor in case already setup.
|
|
$("#manager_emp_id").val('<?php echo $emp_mgr_code ?>');
|
|
//$('#manager_emp_id').select2();
|
|
|
|
|
|
|
|
});
|
|
|
|
function delete_vaccination_details(id) {
|
|
$.ajax({
|
|
url: 'delete_vaccination_details.php',
|
|
data: {
|
|
id: id
|
|
},
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
if (data == 'SUCCESS') {
|
|
BootstrapDialog.alert('Vaccination Details Deleted Successfully!');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error: Vaccination Details Not Deleted!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
</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=\" form-control\">"
|
|
// content += "<option value=\"\"> </option>";
|
|
// content += health_advices;
|
|
// content += "</select></td>"
|
|
// content +=
|
|
// "<td><select multiple=\"\" id=\"known_health_risks\" name=\"known_health_risks[]\" class=\" form-control\">"
|
|
// content += "<option value=\"\"> </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) ?>;
|
|
// if (heath_risk_array != null || heath_risk_array != "") {
|
|
// 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');
|
|
// }
|
|
// }
|
|
// $('.select2').select2()
|
|
// });
|
|
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
|
|
$('#avatar2').editable({
|
|
type: 'image',
|
|
name: 'avatar2',
|
|
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: 'emp_sign', //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 = $('#avatar2').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 = '#avatar2';
|
|
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', 'emp_sign');
|
|
$("#uploadForm2").html(clone);
|
|
}
|
|
});
|
|
|
|
//dummy upload
|
|
setTimeout(function() {
|
|
if ("FileReader" in window) {
|
|
//for browsers that have a thumbnail of selected image
|
|
var thumb = $('#avatar2').next().find('img').data('thumb');
|
|
if (thumb) $('#avatar2').get(0).src = thumb;
|
|
}
|
|
|
|
deferred.resolve({
|
|
'status': 'OK'
|
|
});
|
|
|
|
/*if(last_gritter) $.gritter.remove(last_gritter);
|
|
last_gritter = $.gritter.add({
|
|
title: 'Signature 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['emp_sign']) || $row['emp_sign'] == 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');
|
|
})
|
|
}*/
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////
|
|
|
|
//right & left position
|
|
//show the user info on right or left depending on its position
|
|
$('#user-profile-3 .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();
|
|
});
|
|
});
|
|
|
|
|
|
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>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('common_ace.php'); ?>
|
|
<script>
|
|
$(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) {
|
|
|
|
}
|
|
})
|
|
});
|
|
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);
|
|
// alert();
|
|
|
|
$('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_cadre").val(data.emp_cadre_id);
|
|
|
|
|
|
$("#emp_designation").val(data.designation_id);
|
|
|
|
$("#ohc_type_id").val(data.ohc_type_id);
|
|
$("#blood_group").val(data.blood_group);
|
|
$("#dep_loc").val(data.deployment_location);
|
|
$("#manager_emp_id").val(data.emp_mgr_cd);
|
|
$("#has_first_aid").val(data.is_first_aid);
|
|
$("#has_disabled").val(data.is_disabled);
|
|
$("#phone_no").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();
|
|
$('#emp_cadre').select2();
|
|
$('#ohc_type_id').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);
|
|
// }
|
|
}
|
|
|
|
function calculateAge1(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 == "2")
|
|
// $("#employee_div").hide();
|
|
// else
|
|
// $("#employee_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();
|
|
}
|
|
}
|
|
// showOrHideForDep($("#bussiness_unit").val());
|
|
|
|
// function showOrHideForDep(value) {
|
|
// if (value == "1")
|
|
// $("#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 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 for sickness filter
|
|
function showFilter_sickness(btn) {
|
|
// alert(btn);
|
|
$('#filterOf_sickness').val(btn);
|
|
if (btn == 'sort') {
|
|
$('#search_filter_sickness').hide();
|
|
$('#search_input_sickness').hide();
|
|
$('#sort_filter_sickness').toggle();
|
|
// $('#sort_input').show();
|
|
} else if (btn == 'search') {
|
|
$('#sort_filter_sickness').hide();
|
|
// $('#sort_input_meh').hide();
|
|
$('#search_filter_sickness').toggle();
|
|
$('#search_input_sickness').toggle();
|
|
} else {
|
|
$('#sort_filter_sickness').hide();
|
|
// $('#sort_input_meh').hide();
|
|
$('#search_filter_sickness').hide();
|
|
$('#search_input_sickness').hide();
|
|
}
|
|
var x = document.getElementById("search_filter_sickness");
|
|
var y = document.getElementById("sort_filter_sickness");
|
|
if (x.style.display === "none" && y.style.display === "none") {
|
|
|
|
$('#selected_filter_sickness').hide();
|
|
} else {
|
|
$('#selected_filter_sickness').show();
|
|
}
|
|
|
|
}
|
|
|
|
const wage_sickness = document.getElementById('search_input_sickness');
|
|
if (wage_sickness) {
|
|
wage_sickness.addEventListener('keydown', (e) => {
|
|
if (e.key === 'Enter') {
|
|
getShowingData_sickness();
|
|
}
|
|
});
|
|
}
|
|
|
|
function getShowingData_sickness() {
|
|
|
|
var emp_id = '<?= $_REQUEST['emp_id'] ?>';
|
|
var filterOf_sickness = $("#filterOf_sickness").val();
|
|
var sort_filter_sickness = $("#sort_filter_sickness").val();
|
|
var search_filter_sickness = $("#search_filter_sickness").val();
|
|
var search_input_sickness = $("#search_input_sickness").val();
|
|
// alert(filterOf);
|
|
$.ajax({
|
|
url: 'filter_emp_sickness_data.php',
|
|
data: {
|
|
emp_id: emp_id,
|
|
filterOf: filterOf_sickness,
|
|
sort_filter: sort_filter_sickness,
|
|
search_filter: search_filter_sickness,
|
|
search_input: search_input_sickness
|
|
|
|
},
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// alert(data[0]['task']);
|
|
var content = '';
|
|
content +=
|
|
' <thead><tr><th style="text-align:center">Sr No</th><th style="text-align:center">sicknes Date</th><th style="text-align:center">Ailment Name</th><th style="text-align:center">Attended Doctor</th><th style="text-align:center"></th></tr></thead><tbody'
|
|
for (var l = 0; l < data.length; l++) {
|
|
var ailment_name = data[l]['ailment_name'];
|
|
var sickness_date = data[l]['sickness_date'];
|
|
var att_docter = data[l]['att_docter'];
|
|
var pdf = data[l]['pdf'];
|
|
|
|
var sickness_id = data[l]['sickness_id'];
|
|
|
|
|
|
content += "<tr><td> " + (l + 1) + " </td> <td> " +
|
|
sickness_date +
|
|
" </td> <td> " + ailment_name +
|
|
"</td><td> " +
|
|
att_docter +
|
|
" </td><td> " + pdf + "</td> </tr> ";
|
|
}
|
|
|
|
$("#sickness_table").html(content);
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
// function for opd filter
|
|
|
|
function showFilter_opd(btn) {
|
|
// alert(btn);
|
|
$('#filterOf_opd').val(btn);
|
|
if (btn == 'sort') {
|
|
$('#search_filter_opd').hide();
|
|
$('#search_input_opd').hide();
|
|
$('#sort_filter_opd').toggle();
|
|
// $('#sort_input').show();
|
|
} else if (btn == 'search') {
|
|
$('#sort_filter_opd').hide();
|
|
// $('#sort_input_meh').hide();
|
|
$('#search_filter_opd').toggle();
|
|
$('#search_input_opd').toggle();
|
|
} else {
|
|
$('#sort_filter_opd').hide();
|
|
// $('#sort_input_meh').hide();
|
|
$('#search_filter_opd').hide();
|
|
$('#search_input_opd').hide();
|
|
}
|
|
var x = document.getElementById("search_filter_opd");
|
|
var y = document.getElementById("sort_filter_opd");
|
|
if (x.style.display === "none" && y.style.display === "none") {
|
|
|
|
$('#selected_filter_opd').hide();
|
|
} else {
|
|
$('#selected_filter_opd').show();
|
|
}
|
|
|
|
}
|
|
|
|
const wage_opd = document.getElementById('search_input_opd');
|
|
if (wage_opd) {
|
|
wage_opd.addEventListener('keydown', (e) => {
|
|
if (e.key === 'Enter') {
|
|
getShowingData_opd();
|
|
}
|
|
});
|
|
}
|
|
|
|
function getShowingData_opd() {
|
|
|
|
var emp_id = '<?= $_REQUEST['emp_id'] ?>';
|
|
var filterOf_opd = $("#filterOf_opd").val();
|
|
var sort_filter_opd = $("#sort_filter_opd").val();
|
|
var search_filter_opd = $("#search_filter_opd").val();
|
|
var search_input_opd = $("#search_input_opd").val();
|
|
// alert(filterOf);
|
|
$.ajax({
|
|
url: 'filter_emp_opd_injury_data.php',
|
|
data: {
|
|
emp_id: emp_id,
|
|
filterOf: filterOf_opd,
|
|
sort_filter: sort_filter_opd,
|
|
search_filter: search_filter_opd,
|
|
search_input: search_input_opd
|
|
|
|
},
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// alert(data[0]['task']);
|
|
var content = '';
|
|
content +=
|
|
' <thead><tr><th style="text-align: center">Sr No</th><th style="text-align: center">OPD/Injury</th><th style="text-align: center">Appointment Date</th><th style="text-align: center">Attended By</th><th style="text-align: center">Prescription</th><th style="text-align: center;">Other Supporting Documents</th></tr></thead><tbody>'
|
|
for (var l = 0; l < data.length; l++) {
|
|
var appointment_type = data[l]['appointment_type'];
|
|
var appointment_date = data[l]['appointment_date'];
|
|
var sign_officer_name = data[l]['sign_officer_name'];
|
|
var prescrition = data[l]['prescrition'];
|
|
var other_doc = data[l]['other_doc'];
|
|
var task = '';
|
|
if (appointment_type == 'O') task = "OPD";
|
|
else if (appointment_type == 'I') task = "INJURY";
|
|
|
|
var appointment_id = data[l]['medical_exam_id'];
|
|
|
|
|
|
content += "<tr><td> " + (l + 1) + " </td> <td> " +
|
|
task +
|
|
" </td> <td> " + appointment_date +
|
|
"</td><td> " +
|
|
sign_officer_name +
|
|
" </td><td> " + prescrition + "</td><td>" + other_doc + "</td></tr> ";
|
|
}
|
|
|
|
$("#opd_injury_table").html(content);
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
// function for meh filter
|
|
function showFilter_meh(btn) {
|
|
// alert(btn);
|
|
$('#filterOf_meh').val(btn);
|
|
if (btn == 'sort') {
|
|
$('#search_filter_meh').hide();
|
|
$('#search_input_meh').hide();
|
|
$('#sort_filter_meh').toggle();
|
|
// $('#sort_input').show();
|
|
} else if (btn == 'search') {
|
|
$('#sort_filter_meh').hide();
|
|
// $('#sort_input_meh').hide();
|
|
$('#search_filter_meh').toggle();
|
|
$('#search_input_meh').toggle();
|
|
} else {
|
|
$('#sort_filter_meh').hide();
|
|
// $('#sort_input_meh').hide();
|
|
$('#search_filter_meh').hide();
|
|
$('#search_input_meh').hide();
|
|
}
|
|
var x = document.getElementById("search_filter_meh");
|
|
var y = document.getElementById("sort_filter_meh");
|
|
if (x.style.display === "none" && y.style.display === "none") {
|
|
|
|
$('#selected_filter_meh').hide();
|
|
} else {
|
|
$('#selected_filter_meh').show();
|
|
}
|
|
|
|
}
|
|
|
|
const wage_meh = document.getElementById('search_input_meh');
|
|
if (wage_meh) {
|
|
wage_meh.addEventListener('keydown', (e) => {
|
|
if (e.key === 'Enter') {
|
|
getShowingData_meh();
|
|
}
|
|
});
|
|
}
|
|
|
|
function getShowingData_meh() {
|
|
|
|
var emp_id = '<?= $_REQUEST['emp_id'] ?>';
|
|
var filterOf_meh = $("#filterOf_meh").val();
|
|
var sort_filter_meh = $("#sort_filter_meh").val();
|
|
var search_filter_meh = $("#search_filter_meh").val();
|
|
var search_input_meh = $("#search_input_meh").val();
|
|
// alert(filterOf);
|
|
$.ajax({
|
|
url: 'filter_medical_exam_history_emp.php',
|
|
data: {
|
|
emp_id: emp_id,
|
|
filterOf: filterOf_meh,
|
|
sort_filter: sort_filter_meh,
|
|
search_filter: search_filter_meh,
|
|
search_input: search_input_meh
|
|
|
|
},
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// alert(data[0]['task']);
|
|
var content = '';
|
|
content +=
|
|
'<thead><tr align="center"><th width="15%" style="text-align: center">S.No.</th><th width="15%" style="text-align: center">Medical Examination Type</th><th width="15%" style="text-align: center">Medical Examination Date</th><th width="15%" style="text-align: center">Review By Doctor</th><th width="15%" style="text-align: center">Medical forms</th><th width="15%" style="text-align: center">Other Supporting Documents</th>/tr></thead> '
|
|
for (var l = 0; l < data.length; l++) {
|
|
var checkup_type_name = data[l]['checkup_type_name'];
|
|
var checkup_date = data[l]['checkup_date'];
|
|
var sign_officer_name = data[l]['sign_officer_name'];
|
|
var form = data[l]['form'];
|
|
var other_doc = data[l]["other_doc"];
|
|
content += "<tr><td> " + (l + 1) + " </td> <td> " +
|
|
checkup_type_name +
|
|
" </td> <td> " + checkup_date +
|
|
"</td><td> " +
|
|
sign_officer_name +
|
|
" </td><td> " + form + "</td><td>" + other_doc + "</td></tr> ";
|
|
}
|
|
|
|
$("#medical_exam_history_table").html(content);
|
|
//opd and injury followup data//
|
|
|
|
//BootstrapDialog.alert('Health Indexes Between ' + start + ' and ' + end);
|
|
|
|
},
|
|
error: function(data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
// function for vaccine details
|
|
function showFilter(btn) {
|
|
// alert(btn);
|
|
$('#filterOf').val(btn);
|
|
$('#selected_filter').show();
|
|
if (btn == 'sort') {
|
|
$('#search_filter').hide();
|
|
$('#search_input').hide();
|
|
$('#sort_filter').show();
|
|
// $('#sort_input').show();
|
|
} else if (btn == 'search') {
|
|
$('#sort_filter').hide();
|
|
// $('#sort_input').hide();
|
|
$('#search_filter').show();
|
|
$('#search_input').show();
|
|
} else {
|
|
$('#sort_filter').hide();
|
|
// $('#sort_input').hide();
|
|
$('#search_filter').hide();
|
|
$('#search_input').hide();
|
|
}
|
|
}
|
|
const wage = document.getElementById('search_input');
|
|
if (wage) {
|
|
wage.addEventListener('keydown', (e) => {
|
|
if (e.key === 'Enter') {
|
|
getShowingData();
|
|
}
|
|
});
|
|
}
|
|
|
|
function getShowingData() {
|
|
|
|
var emp_id = '<?= $_REQUEST['emp_id'] ?>';
|
|
var filterOf = $("#filterOf").val();
|
|
var sort_filter = $("#sort_filter").val();
|
|
var search_filter = $("#search_filter").val();
|
|
var search_input = $("#search_input").val();
|
|
// alert(filterOf);
|
|
$.ajax({
|
|
url: 'filter_vaccination.php',
|
|
data: {
|
|
emp_id: emp_id,
|
|
filterOf: filterOf,
|
|
sort_filter: sort_filter,
|
|
search_filter: search_filter,
|
|
search_input: search_input
|
|
|
|
},
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// alert(data.length);
|
|
// $('#total_checkup').val(data.);
|
|
// $('#total_followup').val(data['total_followup']);
|
|
// $('#show_max_date').val(data['max_date']);
|
|
// $('#show_min_date').val(data['min_date']);
|
|
|
|
var content = '';
|
|
content +=
|
|
"<thead><td >Sr No. </td><td> VACCINE NAME </td><td> 1st VACCINE DOSE </td><td> 1st VACCINE CENTER </td><td>2nd VACCINE DOSE </td><td> 2nd VACCINE CENTER </td><td>3rd VACCINE DOSE </td><td> 3rd VACCINE CENTER </td><td> Remarks</td><td > </td></thead><tbody > "
|
|
for (var l = 0; l < data.length; l++) {
|
|
var vaccine_name = data[l]['vaccine_name'];
|
|
var vac_d1 = data[l]['vac_d1'];
|
|
var vac_d2 = data[l]['vac_d2'];
|
|
var vac_d3 = data[l]['vac_d3'];
|
|
|
|
var vac_center1 = data[l]['vac_center1'];
|
|
var vac_center2 = data[l]['vac_center2'];
|
|
var vac_center3 = data[l]['vac_center3'];
|
|
var remarks = data[l]['remarks']
|
|
var id = data[l]['id']
|
|
content += "<tr><td> " + (l + 1) + " </td> <td> " +
|
|
vaccine_name + " </td> <td> " + vac_d1 +
|
|
"</td><td> " +
|
|
vac_center1 +
|
|
" </td><td> " + vac_d2 + "</td> <td>" +
|
|
vac_center2 + " </td> <td> " +
|
|
vac_d3 + " </td> <td>" +
|
|
vac_center3 +
|
|
" </td> <td>" +
|
|
remarks +
|
|
" </td><td align='center'><div style='text-align: left; width: 117.99px;'><a href='#' class='green'onclick='open_vaccine_details('" +
|
|
id +
|
|
"','V');'><i class = 'ace-icon fa fa-search-plus bigger-130'></i></a><a href = '#' class = 'blue' onclick = 'open_vaccine_details('" +
|
|
id +
|
|
"','E');><i class = 'ace-icon fa fa-pencil bigger-130' ></i></a> <a href = '#' class = 'red' onclick = 'delete_vaccine_details('" +
|
|
id +
|
|
"','E');'><i style = 'font-size: 20px;'class = 'ace-icon fa fa-trash-o bigger-130'></i></a> </td></tr > ";
|
|
}
|
|
|
|
$("#vaccination_details_table").html(content);
|
|
//opd and injury followup data//
|
|
|
|
//BootstrapDialog.alert('Health Indexes Between ' + start + ' and ' + end);
|
|
|
|
},
|
|
error: function(data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function delete_vaccine_details(unit_id) {
|
|
$("#unit_id").val(unit_id);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the Vaccination Data?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_vaccination_detail.php',
|
|
type: "POST",
|
|
data: {
|
|
id: unit_id
|
|
},
|
|
success: function(data) {
|
|
if (data.indexOf("SUCCESS") != -1) {
|
|
BootstrapDialog.alert('Details Deleted Successfully.');
|
|
// $("#vaccination_details_table").flexReload();
|
|
location.reload();
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting Details');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting Details');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function open_vaccine_details(employeeId, action) {
|
|
// var id = "";
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
|
|
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url: 'select_vaccination_id.php?',
|
|
type: 'POST',
|
|
data: {
|
|
|
|
id: employeeId,
|
|
|
|
},
|
|
success: function(data) {
|
|
//alert(data);
|
|
data = $.parseJSON(data);
|
|
//alert(data);
|
|
|
|
$("#vac_id0").val(data.id);
|
|
$("#vac_name0").val(data.vac_id);
|
|
$("#dose1_0").val((data.vac_d1));
|
|
$("#vac_center1_0").val(data.vac_center1);
|
|
$("#dose2_0").val((data.vac_d2));
|
|
$("#vac_center2_0").val((data.vac_center2));
|
|
$("#dose3_0").val((data.vac_d3));
|
|
$("#vac_center3_0").val((data.vac_center3));
|
|
$("#remarks_0").val((data.remarks));
|
|
|
|
// $('#modal-add-patient_master').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating User');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function save_employee() {
|
|
var patient_name = $('#patient_name').val();
|
|
if (patient_name == '') {
|
|
BootstrapDialog.alert('Please Enter Patient Name.!!!');
|
|
return false;
|
|
}
|
|
// var emp_code = $('#emp_code').val();
|
|
// if (emp_code == '') {
|
|
// BootstrapDialog.alert('Please Enter Emp Code.!!!');
|
|
// return false;
|
|
// }
|
|
var dob = $('#dob').val();
|
|
if (dob == '') {
|
|
BootstrapDialog.alert('Please Enter Date Of Birth.!!!');
|
|
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 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/Gate Pass No.!!!');
|
|
return false;
|
|
}*/
|
|
// var emp_type_id = $('#emp_type_id').val();
|
|
// if (emp_type_id == '') {
|
|
// BootstrapDialog.alert('Please select Patient Type 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').val() == '') {
|
|
// BootstrapDialog.alert('Please Enter Aadhar no.!!!');
|
|
// return false;
|
|
// }
|
|
// if (($('#aadhar_no').val()).length != 12) {
|
|
// BootstrapDialog.alert('Please Enter 12 Digit Aadhar no.!!!');
|
|
// return false;
|
|
// }
|
|
// if ($('#primary_phone').val() == '') {
|
|
// BootstrapDialog.alert('Please Enter Phone no.!!!');
|
|
// return false;
|
|
// }
|
|
// if (($('#primary_phone').val()).length != 10) {
|
|
// BootstrapDialog.alert('Please Enter 10 Digit Phone no.!!!');
|
|
// 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) {
|
|
// if(data.)
|
|
data = JSON.parse(data);
|
|
if (data.id != "" && data.id != null) {
|
|
//$("#patient_id").val(data.patient_id)
|
|
BootstrapDialog.alert('Patient Details Updated Successfully.');
|
|
} else if (data.patient_id != "" && data.patient_id != null) {
|
|
$("#patient_id").val(data.patient_id)
|
|
BootstrapDialog.alert('Patient Details Updated Successfully.');
|
|
}
|
|
//$("#flex1").flexReload();
|
|
$('.close').click();
|
|
location.reload();
|
|
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>
|
|
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 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);
|
|
// }
|
|
// }
|
|
|
|
|
|
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><div class=\"input-group\"><input class=\"form-control col-sm-2 date-picker\" id=\"dobb" + count +
|
|
"\" name=\"dobb" + count + "\" type=\"text\" readonly onChange=\"calculateAge('dobb" + count +
|
|
"','age1')\" data-date-format=\"dd/mm/yyyy\" placeholder=\"Date of Birth(dd/mm/yyyy)\" value=''><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('age1','dobb" +
|
|
count + "')\" placeholder=\"Age if DOB unknown\"></div></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 cal_total(counter) {
|
|
var medlimit = $('#med_limit' + counter).val();
|
|
var approvedlimit = $('#approved_buffer' + counter).val();
|
|
|
|
var total = parseInt(medlimit) + parseInt(approvedlimit);
|
|
|
|
$('#total_limit' + counter).val(total);
|
|
}
|
|
|
|
function cal_balance(counter) {
|
|
var total_limit = $('#total_limit' + counter).val();
|
|
var approved_buffer = $('#approved_buffer' + counter).val();
|
|
var utilized_amount = $('#utilized_amount' + counter).val();
|
|
|
|
if (parseInt(utilized_amount) > parseInt(total_limit)) {
|
|
BootstrapDialog.alert('Invalid Entry!!!');
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var balance = "";
|
|
}
|
|
|
|
var balance = parseInt(total_limit) + parseInt(approved_buffer) - parseInt(utilized_amount);
|
|
|
|
$('#balance' + counter).val(balance);
|
|
}
|
|
|
|
function cal_npbalance(counter) {
|
|
var npmed_limit = $('#nonpay_med_limit' + counter).val();
|
|
|
|
var nputilized_amount = $('#nputilized_amount' + counter).val();
|
|
|
|
if (parseInt(nputilized_amount) > parseInt(npmed_limit)) {
|
|
BootstrapDialog.alert('Invalid Entry!!!');
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var balance = "";
|
|
}
|
|
|
|
var balance = parseInt(npmed_limit) - parseInt(nputilized_amount);
|
|
|
|
$('#npbalance' + counter).val(balance);
|
|
}
|
|
|
|
function cal_disbalance(counter) {
|
|
var dismed_limit = $('#dismed_limit' + counter).val();
|
|
var disutilized_amount = $('#disutilized_amount' + counter).val();
|
|
|
|
if (parseInt(disutilized_amount) > parseInt(dismed_limit)) {
|
|
BootstrapDialog.alert('Invalid Entry!!!');
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var balance = "";
|
|
}
|
|
|
|
var balance = parseInt(dismed_limit) - parseInt(disutilized_amount);
|
|
|
|
$('#disbalance' + counter).val(balance);
|
|
}
|
|
|
|
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_pdf_fitness(page, fitness_id) {
|
|
$("#flex_sickness_id").val(fitness_id);
|
|
$("#flex_fitness_form_pdf").attr('method', 'POST');
|
|
$("#flex_fitness_form_pdf").attr('action', page);
|
|
$("#flex_fitness_form_pdf").submit();
|
|
}
|
|
|
|
function open_form_pdf(page, medical_exam_id) {
|
|
$("#medical_examform_id").val(medical_exam_id);
|
|
$("#flex_form_pdf").attr('method', 'POST');
|
|
$("#flex_form_pdf").attr('action', page);
|
|
$("#flex_form_pdf").submit();
|
|
}
|
|
|
|
function open_appointment_pdf(page, appointtment_id) {
|
|
$("#appointment_idpdf").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_fitness_form_pdf" method="post" action="" target="_blank" id="flex_fitness_form_pdf">
|
|
<input type="hidden" name="flex_sickness_id" id="flex_sickness_id">
|
|
</form>
|
|
<form style="display: none" name="flex_form_pdf" method="post" action="" target="_blank" id="flex_form_pdf">
|
|
<input type="hidden" name="medical_examform_id" id="medical_examform_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_idpdf" id="appointment_idpdf">
|
|
</form>
|
|
|
|
<script>
|
|
function selectRow(patient_id) {
|
|
// alert(patient_id);
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'select_patient.php',
|
|
data: {
|
|
'key_val': patient_id,
|
|
key: 'id'
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// alert(data.emp_photo)
|
|
|
|
if (data.emp_image_type == null || data.emp_image_type == '') {
|
|
|
|
$("#avatar").attr("src", "images/male-profile.png");
|
|
} else {
|
|
$("#avatar").attr("src", "data:" + data.emp_image_type + ";base64," + data.emp_photo);
|
|
}
|
|
|
|
|
|
|
|
if (data.image_type == null || data.image_type == '') {
|
|
$("#avatar2").attr("src", "images/no_image.png");
|
|
} else {
|
|
$("#avatar2").attr("src", "data:" + data.image_type + ";base64," + data.emp_sign);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$("#emp_cadre").val(data.emp_cadre);
|
|
$("#patient_id").val(data.id)
|
|
$("#ohc_type_id").val(data.ohc_type_id)
|
|
$("#flex_opd_id").val(data.id)
|
|
$("#update_button").show();
|
|
$("#save_button").hide();
|
|
$("#father_name").val(data.father_name);
|
|
$("#patient_name").val(data.patient_name);
|
|
$("#is_ohc_staff").val(data.is_ohc_staff);
|
|
$("#bussiness_unit").val(data.bu_id);
|
|
$("#dept").val(data.dept_id);
|
|
$("#section").val(data.section_id);
|
|
$("#sub_section").val(data.sub_section_id);
|
|
$("#primary_phone").val(data.primary_phone);
|
|
$("#aadhar_no").val(data.aadhar_no);
|
|
$("#client_id").val(data.client_id);
|
|
$("#client_id").select2();
|
|
addClientLocation(data.client_location_id);
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
$("#employer_contractor_id").val(data.employer_contractor_id);
|
|
$("#manager_emp_id").val(data.emp_mgr_code);
|
|
$("#emp_mgr_name").val(getFieldValue("concat(patient_name,'(',emp_code,')')", 'patient_master', 'id', data.emp_mgr_code, 'emp_mgr_name'));
|
|
$("#emp_designation").val(data.designation_id)
|
|
$("#blood_group").val(data.blood_group);
|
|
$("#dep_loc").val(data.deployment_location);
|
|
|
|
$("#has_first_aid").val(data.is_first_aid);
|
|
$("#has_disabled").val(data.is_disabled);
|
|
$("#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);
|
|
$("#primary_patient_id").val(data.primary_patient_id);
|
|
$("#relation_type").val(data.relation_type);
|
|
$("#dob").val(myDateFormater(data.dob))
|
|
$('#employer_contractor_id').select2();
|
|
//$("#manager_emp_id").select2();
|
|
$('#emp_designation').select2();
|
|
//$("#primary_patient_id").select2();
|
|
checkPatient();
|
|
|
|
var gender = "";
|
|
if (data.gender == 'M')
|
|
gender = "Male"
|
|
else if (data.gender == 'F')
|
|
gender = "Female"
|
|
else
|
|
gender = "Others"
|
|
if (data.status == '1')
|
|
status = 'Active'
|
|
else
|
|
status = 'Inactive';
|
|
|
|
$("#dependent_icon").show();
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Fetching Patient Record');
|
|
}
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
function addClientLocation(client_location_id){
|
|
let client_id = $("#client_id").val();
|
|
$('#client_location').html(" ");
|
|
$('#client_location').append('<option value=""> </option>');
|
|
$.ajax({
|
|
async:'false',
|
|
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);
|
|
$("#client_location").val(client_location_id);
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function calcAge(dateString) {
|
|
var birthday = +new Date(dateString);
|
|
return ~~((Date.now() - birthday) / (31557600000));
|
|
}
|
|
|
|
function printDiv(divName) {
|
|
$("#update_button").hide();
|
|
$("#printPageButton").hide();
|
|
|
|
var printContents = document.getElementById(divName).innerHTML;
|
|
var originalContents = document.body.innerHTML;
|
|
|
|
document.body.innerHTML = printContents;
|
|
|
|
window.print();
|
|
|
|
document.body.innerHTML = originalContents;
|
|
$("#printPageButton").show();
|
|
$("#update_button").show();
|
|
}
|
|
|
|
|
|
window.onload = selectRow($('#patient_id').val());
|
|
var src = 'select_patient_list.php';
|
|
|
|
$(function() {
|
|
function log(message) {
|
|
$("<div>").text(message).prependTo("#log");
|
|
$("#log").scrollTop(0);
|
|
}
|
|
|
|
$("#emp_mgr").autocomplete({
|
|
source: function(request, response) {
|
|
$.ajax({
|
|
url: src,
|
|
dataType: "json",
|
|
data: {
|
|
"searchParam": request.term
|
|
},
|
|
success: function(data) {
|
|
$("#mgrListTable tbody tr").remove();
|
|
var table = $("#mgrListTable");
|
|
|
|
if (data.length != 0) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
item = data[i];
|
|
table.append("<tr onClick=\"setSuperVisor(" + item.id + ",'" + item.patient_name + "(" + item.emp_code + ")')\"><td>" + item.patient_name + "</td></tr>");
|
|
}
|
|
|
|
}
|
|
$("#mgrListTable").show();
|
|
$("#mgrListDiv").show();
|
|
}
|
|
});
|
|
},
|
|
minLength: 3,
|
|
delay: 300,
|
|
select: function(event, ui) {
|
|
log(ui.item ?
|
|
"Selected: " + ui.item.label :
|
|
"Nothing selected, input was " + this.value);
|
|
},
|
|
open: function() {
|
|
$(this).removeClass("ui-corner-all").addClass("ui-corner-top");
|
|
},
|
|
close: function() {
|
|
$(this).removeClass("ui-corner-top").addClass("ui-corner-all");
|
|
}
|
|
});
|
|
});
|
|
|
|
function setPrimaryPatient(emp_id, emp_code) {
|
|
$("#primary_patientListTable").hide();
|
|
$("#primary_patientListDiv").hide();
|
|
$("#primary_patient").val('');
|
|
$("#primary_patient_name").val(emp_code);
|
|
$("#primary_patient_id").val(emp_id);
|
|
}
|
|
|
|
function setSuperVisor(mgr_emp_id, emp_code) {
|
|
$("#mgrListTable").hide();
|
|
$("#mgrListDiv").hide();
|
|
$("#emp_mgr").val('');
|
|
$("#emp_mgr_name").val(emp_code);
|
|
$("#manager_emp_id").val(mgr_emp_id);
|
|
}
|
|
</script>
|
|
<style>
|
|
#mgrListDiv {
|
|
overflow: scroll;
|
|
display: none;
|
|
position: absolute;
|
|
background-color: #fff;
|
|
width: 100%;
|
|
margin-top: 30px;
|
|
overflow: auto;
|
|
border: 1px solid #ddd;
|
|
z-index: 111;
|
|
}
|
|
|
|
#primary_patientListDiv {
|
|
overflow: scroll;
|
|
display: none;
|
|
position: absolute;
|
|
background-color: #fff;
|
|
width: 100%;
|
|
margin-top: 30px;
|
|
overflow: auto;
|
|
border: 1px solid #ddd;
|
|
z-index: 111;
|
|
}
|
|
</style>
|