1649 lines
33 KiB
PHP
1649 lines
33 KiB
PHP
|
<?php include('techsyn_header.php'); ?>
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
|
||
|
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
||
|
|
||
|
<!-- page specific plugin styles -->
|
||
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/jquery.gritter.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/select2.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-editable.min.css" />
|
||
|
<!-- text fonts -->
|
||
|
<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />
|
||
|
<!-- ace styles -->
|
||
|
<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
|
||
|
<!--[if lte IE 9]>
|
||
|
<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
|
||
|
<![endif]-->
|
||
|
<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
|
||
|
<!--[if lte IE 9]>
|
||
|
<link rel="stylesheet" href="assets/css/ace-ie.min.css" />
|
||
|
<![endif]-->
|
||
|
<!-- inline styles related to this page -->
|
||
|
<!-- ace settings handler -->
|
||
|
<script src="assets/js/ace-extra.min.js"></script>
|
||
|
|
||
|
<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->
|
||
|
<!--[if lte IE 8]>
|
||
|
<script src="assets/js/html5shiv.min.js"></script>
|
||
|
<script src="assets/js/respond.min.js"></script>
|
||
|
<![endif]-->
|
||
|
<!-- Main Content Container for side bar and body-->
|
||
|
<div class="main-container ace-save-state" id="main-container">
|
||
|
<script type="text/javascript">
|
||
|
try {
|
||
|
ace.settings.loadState('main-container')
|
||
|
} catch (e) {}
|
||
|
</script>
|
||
|
<?php include('techsyn_sidebar.php'); ?>
|
||
|
<!--breadcrumb-->
|
||
|
<div class="main-content">
|
||
|
<div class="main-content-inner">
|
||
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
||
|
<ul class="breadcrumb">
|
||
|
<li class="active">Patient</li>
|
||
|
<li class="active">Add Patient Info</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!-- End of breadcrumb -->
|
||
|
<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>
|
||
|
|
||
|
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="form-group">
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-first">Patient Name<span style="color:red">*</span></label>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="col-sm-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" />
|
||
|
|
||
|
</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<span style="color:red">*</span></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" maxlength="100">
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
<div id="patient_info" style="margin-left:151px">
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
|
||
|
<div class="form-group">
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Age/Birth Date<span style="color:red">*</span></label>
|
||
|
|
||
|
<div class="col-sm-4">
|
||
|
|
||
|
<input class="col-xs-12 col-sm-3 form-control" type="number" id="emp_age" name="emp_age" onChange="checkAge('emp_age','dob')" placeholder="Enter Age if Date of Birth Not Known">
|
||
|
|
||
|
|
||
|
|
||
|
<div class="input-medium">
|
||
|
|
||
|
<div class="input-group">
|
||
|
|
||
|
<input class="input-medium date-picker" id="dob" 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("-20 years")); ?>"> <span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i>
|
||
|
|
||
|
</span>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="gender" style="vertical-align: top">GENDER<span style="color:red">*</span></label>
|
||
|
|
||
|
<div class="col-sm-4" style="vertical-align: top">
|
||
|
|
||
|
<label class="inline"> <input name="gender" id="gender" type="radio" class="ace" value="M" checked> <span class="lbl middle"> Male</span>
|
||
|
|
||
|
</label> <label class="inline"> <input name="gender" id="gender" value="F" type="radio" class="ace"> <span class="lbl middle"> Female</span>
|
||
|
|
||
|
</label> <label class="inline"> <input name="gender" id="gender" value="O" type="radio" class="ace"> <span class="lbl middle"> Others</span>
|
||
|
|
||
|
</label>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="col-sm-12 col-sm-2"></div>
|
||
|
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
|
||
|
<div class="form-group">
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Code/G.Pass No</label>
|
||
|
|
||
|
<div class="col-sm-4">
|
||
|
|
||
|
<input class="form-control" type="text" id="emp_code" name="emp_code" placeholder="Employee Code" maxlength="20">
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Patient Category</label>
|
||
|
|
||
|
<div class="col-sm-4">
|
||
|
|
||
|
<select class="form-control select2" name="patient_category" id="patient_category">
|
||
|
<option value="0">Contractor</option>
|
||
|
<option value="1" selected>Employee</option>
|
||
|
|
||
|
</select>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div id="employee_div" style="display: block">
|
||
|
<div class="col-sm-12 col-sm-2"></div>
|
||
|
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
|
||
|
<div class="form-group">
|
||
|
|
||
|
<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">
|
||
|
<?php echo generateOption('department', 'dept_name', 'dept_id', '1'); ?>
|
||
|
</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" name="emp_designation" style="width: 83%" id="emp_designation">
|
||
|
<?php echo generateOption('designation', 'designation_name', 'designation_id', '1'); ?>
|
||
|
</select>
|
||
|
<button class="btn btn-sm btn-primary" id="new_employee_designation">New</button>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-sm-12 col-sm-2"></div>
|
||
|
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
|
||
|
<div class="form-group">
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Blood Group</label>
|
||
|
|
||
|
<div class="col-sm-4">
|
||
|
<select class="form-control select2" name="blood_group" id="blood_group">
|
||
|
<?php echo generateOption('blood_group', 'type', 'type', 'O+', ''); ?>
|
||
|
</select>
|
||
|
</div>
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Client</label>
|
||
|
<div class="col-sm-4">
|
||
|
|
||
|
<select class="select2 form-control" name="company" id="company">
|
||
|
<?php echo generateOption('client_master', 'client_name', 'client_id', '') ?>
|
||
|
</select>
|
||
|
|
||
|
<button class="btn btn-sm btn-primary" id="new_client">New</button>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="col-sm-12 col-sm-2"></div>
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
|
||
|
<div class="form-group">
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Phone Number <span style="color:red">*</span></label>
|
||
|
|
||
|
<div class="col-sm-4">
|
||
|
<input class="form-control" type="tel" id="phone_no" name="phone_no" data-max="10" placeholder="Enter Phone No" />
|
||
|
|
||
|
|
||
|
</div>
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Aadhar No <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 Aadhar" onchange="adharNoExtOrNot(this.value)" data-max="12">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="col-sm-12 col-sm-2"></div>
|
||
|
<div class="col-sm-12 col-sm-10">
|
||
|
|
||
|
<label class="col-sm-2 control-label no-padding-right" for="form-field-comment">Address</label>
|
||
|
<div class="col-sm-10" rowspan="2">
|
||
|
<textarea class="form-control" rowspan="2" name="address" id="address" style="color:red"></textarea>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
|
||
|
<div class="box-footer" style="text-align: center">
|
||
|
|
||
|
|
||
|
|
||
|
<button class="btn btn-primary" type="button" id="save_button" onclick="save_employee()">
|
||
|
|
||
|
<i class="ace-icon fa fa-save"></i> Save
|
||
|
|
||
|
</button>
|
||
|
<button class="btn btn-primary" type="button" id="update_button" style="display:none" onclick="save_employee()">
|
||
|
|
||
|
<i class="ace-icon fa fa-floppy"></i> Update
|
||
|
|
||
|
</button>
|
||
|
|
||
|
|
||
|
<button class="btn btn-warning" type="reset">
|
||
|
|
||
|
<i class="ace-icon fa fa-undo"></i> Reset
|
||
|
|
||
|
</button>
|
||
|
|
||
|
<button class="btn btn-success" onclick='navigateReceptionist()'>
|
||
|
|
||
|
<i class="ace-icon fa fa-forward"></i> Next
|
||
|
|
||
|
</button>
|
||
|
|
||
|
</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>
|
||
|
// Validating inputs
|
||
|
$('#emp_age').change(function() {
|
||
|
if ($(this).val() != '' && (14 > $(this).val() || $(this).val() > 100)) {
|
||
|
BootstrapDialog.alert("Age should be between 14 and 100");
|
||
|
$(this).val('');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$("#pin_code").change(function(e) {
|
||
|
e.preventDefault();
|
||
|
var keyObj = $("#pin_code");
|
||
|
var maxLength = parseInt(keyObj.attr('data-max'));
|
||
|
if ((keyObj).val().length !== maxLength) {
|
||
|
BootstrapDialog.alert("Pincode should be of 6 digits");
|
||
|
$(this).val('');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$("#phone_no").change(function(e) {
|
||
|
e.preventDefault();
|
||
|
var keyObj = $("#phone_no");
|
||
|
var maxLength = parseInt(keyObj.attr('data-max'));
|
||
|
if ((keyObj).val().length !== maxLength) {
|
||
|
BootstrapDialog.alert("Phone Number should be of 10 digits");
|
||
|
$(this).val('');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$("#aadhar_no").change(function(e) {
|
||
|
e.preventDefault();
|
||
|
var keyObj = $("#aadhar_no");
|
||
|
var maxLength = parseInt(keyObj.attr('data-max'));
|
||
|
if ((keyObj).val().length !== maxLength) {
|
||
|
BootstrapDialog.alert("Aadhar Number should be of 12 digits");
|
||
|
$(this).val('');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
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 showOrHideForDiv(value) {
|
||
|
|
||
|
if (value == 1)
|
||
|
$("#employee_div").show();
|
||
|
else
|
||
|
$("#employee_div").hide();
|
||
|
|
||
|
}
|
||
|
|
||
|
function showAndHideDivForSubCat(value) {
|
||
|
|
||
|
if (value == 1)
|
||
|
$("#emp_sub_category_div").hide();
|
||
|
else
|
||
|
$("#emp_sub_category_div").show();
|
||
|
|
||
|
}
|
||
|
|
||
|
function adharNoExtOrNot(aadharNo) {
|
||
|
|
||
|
if (aadharNo == '0' && aadharNo == '')
|
||
|
return;
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'adhar_details.php',
|
||
|
type: 'POST',
|
||
|
data: {
|
||
|
aadharNo: aadharNo
|
||
|
},
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
if (data.length != 0) {
|
||
|
BootstrapDialog.confirm('Aadhar no. already exists. Press OK to edit existing. Press cancel to change the Aadhar', 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();
|
||
|
} else {
|
||
|
$("#employee_div").hide();
|
||
|
}
|
||
|
if (data.emp_cat_id == 2) {
|
||
|
$("#emp_sub_category_div").show();
|
||
|
} else {
|
||
|
$("#emp_sub_category_div").hide();
|
||
|
}
|
||
|
// $("#gender").val(data.gender);
|
||
|
|
||
|
|
||
|
$('input:radio[id=gender][value=' + data.gender + ']').prop('checked', true);
|
||
|
|
||
|
|
||
|
$("#patient_category").val(data.patient_cat_id);
|
||
|
$("#emp_code").val(data.emp_code);
|
||
|
|
||
|
$("#emp_cadre").val(data.emp_cadre);
|
||
|
$("#dept").val(data.dept_id);
|
||
|
// $("#emp_sub_cat").val(data.emp_sub_cat_id);
|
||
|
$("#employer_contractor_id").val(data.employer_contractor_id);
|
||
|
$("#emp_designation").val(data.designation_id)
|
||
|
$("#blood_group").val(data.blood_group);
|
||
|
// $("#emp_cat").val(data.emp_cat_id);
|
||
|
$("#has_first_aid").val(data.is_first_aid);
|
||
|
$("#phone_no").val(data.primary_phone);
|
||
|
$("#aadhar_no").val(data.aadhar_no);
|
||
|
// $("#village").val(data.village);
|
||
|
// $("#post").val(data.post);
|
||
|
// $("#ps").val(data.ps);
|
||
|
// $("#tehsil").val(data.tehsil);
|
||
|
// $("#district").val(data.district);
|
||
|
// $("#state").val(data.state);
|
||
|
// $("#pin_code").val(data.pin_code);
|
||
|
$("#address").val(data.address);
|
||
|
$("#company").val(data.client_id);
|
||
|
$("#dob").val(myDateFormater(data.dob))
|
||
|
$('#employer_contractor_id').select2();
|
||
|
$('#emp_designation').select2();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
},
|
||
|
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;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/* $(document).ready(function(e){
|
||
|
|
||
|
$("#employee_form").on('submit', function(e){
|
||
|
|
||
|
e.preventDefault();
|
||
|
|
||
|
$.ajax({
|
||
|
|
||
|
type: 'POST',
|
||
|
|
||
|
url: 'save_patient.php',
|
||
|
|
||
|
data: new FormData(this),
|
||
|
|
||
|
contentType: false,
|
||
|
|
||
|
cache: false,
|
||
|
|
||
|
processData:false,
|
||
|
|
||
|
beforeSend: function(){
|
||
|
|
||
|
// $('.submitBtn').attr("disabled","disabled");
|
||
|
|
||
|
//$('#fupForm').css("opacity",".5");
|
||
|
|
||
|
},
|
||
|
|
||
|
success: function(msg){
|
||
|
|
||
|
|
||
|
if(msg=="success")
|
||
|
BootstrapDialog.alert('Patient Saved Successfully.');
|
||
|
|
||
|
|
||
|
|
||
|
$('.close').click();
|
||
|
|
||
|
|
||
|
|
||
|
return;
|
||
|
|
||
|
},
|
||
|
|
||
|
error : function(data) {
|
||
|
|
||
|
BootstrapDialog.alert('Error Saving Patient');
|
||
|
|
||
|
$('.close').click();
|
||
|
|
||
|
return;
|
||
|
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
});
|
||
|
|
||
|
});*/
|
||
|
|
||
|
|
||
|
|
||
|
function save_employee() {
|
||
|
|
||
|
var patient_name = $('#patient_name').val();
|
||
|
// alert(patient_name);
|
||
|
|
||
|
if (patient_name == '') {
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Patient Name.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var fathername = $('#father_name').val();
|
||
|
|
||
|
if (fathername == '') {
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Patient Father Name.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var dob = $('#dob').val();
|
||
|
|
||
|
if (dob == '') {
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Date of Birth.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
var aadhar_no = $('#aadhar_no').val();
|
||
|
if (aadhar_no == '') {
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Aadhar No.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
var doj = $('#doj').val();
|
||
|
|
||
|
if(doj == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter DOJ.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var designationid = $('#designationid').val();
|
||
|
|
||
|
if(designationid == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Designation Id.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var emp_code = $('#emp_code').val();
|
||
|
|
||
|
if(emp_code == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Employee Code.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var emp_type_id = $('#emp_type_id').val();
|
||
|
|
||
|
if(emp_type_id == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Employee Type Id.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var bu_id = $('#bu_id').val();
|
||
|
|
||
|
if(bu_id == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Bu Id.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var sbu_id = $('#sbu_id').val();
|
||
|
|
||
|
if(sbu_id == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter SBU Id.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var section_id = $('#section_id').val();
|
||
|
|
||
|
if(section_id == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Section Id.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var sub_section_id = $('#sub_section_id').val();
|
||
|
|
||
|
if(sub_section_id == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Sub Section Id.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var mgr_emp_id = $('#mgr_emp_id').val();
|
||
|
|
||
|
if(mgr_emp_id == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Manager.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var gender = $('#gender').val();
|
||
|
|
||
|
if(gender == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Select Gender.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
var address = $('#address').val();
|
||
|
|
||
|
if(address == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Enter Address.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
*/
|
||
|
|
||
|
/*
|
||
|
var blood_group = $('#blood_group').val();
|
||
|
|
||
|
if(blood_group == ''){
|
||
|
|
||
|
BootstrapDialog.alert('Please Select Blood Group.!!!');
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}*/
|
||
|
|
||
|
|
||
|
$.ajax({
|
||
|
|
||
|
type: 'POST',
|
||
|
|
||
|
url: 'save_patient.php',
|
||
|
|
||
|
data: $("#employee_form").serialize(),
|
||
|
dataType: 'json',
|
||
|
|
||
|
|
||
|
success: function(data) {
|
||
|
// if(data.)
|
||
|
if (data.id != "" && data.id != null) {
|
||
|
//$("#patient_id").val(data.patient_id)
|
||
|
BootstrapDialog.alert('Patient Updated Successfully.');
|
||
|
} else if (data.patient_id != "" && data.patient_id != null) {
|
||
|
$("#patient_id").val(data.patient_id)
|
||
|
BootstrapDialog.alert('Patient Saved Successfully.');
|
||
|
|
||
|
}
|
||
|
|
||
|
//$("#flex1").flexReload();
|
||
|
|
||
|
$('.close').click();
|
||
|
|
||
|
return;
|
||
|
|
||
|
},
|
||
|
|
||
|
error: function(data) {
|
||
|
|
||
|
BootstrapDialog.alert('Error In Saving Patient');
|
||
|
|
||
|
$('.close').click();
|
||
|
|
||
|
return;
|
||
|
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
$('#doj').datepicker({
|
||
|
|
||
|
autoclose: true,
|
||
|
|
||
|
|
||
|
|
||
|
format: 'dd/mm/yyyy',
|
||
|
|
||
|
//startDate: '1d/1m/2000y',
|
||
|
|
||
|
endDate: 'current',
|
||
|
|
||
|
todayHighlight: true,
|
||
|
|
||
|
|
||
|
|
||
|
}).next().on(ace.click_event, function() {
|
||
|
|
||
|
$(this).prev().focus();
|
||
|
|
||
|
});
|
||
|
|
||
|
$('#dob').datepicker({
|
||
|
|
||
|
autoclose: true,
|
||
|
|
||
|
format: 'dd/mm/yyyy',
|
||
|
|
||
|
endDate: "today"
|
||
|
|
||
|
//startDate: '1d/1m/1970y',
|
||
|
|
||
|
|
||
|
}).next().on(ace.click_event, function() {
|
||
|
|
||
|
$(this).prev().focus();
|
||
|
|
||
|
|
||
|
|
||
|
});
|
||
|
</script>
|
||
|
<script>
|
||
|
function checkPatient() {
|
||
|
if ($("#patient_id").val() == '') {
|
||
|
// $("#fieldsetBtn").prop("disabled", true);
|
||
|
//}else{
|
||
|
//$("#fieldsetBtn").prop("disabled", false);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function navigateReceptionist() {
|
||
|
|
||
|
|
||
|
var task = $("#task").val();
|
||
|
var patientId = $("#patient_id").val();
|
||
|
|
||
|
$("#flex_patient_id").val(patientId);
|
||
|
$("#employee_form").attr('method', 'POST');
|
||
|
$("#employee_form").attr('action', 'checkup.php');
|
||
|
$("#employee_form").submit();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
$('#new_employee_contractor').click(function() {
|
||
|
$("#employee_form").submit(function(e) {
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
|
||
|
$(".save_button").show();
|
||
|
$("#id").val("");
|
||
|
$("#employer_contractor").val("");
|
||
|
|
||
|
$("#remarks").val("");
|
||
|
|
||
|
$('#modal-add-employer-contractor').modal("show");
|
||
|
})
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
function save_employer_contractor() {
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'save_employer_contractor.php',
|
||
|
type: "POST",
|
||
|
data: $("#employer-contractor_form").serialize(),
|
||
|
success: function(data) {
|
||
|
setEmployeeContractorList();
|
||
|
BootstrapDialog.alert('employer / Contractor Saved Successfully.');
|
||
|
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error In Saving employer / Contractor');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
}
|
||
|
|
||
|
function setEmployeeContractorList() {
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'select_employee_contractor_list.php',
|
||
|
type: "POST",
|
||
|
async: 'false',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
var content = "";
|
||
|
if (data != null && data != "") {
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
content = content + "<option value=" + data[i].id + ">" + data[i].employer_contractor_name + "</option>"
|
||
|
}
|
||
|
$("#employer_contractor_id").html(content);
|
||
|
$('.select2').select2()
|
||
|
}
|
||
|
|
||
|
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error In Fetching Employeer Contractor ');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
function open_employer_contractor(id, action) {
|
||
|
|
||
|
|
||
|
if (action == "V") {
|
||
|
$(".save_button").hide();
|
||
|
|
||
|
} else {
|
||
|
$(".save_button").show();
|
||
|
}
|
||
|
$.ajax({
|
||
|
url: 'select_employer_contrator.php',
|
||
|
type: 'POST',
|
||
|
data: {
|
||
|
id: id
|
||
|
},
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
|
||
|
$("#id").val(data.id);
|
||
|
$("#employer_contractor").val(data.employer_contractor_name);
|
||
|
|
||
|
$("#remarks").val(data.employer_contractor_desc);
|
||
|
|
||
|
|
||
|
|
||
|
$('#modal-add-employer-contractor').modal("show");
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Patient Category');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
$('#new_employee_designation').click(function() {
|
||
|
$("#employee_form").submit(function(e) {
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
$(".save_button").show();
|
||
|
$("#designation_id").val("");
|
||
|
$("#designation_name").val("");
|
||
|
$("#designation_desc").val("");
|
||
|
|
||
|
$('#modal-add-designation').modal("show");
|
||
|
});
|
||
|
|
||
|
function save_designation() {
|
||
|
$.ajax({
|
||
|
url: 'save_designation.php',
|
||
|
type: "POST",
|
||
|
data: $("#designation_form").serialize(),
|
||
|
success: function(data) {
|
||
|
setDesignationList();
|
||
|
BootstrapDialog.alert('Designation Saved Successfully.');
|
||
|
|
||
|
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Designation');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
}
|
||
|
|
||
|
function setDesignationList() {
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'select_designation_list.php',
|
||
|
type: "POST",
|
||
|
async: 'false',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
var content = "";
|
||
|
if (data != null && data != "") {
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
content = content + "<option value=" + data[i].designation_id + ">" + data[i].designation_name + "</option>"
|
||
|
}
|
||
|
$("#emp_designation").html(content);
|
||
|
$('.select2').select2()
|
||
|
}
|
||
|
|
||
|
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error In Fetching Employeer Contractor ');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<?php include('form/add_designation.php'); ?>
|
||
|
<?php include('form/employer_contractor_form.php'); ?>
|