File manager - Edit - /home/autoph/public_html/tasks/resources/views/common/script/knowledegebase_video.php
Back
<script> var selected_video_data = 0; var is_new_video = 0; var ticket_selected_filters = "[]"; var ticket_selected_filters_priority = "[]"; var ticket_selected_filters_category = "[]"; var upload_video_json_data = ""; var upload_video_attachments_arr = []; var upload_video_attachments_has_error = false; var upload_video_attachments_error_msg; var remove_video_attachment_mock_files = []; var upload_video_file_attachments_arr = []; var upload_video_file_attachments_has_error = false; var remove_video_file_attachment_mock_files = []; var video_display_limit_const = 8; var video_display_limit = video_display_limit_const; var video_display_count = 0; var selected_positions = []; var send_notif_selected_positions = 0; // DROPZONE 2 START // Get the template HTML and remove it from the doumenthe template HTML and remove it from the doument var videoModalNode = document.querySelector("#video_modal_template") videoModalNode.id = "" var videoModalTemplate = videoModalNode.parentNode.innerHTML videoModalNode.parentNode.removeChild(videoModalNode) var uploadVideoDropzone = new Dropzone("#video_modal", { url: "app/models/file.php", paramName: "file", maxFilesize: 205, maxFiles: 1, autoProcessQueue: false, acceptedFiles: '.mp4, .mkv, .mov, .avi, .wmv', init: function() { this.on('sending', function(file, xhr, formData) { formData.append("model", "create_file"); formData.append("file", "videos"); }); }, thumbnailWidth: 50, thumbnailHeight: 50, parallelUploads: 20, previewTemplate: videoModalTemplate, autoQueue: false, // Make sure the files aren't queued until manually added previewsContainer: "#video_modal_previews", // Define the container to display the previews clickable: ".video-modal-button" // Define the element that should be used as click trigger to select files. }); function startVideoUpload() { if (!is_new_video) { createVideo(); return false; } if (uploadVideoDropzone.getAcceptedFiles().length < 1) { toastr.remove(); toastr.info("Select video to upload..."); return false; } for (var i = 0; i < uploadVideoDropzone.getAcceptedFiles().length; i++) { uploadVideoDropzone.processFile(uploadVideoDropzone.getAcceptedFiles()[i]); } } uploadVideoDropzone.on('success', function(file, result) { try { result = JSON.parse(result) if (parseInt(result.status) === 1) { // alert(result.change_name); var upload_video_attachments_obj = { "change_name": result.change_name, "original_name": result.orig_name } upload_video_attachments_arr.push(upload_video_attachments_obj); } else if (parseInt(result.status) === 0) { //put the first error only if (!upload_video_attachments_has_error) { upload_video_attachments_has_error = true; uploaded_ticket_attachments_error_msg = { filename: result.orig_name, message: result.message }; } } if (!result.error) { if (uploadVideoDropzone.getQueuedFiles().length === 0 && uploadVideoDropzone.getUploadingFiles().length === 0) { // console.log(upload_video_attachments_arr) if (upload_video_attachments_has_error) { toastr.remove(); toastr.error(uploaded_ticket_attachments_error_msg.filename + ' - ' + uploaded_ticket_attachments_error_msg.message) //remove uploaded files $.ajax({ url: "app/models/file.php", data: { model: 'delete_file', file: 'videos', file_names: JSON.stringify(upload_video_attachments_arr) }, type: "POST", dataType: 'json', beforeSend: function() {}, success: function(result) {}, error: function() {} }); } else { // uploadVideoDropzone.removeAllFiles(true); createVideo(); } upload_video_attachments_has_error = false; upload_video_attachments_arr = []; } } //TODO - } catch (e) { //TODO - console.log(e) } }); function createVideo() { return $.ajax({ url: "app/models/knowledgebase.php", data: { model: 'create_video', json_data: upload_video_json_data, is_new_video: is_new_video, video_id: selected_video_data, attachments: JSON.stringify(upload_video_attachments_arr), remove_attachments: JSON.stringify(remove_video_attachment_mock_files), rsc_attachments: JSON.stringify(upload_video_file_attachments_arr), rsc_remove_attachments: JSON.stringify(remove_video_file_attachment_mock_files), position_data: JSON.stringify(selected_positions), send_notif: send_notif_selected_positions }, type: "POST", dataType: 'json', beforeSend: function() { $('#btn_video_save').prop( 'disabled', true); // toastr.remove(); // toastr.info("Adding entry..."); }, success: function(result) { if (parseInt(result.status) === 1) { // created_ticket_id = result.id; createVideoDone(result.message) } else { $('#btn_video_save').prop( 'disabled', false); toastr.remove(); toastr.error(result.message); } }, error: function() { $('#btn_video_save').prop( 'disabled', false); toastr.remove(); toastr.error( "Error has occurred. Try again." ) } }); } function createVideoDone(message) { upload_video_file_attachments_has_error = false; upload_video_file_attachments_arr = []; toastr.remove(); toastr.success(message); resetVideoModal(); $('#video_modal').modal( 'hide'); $('#btn_video_save').prop( 'disabled', false); // refreshTicketTableSilent(); defaultVideos(); } // DROPZONE 2 END // DROPZONE 3 START // Get the template HTML and remove it from the doumenthe template HTML and remove it from the doument var videoFileModalNode = document.querySelector("#attach_modal_template") videoFileModalNode.id = "" var videoFileModalTemplate = videoFileModalNode.parentNode.innerHTML videoFileModalNode.parentNode.removeChild(videoFileModalNode) var uploadVideoFileDropzone = new Dropzone("#attach-file-dropzone-div", { removedfile: function(file) { if (!isEmpty(file.id)) { remove_video_file_attachment_mock_files.push(file.id); } var _ref; return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0; }, url: "app/models/file.php", paramName: "file", maxFilesize: 1024, maxFiles: 999, autoProcessQueue: false, acceptedFiles: '.pdf, .doc, .docx, .txt, .html, .htm, .ppt, .pptx, .xls, .csv, .xlsx, .png, .jpeg, .jpg, .mp4, .mkv, .mov, .avi, .wmv', init: function() { this.on('sending', function(file, xhr, formData) { formData.append("model", "create_file"); formData.append("file", "video_attach"); }); }, thumbnailWidth: 50, thumbnailHeight: 50, parallelUploads: 20, previewTemplate: videoFileModalTemplate, autoQueue: false, // Make sure the files aren't queued until manually added previewsContainer: "#attach_modal_previews", // Define the container to display the previews clickable: ".attach-modal-button" // Define the element that should be used as click trigger to select files. }); function startVideoFileUpload() { if (uploadVideoDropzone.getAcceptedFiles().length < 1 && is_new_video) { toastr.remove(); toastr.info("Select video to upload..."); return false; } $('#btn_video_save').prop( 'disabled', true); toastr.remove(); toastr.info("Saving entry..."); if (uploadVideoFileDropzone.getAcceptedFiles().length < 1) { // createVideoFile(); startVideoUpload(); return false; } for (var i = 0; i < uploadVideoFileDropzone.getAcceptedFiles().length; i++) { uploadVideoFileDropzone.processFile(uploadVideoFileDropzone.getAcceptedFiles()[i]); } } uploadVideoFileDropzone.on('success', function(file, result) { try { result = JSON.parse(result) if (parseInt(result.status) === 1) { // alert(result.change_name); var upload_video_attachments_obj = { "change_name": result.change_name, "original_name": result.orig_name } upload_video_file_attachments_arr.push(upload_video_attachments_obj); } else if (parseInt(result.status) === 0) { //put the first error only if (!upload_video_file_attachments_has_error) { upload_video_file_attachments_has_error = true; uploaded_ticket_attachments_error_msg = { filename: result.orig_name, message: result.message }; } } if (!result.error) { if (uploadVideoFileDropzone.getQueuedFiles().length === 0 && uploadVideoFileDropzone.getUploadingFiles().length === 0) { // console.log(upload_video_file_attachments_arr) if (upload_video_file_attachments_has_error) { upload_video_file_attachments_has_error = false; upload_video_file_attachments_arr = []; toastr.remove(); toastr.error(uploaded_ticket_attachments_error_msg.filename + ' - ' + uploaded_ticket_attachments_error_msg.message) //remove uploaded files $.ajax({ url: "app/models/file.php", data: { model: 'delete_file', file: 'video_attach', file_names: JSON.stringify(upload_video_file_attachments_arr) }, type: "POST", dataType: 'json', beforeSend: function() {}, success: function(result) {}, error: function() {} }); } else { // uploadVideoFileDropzone.removeAllFiles(true); startVideoUpload(); } } } //TODO - } catch (e) { //TODO - console.log(e) } }); // DROPZONE 3 END function initFilterCategory() { $.when(loadTicketFilterCategory()).done(function(ajax1Results) { $(".ticket-filter-category li").each(function() { $(this).on('click', function() { $(this).toggleClass("active"); var active_items = $('.ticket-filter-category').find('li.active').map( function() { var item = {}; // item.id = this.value; item.status = $(this).text(); return item; }); var active_items_arr = []; $.each(active_items, function(i, n) { active_items_arr.push(n.status) }); ticket_selected_filters_category = JSON.stringify(active_items_arr); // alert(ticket_selected_filters_category) // refreshTicketTableSilent(); // refreshVideoList(); defaultVideos(); }); }); }); } function initVideoSearchEvt() { $('.search-data').focusin(function() { $('.search-data-div').removeClass('default-search-size'); $('.search-data-div').addClass('expand-search-size'); }); $('.search-data').focusout(function() { if (isEmpty($(this).val())) { $('.search-data-div').removeClass('expand-search-size'); $('.search-data-div').addClass('default-search-size'); } }); $('.search-data').on('keyup', delay(function(e) { // if($('.search-data').val().length >= 3){ // defaultVideos(); // } if (e.key === 'Enter' || e.keyCode === 13) { // Do something // if($('.search-data').val().length > 0){ defaultVideos(); // } } }, 500)); $('.search-data-button').on('click', function(e) { // if($('.search-data').val().length > 0){ defaultVideos(); // } }); } function resetVideoModal() { var $el = $('#video_modal'); resetElementForm($el); uploadVideoDropzone.removeAllFiles(true); uploadVideoFileDropzone.removeAllFiles(true); } function btnNewVideoEvt() { $('#btn_new_video').on("click", function(e) { is_new_video = 1; resetVideoModal(); $('#video_modal').modal('show'); selected_positions = []; send_notif_selected_positions = 0; refreshRoleBrandfileTableSilent(); $('#video-file-dropzone-div').show(); if(!isEmpty(param_section) && param_section != 'EMPTY_SECTION'){ var newState = new Option(param_section, param_section, true, true); $("#section").append(newState).trigger('change'); } }); } function saveVideoEvt() { $('#btn_video_save').on('click', function() { if (check_if_empty_field($('#category'), 'Category is required.')) { return false; } if (check_if_empty_field($('#title'), 'Title is required.')) { return false; } if ($('#title').val().length <= 4) { toastr.remove(); toastr.error("Title is too short..."); $('#title').trigger('focus'); return false; } if (check_if_empty_field($('#description'), 'Description is required.')) { return false; } if ($('#description').val().length <= 5) { toastr.remove(); toastr.error("Description is too short..."); $('#description').trigger('focus'); return false; } if (!isEmpty($('#year_model').val())) { if ($('#year_model').val().length != 4) { toastr.remove(); toastr.error("Invalid year model..."); $('#year_model').trigger('focus'); return; } } var $element = $("[json-video-modal]"); upload_video_json_data = generate_json( 'json-video-modal', $element); // alert(upload_video_json_data); // return false; // startVideoUpload(); startVideoFileUpload(); }); } function refreshVideoList() { $.ajax({ url: "app/models/knowledgebase.php", data: { model: 'read_videos', search: $('.search-data').val(), filter_category: ticket_selected_filters_category, owned_video_only: owned_video_only, filter_brand: $('#brand-filter').val(), filter_model: $('#model-filter').val(), filter_position: $('#position-filter').val(), // filter_section: $('#section-filter').val(), filter_section: isEmpty(param_section) ? $('#section-filter').val() : param_section, offset: video_display_limit - video_display_limit_const, limit: video_display_limit_const }, type: "POST", dataType: 'json', beforeSend: function() { // $('#video_container').html('') }, success: function(result) { // console.log(result) $.each(result.rows, function(i, n) { // console.log(i); // console.log(n); var remove_btn = (owned_video_only) ? `<button type="button" title="Update" action-video-update="` + n.id + `" class="tooltip-me btn btn-icon btn-primary "> <i class="fa fa-pen"></i> </button> <button type="button" title="Remove" action-video-remove="` + n.id + `" class="tooltip-me btn btn-icon btn-danger "> <i class="fa fa-trash"></i> </button> ` : ``; $('#video_container').append(` <div class="col-lg-3 col-md-4 col-sm-12 pb-3" > <div class="card h-100"> <div class="file"> <a href="javascript:void(0);"> <div class="hover "> ` + remove_btn + ` </div> <div class="icon p-0" id="play_video_` + n.id + `" > <i class="fa fa-play text-danger" aria-hidden="true"></i> </div> <div class="file-name"> <p class="m-0 text-muted text-sm"><span class="font-weight-bold">Title:</span> ` + n.title + `</p> <p class="mb-2 text-muted text-sm"><span class="font-weight-bold">Description:</span> ` + n.description + `</p> <small><!--Size: ` + n.size + `--><span class="date text-muted">` + n.date + `</span></small> </div> </a> </div> </div> </div> `); $('#play_video_' + n.id).on('click', function() { window.location.hash = 'videos-view-' + n.id; // videoPlayer(n) }) video_display_count++; }); $("[action-video-update]").each(function() { $(this).off('click').on('click', function() { var video_id = $(this).attr('action-video-update'); // alert(video_id) selected_video_data = video_id; // var ticket_id = $(this).attr("update-ticket-action"); // removeSelectChangeEvt(); is_new_video = 0; resetVideoModal(); $('#video_modal').modal('show'); selected_positions = []; send_notif_selected_positions = 0; refreshRoleBrandfileTableSilent(); $('#video-file-dropzone-div').hide(); setTimeout(function() { initVideoData(); }, 100) }); }); $("[action-video-remove]").each(function() { $(this).off('click').on('click', function() { var video_id = $(this).attr('action-video-remove'); // SWAL Swal.fire({ icon: 'warning', html: 'Are you sure you want to remove this video?', showDenyButton: false, showCancelButton: true, confirmButtonText: `Yes`, cancelButtonText: `No`, denyButtonText: `Don't Confirm`, showClass: { backdrop: 'swal2-noanimation', // disable backdrop animation popup: '', // disable popup animation icon: '' // disable icon animation }, hideClass: { popup: '', // disable popup fade-out animation }, customClass: 'swal-height' }).then((result) => { if (result.isConfirmed) { $.ajax({ url: "app/models/knowledgebase.php", data: { model: 'delete_video', video_id: video_id }, type: "POST", dataType: 'json', beforeSend: function() { toastr.remove(); toastr.info('Removing video...') }, success: function(result) { toastr.remove(); toastr.success(result.message); $('#video_container').html('') refreshVideoList(); }, error: function() {} }); } else if (result.isDenied) {} else {} }) // SWAL }); }); if (result['rows'].length == 0) { // $('#view_more_videos').addClass('hideEl'); } else { // $('#view_more_videos').removeClass('hideEl'); defaultFunctions(); } if (video_display_count == 0) { $('#video_container').html('<div class="col-12 text-center"><span class="text-center">No result</span></div>') $('#view_more_videos').addClass('hideEl'); } else if (video_display_count != 0 && result['rows'].length == 0) { toastr.remove(); toastr.info("No more videos.") } else { $('#view_more_videos').removeClass('hideEl'); } }, error: function() {} }); } function videoPlayer(n) { selected_video_data = n.id; $('#video_player_modal').modal('show'); $.when(init_video_player_modal(n)).done(function(ajax1Results) { $('#video_player_modal').modal('show'); $('#video_player_modal').on('hidden.bs.modal', function() { $('#video_player_modal').remove(); }); initVideoDataView(); }); } function initVideoDataView() { return $.ajax({ url: "app/models/knowledgebase.php", data: { model: 'read_video_data', video_id: selected_video_data }, type: "POST", dataType: 'json', beforeSend: function() {}, success: function(result) { if (isEmpty(result.rows.brand) && isEmpty(result.rows.model) && isEmpty(result.rows.model_variant)) { $('#vehicle_info').hide(); } $.each(result.rows, function(i, n) { if (i == 'description') { // var description = n.replaceAll("\n", "<br>") // $("#span_video_description").html(description); } else if (i == 'brand' && isEmpty(n)) { $("#v_view_brand_p").hide(); } else if (i == 'model' && isEmpty(n)) { $("#v_view_model_p").hide(); } else if (i == 'model_variant' && isEmpty(n)) { $("#v_view_model_variant_p").hide(); } else { // $("#" + i).text(n); // $("#span_video_title" + i).text(n); } }); $("#span_video_title").text(result.rows.title); var description = result.rows.description.replaceAll("\n", "<br>") $("#span_video_description").html(description); $("#v_view_brand").text(result.rows.brand); $("#v_view_model").text(result.rows.model); $("#v_view_model_variant").text(result.rows.model_variant); if (result.attachments.length > 0) { $('#video_attachment_container').html(''); $.each(result.attachments, function(i, n) { var fileExt = n.change_name.split('.').pop(); var filename = n.change_name.replace(/\.[^/.]+$/, "") switch (fileExt) { case 'png': case 'jpg': case 'jpeg': $('#video_attachment_container').append(`<a data-type="image" data-toggle="lightbox" href="viewer/image.php?token=` + filename + `@4" > <u><span>` + n.original_name + `</span></u> </a><br>`); break; case 'pdf': $('#video_attachment_container').append(`<a target="_blank" href="pdf/pdf.php?token=` + filename + `@4" > <u><span>` + n.original_name + `</span></u> </a><br> `); break; default: $('#video_attachment_container').append(`<a href="javascript:void(0);" onclick="downloadTicketAttachment('` + n.change_name + `','4')"> <u><span>` + n.original_name + `</span></u> </a> <br> `); } }); } else { $('#video_attachment').hide(); } var src_vid = 'dist/videos/' + result.rows.attachment_name; $("#video_el").html('<source src="' + src_vid + '" type="video/mp4"></source>'); }, error: function() {} }); } function init_video_player_modal(n) { var file_location = "dist/videos/" + n.attachment_name; return $.ajax({ url: "resources/views/modals/video_player_modal.php", data: { file: file_location, json_data: JSON.stringify(n) }, type: "POST", beforeSend: function() {}, success: function(data) { $('#modal_container').append(data); }, error: function() { toastr.remove(); toastr.error("Error has occurred. Try again.") } }); } function initVideoData() { return $.ajax({ url: "app/models/knowledgebase.php", data: { model: 'read_video_data', video_id: selected_video_data }, type: "POST", dataType: 'json', beforeSend: function() {}, success: function(result) { addSelectChangeEvt(); remove_video_attachment_mock_files = []; remove_video_file_attachment_mock_files = []; selected_positions = isEmpty(result.rows.position_access) ? [] : JSON.parse(result.rows.position_access); // console.log(selected_positions) $.each(result.rows, function(i, n) { // if(i == 'description'){ // var description = n.replaceAll("<br>", "\n") // $("#" + i).val(n+'asd'); // }else{ $("#" + i).text(n); $("#" + i).val(n); $("#" + i).trigger('change') var newState = new Option(n, n, true, true); // Append it to the select $("#" + i).append(newState).trigger('change'); // } }); $.each(result.attachments, function(key, value) { var mockFile = { id: value.id, name: value.original_name, size: value.unreadable_size }; uploadVideoFileDropzone.emit("addedfile", mockFile); uploadVideoFileDropzone.emit("complete", mockFile); uploadVideoFileDropzone.files.push(mockFile); // here you add them into the files array }); // delete ticket_attachment_mock_files[57]; }, error: function() {} }); } function initSelect2UnselectElement() { $('#brand-filter,#model-filter,#position-filter,#section-filter').on('select2:select select2:unselecting', function(e) { defaultVideos(); }); } function defaultVideos() { video_display_limit = video_display_limit_const; video_display_count = 0; $('#video_container').html('') refreshVideoList(); } function kbVideoAutoComplete() { var xhr = null; $('#txt_video_search').autoComplete({ resolver: 'custom', noResultsText: '', events: { search: function(qry, callback) { // let's do a custom ajax call if (xhr != null) { //kill the request xhr.abort() } xhr = $.ajax( 'app/models/knowledgebase.php', { data: { 'search': qry, offset: 0, limit: 10, 'model': 'read_knowledgebase_video_autocomplete' } } ).done(function(res) { // console.log(res) results = JSON.parse(res) // console.log(results.rows); callback(results.rows) }); } } }); $('#txt_video_search').on('autocomplete.select', function(evt, item) { // $("#title_id").val(item.id); defaultVideos(); }); } function checkViberSubscription() { $.ajax({ url: "app/models/user.php", data: { model: 'read_viber_subscription' }, type: "POST", dataType: 'json', beforeSend: function() {}, success: function(result) { if (parseInt(result.status) === 0) { if (Cookies.get('viber_modal_shown')) { // alert('exist'); } else { // alert('not exist'); var inMinutes = new Date(new Date().getTime() + 5 /*minutes*/ * 60 * 1000); Cookies.set('viber_modal_shown', true, { expires: inMinutes }); $('#btn_viber_subscribe').on('click', function() { window.location.href = "viber://pa?chatURI=autohub-tasks&context=" + result.user_id; }); $("#viberModal").modal('show'); } } }, error: function() {} }); } ////START ROLE DEALER function refreshRoleBrandfileTable() { initRoleBrandfileList(); var $table = $('#table_position_file') $(function() { $table.bootstrapTable('refresh', { url: 'app/models/user.php' }); }) } function refreshRoleBrandfileTableSilent() { var $table = $('#table_position_file') $(function() { $table.bootstrapTable('refresh', { url: 'app/models/user.php' }); }) } function initRoleBrandfileList() { var $table = $('#table_position_file'); $table.bootstrapTable('destroy').bootstrapTable({ sidePagination: 'server', formatSearch: function() { return 'Search...' }, onLoadSuccess: function() {}, exportOptions: { fileName: function() { return 'titile' } } }); } function roleBrandfileQueryParams(params) { return { search: $('#position-search').val(), offset: params.offset, limit: params.limit, sort: params.sort, order: params.order, selected_positions: JSON.stringify(selected_positions), model: 'read_position_list', }; } function roleBrandFormatter(value, row, index) { var html = '<input class="" type="checkbox">'; if (parseInt(row.status) === 1) { html = '<input class="" type="checkbox" checked>'; } return html; } window.roleBrandEvent = { 'click input': function(e, value, row, index) { //get selected id if (row.status == '0') { selected_positions.push(row.id); } else { var index = selected_positions.indexOf(row.id); if (index !== -1) { selected_positions.splice(index, 1); } } refreshRoleBrandfileTableSilent(); } }; ////END ROLE DEALER function initPositionSearchEvt() { $('#position-search-div').removeClass('default-search-size'); $('#position-search-div').addClass('expand-search-size'); // $('#position-search').focusin(function() { // $('#position-search-div').removeClass('default-search-size'); // $('#position-search-div').addClass('expand-search-size'); // }); // $('#position-search').focusout(function() { // if (isEmpty($(this).val())) { // $('#position-search-div').removeClass('expand-search-size'); // $('#position-search-div').addClass('default-search-size'); // } // }); $('#position-search').on('keyup', delay(function(e) { refreshRoleBrandfileTableSilent(); }, 500)); } $(function() { // initLightBox(); defaultVideos(); // ticketTableCellClickEvt(); // hideTicketTypes(); btnNewVideoEvt(); // initDateRangePicker(); // resetDateRangePicker(); filterEvt(); initFilterCategory(); // initFilterStatus(); // initFilterPriority(); initVideoSearchEvt(); initSelect2Element(); modelVariantEvt(); addSelectChangeEvt(); saveVideoEvt(); initSelect2UnselectElement(); // ticketInformationEvt(); kbVideoAutoComplete(); checkViberSubscription(); $('#btn_get_updates').on('click', function() { $("#viberModal").modal('show'); $('#btn_viber_subscribe').on('click', function() { window.location.href = "viber://pa?chatURI=autohub-tasks&context=" + global_user_id; $("#viberModal").modal('hide'); }); }); $('#btn_filter_video').on('click', function() { // $('#video_filter_modal').modal('show'); var send_notification_div = ''; if (is_new_video) { send_notification_div = `<div class="text-right-lg text-left"> <input json-video-modal="true" type="checkbox" name="" id="chk_send_notification"> <label for="chk_send_notification" class="text-black font-weight-normal cursor-pointer m-0">Send Notification</label> </div> `; } Swal.fire({ title: '', icon: '', html: ` <div class="tab-content m-0 p-2" id="video-filter-modal-tab-content"> <div class="tab-pane fade show active" id="video-filter-modal-tab-information-sec" role="tabpanel" aria-labelledby="video-filter-modal-tab-information"> <div class="mb-0"> <nav class="navbar navbar-expand-md navbar-light justify-content-start pb-1 px-0" style=" background-color:transparent;"> <button class="navbar-toggler hide-sm" type="button" data-toggle="collapse" data-target="#navbarNav"> <span class="navbar-toggler-icon"></span> </button> <div class="navbar-collapse collapse show p-0" id="navbarNav"> <ul class="nav nav-tabs mt-0 navbar-nav mr-auto" style="border-bottom: 0px solid #dee2e6;"> <li class="nav-item mr-0 mb-1"> <div class="input-group search-transition default-search-size" id="position-search-div"> <div class="input-group-prepend"> <span class="input-group-text pr-2 pl-2 pt-0 pb-0"><i class="fas fa-search"></i></span> </div> <input type="search" id="position-search" class="form-control form-control-sm pr-0" placeholder="Search..."> </div> </li> </ul> <ul class="nav nav-tabs navbar-nav ml-auto-md " style="border-bottom: 0px solid #dee2e6;"> <li class="nav-item mr-2 mb-1"> ` + send_notification_div + ` </li> </ul> </div> </nav> </div> <table id="table_position_file" data-search="false" data-show-refresh="false" class="table table-bordered table-hover table-sm" data-show-export="false" data-page-size="10" data-page-list="[10, 25, 50, 100, all]" data-query-params="roleBrandfileQueryParams" data-pagination="true"> <thead> <tr> <th data-field="name"> Position </th> <th data-events="roleBrandEvent" data-formatter="roleBrandFormatter" class="text-center" data-width="30" data-field="status"> Status </th> </tr> </thead> </table> </div> </div> `, showCloseButton: false, showCancelButton: false, focusConfirm: false, confirmButtonText: 'Save', confirmButtonAriaLabel: 'Thumbs up, great!', cancelButtonText: '<i class="fa fa-thumbs-down"></i>', cancelButtonAriaLabel: 'Thumbs down', showClass: { backdrop: 'swal2-noanimation', // disable backdrop animation popup: '', // disable popup animation icon: '' // disable icon animation }, hideClass: { popup: '', // disable popup fade-out animation }, customClass: { container: 'container-class', popup: 'popup-class', header: 'header-class', title: 'title-class', closeButton: 'close-button-class', content: 'content-class p-0', input: 'input-class', actions: 'actions-class', footer: 'footer-class' }, didOpen: function() { refreshRoleBrandfileTable(); initPositionSearchEvt(); if (is_new_video) { $('#chk_send_notification').on('change', function() { if (this.checked) { send_notif_selected_positions = 1; } else { send_notif_selected_positions = 0; } }); if (send_notif_selected_positions) { $('#chk_send_notification').prop('checked', true); } else { $('#chk_send_notification').prop('checked', false); } } } }); }); $('#videos_view_more').on('click', function() { video_display_limit = video_display_limit + video_display_limit_const; refreshVideoList(); }); $("#position-filter").select2({ // tags:true, minimumResultsForSearch: -1, placeholder: "Select position", allowClear: true, escapeMarkup: function(markup) { return markup; }, ajax: { url: 'app/models/user.php', dataType: 'json', delay: 250, data: function(data) { return { model: 'read_positions', search: data.term // search term }; }, processResults: function(response) { return { results: response }; }, cache: true } }); }); </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings