���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/lnovel/layout/adminlte320rc/dist/js/ |
(function($) { 'use strict'; $(function () { if($(".select2").length > 0){ $(".select2").select2(); } if($("#show_ckeditor").length > 0){ CKEDITOR.replace( 'show_ckeditor', { extraPlugins: 'easyimage', height: 300, cloudServices_tokenUrl: '', cloudServices_uploadUrl: 'http://localhost/admin.adimi/upload.php' } ); } $('.dropify').dropify();//upload file $('.module_title_search').keypress(function(e){ var code_search = $('#txt_code_search').val(); if(e.which == 13){//Enter key pressed location.href='index.php?'+code_search+'&fkeyword='+$(this).val(); //$('#searchButton').click();//Trigger search button click event } }); $("#check_all").change(function () { var hdn_object = $('#list_id'); hdn_object.value = ""; var arr_chk = $('[name="txt_id"]'); if($(this).is(':checked')) { $(".filled-in").prop('checked', true); $('.btn-danger').show(); }else{ $(".filled-in").prop('checked', false); $('.btn-danger').hide(); } var p=0; var i=0; for (i=0;i<arr_chk.length;i++){ if (arr_chk[i].checked){ if (p==0){ hdn_object.value = arr_chk[i].value; }else{ hdn_object.value = hdn_object.value+"@"+arr_chk[i].value; } p++; } } hdn_object.attr('value',hdn_object.value); }); $('[name="txt_id"]').change(function () { var hdn_object = $('#list_id'); hdn_object.value = ""; var arr_chk = $('[name="txt_id"]'); var p=0; var i=0; for (i=0;i<arr_chk.length;i++){ if (arr_chk[i].checked){ if (p==0){ hdn_object.value = arr_chk[i].value; }else{ hdn_object.value = hdn_object.value+"@"+arr_chk[i].value; } p++; } } hdn_object.attr('value',hdn_object.value); }); $('#bt_act_delete').click(function () { if(confirm('Are you sure to want delete?')) { var list_id = $('#list_id').val(); location.href = '?a=WALLS2&act=language&type=delete&list_id=' + list_id; } }); $('.do_action').click(function () { var module = $(this).attr('data-module'); var list_id = $('#list_id').val(); location.href = '?'+module+'&list_id=' + list_id; }); $(".txt_top_change_lang").click(function () { var lang_type = $(this).attr('rel'); $.ajax({ type: 'POST', url: 'index.php', data: 'lang='+lang_type, dataType: 'text', success: function(data){ location.reload(); return false; } }); }); $('#update_pos').click(function () { $('[name="type2"]').attr('value','update_pos'); $('#form_quick_update').submit(); }); /*var check_choose_company = $('#check_choose_company').attr('value'); if(check_choose_company!=1){ $('.dropdown-menu').show(); }*/ $("#cap_hoc").change(function () { var cap_hoc = $(this).val(); if(cap_hoc=='thpt'){ //$('#txt_type2').show(); $('#txt_subject_type').children('option[value="3"]').show(); }else{ //$('#txt_type2').hide(); $('#txt_subject_type').children('option[value="3"]').hide(); } }); $('#txt_subject_type').change(function () { var subject_type = $(this).val(); if(subject_type=='3'){ $('#txt_type2').show(); //$('#txt_subject_type').children('option[value="3"]').show(); }else{ $('#txt_type2').hide(); //$('#txt_subject_type').children('option[value="3"]').hide(); } }); $('.mydatepicker, #datepicker').datepicker({ format: 'dd-mm-yyyy', }); $('.mydatepicker2').datepicker({ format: 'yyyy-mm-dd', }); if($("#optgroup").length > 0) { $('#optgroup').multiSelect({ selectableOptgroup: true }); } if($(".optgroup_pcgd").length > 0) { $('.optgroup_pcgd').multiSelect({ selectableOptgroup: true }); } $('#txt_fullname').keyup(function () { var fullname = $(this).val(); var staff_id = $('#staff_id').val(); $.ajax({ type: 'GET', url: 'index.php', data: 'act=management&code=staff&type=ajax&ajax=check_fullname&name='+fullname+'&staff_id='+staff_id, dataType: 'json', success: function(data){ if(data.status=='1') { $('[name="submitbt"]').hide(); swal({ title: "Warning: ", text: 'User '+data.fullname+' already exist on the system, are you sure you want to create this account? Please check back the job function of staffs before continue.', icon: 'warning', buttons: { cancel: { text: "Quit create", value: null, visible: true, className: "btn btn-danger", closeModal: true, }, confirm: { text: "Continue create", value: true, visible: true, className: "btn btn-primary", closeModal: true } } }).then(function(isConfirm){ if (isConfirm) { $('[name="submitbt"]').show(); }else{ location.replace('index.php?act=management&code=staff'); } }); return false; }else{ return true; } } }); return false; }); $('#search_staff_from_function').change(function () { var fid = $(this).val(); $.ajax({ type: 'GET', url: 'index.php', data: 'act=management&code=staff&type=ajax&ajax=search_staff_from_function&fid='+fid, dataType: 'json', success: function(data){ alert(data.fullname); return false; } }); }); $('#city_op').change(function (){ var city_code = $(this).val(); $.ajax({ type: 'POST', url: 'index.php', data: 'city_code='+city_code, dataType: '', success: function(data){ $('#district_op').html(data); } }); }); $('#district_op').change(function (){ var district_code = $(this).val(); $.ajax({ type: 'POST', url: 'index.php', data: 'district_code='+district_code, dataType: '', success: function(data){ $('#ward_op').html(data); } }); }); $('.editable').jinplace(); $('.chon_lop_cho_room').editable({ url: 'index.php?act=management&code=pcph&type=update_class_in_room', type: 'json', params: function(params) { var pr_basic = $(this).attr("data-urls"); params.data_urls = pr_basic; //params.item = {value: params.value} return params; }, source: function () { var items = $(this).attr("data-value"); return items; //return Object.keys(items).map(function(x) {return items[x];}); }, ajaxOptions:{ type:'get', dateType: 'json' }, success: function (response,new_value) { //alert(new_value); } }); $('.chon_mon_cho_tkb').editable({ //mode: 'inline', url: 'index.php?act=management&code=tkb&type=update_subject_tkb', type: 'json', params: function(params) { var pr_basic = $(this).attr("data-urls"); params.data_urls = pr_basic; //params.item = {value: params.value} return params; }, source: function () { var items = $(this).attr("data-value"); return items; //return Object.keys(items).map(function(x) {return items[x];}); }, ajaxOptions:{ type:'get', dateType: 'json' }, success: function (response,new_value) { if(response==0){ //https://sweetalert.js.org/guides/#installation swal({ title: "Warning: ", text: 'No assignment yet! - Chưa cĂ³ phĂ¢n cĂ´ng giảng dạy!', icon: 'warning'}); //alert('Chưa cĂ³ phĂ¢n cĂ´ng giảng dạy!'); } if(response=='-1'){ //https://sweetalert.js.org/guides/#installation swal({ title: "Warning: ", text: 'Exceeded the number of assignments per week - ÄĂ£ vượt quĂ¡ số tiết phĂ¢n cĂ´ng/tuần!', icon: 'warning'}); //alert('Chưa cĂ³ phĂ¢n cĂ´ng giảng dạy!'); } if(response=='-2'){ //https://sweetalert.js.org/guides/#installation swal({ title: "Warning: ", text: 'This teacher has been assigned to another class at the same time - GiĂ¡o viĂªn dạy mĂ´n nĂ y Ä‘Ă£ được phĂ¢n cĂ´ng ở lá»›p khĂ¡c cĂ¹ng thá»i gian!', icon: 'warning'}); //alert('Chưa cĂ³ phĂ¢n cĂ´ng giảng dạy!'); } if(response=='-3'){ //https://sweetalert.js.org/guides/#installation swal({ title: "Warning: ", text: 'Timetable activated, not editable - Thá»i khĂ³a biểu Ä‘Ă£ kĂch hoạt, khĂ´ng thể chỉnh sá»a.', icon: 'warning'}); //alert('Chưa cĂ³ phĂ¢n cĂ´ng giảng dạy!'); } } }); $('#txt_list_teacher_select2').select2({ placeholder: "Chá»n giĂ¡o viĂªn - cbnv", allowClear: true, ajax: { url: 'index.php', dataType: 'json', data: function (params) { var query = { a: 'WALLS2', act: 'ajax_home', type: 'list_teacher', search: params.term, pageNum: params.page || 1 } // Query parameters will be ?search=[term]&page=[page] return query; } } }); $('body').on('shown.bs.modal', '.modal', function() { $(this).find('select.form-control').each(function() { var dropdownParent = $(document.body); if ($(this).parents('.modal.in:first').length !== 0) dropdownParent = $(this).parents('.modal.in:first'); $(this).select2({ dropdownParent: dropdownParent, placeholder: "Ngưá»i tham dá»±", allowClear: true, ajax: { url: 'index.php', dataType: 'json', data: function (params) { var query = { a: 'WALLS2', act: 'ajax_home', type: 'list_teacher', search: params.term, pageNum: params.page || 1 } // Query parameters will be ?search=[term]&page=[page] return query; } } }); }); }); $('[name="radio_user_type"]').click(function (){ var type_user = $(this).val(); var url_user=''; switch (type_user){ case 'hs': url_user = 'list_hocsinh_user'; break; case 'ph': url_user = 'list_phuhuynh_user'; break; default: url_user = 'list_teacher_user'; break; } $('#to_user').show(); $('#to_user').select2({ placeholder: "To:", allowClear: true, ajax: { url: 'index.php', dataType: 'json', data: function (params) { var query = { a: 'WALLS2', act: 'ajax_home', type: url_user, search: params.term, pageNum: params.page || 1 } // Query parameters will be ?search=[term]&page=[page] return query; } } }); }); $('#contacts_search_teacher').select2({ placeholder: "", allowClear: true, dropdownCssClass : 'custom-width', ajax: { url: 'index.php', dataType: 'json', data: function (params) { var query = { a: 'WALLS2', act: 'ajax_home', type: 'list_teacher_user', search: params.term, pageNum: params.page || 1 } // Query parameters will be ?search=[term]&page=[page] return query; } } }); $('#search_customer').select2({ placeholder: "", allowClear: true, dropdownCssClass : 'custom-width', ajax: { url: 'index.php', dataType: 'json', data: function (params) { var query = { act: 'management', code: 'customer', type: 'list_search_customer', search: params.term, pageNum: params.page || 1 } // Query parameters will be ?search=[term]&page=[page] return query; } } }); $(".modal-ajax").click(function(){ $('#modal_ajax').find('.modal-title').html($(this).attr('data-title')); $('#modal_ajax').find('.modal-body').load($(this).attr('href')); $('#modal_ajax').modal('show'); return false; }); /*$('#get_staff_from_name').easyAutocomplete({ url: function(phrase) { return "index.php?act=management&code=staff&type=ajax&ajax=search_staff_from_name&keyword="+phrase; }, getValue: function(element) { //$('#staff_id_leader').attr('value',element.staff_id); //alert(element.staff_id); return element.staff_fullname; }, template: { type: "description", fields: { description: function(element) { return element.staff_email365; } } }, list: { onSelectItemEvent: function() { var selectedItemValue = $("#get_staff_from_name").getSelectedItemData().staff_id; $("#staff_id_leader").val(selectedItemValue).trigger("change"); } }, ajaxSettings: { dataType: "json", method: "GET", data: { dataType: "json" } }, preparePostData: function(data) { data.phrase = $("#get_staff_from_name").val(); return data; }, requestDelay: 400 });*/ $('.file-upload-browse').on('click', function() { var file = $(this).parent().parent().parent().find('.file-upload-default'); file.trigger('click'); }); $('.file-upload-default').on('change', function() { $(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, '')); }); if($(".summernote").length > 0) { /*$('.summernote').summernote({ height: 150, callbacks: { onImageUpload: function(files, editor, welEditable) { sendFile(files[0], editor, welEditable); } } });*/ $('.summernote').summernote({ tabsize: 2, height: 300, callbacks: { onImageUpload: function(files, editor, welEditable) { sendFile(files[0], editor, welEditable); } } }); } if($(".summernote2").length > 0) { $('.summernote2').summernote({ tabsize: 2, height: 300, callbacks: { onImageUpload: function(files, editor, welEditable) { sendFile2(files[0], editor, welEditable); } } }); } if($('div[title]').length >0 ){ $('div[title]').tooltip(); } if($('.table-responsive').length >0 ) { $('.table-responsive').doubleScroll(); } }); })(jQuery); /*function sendFile(file, editor, welEditable) { data = new FormData(); data.append("file", file); $(".summernote").before("<div class=\"editor_upload_loading spinner-border text-primary\" role=\"status\">\n" + " <span class=\"sr-only\">Loading...</span>\n" + "</div>"); $.ajax({ data: data, type: "POST", //url: "https://img.vidoe.top/upanh2/remote_upload.php", url: "upload/editor_upload.php", cache: false, contentType: false, processData: false, success: function(url) { $('.summernote').summernote('insertImage', url); //editor.insertImage(welEditable, url); $(".editor_upload_loading").remove(); } }); }*/ function sendFile(file, editor, welEditable) { data = new FormData(); data.append("file", file); $(".summernote").before("<div class=\"editor_upload_loading spinner-border text-primary\" role=\"status\">\n" + " <span class=\"sr-only\">Loading...</span>\n" + "</div>"); $.ajax({ data: data, type: "POST", url: "upload/editor_upload.php", cache: false, processData: false, contentType: false, success: function(url) { var image = $('<img>').attr('src', url); $('.summernote').summernote("insertNode", image[0]); $(".editor_upload_loading").remove(); } }); } function sendFile2(file, editor, welEditable) { data = new FormData(); data.append("file", file); $(".summernote2").before("<div class=\"editor_upload_loading2 spinner-border text-primary\" role=\"status\">\n" + " <span class=\"sr-only\">Loading...</span>\n" + "</div>"); $.ajax({ data: data, type: "POST", url: "upload/editor_upload.php", cache: false, processData: false, contentType: false, success: function(url) { var image = $('<img>').attr('src', url); $('.summernote2').summernote("insertNode", image[0]); $(".editor_upload_loading2").remove(); } }); } function change_company(id,brand) { $.ajax({ type: 'POST', url: 'index.php', data: 'txt_company_id='+id+'&txt_brand='+brand, dataType: 'text', success: function(data){ location.reload(); return false; } }); } function setting_page(id,brand) { $.ajax({ type: 'POST', url: 'index.php', data: 'txt_company_id='+id+'&txt_brand='+brand, dataType: 'text', success: function(data){ window.location.href='index.php?a=WALLS2&act=settings'; return false; } }); } function check_past_date(dateinput) { var d = new Date(); var day = d.getDate(), month = d.getMonth()+1, year = d.getFullYear(); if(day<10) { day = '0'+day; } if(month<10) { month = '0'+month; } var current = day+'/'+month+'/'+year; var currentDate = parseDate(current).getTime(); var inputDate = parseDate(dateinput).getTime(); if (inputDate > currentDate) { $('[name="submitbt_out_work"]').hide(); swal({ text: 'Date out off must be before the current date (NgĂ y nghỉ phải trước ngĂ y hiện tại)', button: { text: "OK", value: true, visible: true, className: "btn btn-primary" } }) }else{ $('[name="submitbt_out_work"]').show(); } } function parseDate(str) { var mdy = str.split('/'); return new Date(mdy[2], mdy[1], mdy[0]); } /* var refreshIntervalId = setInterval(function() { var login_remain = $('#show_login_remain').text(); if(login_remain>=11) { var seconds = login_remain - 1; $('#show_login_remain').text(seconds); }else{ swal({ title: "Warning: ", text: 'The session will end in 10s, click "Yes" if you want to continue!', icon: 'warning', buttons: { cancel: { text: "Cancel", value: null, visible: true, className: "btn btn-danger", closeModal: true, }, confirm: { text: "Yes", value: true, visible: true, className: "btn btn-primary", closeModal: true } } }).then(function(isConfirm){ if (isConfirm) { location.reload(); }else{ location.href='index.php?act=logout'; } }); clearInterval(refreshIntervalId); return false; } }, 1000); */ function logout_user(name,school) { var datasend = name+' - '+school; //socket.emit('Client_Send_Data_User_Logout',datasend); $.ajax({ url: 'index.php?a=WALLS2&act=logout_ajax', type: 'get', data: '&name='+datasend, dataType: '', success: function(result){ alert('Logout succesfull!'); location.href='index.php'; } }); } function submit_form_pcgd(v_subject_id,staff_id) { //$('#pcgd_'+v_subject_id+'_'+staff_id).submit(); $('#pcgd_'+v_subject_id+'_'+staff_id).ajaxSubmit({ target: '', // target element(s) to be updated with server response beforeSubmit: function(formData, jqForm, options){ $('.icon-check').hide(); /*$.toast({ heading: 'Info', text: 'Updating!', showHideTransition: 'slide', icon: 'info', loaderBg: '#46c35f', position: 'top-right' });*/ return true; }, // pre-submit callback success: function(responseText, statusText, xhr, $form){ $.toast({ heading: 'Success', text: 'Update sussessfull.', showHideTransition: 'slide', icon: 'success', loaderBg: '#f96868', position: 'top-right' }); $('.icon-check').show(); } }); return false; } function tkb_apply(v_company_id,txt_year,txt_term,v_grade,txt_tkb_date) { swal({ title: "Warning: ", text: 'Are you sure to apply this timetable?', icon: 'warning', buttons: { cancel: { text: "Cancel", value: null, visible: true, className: "btn btn-danger", closeModal: true, }, confirm: { text: "Yes", value: true, visible: true, className: "btn btn-primary", closeModal: true } } }).then(function(isConfirm){ if (isConfirm) { $.ajax({ url: 'index.php?act=management&code=tkb&type=tkb_apply', type: 'post', data: '&v_company_id='+v_company_id+'&txt_year='+txt_year+'&txt_term='+txt_term+'&v_grade='+v_grade+'&txt_tkb_date='+txt_tkb_date, dataType: '', success: function(result){ if(result=='1'){ $.toast({ heading: 'Success', text: 'Timetable actived', showHideTransition: 'slide', icon: 'success', loaderBg: '#f96868', position: 'top-right' }); window.location.reload(); } //alert('Logout succesfull!'); //location.href='index.php'; } }); //location.reload(); }else{ return false; } }); } function tkb_delete(v_company_id,txt_year,txt_term,v_grade,txt_tkb_date) { swal({ title: "Warning: ", text: 'Are you sure want to delete this timetable?', icon: 'warning', buttons: { cancel: { text: "Cancel", value: null, visible: true, className: "btn btn-danger", closeModal: true, }, confirm: { text: "Yes", value: true, visible: true, className: "btn btn-primary", closeModal: true } } }).then(function(isConfirm){ if (isConfirm) { $.ajax({ url: 'index.php?act=management&code=tkb&type=tkb_delete', type: 'post', data: '&v_company_id='+v_company_id+'&txt_year='+txt_year+'&txt_term='+txt_term+'&v_grade='+v_grade+'&txt_tkb_date='+txt_tkb_date, dataType: '', success: function(result){ if(result=='1'){ $.toast({ heading: 'Success', text: 'Timetable deleted', showHideTransition: 'slide', icon: 'success', loaderBg: '#f96868', position: 'top-right' }); } if(result=='-1'){ $.toast({ heading: 'Failed', text: 'Timetable actived, can not delete', showHideTransition: 'slide', icon: 'error', loaderBg: '#f96868', position: 'top-right' }); } //alert('Logout succesfull!'); //location.href='index.php'; } }); //location.reload(); }else{ return false; } }); } function multi_delete(act,code) { if(confirm('Are you sure to want delete?')) { var list_id = $('#list_id').val(); location.href = '?act='+act+'&code='+code+'&type=delete&list_id=' + list_id; } } function cajax(u,d,datatype_callback,callback) { $.ajax({ type: "post", url: u, data:d, dataType:datatype_callback, success: function(data) { if(typeof callback == 'function') { callback(data); } } }); } function open_popup(url_uc,target){ var popupWidth=1280; var popupHeight=650; var xPosition=($(window).width()-popupWidth)/2; var yPosition=($(window).height()-popupHeight)/2; var myPopup = window.open(url_uc, target, "directories=no,titlebar=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,"+ "width="+popupWidth+",height="+popupHeight+","+ "left="+xPosition+",top="+yPosition); }