1611 lines
34 KiB
PHP
1611 lines
34 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">Employee</li>
|
|
<li class="active">Add New Employee 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"></div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right"
|
|
for="form-field-first">Patient Name</label>
|
|
|
|
|
|
|
|
<div class="col-sm-10">
|
|
<input class="form-control"
|
|
style="text-transform: uppercase;" type="text"
|
|
name="patient_name" id="patient_name"
|
|
placeholder="Patient Name">
|
|
|
|
<input type="hidden" name="patient_id" id="patient_id" />
|
|
<input type="hidden" name="flex_patient_id" id="flex_patient_id" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label no-padding-right"
|
|
for="form-field-username">Father's Name</label>
|
|
|
|
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input class="form-control"
|
|
style="text-transform: uppercase;" type="text"
|
|
name="father_name" id="father_name"
|
|
placeholder="Father's Name">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-sm-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</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)"> <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"></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">
|
|
|
|
</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" name="patient_category" onchange="showOrHideForDiv(this.value)"
|
|
id="patient_category">
|
|
<option value="0">Non-Employee</option>
|
|
<option value="1">Employee</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div id="employee_div" style="display: none">
|
|
<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" 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" name="emp_designation"
|
|
id="emp_designation">
|
|
<?php echo generateOption('designation','designation_name','designation_id','2',''); ?>
|
|
</select>
|
|
|
|
|
|
|
|
</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">Employee Cadre</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control" name="emp_cadre"
|
|
id="emp_cadre">
|
|
<?php echo generateOption('emp_cadre','emp_cadre','emp_cadre_id','1'); ?>
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<label class="col-sm-2 control-label no-padding-right"
|
|
for="form-field-comment">Employer/Contractor </label>
|
|
|
|
<div class="col-sm-4">
|
|
<select class="form-control" name="employer_contractor"
|
|
id="employer_contractor">
|
|
<?php echo generateOption('employer_contractor','employer_contractor_name','id','1'); ?>
|
|
</select>
|
|
|
|
|
|
|
|
</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">Employee Category </label>
|
|
|
|
<div class="col-sm-4">
|
|
<select class="form-control" name="emp_cat" id="emp_cat" onchange="showAndHideDivForSubCat(this.value)">
|
|
<?php echo generateOption('employee_category','emp_cat_name','emp_cat_id','1'); ?>
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
<div id="emp_sub_category_div" style="display: none">
|
|
<label class="col-sm-2 control-label no-padding-right"
|
|
for="form-field-comment">Employee Sub Category</label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<select class="form-control" name="emp_sub_cat" id="emp_sub_cat">
|
|
<?php echo generateOption('employee_sub_category','sub_cat_name','emp_sub_cat_id','1'); ?>
|
|
</select>
|
|
|
|
</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" 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">Is First Aider</label>
|
|
|
|
<div class="col-sm-4">
|
|
<select class="form-control" name="has_first_aid"
|
|
id="has_first_aid">
|
|
<option value="0" selected>No</option>
|
|
<option value="1">Yes</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</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">Phone Number</label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="number" id="phone_no"
|
|
name="phone_no" placeholder="Enter Phone No">
|
|
|
|
|
|
</div>
|
|
<label class="col-sm-2 control-label no-padding-right"
|
|
for="form-field-comment">Aadhar No </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="aadhar_no"
|
|
name="aadhar_no" placeholder="Enter Aadhar">
|
|
|
|
|
|
|
|
</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-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">Residing Village</label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="village"
|
|
name="village" placeholder="Enter 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"
|
|
name="post" placeholder="Enter Post">
|
|
|
|
|
|
|
|
</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">PS</label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="ps" name="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"
|
|
name="tehsil" placeholder="Enter Tehsil ">
|
|
|
|
|
|
|
|
</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">District </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="text" id="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"
|
|
name="state" placeholder="Enter State">
|
|
|
|
|
|
|
|
</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">Pin Code </label>
|
|
|
|
<div class="col-sm-4">
|
|
<input class="form-control" type="number" id="pin_code"
|
|
name="pin_code" placeholder="Enter Pin Code">
|
|
<input type="hidden" id="task"
|
|
name="task" value="<?php echo $_REQUEST['task']?>" >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="box-footer" style="text-align: center">
|
|
|
|
<button class="btn btn-primary" type="button" id="save_button"
|
|
onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-save"></i> Save
|
|
|
|
</button>
|
|
<button class="btn btn-primary" type="button" id="update_button" style="display:none"
|
|
onclick="save_employee()">
|
|
|
|
<i class="ace-icon fa fa-floppy"></i> Update
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
|
|
<i class="ace-icon fa fa-undo"></i> Reset
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-success" type="button" 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>
|
|
function checkAge(ageField,dobField){
|
|
var age = $("#"+ageField).val();
|
|
if(age<18 || age>70){
|
|
BootstrapDialog.alert("Invalid Age");
|
|
$("#"+ageField).val('');
|
|
return;
|
|
}
|
|
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);
|
|
if(age<18 || age>70){
|
|
BootstrapDialog.alert("Invalid Age");
|
|
$("#"+dobField).datepicker('setDate',"");
|
|
$("#"+ageField).val('');
|
|
return;
|
|
}else{
|
|
$("#"+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 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 fname = $('#fname').val();
|
|
|
|
if(fname == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter First Name.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var lname = $('#lname').val();
|
|
|
|
if(lname == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Last Name.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var fathername = $('#father_name').val();
|
|
|
|
if(fathername == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Father Name.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var dob = $('#dob').val();
|
|
|
|
if(dob == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter DOB.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var doj = $('#doj').val();
|
|
|
|
if(doj == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter DOJ.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var designationid = $('#designationid').val();
|
|
|
|
if(designationid == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Designation Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var emp_code = $('#emp_code').val();
|
|
|
|
if(emp_code == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Employee Code.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var emp_type_id = $('#emp_type_id').val();
|
|
|
|
if(emp_type_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Employee Type Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var bu_id = $('#bu_id').val();
|
|
|
|
if(bu_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Bu Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var sbu_id = $('#sbu_id').val();
|
|
|
|
if(sbu_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter SBU Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var section_id = $('#section_id').val();
|
|
|
|
if(section_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Section Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var sub_section_id = $('#sub_section_id').val();
|
|
|
|
if(sub_section_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Sub Section Id.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var mgr_emp_id = $('#mgr_emp_id').val();
|
|
|
|
if(mgr_emp_id == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Manager.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var gender = $('#gender').val();
|
|
|
|
if(gender == ''){
|
|
|
|
BootstrapDialog.alert('Please Select Gender.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var address = $('#address').val();
|
|
|
|
if(address == ''){
|
|
|
|
BootstrapDialog.alert('Please Enter Address.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(aadhar_no == ''){
|
|
|
|
BootstrapDialog.alert('Please Aadhar No.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var blood_group = $('#blood_group').val();
|
|
|
|
if(blood_group == ''){
|
|
|
|
BootstrapDialog.alert('Please Select Blood Group.!!!');
|
|
|
|
return false;
|
|
|
|
}*/
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: 'POST',
|
|
|
|
url: 'save_patient.php',
|
|
|
|
data:$("#employee_form").serialize(),
|
|
dataType:'json',
|
|
|
|
|
|
success: function(data){
|
|
// if(data.)
|
|
if(data.patient_id!="" && data.patient_id!=null)
|
|
BootstrapDialog.alert('Patient Updated Successfully.');
|
|
else
|
|
BootstrapDialog.alert('Patient Saved Successfully.');
|
|
|
|
|
|
$("#patient_id").val(data.patient_id_ime);
|
|
$("#flex_patient_id").val(data.patient_id_ime);
|
|
|
|
|
|
//$("#flex1").flexReload();
|
|
|
|
$('.close').click();
|
|
|
|
return;
|
|
|
|
},
|
|
|
|
error : function(data) {
|
|
|
|
BootstrapDialog.alert('Error In Saving Patient');
|
|
|
|
$('.close').click();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#doj').datepicker({
|
|
|
|
autoclose:true,
|
|
|
|
|
|
|
|
format: 'dd/mm/yyyy',
|
|
|
|
startDate: '1d/1m/2000y',
|
|
|
|
endDate: 'current',
|
|
|
|
todayHighlight: true,
|
|
|
|
|
|
|
|
}).next().on(ace.click_event, function(){
|
|
|
|
$(this).prev().focus();
|
|
|
|
});
|
|
|
|
$('#dob').datepicker({
|
|
|
|
autoclose:true,
|
|
|
|
format: 'dd/mm/yyyy',
|
|
|
|
startDate: '1d/1m/1970y',
|
|
|
|
|
|
}).next().on(ace.click_event, function(){
|
|
|
|
$(this).prev().focus();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
<script>
|
|
function navigateReceptionist(){
|
|
|
|
|
|
var task=$("#task").val();
|
|
var patientId=$("#patient_id").val();
|
|
if(task!=null && task!='' ){
|
|
|
|
|
|
if((task=='ime_long' ||task=='ime_short') && 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');
|
|
$("#employee_form").submit();
|
|
}else if(task=='ame_greater_40'){
|
|
$("#employee_form").attr('action', 'add_patient_details.php');
|
|
$("#employee_form").submit();
|
|
}else if(task=='ime_short'){
|
|
$("#employee_form").attr('action', 'add_patient_details_short_term.php');
|
|
$("#employee_form").submit();
|
|
}else if(task=='ime_long'){
|
|
$("#employee_form").attr('action', 'add_patient_details_ime_long_term.php');
|
|
$("#employee_form").submit();
|
|
}else if(task=='ame_less_40'){
|
|
$("#employee_form").attr('action', 'add_patient_details_ame_less_40.php');
|
|
$("#employee_form").submit();
|
|
}else if(task=='shutdown'){
|
|
$("#employee_form").attr('action', 'add_patient_details.php');
|
|
$("#employee_form").submit();
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|