1921 lines
95 KiB
PHP
1921 lines
95 KiB
PHP
<?php include('techsyn_header.php');
|
|
$pre_emp_cat_id = getTableFieldValue('patient_category', 'patient_cat_id', 'patient_cat_name', '"Pre Employment"');
|
|
$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-->
|
|
<style>
|
|
#loader {
|
|
border: 12px solid #f3f3f3;
|
|
border-radius: 50%;
|
|
border-top: 12px solid #444444;
|
|
width: 70px;
|
|
height: 70px;
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
</style>
|
|
<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 -->
|
|
<div class="page-content">
|
|
<div class="box box-primary" style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%;">
|
|
<div class="box-header with-border">
|
|
<h3 class="box-title">Patient Profile</h3>
|
|
</div>
|
|
<div id="user-profile-2">
|
|
<form class="form-horizontal" id="employee_form" name="employee_form" enctype="multipart/form-data" action="#" method="post">
|
|
<div class="box-body">
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-2">
|
|
<span class="profile-picture"> <img class="editable img-responsive" style="width: 120px; height: 120px" alt="Patient Profile Pic" id="avatar" src="images/male-profile.png" />
|
|
</span>
|
|
<div class="space space-4"></div>
|
|
<div class="hide" id="uploadForm"></div>
|
|
<div id="loader" class="center">
|
|
</div>
|
|
|
|
<div class="hide" id="uploadForm"></div>
|
|
<input type="file" name="photoDM" id="photoDM" class="form-control" style="display: none;">
|
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
|
|
Launch Camera
|
|
</button>
|
|
|
|
</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 class="form-control" name="patient_category" onchange="showOrHideForDiv(this.value)" id="patient_category">
|
|
<?php echo generateOption('patient_category', 'patient_cat_name', 'patient_cat_id', '1', ''); ?>
|
|
</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"></div>
|
|
|
|
<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-10">
|
|
<div class="input-group">
|
|
<?php include('patient_search_list.php'); ?>
|
|
<input type="hidden" name="patient_id" id="patient_id" />
|
|
<input type="hidden" name="flex_patient_id" id="flex_patient_id" />
|
|
<span class="input-group-addon"><i style="font-size: 17px;cursor: pointer; color: blue;display: none;" class="glyphicon glyphicon-user" onclick="getDependentList()" id="dependent_icon" title="Show Dependent List"></i>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="form-group" style="display: none;" id="dependent_list">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-first">Dependent List</label>
|
|
|
|
<div class="col-sm-9">
|
|
<select name="dependent_list_select" id="dependent_list_select" class="form-control select2" style="width: 50px;">
|
|
<option value=""></option>
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<input type="hidden" id="task" name="task" value="<?= $_REQUEST['task'] ?>">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-username"> Father's Name</label>
|
|
<div class="col-sm-10">
|
|
<input class="form-control" style="text-transform: uppercase;" type="text" name="father_name" id="father_name" placeholder="Father's Name">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div id="patient_info" style="margin-left: 151px"></div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<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" id='dob_mendetory'>*</span></label>
|
|
<div class="col-sm-4">
|
|
|
|
<div class="input-group">
|
|
<input class="form-control col-sm-2 date-picker" id="dob" style="z-index: 0" name="dob" type="text" 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" style="z-index: 0" type="number" id="emp_age" name="emp_age" onChange="checkAge('emp_age','dob')" placeholder="Age if DOB unknown">
|
|
</div>
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="gender" style="vertical-align: top"></label>
|
|
<div class="col-sm-4" style="vertical-align: top">
|
|
<label class="inline"> <input name="gender" id="gender" type="radio" class="ace" value="M" 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 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">
|
|
<div id="employee_code_div">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Employee ID <span style="color: red">*</span></label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="emp_code" name="emp_code" onchange="check_existing_emp(this, 'ecode',this.value)">
|
|
</div>
|
|
</div>
|
|
<div id="employee_contractor_div">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Employer/Contractor</label>
|
|
<div class="col-sm-4">
|
|
<div class="input-group">
|
|
<select class="form-control select2 col-sm-3" name="employer_contractor_id" style="width: 83%" id="employer_contractor_id">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('employer_contractor', 'employer_contractor_name', '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>
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
<div id="blood_group_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', '', ''); ?>
|
|
</select>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div id="bussiness_unit_div">
|
|
<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>
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
<div id="section_div">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Section</label>
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2" name="section" id="section">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('section', 'section_name', 'section_id', $section_id, ''); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div id="dept_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 disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('department', 'dept_name', 'dept_id', '', ''); ?>
|
|
</select>
|
|
|
|
</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">
|
|
<div id="emp_cadre_div">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Employee Cadre</label>
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2" id="emp_cadre" name="emp_cadre" data-placeholder="">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('emp_cadre', 'emp_cadre', 'emp_cadre_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="emp_designation_div">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Designation</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2 col-sm-3" name="emp_designation" id="emp_designation" style="width: 100%;">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('designation', 'designation_name', 'designation_id', '', ''); ?>
|
|
</select>
|
|
|
|
|
|
</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">
|
|
<div id="emp_grade_div">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Grade</label>
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2" id="emp_grade" name="emp_grade" data-placeholder="">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('grade_master', 'grade_name', 'grade_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="emp_plant_div">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Plant</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2 col-sm-3" name="emp_plant" id="emp_plant" style="width: 100%;">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('plant_master', 'plant_name', 'plant_id', '', ''); ?>
|
|
</select>
|
|
|
|
|
|
</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">
|
|
<div id="aadhar_no_div">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Aadhar No</label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="number" id="aadhar_no" name="aadhar_no" placeholder="Enter Aadhar" onchange="check_existing_emp(this,'aadhar',this.value)">
|
|
</div>
|
|
</div>
|
|
|
|
<div id="emp_mgr_div">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Supervisor</label>
|
|
<div class="col-sm-4">
|
|
<div class="input-group">
|
|
<input class="form-control col-sm-1 " name="emp_mgr" id="emp_mgr" onChange=' $("#mgrListTable").toggle("show"); $("#mgrListDiv").toggle("show");' />
|
|
<div id="mgrListDiv" class="dropdown-content">
|
|
<table id="mgrListTable" class="table table-bordered table-hover">
|
|
|
|
<tbody>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
</div> <span class="input-group-addon"> <i class="ace-icon fa fa-search"></i>
|
|
</span> <input class="col-sm-3 form-control" type="text" readonly id="emp_mgr_name" name="emp_mgr_name">
|
|
<input type="hidden" name="manager_emp_id" id="manager_emp_id">
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</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">Location</label>
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2 col-sm-4" name="dep_loc"
|
|
style="width: 100%" id="dep_loc">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('branch', 'branch_name', 'branch_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right"
|
|
for="form-field-comment">Work Type </label>
|
|
|
|
<div class="col-sm-4">
|
|
<select class="form-control select1" name="work_type"
|
|
id="work_type">
|
|
|
|
<option disabled selected> Please select option</option>
|
|
<option value="R" <?php if (strcmp($employee_worktype, 'R') == 0) {
|
|
echo "selected";
|
|
} ?>> R</option>
|
|
<option value="NR" <?php if (strcmp($employee_worktype, 'NR') == 0) {
|
|
echo "selected";
|
|
} ?>>NR</option>
|
|
<option value="E" <?php if (strcmp($employee_worktype, 'E') == 0) {
|
|
echo "selected";
|
|
} ?>> E</option>
|
|
<option value="M" <?php if (strcmp($employee_worktype, 'M') == 0) {
|
|
echo "selected";
|
|
} ?>>M</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">
|
|
<div id="primary_phone_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="number" id="primary_phone" name="primary_phone" placeholder="Enter Phone No">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div id="emp_code_div" style="display: none">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Temp Employee ID</label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" readonly type="text" id="temp_emp_code" name="temp_emp_code" onchange="check_existing_emp(this, 'ecode',this.value)">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="non_employee_div" style="display: none">
|
|
<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">Associated Employee</label>
|
|
<div class="col-sm-4">
|
|
<div class="input-group">
|
|
<input class="form-control col-sm-1 " name="primary_patient" id="primary_patient" onChange=' $("#primary_patientListTable").toggle("show"); $("#primary_patientListDiv").toggle("show");' />
|
|
<div id="primary_patientListDiv" class="dropdown-content">
|
|
<table id="primary_patientListTable" class="table table-bordered table-hover">
|
|
<tbody></tbody>
|
|
</table>
|
|
</div> <span class="input-group-addon"> <i class="ace-icon fa fa-search"></i> </span><input class="col-sm-3 form-control" type="text" readonly id="primary_patient_name" name="primary_patient_name"><input type="hidden" name="primary_patient_id" id="primary_patient_id">
|
|
</div>
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Relation</label>
|
|
<div class="col-sm-4">
|
|
<select class=" form-control" name="relation_type" id="relation_type">
|
|
<option value="" disabled selected>Please Select Relationship
|
|
</option>
|
|
<option value="Spouse">Spouse</option>
|
|
<option value="Son">Son</option>
|
|
<option value="Daughter">Daughter</option>
|
|
<option value="Father">Father</option>
|
|
<option value="Mother">Mother</option>
|
|
<option value="others">Others</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</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
</div>
|
|
</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 class="col-sm-10 col-sm-2"></div>
|
|
<?php if ($_REQUEST['task'] == 'health_survelliance') {
|
|
?>
|
|
<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">
|
|
Checkup Type</label>
|
|
<div class="col-sm-10">
|
|
<select name="checkup_type_id" id="checkup_type_id" class="form-control chosen-select">
|
|
<option value="" disabled selected>--Select Checkup Type--
|
|
</option>
|
|
<?php echo generateCheckupOptionsAccToOhc('checkup_type', 'checkup_type_name', 'checkup_type_id', '', '', 'type_status', 'Active', $_SESSION['current_ohcttype']); ?>
|
|
|
|
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<?php }
|
|
?>
|
|
<?php if ($_REQUEST['task'] == 'direct_medical_entry') {
|
|
?>
|
|
<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">
|
|
Checkup Type</label>
|
|
<div class="col-sm-10">
|
|
<select name="checkup_type_id_direct" id="checkup_type_id_direct" class="form-control chosen-select">
|
|
<option value="" disabled selected>--Select Checkup Type--
|
|
</option>
|
|
<?php echo generateCheckupOptionsAccToOhc('checkup_type', 'checkup_type_name', 'checkup_type_id', '', '', 'type_status', 'Active', $_SESSION['current_ohcttype']); ?>
|
|
|
|
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<?php }
|
|
?>
|
|
<!-- <div class="col-sm-10 col-sm-2"></div> -->
|
|
<?php if ($_REQUEST['task'] == 'direct_test_lab') {
|
|
?>
|
|
<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">
|
|
Checkup Type<span style="color:red">*</span></label>
|
|
<div class="col-sm-10">
|
|
<select name="checkup_type_id" id="checkup_type_id" class="form-control chosen-select">
|
|
<option value="" disabled selected>--Select Lab Checkup Type--
|
|
</option>
|
|
<?php echo generateCheckupOptionsAccToOhc('checkup_type', 'checkup_type_name', 'checkup_type_id', '', '', 'type_state', 'Yes', $_SESSION['current_ohcttype']); ?>
|
|
|
|
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<?php }
|
|
?>
|
|
<?php if ($_REQUEST['task'] == 'direct_test') {
|
|
?>
|
|
<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">
|
|
Checkup Type<span style="color:red">*</span></label>
|
|
<div class="col-sm-10">
|
|
<select name="checkup_type_id" id="checkup_type_id" class="form-control chosen-select">
|
|
<option value="" disabled selected>--Select Lab Checkup Type--
|
|
</option>
|
|
<?php echo generateCheckupOptionsAccToOhc('checkup_type', 'checkup_type_name', 'checkup_type_id', '', '', 'type_state', 'Yes', $_SESSION['current_ohcttype']); ?>
|
|
|
|
|
|
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<?php }
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="box-footer" style="text-align: center">
|
|
<?php // if( $_REQUEST['task']=='ime_long' || $_REQUEST['task']=='ime_short' || $_REQUEST['task']=='visitor_opd'){
|
|
?> <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>
|
|
<?php //}
|
|
?>
|
|
<?php if ($_REQUEST['task'] != 'patients') { ?>
|
|
<button type="button" class="btn btn-success" id='next' name='next' <?php if ($_REQUEST['task'] == 'DIRECT_ENTRY') echo 'disabled' ?> onclick="validatePatient()">
|
|
<i class="ace-icon fa fa-forward"></i> Next
|
|
</button>
|
|
<?php } ?>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!-- /.span -->
|
|
</div>
|
|
<!-- end user profile2 -->
|
|
</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>
|
|
<!-- inline scripts related to this page -->
|
|
<script type="text/javascript">
|
|
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>
|
|
function checkAge(ageField, dobField) {
|
|
var age = $("#" + ageField).val();
|
|
//if($("#"+dobField).val()==''){
|
|
var dobCal = getCalculatedDOBFromAge(age);
|
|
$("#" + dobField).datepicker('setDate', dobCal);
|
|
//}
|
|
}
|
|
|
|
function calculateAge(dobField, ageField) {
|
|
var dob = $("#" + dobField).val();
|
|
if (dob != '') {
|
|
var age = getAge(age);
|
|
$("#" + ageField).val(age);
|
|
}
|
|
}
|
|
</script>
|
|
<script>
|
|
function getDependentList() {
|
|
$('#dependent_list_select').html(" ");
|
|
$('#dependent_list_select').append('<option value=""> </option>');
|
|
let patient_id = $("#patient_id").val();
|
|
$("#dependent_list").show();
|
|
$.ajax({
|
|
type: 'post',
|
|
data: {
|
|
patient_id: patient_id
|
|
},
|
|
url: 'get_dependent_list.php',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// data = JSON.parse(data);
|
|
if (data != '' && data != null) {
|
|
// alert(data);
|
|
$("#dependent_list_select").append(data);
|
|
}
|
|
|
|
},
|
|
error(data) {
|
|
BootstrapDialog.alert("Can't Fetch the dependent list");
|
|
}
|
|
});
|
|
}
|
|
|
|
$("#dependent_list_select").on('change', function() {
|
|
let id = $("#dependent_list_select option:selected").val();
|
|
selectRow(id);
|
|
$("#dependent_list").hide();
|
|
});
|
|
|
|
function getTemEmpCode() {
|
|
var code = $('#temp_emp_code').val();
|
|
|
|
if (code == '' || code == null) {
|
|
$('#temp_emp_code').val('<?= getPreEmployeeEmpCode() ?>')
|
|
}
|
|
}
|
|
|
|
function showOrHideForDiv(value) {
|
|
|
|
if (value == 1 || value == 3) {
|
|
$('#dob_mendetory').show();
|
|
$("#employee_div").show();
|
|
$("#non_employee_div").hide();
|
|
|
|
} else {
|
|
|
|
$("#employee_div").show();
|
|
|
|
if (value == '<?= $pre_emp_cat_id ?>') {
|
|
$('#dob_mendetory').show();
|
|
$("#non_employee_div").hide();
|
|
$("#employee_code_div").hide();
|
|
$("#employee_contractor_div").show();
|
|
$('#emp_code_div').hide();
|
|
$('#bussiness_unit_div').hide();
|
|
$('#section_div').hide();
|
|
$('#dept_div').hide();
|
|
$('#emp_cadre_div').hide();
|
|
$('#emp_designation_div').hide();
|
|
$('#emp_grade_div').hide();
|
|
$('#emp_plant_div').hide();
|
|
$('#emp_mgr_div').hide();
|
|
|
|
|
|
// $("#employee_contractor_div").hide();
|
|
$('#emp_code_div').show();
|
|
getTemEmpCode();
|
|
} else {
|
|
$('#dob_mendetory').hide();
|
|
$('#emp_code_div').hide();
|
|
$("#non_employee_div").show();
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
function showAndHideDivForSubCat(value) {
|
|
if (value == 1)
|
|
$("#emp_sub_category_div").hide();
|
|
else
|
|
$("#emp_sub_category_div").show();
|
|
}
|
|
|
|
function validatePatient() {
|
|
|
|
$("name").val("");
|
|
$("type").val("");
|
|
$("med_date").val("");
|
|
|
|
var task = '<?= $_REQUEST['task'] ?>';
|
|
// alert(task);
|
|
// alert($("#checkup_type_id").val());
|
|
|
|
if ((task == 'health_survelliance' || task == 'direct_test_lab' || task == 'direct_test') &&
|
|
($("#checkup_type_id").val() == null || $("#checkup_type_id").val() == '')) {
|
|
BootstrapDialog.alert('Please Select Checkup Type Before Proceeding Further !');
|
|
return false;
|
|
}
|
|
|
|
if ((task == 'direct_medical_entry') && ($("#checkup_type_id_direct").val() == null || $("#checkup_type_id_direct").val() == '')) {
|
|
BootstrapDialog.alert('Please Select Checkup Type Before Proceeding Further !');
|
|
return false;
|
|
}
|
|
|
|
if (task == 'DIRECT_ENTRY') {
|
|
|
|
}
|
|
// var patient_category = $("#patient_category").val();
|
|
// alert(patient_category);
|
|
// if (patient_category === '1') {
|
|
var department = $('#dept').val();
|
|
// if (department == '' || department == null) {
|
|
// var patient_id = $("#patient_id").val();
|
|
// BootstrapDialog.show({
|
|
// title: 'Information',
|
|
// message: 'Please click ok to go to patient profile to update Department.',
|
|
// buttons: [{
|
|
// label: 'OK',
|
|
// action: function(dialog) {
|
|
// location.href = "edit_employee_details.php?emp_id='" + patient_id +
|
|
// "'&accessOption=E";
|
|
// }
|
|
// }]
|
|
// });
|
|
// return;
|
|
// }
|
|
var cadre = $('#emp_cadre').val();
|
|
// if (cadre == '' || cadre == null) {
|
|
// var patient_id = $("#patient_id").val();
|
|
// BootstrapDialog.show({
|
|
// title: 'Information',
|
|
// message: 'Please click ok to go to patient profile to update Cadre.',
|
|
// buttons: [{
|
|
// label: 'OK',
|
|
// action: function(dialog) {
|
|
// location.href = "edit_employee_details.php?emp_id='" + patient_id +
|
|
// "'&accessOption=E";
|
|
// }
|
|
// }]
|
|
// });
|
|
// return;
|
|
// }
|
|
var designation = $('#emp_designation').val();
|
|
// if (designation == '' || designation == null) {
|
|
// var patient_id = $("#patient_id").val();
|
|
// BootstrapDialog.show({
|
|
// title: 'Information',
|
|
// message: 'Please click ok to go to patient profile to update Designation.',
|
|
// buttons: [{
|
|
// label: 'OK',
|
|
// action: function(dialog) {
|
|
// location.href = "edit_employee_details.php?emp_id='" + patient_id +
|
|
// "'&accessOption=E";
|
|
// }
|
|
// }]
|
|
// });
|
|
// return;
|
|
// }
|
|
var employer_contractor_id = $('#employer_contractor_id').val();
|
|
// if (employer_contractor_id == '' || employer_contractor_id == null) {
|
|
// var patient_id = $("#patient_id").val();
|
|
// BootstrapDialog.show({
|
|
// title: 'Information',
|
|
// message: 'Please click ok to go to patient profile to update Employer Contractor.',
|
|
// buttons: [{
|
|
// label: 'OK',
|
|
// action: function(dialog) {
|
|
// location.href = "edit_employee_details.php?emp_id='" + patient_id +
|
|
// "'&accessOption=E";
|
|
// }
|
|
// }]
|
|
// });
|
|
// return;
|
|
// }
|
|
// }
|
|
|
|
if (task != null && task != '') {
|
|
if (task != 'ime_long' && task != 'ime_short' && task != 'pme' && task != 'shutdown' && task !=
|
|
'ame_greater_40' && task != 'ame_less_40') {
|
|
return navigateReceptionist();
|
|
} else {
|
|
|
|
var key_name = 'patient_id';
|
|
var value = $("#patient_id").val();
|
|
$.ajax({
|
|
url: 'check_existing_exam.php',
|
|
type: "POST",
|
|
data: {
|
|
key: key_name,
|
|
'key_val': value
|
|
},
|
|
dataType: 'json',
|
|
|
|
success: function(data) {
|
|
|
|
if (data.status != 200) {
|
|
|
|
$("#name").val(data.patient_name);
|
|
$("#med_date").val(data.date);
|
|
|
|
if (data.task == 'ame_greater_40') {
|
|
data.task = 'PME ANNUAL';
|
|
} else if (data.task == 'ame_less_40') {
|
|
data.task = 'PME SEMI-ANNUAL';
|
|
} else if (data.task == 'ime_short') {
|
|
data.task = 'IME SHORT TERM';
|
|
} else if (data.task == 'ime_long') {
|
|
data.task = 'IME LONG TERM';
|
|
}
|
|
$("#type").val(data.task);
|
|
$('#display_existing_medical').modal("show");
|
|
} else {
|
|
navigateReceptionist();
|
|
}
|
|
},
|
|
error: function(data) {
|
|
// BootstrapDialog.alert('Error Finiding patient');
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
// $('.close').click();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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(
|
|
'Patient with matching Aadhar or ECode already exists. Press OK to edit existing. Press cancel to change the value',
|
|
function(result) {
|
|
if (result) {
|
|
$("#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();
|
|
$("#non_employee_div").hide();
|
|
|
|
} else {
|
|
$("#employee_div").hide();
|
|
$("#non_employee_div").show();
|
|
|
|
}
|
|
// $("#gender").val(data.gender);
|
|
$('input:radio[id=gender][value=' + data.gender + ']').prop('checked',
|
|
true);
|
|
$("#patient_category").val(data.patient_cat_id);
|
|
$("#emp_code").val(data.emp_code);
|
|
$("#emp_cadre").val(data.emp_cadre);
|
|
$("#dept").val(data.dept_id);
|
|
// $("#emp_sub_cat").val(data.emp_sub_cat_id);
|
|
$("#employer_contractor_id").val(data.employer_contractor_id);
|
|
$("#emp_designation").val(data.designation_id)
|
|
$("#blood_group").val(data.blood_group);
|
|
$("#manager_emp_id").val(data.emp_mgr_cd);
|
|
$("#emp_mgr_name").val(getFieldValue(
|
|
"concat(patient_name,'(',emp_code,')')", 'patient_master', 'id',
|
|
data.emp_mgr_code, 'emp_mgr_name'));
|
|
$("#has_first_aid").val(data.is_first_aid);
|
|
$("#primary_phone").val(data.primary_phone);
|
|
$("#aadhar_no").val(data.aadhar_no);
|
|
$("#village").val(data.village);
|
|
$("#post").val(data.post);
|
|
$("#ps").val(data.ps);
|
|
$("#tehsil").val(data.tehsil);
|
|
$("#district").val(data.district);
|
|
$("#state").val(data.state);
|
|
$("#pin_code").val(data.pin_code);
|
|
$("#dob").val(myDateFormater(data.dob))
|
|
$("#doj").val(myDateFormater(data.doj))
|
|
$('#employer_contractor_id').select2();
|
|
$('#emp_designation').select2();
|
|
// $("#manager_emp_id").select2();
|
|
} else {
|
|
field.value = '';
|
|
}
|
|
});
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert(" Error Updated Aadhar Details ");
|
|
}
|
|
});
|
|
}
|
|
|
|
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 save_employee() {
|
|
|
|
|
|
var task = '<?= $_REQUEST['task'] ?>';
|
|
var patient_name = $('#patient_name').val();
|
|
|
|
var dob = $('#dob').val();
|
|
var pat_cat = $("#patient_category option:selected").html().trim();
|
|
var patient_category = $("#patient_category").val();
|
|
if (task == 'health_survelliance') {
|
|
if ($("#checkup_type_id").val() == null || $("#checkup_type_id").val() == '') {
|
|
BootstrapDialog.alert('Please Select Checkup Type Before Saving !');
|
|
return false;
|
|
}
|
|
}
|
|
if (task == 'direct_medical_entry') {
|
|
if ($("#checkup_type_id_direct").val() == null || $("#checkup_type_id_direct").val() == '') {
|
|
BootstrapDialog.alert('Please Select Checkup Type Before Saving !');
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
if (patient_name == '') {
|
|
|
|
BootstrapDialog.alert('Please Enter Patient Name.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
if (dob == '01/01/1970' && patient_category != '2') {
|
|
|
|
BootstrapDialog.alert('Please Enter Date Of Birth.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
if (pat_cat != 'Pre Employment' && pat_cat != 'Non Employee') {
|
|
|
|
if ($("#emp_code").val().trim() == '') {
|
|
|
|
BootstrapDialog.alert("Please Enter Emp Code!!!");
|
|
return false;
|
|
}
|
|
}
|
|
if ($('#aadhar_no').val().length != 0) {
|
|
if ($('#aadhar_no').val().length != 12) {
|
|
BootstrapDialog.alert('Please Enter 12 Digit Aadhar no.!!!');
|
|
return false;
|
|
}
|
|
}
|
|
if ($('#primary_phone').val().length != 0) {
|
|
if ($('#primary_phone').val().length != 10) {
|
|
BootstrapDialog.alert('Please Enter 10 Digit Phone no.!!!');
|
|
return false;
|
|
}
|
|
}
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'save_patient.php',
|
|
data: new FormData(document.getElementById("employee_form")),
|
|
contentType: false,
|
|
processData: false,
|
|
success: function(data) {
|
|
// if(data.)
|
|
|
|
if (data.id != null && data.id != "") {
|
|
$("#patient_id").val(data.patient_id)
|
|
BootstrapDialog.alert('Patient Updated Successfully.');
|
|
} else if (data.patient_id != null && data.patient_id != "") {
|
|
$("#patient_id").val(data.patient_id)
|
|
|
|
BootstrapDialog.alert('Patient Saved Successfully.');
|
|
}
|
|
//$("#flex1").flexReload();
|
|
$('#next').prop('disabled', false);
|
|
$('.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();
|
|
});
|
|
|
|
// else if (patient_category == '' || patient_category == null) {
|
|
// BootstrapDialog.alert('Please Select Patient Catogery.!!!');
|
|
// return false;
|
|
// } else if (dob == '') {
|
|
// BootstrapDialog.alert('Please Enter Date of Birth.!!!');
|
|
// return false;
|
|
// } else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && employer_contractor_id ==
|
|
// null) {
|
|
// BootstrapDialog.alert('Please Enter Employeer/contractor.!!!');
|
|
// return false;
|
|
// } else if ($("#dob").val() == null && $("#emp_age").val() == null) {
|
|
// BootstrapDialog.alert('Please Enter Date Of Birth/Age !');
|
|
// return false;
|
|
// } else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && $('#bussiness_unit1').val() ==
|
|
// null &&
|
|
// $('#bussiness_unit').val() == null) {
|
|
// BootstrapDialog.alert('Please Select Division');
|
|
// return false;
|
|
// }
|
|
// /* else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && $('#sub_section').val() ==
|
|
// null && $(
|
|
// '#sub_section1').val() == null) {
|
|
// // BootstrapDialog.alert('Please Enter Area /Section !');
|
|
// // return false;
|
|
// }*/
|
|
// else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && $('#dept').val() == null && $(
|
|
// '#dept1')
|
|
// .val() == null) {
|
|
// BootstrapDialog.alert('Please Select Department');
|
|
// return false;
|
|
// } else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && $('#emp_designation').val() ==
|
|
// null) {
|
|
// BootstrapDialog.alert('Please Enter Designation.!!!');
|
|
// return false;
|
|
// } else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && $('#primary_phone').val() ==
|
|
// '') {
|
|
// BootstrapDialog.alert('Please Enter Phone no.!!!');
|
|
// return false;
|
|
// } else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && ($('#primary_phone').val())
|
|
// .length !=
|
|
// 10) {
|
|
// BootstrapDialog.alert('Please Enter 10 Digit Phone no.!!!');
|
|
// return false;
|
|
// }
|
|
/*else if (patient_category != '2' && patient_category != '<?= $pre_emp_cat_id ?>' && ($('#aadhar_no').val())
|
|
.length != 12) {
|
|
// BootstrapDialog.alert('Please Enter 12 Digit Adhar no.!!!');
|
|
//return false;
|
|
}*/
|
|
|
|
}
|
|
</script>
|
|
<script>
|
|
function checkPatient() {
|
|
if ($("#patient_name").val() == '') {
|
|
var cat_id = $("#patient_category").val();
|
|
$("#employee_form").trigger("reset");
|
|
$("#patient_category").val(cat_id);
|
|
$("#save_button").show();
|
|
$('.select2').select2();
|
|
$("#patient_id").val('');
|
|
|
|
// $("#fieldsetBtn").prop("disabled", true);
|
|
//}else{
|
|
//$("#fieldsetBtn").prop("disabled", false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function DisableField() {
|
|
document.getElementById("employer_contractor_id").disabled = true;
|
|
document.getElementById("father_name").disabled = true;
|
|
document.getElementById("dept").disabled = true;
|
|
document.getElementById("emp_cadre").disabled = true;
|
|
document.getElementById("emp_designation").disabled = true;
|
|
document.getElementById("primary_phone").disabled = true;
|
|
document.getElementById("aadhar_no").disabled = true;
|
|
document.getElementById("emp_age").disabled = true;
|
|
document.getElementById("emp_code").disabled = true;
|
|
document.getElementById("blood_group").disabled = true;
|
|
document.getElementById("village").disabled = true;
|
|
document.getElementById("post").disabled = true;
|
|
document.getElementById("tehsil").disabled = true;
|
|
document.getElementById("ps").disabled = true;
|
|
document.getElementById("district").disabled = true;
|
|
document.getElementById("state").disabled = true;
|
|
document.getElementById("pin_code").disabled = true;
|
|
$("#new_employee_contractor").hide();
|
|
var radio = document.getElementsByName("gender");
|
|
var len = radio.length;
|
|
for (var i = 0; i < len; i++) {
|
|
radio[i].disabled = true;
|
|
}
|
|
}
|
|
|
|
function EnableField() {
|
|
document.getElementById("employer_contractor_id").disabled = false;
|
|
document.getElementById("father_name").disabled = false;
|
|
document.getElementById("dept").disabled = false;
|
|
document.getElementById("emp_cadre").disabled = false;
|
|
document.getElementById("emp_designation").disabled = false;
|
|
document.getElementById("primary_phone").disabled = false;
|
|
document.getElementById("aadhar_no").disabled = false;
|
|
document.getElementById("emp_age").disabled = false;
|
|
document.getElementsByTagName("checkbox").disabled = false;
|
|
document.getElementById("emp_code").disabled = false;
|
|
document.getElementById("blood_group").disabled = false;
|
|
document.getElementById("village").disabled = false;
|
|
document.getElementById("post").disabled = false;
|
|
document.getElementById("tehsil").disabled = false;
|
|
document.getElementById("ps").disabled = false;
|
|
document.getElementById("district").disabled = false;
|
|
document.getElementById("state").disabled = false;
|
|
document.getElementById("pin_code").disabled = false;
|
|
$("#new_employee_contractor").show();
|
|
var radio = document.getElementsByName("gender");
|
|
var len = radio.length;
|
|
for (var i = 0; i < len; i++) {
|
|
radio[i].disabled = false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function navigateReceptionist() {
|
|
var task = $("#task").val();
|
|
var patientId = $("#patient_id").val();
|
|
if (task != null && task != '') {
|
|
if ((task == 'opd' || task == 'visitor_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 == 'store_return') {
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'direct_store_return_item.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if (task == 'store_issue') {
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'add_direct_item_issue.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if (task == 'store_issue_edit') {
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
|
|
$("#employee_form").attr('action', 'item_issue_list.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if (task == 'DIRECT_ENTRY') {
|
|
|
|
$("<input />").attr("type", "hidden")
|
|
.attr("name", "flex_opd_id")
|
|
.attr("value", patientId)
|
|
.appendTo("#employee_form");
|
|
|
|
$("<input />").attr("type", "hidden")
|
|
.attr("name", "emp_id")
|
|
.attr("value", patientId)
|
|
.appendTo("#employee_form");
|
|
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'edit_opd.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if ((task == 'ime_long' || task == 'ime_short' || task == 'pme' || task == 'shutdown' || task ==
|
|
'ame_greater_40' || task == 'ame_less_40' || task == 'covid' || task == 'wah') && 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 == 'ame_less_40') {
|
|
$("#employee_form").attr('action', 'add_patient_details_ame_less_40.php');
|
|
} else if (task == 'covid') {
|
|
$("#employee_form").attr('action', 'covid_screening.php');
|
|
} else if (task == 'wah') {
|
|
$("#employee_form").attr('action', 'wah_questionaire.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 == 'health_survelliance' && patientId != null && patientId != '') {
|
|
$("#flex_patient_id").val(patientId);
|
|
//$("#flex_checkup_type_id").val(checkuptypeid);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'checkup.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if (task == 'direct_medical_entry' && patientId != null && patientId != '') {
|
|
$.ajax({
|
|
url: 'save_direct_checkup.php ',
|
|
type: "POST",
|
|
data: $("#employee_form").serialize(),
|
|
success(re) {
|
|
var data = JSON.parse(re);
|
|
updateApp(data.checkup_id,data.emp_id_history,data.checkdown_date);
|
|
var currentUrl = window.location.href;
|
|
try{
|
|
var urlParts = currentUrl.split('/');
|
|
// alert(urlParts);
|
|
if('<?=$_SESSION['RoleCode']?>' == 'LAB'){
|
|
urlParts[urlParts.length - 1] = 'pending_medical_examination_list.php';
|
|
}else if('<?=$_SESSION['RoleCode']?>'== 'DOC'){
|
|
urlParts[urlParts.length - 1] = 'medical_examination_list.php';
|
|
}
|
|
// alert(urlParts);
|
|
var newUrl = urlParts.join('/');
|
|
// alert(newUrl);
|
|
currentUrl = newUrl;
|
|
}catch(err){
|
|
console.log(err);
|
|
}
|
|
|
|
// alert(currentUrl);
|
|
var form = document.createElement("form");
|
|
form.id = "flex_form_checkup";
|
|
form.method = "POST";
|
|
form.action = "checkup_from_before.php";
|
|
|
|
var flex_checkup_id = document.createElement("input");
|
|
flex_checkup_id.type = "text";
|
|
flex_checkup_id.name = "flex_checkup_id";
|
|
form.appendChild(flex_checkup_id);
|
|
|
|
var is_new_entry = document.createElement("input");
|
|
is_new_entry.type = "hidden";
|
|
is_new_entry.name = "is_new_entry";
|
|
form.appendChild(is_new_entry);
|
|
|
|
var checkup_type_id_db = document.createElement("input");
|
|
checkup_type_id_db.type = "text";
|
|
checkup_type_id_db.name = "checkup_type_id_db";
|
|
form.appendChild(checkup_type_id_db);
|
|
|
|
var emp_id_history = document.createElement("input");
|
|
emp_id_history.type = "text";
|
|
emp_id_history.name = "emp_id_history";
|
|
form.appendChild(emp_id_history);
|
|
|
|
// var toPage = document.createElement("input");
|
|
// toPage.type = "hidden";
|
|
// toPage.name = "toPage";
|
|
// form.appendChild(toPage);
|
|
|
|
var returnPage = document.createElement("input");
|
|
returnPage.type = "hidden";
|
|
returnPage.name = "returnPage";
|
|
form.appendChild(returnPage);
|
|
|
|
if (data.checkup_id != null && data.checkup_id != '') {
|
|
is_new_entry.value = "1";
|
|
flex_checkup_id.value = data.checkup_id;
|
|
checkup_type_id_db.value = data.checkup_type_id_db;
|
|
emp_id_history.value = data.emp_id_history;
|
|
// toPage.value = action;
|
|
returnPage.value = currentUrl;
|
|
document.body.appendChild(form);
|
|
form.submit();
|
|
}
|
|
|
|
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Checkup');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
|
|
}
|
|
if (task == 'direct_test_lab' && patientId != null && patientId != '') {
|
|
$("#flex_patient_id").val(patientId);
|
|
//$("#flex_checkup_type_id").val(checkuptypeid);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'checkup_direct.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if (task == 'direct_test' && patientId != null && patientId != '') {
|
|
$("#flex_patient_id").val(patientId);
|
|
//$("#flex_checkup_type_id").val(checkuptypeid);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'checkup.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if (task == 'fitness' && patientId != null && patientId != '') {
|
|
$("#flex_patient_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'sickness.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
}
|
|
}
|
|
$('#new_employee_contractor').click(function() {
|
|
$("#employee_form").submit(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
$(".save_button").show();
|
|
$("#id").val("");
|
|
$("#employer_contractor").val("");
|
|
$("#remarks").val("");
|
|
$('#modal-add-employer-contractor').modal("show");
|
|
})
|
|
|
|
function save_employer_contractor() {
|
|
$.ajax({
|
|
url: 'save_employer_contractor.php',
|
|
type: "POST",
|
|
data: $("#employer-contractor_form").serialize(),
|
|
success: function(data) {
|
|
setEmployeeContractorList();
|
|
BootstrapDialog.alert('employer / Contractor Saved Successfully.');
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Saving employer / Contractor');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
function setEmployeeContractorList() {
|
|
$.ajax({
|
|
url: 'select_employee_contractor_list.php',
|
|
type: "POST",
|
|
async: 'false',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var content = "";
|
|
if (data != null && data != "") {
|
|
for (var i = 0; i < data.length; i++) {
|
|
content = content + "<option value=" + data[i].id + ">" + data[i]
|
|
.employer_contractor_name + "</option>"
|
|
}
|
|
$("#employer_contractor_id").html(content);
|
|
$('.select2').select2()
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Fetching Employer 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;
|
|
}
|
|
});
|
|
}
|
|
document.onreadystatechange = function() {
|
|
if (document.readyState !== "complete") {
|
|
document.querySelector(
|
|
"body").style.visibility = "hidden";
|
|
document.querySelector(
|
|
"#loader").style.visibility = "visible";
|
|
} else {
|
|
document.querySelector(
|
|
"#loader").style.display = "none";
|
|
document.querySelector(
|
|
"body").style.visibility = "visible";
|
|
}
|
|
};
|
|
function updateApp(id,checkup_emp_id,checkdown_date){
|
|
// alert(checkup_emp_id);
|
|
$.ajax({
|
|
url: 'update_book_app.php',
|
|
data: {
|
|
id: id,
|
|
emp_id:checkup_emp_id,
|
|
app_type:'MED',
|
|
checkdown_date:checkdown_date,
|
|
},
|
|
|
|
type: 'POST',
|
|
success: function(data) {
|
|
var checkId = JSON.parse(data);
|
|
if(checkId!='' && checkId!=null){
|
|
open_mail(checkId,'save');
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Checkup Form ');
|
|
return;
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function open_mail(appointmentId,type) {
|
|
|
|
|
|
|
|
$.ajax({
|
|
url: 'select_app_data.php',
|
|
type: "POST",
|
|
data: {
|
|
'cityId': appointmentId,
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var app_id = data.id;
|
|
|
|
var link = ""+data.app_root+"/checkup_form_pdf.php?checkup_id=" + data.app_id;
|
|
// var link = "" + app_root + "/opd_form_pdf.php?appointment_id_pdf=" + app_id;
|
|
var emailContent = "";
|
|
var status = '';
|
|
var sub_status = '';
|
|
sub_status = 'completed';
|
|
status = "<font color=green>completed</font> ";
|
|
data.app_type = 'Periodic Health Checkup';
|
|
|
|
|
|
var email_list_to = data.emp_mail;
|
|
var email_list_cc = data.doc_mail;
|
|
// var app_root = '<?php echo getConfigKey('APP_ROOT') ?>';
|
|
|
|
ref_type = "Appointments Booked";
|
|
|
|
var subject = 'Your '+ data.app_type+' got ' + sub_status + ' in ' + data.ohc_type + ' OHC on ' + data
|
|
.date + '.';
|
|
emailContent +=
|
|
"<p>Dear Sir/Madam,</p><p>Your " + data.app_type + " in " + data.ohc_type + " ohc got " +
|
|
status +
|
|
".<br>Below are more details of your booking </p><br><table class=`table-bordered` width=`100%`><thead><tr><th>Date</th><th>Time</th><th>Patient Name</th>";
|
|
|
|
// emailContent +="<th>Doc Name</th>";
|
|
|
|
emailContent +="<th> Appointment Type</th><th> status</th><th> Remarks</th></tr><thead><tbody>";
|
|
emailContent += "<tr><td>" + data.date + "</td><td>" + data.slot + '-' + data.slot_end +
|
|
"</td><td>" +
|
|
data.patient_name +
|
|
// "</td><td>" +
|
|
// data.doctor_name +
|
|
"</td><td>" + data.app_type +
|
|
"</td><td>" + status +
|
|
"</td><td>" + data.remarks + "</td></tr>";
|
|
emailContent +=
|
|
"</tbody></table>";
|
|
emailContent += "<br><a href=" + link +
|
|
">More Details</a> ";
|
|
|
|
emailContent += "<p> Regards,</p><p> Team OHC</p>";
|
|
|
|
message = emailContent;
|
|
|
|
|
|
var id = appointmentId;
|
|
message = emailContent;
|
|
|
|
send_email(ref_type, appointmentId, email_list_to, email_list_cc, subject,
|
|
message,type);
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Pulling Id');
|
|
return id;
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
function send_email(ref_type, ref_identifier, email_list_to, email_list_cc, subject, message, type) {
|
|
|
|
$.ajax({
|
|
url: 'send_email.php',
|
|
type: 'POST',
|
|
data: {
|
|
ref_type: ref_type,
|
|
ref_identifier: ref_identifier,
|
|
email_list_to: email_list_to,
|
|
email_list_cc: email_list_cc,
|
|
subject: subject,
|
|
message: message,
|
|
},
|
|
success: function(data) {
|
|
|
|
return;
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error in sending mail');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
|
|
</script>
|
|
<?php include('form/add_designation.php'); ?>
|
|
<?php include('form/employer_contractor_form.php'); ?>
|
|
|
|
<?php include('existing_patient.php'); ?>
|
|
<?php include ('open_camera.php') ?>
|