update biface local
This commit is contained in:
48
web/js/capture-logs.js
Normal file
48
web/js/capture-logs.js
Normal file
@@ -0,0 +1,48 @@
|
||||
$(function () {
|
||||
common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY");
|
||||
common.dateTimePickerDay("birthday");
|
||||
});
|
||||
|
||||
function _search(e) {
|
||||
window.location = $(e).attr("data-href") + "?from=" + $("input[name='From']").val() + "&to=" + $("input[name='To']").val();
|
||||
}
|
||||
|
||||
function _form(e) {
|
||||
$("#form").removeClass("hidden");
|
||||
$("input[name='CaptureLogsID']").val($(e).attr("data-id"));
|
||||
$("#FaceImage").attr("src", $(e).attr("data-img"));
|
||||
}
|
||||
|
||||
function _close() {
|
||||
$("#form").addClass("hidden");
|
||||
}
|
||||
|
||||
function _save(e) {
|
||||
var name = $("input[name='Name']").val();
|
||||
if (name === "") {
|
||||
alert("Hãy nhập tên!");
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
name: name,
|
||||
type: $("select[name='Type']").val(),
|
||||
gender: $("select[name='Gender']").val(),
|
||||
birthday: $("input[name='Birthday']").val(),
|
||||
telephone: $("input[name='Telephone']").val(),
|
||||
address: $("input[name='Address']").val(),
|
||||
id: $("input[name='CaptureLogsID']").val()
|
||||
},
|
||||
success: function (data) {
|
||||
alert("Đã thêm dữ liệu thành công!");
|
||||
window.location.reload(true);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -241,6 +241,14 @@ common.dateTimePickerHour = function (id) {
|
||||
format: 'HH:mm'
|
||||
});
|
||||
};
|
||||
common.dateTimePickerByClass = function (cls, format) {
|
||||
$('.' + cls).datetimepicker({
|
||||
locale: 'vi',
|
||||
ignoreReadonly: true,
|
||||
sideBySide: true,
|
||||
format: format
|
||||
});
|
||||
};
|
||||
common.checkAll = function (id, cls) {
|
||||
$('#' + id).on('ifChecked', function (event) {
|
||||
$('.' + cls).iCheck('check');
|
||||
|
||||
Reference in New Issue
Block a user