656 lines
26 KiB
PHP
656 lines
26 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'); ?>
|
||
|
<?php
|
||
|
|
||
|
|
||
|
$query = "select * from employee_signature where emp_id='" . $_SESSION['logged_user_empid'] . "' ";
|
||
|
// echo $query;
|
||
|
if (! $result = @mysqli_query($conn,$query)) {
|
||
|
exit(mysqli_error($conn));
|
||
|
} else {
|
||
|
$row = @mysqli_fetch_array($result);
|
||
|
@extract($row);
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|
||
|
<!--breadcrumb-->
|
||
|
<div class="main-content">
|
||
|
<div class="main-content-inner">
|
||
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
||
|
</div>
|
||
|
<!-- End of breadcrumb -->
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="page-content">
|
||
|
<div id="user-profile-2">
|
||
|
<form class="form-horizontal" id="company_form" name="company_form" enctype="multipart/form-data"
|
||
|
action="#" method="post">
|
||
|
<div class="box box-primary">
|
||
|
<div class="box-header with-border">
|
||
|
<h4 class="box-title">Manage Signature</h4>
|
||
|
</div>
|
||
|
<div class="box-body">
|
||
|
<div id="user-profile-1" class="user-profile row">
|
||
|
<div class="col-xs-6 center">
|
||
|
<h4 class="box-title">Signature</h4>
|
||
|
<span class="profile-picture">
|
||
|
<?php if(isset($row['emp_sign']) && $row['emp_sign']!=null){?>
|
||
|
<img class="editable img-responsive" id="avatar2"
|
||
|
src="data:<?php echo $row['image_type']?>;base64,<?php echo base64_encode( $row['emp_sign'] )?>"
|
||
|
style="display: block; width: 180px; height: 100px;" />
|
||
|
|
||
|
<?php }else{?>
|
||
|
<img class="editable img-responsive" alt="Doctor Signature" id="avatar2"
|
||
|
src="images/no_image.png"
|
||
|
style="display: block; width: 180px; height: 100px;" />
|
||
|
<?php }?>
|
||
|
</span>
|
||
|
<div class="space space-4"></div>
|
||
|
<div class="hide" id="uploadForm2"></div>
|
||
|
</div>
|
||
|
<div class="col-xs-6 center">
|
||
|
<h4 class="box-title">Stamp</h4>
|
||
|
<span class="profile-picture">
|
||
|
<?php if(isset($row['emp_stamp']) && $row['emp_stamp']!=null){?>
|
||
|
<img class="editable img-responsive" id="avatar"
|
||
|
src="data:<?php echo $row['stamp_image_type']?>;base64,<?php echo base64_encode( $row['emp_stamp'] )?>"
|
||
|
style="display: block; width: 180px; height: 100px;" />
|
||
|
|
||
|
<?php }else{?>
|
||
|
<img class="editable img-responsive" alt="Doctor Signature" id="avatar"
|
||
|
src="images/no_image.png"
|
||
|
style="display: block; width: 180px; height: 100px;" />
|
||
|
<?php }?>
|
||
|
</span>
|
||
|
<div class="space space-4"></div>
|
||
|
<div class="hide" id="uploadForm"></div>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="space-20"></div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-2 control-label no-padding-right"
|
||
|
for="form-field-comment">Qualification</label>
|
||
|
<div class="col-sm-4">
|
||
|
<input class="col-xs-12 col-sm-10" type="text" id="qualification"
|
||
|
name="qualification" value="<?php echo $row['qualification'];?>"
|
||
|
placeholder="Qualification">
|
||
|
</div>
|
||
|
<label class="col-sm-2 control-label no-padding-right"
|
||
|
for="form-field-comment">Registration Number</label>
|
||
|
<div class="col-sm-4">
|
||
|
<input class="col-xs-12 col-sm-10" type="text" id="registration_no"
|
||
|
name="registration_no" value="<?php echo $row['registration_no'];?>"
|
||
|
placeholder="Registration Number">
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
<!-- /.box-body -->
|
||
|
<div class="box-footer" style="text-align: center">
|
||
|
<button class="btn btn-primary" type="button" onclick="save_employee()">
|
||
|
<i class="ace-icon fa fa-floppy-o bigger-160"></i> Save
|
||
|
</button>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</form>
|
||
|
</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
|
||
|
$('#avatar2').editable({
|
||
|
type: 'image',
|
||
|
name: 'avatar2',
|
||
|
value: null,
|
||
|
//onblur: 'ignore', //don't reset or hide editable onblur?!
|
||
|
image: {
|
||
|
//specify ace file input plugin's options here
|
||
|
btn_choose: 'Change Image',
|
||
|
droppable: true,
|
||
|
|
||
|
maxSize: 660000, //~600Kb
|
||
|
|
||
|
//and a few extra ones here
|
||
|
name: 'emp_sign', //put the field name here as well, will be used inside the custom plugin
|
||
|
on_error: function(
|
||
|
error_type
|
||
|
) { //on_error function will be called when the selected file has a problem
|
||
|
if (last_gritter) $.gritter.remove(last_gritter);
|
||
|
if (error_type == 1) { //file format error
|
||
|
last_gritter = $.gritter.add({
|
||
|
title: 'File is not an image!',
|
||
|
text: 'Please choose a jpg|gif|png image!',
|
||
|
class_name: 'gritter-error gritter-center'
|
||
|
});
|
||
|
} else if (error_type == 2) { //file size rror
|
||
|
last_gritter = $.gritter.add({
|
||
|
title: 'File too big!',
|
||
|
text: 'Image size should not exceed 600Kb!',
|
||
|
class_name: 'gritter-error gritter-center'
|
||
|
});
|
||
|
} else { //other error
|
||
|
}
|
||
|
},
|
||
|
on_success: function() {
|
||
|
$.gritter.removeAll();
|
||
|
}
|
||
|
},
|
||
|
url: function(params) {
|
||
|
// ***UPDATE AVATAR HERE*** //
|
||
|
//for a working upload example you can replace the contents of this function with
|
||
|
//examples/profile-avatar-update.js
|
||
|
|
||
|
var deferred = new $.Deferred
|
||
|
|
||
|
var value = $('#avatar2').next().find('input[type=hidden]:eq(0)').val();
|
||
|
if (!value || value.length == 0) {
|
||
|
deferred.resolve();
|
||
|
return deferred.promise();
|
||
|
}
|
||
|
var formData_object = new FormData();
|
||
|
var avatar = '#avatar2';
|
||
|
var $form = $(avatar).next().find('.editableform:eq(0)')
|
||
|
var file_input = $form.find('input[type=file]:eq(0)');
|
||
|
$form.find('input[type=file]').each(function() {
|
||
|
var field_name = $(this).attr('name');
|
||
|
var files = $(this).data('ace_input_files');
|
||
|
if (files && files.length > 0) {
|
||
|
var clone = $(this).clone();
|
||
|
clone.attr('name', 'emp_sign');
|
||
|
$("#uploadForm2").html(clone);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
//dummy upload
|
||
|
setTimeout(function() {
|
||
|
if ("FileReader" in window) {
|
||
|
//for browsers that have a thumbnail of selected image
|
||
|
var thumb = $('#avatar2').next().find('img').data('thumb');
|
||
|
if (thumb) $('#avatar2').get(0).src = thumb;
|
||
|
}
|
||
|
|
||
|
deferred.resolve({
|
||
|
'status': 'OK'
|
||
|
});
|
||
|
|
||
|
/*if(last_gritter) $.gritter.remove(last_gritter);
|
||
|
last_gritter = $.gritter.add({
|
||
|
title: 'Signature Updated!',
|
||
|
text: '',
|
||
|
class_name: 'gritter-info gritter-center'
|
||
|
});
|
||
|
*/
|
||
|
}, parseInt(Math.random() * 800 + 800))
|
||
|
|
||
|
return deferred.promise();
|
||
|
|
||
|
// ***END OF UPDATE AVATAR HERE*** //
|
||
|
},
|
||
|
|
||
|
success: function(response, newValue) {}
|
||
|
})
|
||
|
} catch (e) {}
|
||
|
|
||
|
|
||
|
//let's display edit mode by default?
|
||
|
var blank_image = true;
|
||
|
<?php if(!isset($row['emp_sign']) || $row['emp_sign']==null){?>
|
||
|
blank_image = false;
|
||
|
<?php } ?>
|
||
|
//somehow you determine if image is initially blank or not, or you just want to display file input at first
|
||
|
/*if(blank_image) {
|
||
|
$('#avatar').editable('show').on('hidden', function(e, reason) {
|
||
|
if(reason == 'onblur') {
|
||
|
$('#avatar').editable('show');
|
||
|
return;
|
||
|
}
|
||
|
$('#avatar').off('hidden');
|
||
|
})
|
||
|
}*/
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
///////////////////////////////////////////
|
||
|
|
||
|
//right & left position
|
||
|
//show the user info on right or left depending on its position
|
||
|
$('#user-profile-3 .memberdiv').on('mouseenter touchstart', function() {
|
||
|
var $this = $(this);
|
||
|
var $parent = $this.closest('.tab-pane');
|
||
|
|
||
|
var off1 = $parent.offset();
|
||
|
var w1 = $parent.width();
|
||
|
|
||
|
var off2 = $this.offset();
|
||
|
var w2 = $this.width();
|
||
|
|
||
|
var place = 'left';
|
||
|
if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) place = 'right';
|
||
|
|
||
|
$this.find('.popover').removeClass('right left').addClass(place);
|
||
|
}).on('click', function(e) {
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////
|
||
|
//change profile
|
||
|
$('[data-toggle="buttons"] .btn').on('click', function(e) {
|
||
|
var target = $(this).find('input[type=radio]');
|
||
|
var which = parseInt(target.val());
|
||
|
$('.user-profile').parent().addClass('hide');
|
||
|
$('#user-profile-' + which).parent().removeClass('hide');
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
$(document).one('ajaxloadstart.page', function(e) {
|
||
|
//in ajax mode, remove remaining elements before leaving page
|
||
|
try {
|
||
|
$('.editable').editable('destroy');
|
||
|
} catch (e) {}
|
||
|
$('[class*=select2]').remove();
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
jQuery(function($) {
|
||
|
//editables on first profile page
|
||
|
$.fn.editable.defaults.mode = 'inline';
|
||
|
$.fn.editableform.loading =
|
||
|
"<div class='editableform-loading'><i class='ace-icon fa fa-spinner fa-spin fa-2x light-blue'></i></div>";
|
||
|
$.fn.editableform.buttons =
|
||
|
'<button type="submit" class="btn btn-info editable-submit"><i class="ace-icon fa fa-check"></i></button>' +
|
||
|
'<button type="button" class="btn editable-cancel"><i class="ace-icon fa fa-times"></i></button>';
|
||
|
//editables
|
||
|
// *** editable avatar *** //
|
||
|
try { //ie8 throws some harmless exceptions, so let's catch'em
|
||
|
//first let's add a fake appendChild method for Image element for browsers that have a problem with this
|
||
|
//because editable plugin calls appendChild, and it causes errors on IE at unpredicted points
|
||
|
try {
|
||
|
document.createElement('IMG').appendChild(document.createElement('B'));
|
||
|
} catch (e) {
|
||
|
Image.prototype.appendChild = function(el) {}
|
||
|
}
|
||
|
var last_gritter
|
||
|
$('#avatar').editable({
|
||
|
type: 'image',
|
||
|
name: 'avatar',
|
||
|
value: null,
|
||
|
//onblur: 'ignore', //don't reset or hide editable onblur?!
|
||
|
image: {
|
||
|
//specify ace file input plugin's options here
|
||
|
btn_choose: 'Change Image',
|
||
|
droppable: true,
|
||
|
maxSize: 660000, //~600Kb
|
||
|
//and a few extra ones here
|
||
|
name: 'emp_stamp', //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', 'emp_stamp');
|
||
|
$("#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['emp_stamp']) || $row['emp_stamp'] == 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 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) {
|
||
|
$("#company_form").on('submit', function(e) {
|
||
|
e.preventDefault();
|
||
|
$.ajax({
|
||
|
type: 'POST',
|
||
|
url: 'save_signature.php',
|
||
|
data: new FormData(this),
|
||
|
contentType: false,
|
||
|
cache: false,
|
||
|
processData: false,
|
||
|
beforeSend: function() {
|
||
|
// $('.submitBtn').attr("disabled","disabled");
|
||
|
//$('#fupForm').css("opacity",".5");
|
||
|
},
|
||
|
success: function(msg) {
|
||
|
BootstrapDialog.alert('Signature Saved Successfully.');
|
||
|
|
||
|
var emp_id = JSON.parse(msg);
|
||
|
//$("#flex1").flexReload();
|
||
|
//$("#Company_id").val(emp_id);
|
||
|
$('.close').click();
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Signature');
|
||
|
$('.close').click();
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
function save_employee() {
|
||
|
|
||
|
$("#company_form").submit();
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
</script>
|