1907 lines
96 KiB
PHP
1907 lines
96 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">Location Details</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>
|
|
<!-- <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">Location Name<span style="color: red">*</span></label>
|
|
<div class="col-sm-10">
|
|
<?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" />
|
|
<input type="hidden" name="emp_id" id="emp_id" />
|
|
|
|
</div>
|
|
<!-- <div class="col-sm-1">
|
|
<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>
|
|
</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>
|
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
<input type="hidden" id="task" name="task" value="">
|
|
|
|
<?php } else { ?>
|
|
<input type="hidden" id="task" name="task" value="<?= $_REQUEST['task'] ?>">
|
|
<?php } ?>
|
|
|
|
|
|
<!-- <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/Spouse 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="Surname" value="<?= $father_surname; ?>">
|
|
</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">Stabilization 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" 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="Years if Date unknown">
|
|
</div>
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Location Incharge<span style="color: red"></span></label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="passport" name="passport" placeholder="Enter Location Incharge" onchange="check_existing_emp(this,'passport',this.value)">
|
|
|
|
</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">
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Plant ID </label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="emp_code" placeholder="Enter Plant Id" name="emp_code" onchange="check_existing_emp(this, 'ecode',this.value)">
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Department</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="dept" id="dept">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('department', 'dept_name', 'dept_id', '', ''); ?>
|
|
</select>
|
|
|
|
</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 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">Shift</label>
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control select2" name="blood_group" id="blood_group">
|
|
<option disabled selected>Please
|
|
select option</option>
|
|
<?php echo generateOption('blood_group', 'type', 'type', '', ''); ?>
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
<label 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>
|
|
|
|
<!-- <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">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">Location Details <span style="color: red">*</span></label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="aadhar_no" name="aadhar_no" placeholder="Enter National Identity" onchange="check_existing_emp(this,'aadhar',this.value)">
|
|
</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>
|
|
|
|
<!-- <div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Passport Number<span style="color: red"></span></label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="passport" name="passport" placeholder="Enter Passport Number" onchange="check_existing_emp(this,'passport',this.value)">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div> -->
|
|
|
|
|
|
</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>
|
|
|
|
<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>
|
|
</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">Zip Code</label>
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="number" id="pin_code" name="pin_code" placeholder="Enter Zip Code">
|
|
</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="row" style="margin: 5px;">
|
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
<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"></label>
|
|
<div class="col-sm-2">
|
|
|
|
<label class="inline"> <input onchange="showOrHideForhealth_chk(this.value)" name="checkup_type_radio" id="checkup_type_radio" type="radio" class="ace" value="opd" checked> <span class="lbl middle">
|
|
Illness</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-2">
|
|
<label class="inline"> <input onchange="showOrHideForhealth_chk(this.value)" name="checkup_type_radio" id="checkup_type_radio" type="radio" class="ace" value="injury"> <span class="lbl middle">
|
|
Injury</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-2">
|
|
<label class="inline"> <input onchange="showOrHideForhealth_chk(this.value)" name="checkup_type_radio" id="checkup_type_radio" type="radio" class="ace" value="pre_employment"> <span class="lbl middle">
|
|
Health Check</span>
|
|
|
|
</div>
|
|
|
|
<!-- <div class="col-sm-2">
|
|
<label class="inline"> <input onchange="showOrHideForhealth_chk(this.value)" name="checkup_type_radio" id="checkup_type_radio" type="radio" class="ace" value="WORK" checked> <span class="lbl middle">
|
|
Work Relate</span>
|
|
|
|
</div> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<?php
|
|
|
|
|
|
if ($_REQUEST['task'] == 'health_survelliance' || $_REQUEST['task'] == 'DIRECT_ENTRY' || $_REQUEST['task'] == 'pre_employment') {
|
|
?>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
<div id="chk_type" style="display: none;">
|
|
<?php } ?>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">
|
|
Checkup Category</label>
|
|
<div class="col-sm-10">
|
|
<!-- <select name="pre_checkup_type" id="pre_checkup_type" class="pre_checkup_type form-control chosen-select pre_checkup_type"> -->
|
|
|
|
|
|
<?php if ($_REQUEST['task'] == 'pre_employment' || $_REQUEST['task'] == 'DIRECT_ENTRY' || $_REQUEST['task'] == 'health_survelliance') { ?>
|
|
<select class="form-control select2" id="pre_checkup_type" name="pre_checkup_type" onchange="pre_checkup_type01()" data-placeholder="">
|
|
<?php } else { ?>
|
|
<select class="form-control select2" id="pre_checkup_type" name="pre_checkup_type" onchange="pre_checkup_type()" data-placeholder="">
|
|
<?php } ?>
|
|
|
|
<option value="" disabled selected>--Select Checkup Type--
|
|
</option>
|
|
<?php
|
|
echo generateOption('checkup_pre_type', 'checkup_pre_type_name', 'id', $row['pre_checkup_type'], '');
|
|
?>
|
|
|
|
|
|
</select>
|
|
</div>
|
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-sm-10 col-sm-2"></div>
|
|
<div class="col-sm-10 col-sm-10">
|
|
|
|
<div class="form-group">
|
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
<div id="chk_type_main" style="display: none;">
|
|
<?php } ?>
|
|
|
|
|
|
<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_iddm" id="checkup_type_iddm" class="pre_checkup_type form-control chosen-select pre_checkup_type"> -->
|
|
<?php if ($_REQUEST['task'] == 'pre_employment' || $_REQUEST['task'] == 'DIRECT_ENTRY' || $_REQUEST['task'] == 'health_survelliance') { ?>
|
|
<select class="form-control select2" id="checkup_type_iddm" name="checkup_type_iddm" data-placeholder="">
|
|
<?php } else { ?>
|
|
<select class="form-control select2" id="checkup_type_id" name="checkup_type_id" data-placeholder="">
|
|
<?php } ?>
|
|
<option value="" disabled selected>--Select Checkup Type--
|
|
</option>
|
|
<?php
|
|
// echo generateCheckupOptionsAccToOhc('checkup_type', 'checkup_type_name', 'checkup_type_iddm', '', '', 'type_status', 'Active', $_SESSION['current_ohcttype']);
|
|
?>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<script>
|
|
// $(document).on('change', '#pre_checkup_type', function() {
|
|
function pre_checkup_type01() {
|
|
// alert();
|
|
|
|
|
|
let pre_checkup_type = $("#pre_checkup_type").val();
|
|
$('#checkup_type_iddm').html(" ");
|
|
$('#checkup_type_iddm').append('<option value=""> </option>');
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_checkup_type.php',
|
|
data: {
|
|
pre_checkup_type: pre_checkup_type
|
|
},
|
|
dataType: 'json',
|
|
success: function(re) {
|
|
|
|
var data = re;
|
|
console.log(data.length);
|
|
|
|
if (data != '' && data != null && data != 0) {
|
|
var html = "<option disable selected>please select option</option>";
|
|
for (var i = 0; i < data.length; i++) {
|
|
console.log(data[i]['id']);
|
|
var id = data[i]['id'];
|
|
|
|
html += "<option selected value=" + id + ">" + data[i]['checkup_type_name'] +
|
|
"</option>";
|
|
|
|
}
|
|
console.log(html);
|
|
$("#checkup_type_iddm").append(html);
|
|
|
|
// console.log(d.checkup_type_name);
|
|
|
|
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
|
|
function pre_checkup_type() {
|
|
// alert();
|
|
|
|
|
|
let pre_checkup_type = $("#pre_checkup_type").val();
|
|
$('#checkup_type_id').html(" ");
|
|
$('#checkup_type_id').append('<option value=""> </option>');
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_checkup_type.php',
|
|
data: {
|
|
pre_checkup_type: pre_checkup_type
|
|
},
|
|
dataType: 'json',
|
|
success: function(re) {
|
|
|
|
var data = re;
|
|
console.log(data.length);
|
|
|
|
if (data != '' && data != null && data != 0) {
|
|
var html = "<option disable selected>please select option</option>";
|
|
for (var i = 0; i < data.length; i++) {
|
|
console.log(data[i]['id']);
|
|
var id = data[i]['id'];
|
|
|
|
html += "<option selected value=" + id + ">" + data[i]['checkup_type_name'] +
|
|
"</option>";
|
|
|
|
}
|
|
console.log(html);
|
|
$("#checkup_type_id").append(html);
|
|
|
|
// console.log(d.checkup_type_name);
|
|
|
|
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
})
|
|
}
|
|
// );
|
|
</script>
|
|
<?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 checkup_type_id">
|
|
<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 checkup_type_id">
|
|
<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' 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>
|
|
$(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 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 showOrHideForhealth_chk(value) {
|
|
console.log("Function called with value:", value);
|
|
|
|
if (value == 'pre_employment') {
|
|
console.log("Showing elements");
|
|
$("#chk_type").show();
|
|
$("#chk_type_main").show();
|
|
} else {
|
|
console.log("Hiding elements");
|
|
$("#chk_type").hide();
|
|
$("#chk_type_main").hide();
|
|
}
|
|
}
|
|
|
|
|
|
// function showOrHideForDiv(value) {
|
|
|
|
// if (value == 1 || value == 3) {
|
|
// $("#employee_div").show();
|
|
// $("#non_employee_div").hide();
|
|
|
|
// } else {
|
|
// $("#employee_div").hide();
|
|
|
|
// if (value == '<?= $pre_emp_cat_id ?>') {
|
|
// $("#non_employee_div").hide();
|
|
// $('#emp_code_div').show();
|
|
// getTemEmpCode();
|
|
// } else {
|
|
// $('#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);
|
|
|
|
// 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 !');
|
|
// return false;
|
|
// }
|
|
if ((task == 'health_survelliance' || task == 'direct_test_lab' || task == 'direct_test') && ($("#checkup_type_iddm").val() == null || $("#checkup_type_iddm").val() == '')) {
|
|
BootstrapDialog.alert('Please Select checkup type !');
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
// 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 mathing 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'] ?>';
|
|
// // alert(pre_emp_cat_id);
|
|
// if (task == 'health_survelliance') {
|
|
// if ($("#checkup_type_idd").val() == null || $("#checkup_type_idd").val() == '') {
|
|
// BootstrapDialog.alert('Please Select checkup type !');
|
|
// return false;
|
|
// }
|
|
// }
|
|
// if (task == 'pre_employment') {
|
|
// if ($("#checkup_type_iddm").val() == null || $("#checkup_type_iddm").val() == '') {
|
|
// BootstrapDialog.alert('Please Select checkup type !');
|
|
// return false;
|
|
// }
|
|
// }
|
|
|
|
var patient_name = $('#patient_name').val();
|
|
|
|
if (patient_name == '') {
|
|
|
|
BootstrapDialog.alert('Please Enter Patient Name.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var dob = $('#dob').val();
|
|
|
|
|
|
|
|
if (dob == '01/01/1970') {
|
|
|
|
BootstrapDialog.alert('Please Enter Date Of Birth.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// var pat_cat = $("#patient_category option:selected").html().trim();
|
|
// 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;
|
|
// }
|
|
// }
|
|
var aadhar_no = $('#aadhar_no').val();
|
|
|
|
if (aadhar_no == '') {
|
|
|
|
BootstrapDialog.alert('Please Enter National Identity.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// if ($('#primary_phone').val().length != 0) {
|
|
// if ($('#primary_phone').val().length != 10) {
|
|
// BootstrapDialog.alert('Please Enter 10 Digit Phone no.!!!');
|
|
// return false;
|
|
// }
|
|
// }
|
|
|
|
// 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;
|
|
}*/
|
|
else {
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'save_patient.php',
|
|
data: $("#employee_form").serialize(),
|
|
dataType: 'json',
|
|
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();
|
|
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 save_chk() {
|
|
$.ajax({
|
|
url: 'save_city.php ',
|
|
type: "POST",
|
|
data: $("#city_form").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.alert('city Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving update city');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
</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() {
|
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
var dm = $("input[name='checkup_type_radio']:checked").val();
|
|
|
|
var task = dm;
|
|
$("#task").val(dm);
|
|
<?php } else { ?>
|
|
|
|
var task = $("#task").val();
|
|
<?php } ?>
|
|
|
|
|
|
var patientId = $("#patient_id").val();
|
|
if (task != null && task != '') {
|
|
<?php
|
|
// if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
|
if ((task == 'opd' || task == 'visitor_opd') && patientId != null && patientId != '') {
|
|
$("#emp_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'edit_opd.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if (task == 'injury' && patientId != null && patientId != '') {
|
|
$("#emp_id").val(patientId);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'edit_injury.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
<?php
|
|
// } else { ?>
|
|
// 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();
|
|
// }
|
|
<?php
|
|
// } ?>
|
|
if (task == 'DIRECT_ENTRY') {
|
|
|
|
if ($(".checkup_type_id").val() == '' || $(".checkup_type_id").val() == null) {
|
|
location.href =
|
|
"<?php echo getTableFieldValue('role_master', 'role_home_page', 'role_id', $_SESSION['RoleId']) ?>";
|
|
} else {
|
|
$("#flex_patient_id").val(patientId);
|
|
//$("#flex_checkup_type_iddm").val(checkuptypeid);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'checkup.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_iddm").val(checkuptypeid);
|
|
$("#employee_form").attr('method', 'POST');
|
|
$("#employee_form").attr('action', 'checkup.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
if ((task == 'health_survelliance'||task == 'pre_employment') && patientId != null && patientId != '') {
|
|
|
|
|
|
$.ajax({
|
|
url: 'save_em_checkup.php ',
|
|
type: "POST",
|
|
data: $("#employee_form").serialize(),
|
|
success(re) {
|
|
var data = JSON.parse(re)
|
|
location.href = "checkup_from_before.php?flex_checkup_id=" + data.checkup_id + "&checkup_type_id_db=" + data.checkup_type_id_db + "&emp_id_history=" + data.emp_id_history;
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Checkup');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
|
|
|
|
|
|
|
|
// $("#flex_patient_id").val(patientId);
|
|
// //$("#flex_checkup_type_iddm").val(checkuptypeid);
|
|
// $("#employee_form").attr('method', 'POST');
|
|
// $("#employee_form").attr('action', 'checkup_from_before.php');
|
|
// $("#employee_form").submit();
|
|
}
|
|
if (task == 'direct_test_lab' && patientId != null && patientId != '') {
|
|
$("#flex_patient_id").val(patientId);
|
|
//$("#flex_checkup_type_iddm").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_iddm").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();
|
|
}
|
|
save();
|
|
}
|
|
}
|
|
$('#new_employee_contractor').click(function() {
|
|
$("#employee_form").submit(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
$(".save_button").show();
|
|
$("#id").val("");
|
|
$("#employer_contractor").val("");
|
|
$("#remarks").val("");
|
|
$('#modal-add-employer-contractor').modal("show");
|
|
})
|
|
|
|
|
|
function save_employer_contractor() {
|
|
$.ajax({
|
|
url: 'save_employer_contractor.php',
|
|
type: "POST",
|
|
data: $("#employer-contractor_form").serialize(),
|
|
success: function(data) {
|
|
setEmployeeContractorList();
|
|
BootstrapDialog.alert('employer / Contractor Saved Successfully.');
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Saving employer / Contractor');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
function setEmployeeContractorList() {
|
|
$.ajax({
|
|
url: 'select_employee_contractor_list.php',
|
|
type: "POST",
|
|
async: 'false',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var content = "";
|
|
if (data != null && data != "") {
|
|
for (var i = 0; i < data.length; i++) {
|
|
content = content + "<option value=" + data[i].id + ">" + data[i]
|
|
.employer_contractor_name + "</option>"
|
|
}
|
|
$("#employer_contractor_id").html(content);
|
|
$('.select2').select2()
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Fetching Employeer Contractor ');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
function open_employer_contractor(id, action) {
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url: 'select_employer_contrator.php',
|
|
type: 'POST',
|
|
data: {
|
|
id: id
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
$("#id").val(data.id);
|
|
$("#employer_contractor").val(data.employer_contractor_name);
|
|
$("#remarks").val(data.employer_contractor_desc);
|
|
$('#modal-add-employer-contractor').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Patient Category');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
$('#new_employee_designation').click(function() {
|
|
$("#employee_form").submit(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
$(".save_button").show();
|
|
$("#designation_id").val("");
|
|
$("#designation_name").val("");
|
|
$("#designation_desc").val("");
|
|
$('#modal-add-designation').modal("show");
|
|
});
|
|
|
|
function save_designation() {
|
|
$.ajax({
|
|
url: 'save_designation.php',
|
|
type: "POST",
|
|
data: $("#designation_form").serialize(),
|
|
success: function(data) {
|
|
setDesignationList();
|
|
BootstrapDialog.alert('Designation Saved Successfully.');
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Designation');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
function setDesignationList() {
|
|
$.ajax({
|
|
url: 'select_designation_list.php',
|
|
type: "POST",
|
|
async: 'false',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var content = "";
|
|
if (data != null && data != "") {
|
|
for (var i = 0; i < data.length; i++) {
|
|
content = content + "<option value=" + data[i].designation_id + ">" + data[i]
|
|
.designation_name + "</option>"
|
|
}
|
|
$("#emp_designation").html(content);
|
|
$('.select2').select2()
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Fetching Employeer Contractor ');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
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";
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<?php include('form/add_designation.php'); ?>
|
|
<?php include('form/employer_contractor_form.php'); ?>
|
|
|
|
<?php include('existing_patient.php'); ?>
|