From 75880e836677099009e59fbd897227394c995c7a Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Wed, 5 Feb 2025 09:48:05 +0700 Subject: [PATCH] pretty url stage 5 --- ui/ui/admin/admin/login.tpl | 4 +- ui/ui/admin/admin/view.tpl | 4 +- ui/ui/admin/balance/add.tpl | 4 +- ui/ui/admin/balance/edit.tpl | 4 +- ui/ui/admin/balance/list.tpl | 111 ++++++++++++---------- ui/ui/admin/bandwidth/add.tpl | 4 +- ui/ui/admin/bandwidth/edit.tpl | 4 +- ui/ui/admin/bandwidth/list.tpl | 11 ++- ui/ui/admin/coupons/add.tpl | 29 ++++-- ui/ui/admin/coupons/edit.tpl | 4 +- ui/ui/admin/coupons/list.tpl | 168 ++++++++++++++++----------------- 11 files changed, 182 insertions(+), 165 deletions(-) diff --git a/ui/ui/admin/admin/login.tpl b/ui/ui/admin/admin/login.tpl index 553a37f7..503a987e 100644 --- a/ui/ui/admin/admin/login.tpl +++ b/ui/ui/admin/admin/login.tpl @@ -45,7 +45,7 @@ {if isset($notify)} {$notify} {/if} -
+
@@ -56,7 +56,7 @@
- {Lang::T('Go Back')} + {Lang::T('Go Back')}
diff --git a/ui/ui/admin/admin/view.tpl b/ui/ui/admin/admin/view.tpl index 002255ed..c45562bc 100644 --- a/ui/ui/admin/admin/view.tpl +++ b/ui/ui/admin/admin/view.tpl @@ -39,9 +39,9 @@ diff --git a/ui/ui/admin/balance/add.tpl b/ui/ui/admin/balance/add.tpl index 87d63897..22c8f09f 100644 --- a/ui/ui/admin/balance/add.tpl +++ b/ui/ui/admin/balance/add.tpl @@ -5,7 +5,7 @@
{Lang::T('Add Service Package')}
-
+
@@ -47,7 +47,7 @@
- Or {Lang::T('Cancel')} + Or {Lang::T('Cancel')}
diff --git a/ui/ui/admin/balance/edit.tpl b/ui/ui/admin/balance/edit.tpl index 0704e625..cc4d3d39 100644 --- a/ui/ui/admin/balance/edit.tpl +++ b/ui/ui/admin/balance/edit.tpl @@ -5,7 +5,7 @@
{Lang::T('Edit Service Package')}
-
+
@@ -56,7 +56,7 @@
- Or {Lang::T('Cancel')} + Or {Lang::T('Cancel')}
diff --git a/ui/ui/admin/balance/list.tpl b/ui/ui/admin/balance/list.tpl index 6166148a..2e25c68a 100644 --- a/ui/ui/admin/balance/list.tpl +++ b/ui/ui/admin/balance/list.tpl @@ -1,58 +1,65 @@ {include file="sections/header.tpl"} -
-
-
-
{Lang::T('Balance Package')}
-
-
-
- -
-   -
-
- - - - - - - - - - {foreach $d as $ds} - - - - - - {/foreach} - -
{Lang::T('Package Name')}{Lang::T('Package Price')}{Lang::T('Manage')}
{$ds['name_plan']}{Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])} - {Lang::moneyFormat($ds['price_old'])} - {/if} - {Lang::T('Edit')} - -
-
- {include file="pagination.tpl"} - +
+
+
+
{Lang::T('Balance Package')}
+
+
+
+
+
+   +
+
+ + + + + + + + + + {foreach $d as $ds} + + + + + + {/foreach} + +
{Lang::T('Package Name')}{Lang::T('Package Price')}{Lang::T('Manage')}
{$ds['name_plan']}{Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])} + {Lang::moneyFormat($ds['price_old'])} + {/if} + + {Lang::T('Edit')} + +
+
+ {include file="pagination.tpl"} -{include file="sections/footer.tpl"} +
+
+
+
+ +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/admin/bandwidth/add.tpl b/ui/ui/admin/bandwidth/add.tpl index 882bcbef..d7df5547 100644 --- a/ui/ui/admin/bandwidth/add.tpl +++ b/ui/ui/admin/bandwidth/add.tpl @@ -5,7 +5,7 @@
{Lang::T('Add New Bandwidth')}
-
+
@@ -70,7 +70,7 @@
- Or {Lang::T('Cancel')} + Or {Lang::T('Cancel')}
diff --git a/ui/ui/admin/bandwidth/edit.tpl b/ui/ui/admin/bandwidth/edit.tpl index cffb86eb..be7bb80c 100644 --- a/ui/ui/admin/bandwidth/edit.tpl +++ b/ui/ui/admin/bandwidth/edit.tpl @@ -6,7 +6,7 @@
{Lang::T('Edit Bandwidth')}
-
+
@@ -87,7 +87,7 @@
- {Lang::T("Or")} {Lang::T('Cancel')} + {Lang::T("Or")} {Lang::T('Cancel')}
diff --git a/ui/ui/admin/bandwidth/list.tpl b/ui/ui/admin/bandwidth/list.tpl index 322ff693..d7e1b62d 100644 --- a/ui/ui/admin/bandwidth/list.tpl +++ b/ui/ui/admin/bandwidth/list.tpl @@ -7,7 +7,7 @@
- @@ -43,9 +44,9 @@ {$ds['burst']} - {Lang::T('Edit')} - @@ -66,4 +67,4 @@
-{include file="sections/footer.tpl"} +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/admin/coupons/add.tpl b/ui/ui/admin/coupons/add.tpl index 19c3d433..b7b71c6a 100644 --- a/ui/ui/admin/coupons/add.tpl +++ b/ui/ui/admin/coupons/add.tpl @@ -6,7 +6,7 @@
{Lang::T('Add Coupon')}
-
+ @@ -16,7 +16,8 @@
- +

{Lang::T('Unique code for the coupon')}

@@ -38,8 +39,11 @@
- -

{Lang::T('Value of the discount (amount or percentage)')}

+ +

{Lang::T('Value of the discount (amount or percentage)')} +

@@ -56,8 +60,11 @@
- -

{Lang::T('Maximum number of times this coupon can be used 0 is Unlimited')}

+ +

+ {Lang::T('Maximum number of times this coupon can be used 0 is Unlimited')} +

@@ -66,7 +73,8 @@
-

{Lang::T('Minimum cart total required to use this coupon')}

+

+ {Lang::T('Minimum cart total required to use this coupon')}

@@ -75,7 +83,8 @@
-

{Lang::T('Maximum discount amount applicable (for percent type)')}

+

+ {Lang::T('Maximum discount amount applicable (for percent type)')}

@@ -114,7 +123,7 @@ - Or {Lang::T('Cancel')} + Or {Lang::T('Cancel')}
@@ -150,4 +159,4 @@ -{include file="sections/footer.tpl"} +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/admin/coupons/edit.tpl b/ui/ui/admin/coupons/edit.tpl index 2a2293a9..c91f2784 100644 --- a/ui/ui/admin/coupons/edit.tpl +++ b/ui/ui/admin/coupons/edit.tpl @@ -8,7 +8,7 @@
{Lang::T('Edit Coupon')}
-
+ @@ -116,7 +116,7 @@ - Or {Lang::T('Cancel')} + Or {Lang::T('Cancel')}
diff --git a/ui/ui/admin/coupons/list.tpl b/ui/ui/admin/coupons/list.tpl index 11d5d20f..7001760c 100644 --- a/ui/ui/admin/coupons/list.tpl +++ b/ui/ui/admin/coupons/list.tpl @@ -120,7 +120,7 @@
@@ -153,66 +153,66 @@ {if $coupons} - {foreach $coupons as $coupon} - - - - {$coupon['code']} - - {$coupon['type']} - {$coupon['value']} - {$coupon['description']} - {$coupon['max_usage']} - {$coupon['usage_count']} - - {if $coupon['status'] == 'inactive'} - {Lang::T('Inactive')} - {elseif $coupon['status'] == 'active'} - {Lang::T('Active')} - {else} - {Lang::T('Unknown')} - {/if} - - {$coupon['min_order_amount']} - {$coupon['max_discount_amount']} - {$coupon['start_date']} - {$coupon['end_date']} - {$coupon['created_at']} - {$coupon['updated_at']} - - -
- {Lang::T('Edit')} - {if $coupon['status'] neq 'inactive'} - - {Lang::T('Block')} - - {else} - - {Lang::T('Unblock')} - - {/if} -
- - - {/foreach} + +
+ {Lang::T('Edit')} + {if $coupon['status'] neq 'inactive'} + + {Lang::T('Block')} + + {else} + + {Lang::T('Unblock')} + + {/if} +
+ + + {/foreach} {else} - - - {Lang::T('No coupons found.')} - - + + + {Lang::T('No coupons found.')} + + {/if} @@ -222,7 +222,7 @@
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])} - {/if}
@@ -247,9 +247,9 @@ }).then((result) => { if (result.isConfirmed) { var xhr = new XMLHttpRequest(); - xhr.open('POST', '{$_url}coupons/delete', true); + xhr.open('POST', '{Text::url('coupons/delete')}', true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - xhr.onload = function () { + xhr.onload = function() { if (xhr.status === 200) { var response = JSON.parse(xhr.responseText); @@ -293,9 +293,9 @@ } // Example usage for selected coupons - document.getElementById('deleteSelectedCoupons').addEventListener('click', function () { + document.getElementById('deleteSelectedCoupons').addEventListener('click', function() { var selectedCoupons = []; - document.querySelectorAll('input[name="coupon_ids[]"]:checked').forEach(function (checkbox) { + document.querySelectorAll('input[name="coupon_ids[]"]:checked').forEach(function(checkbox) { selectedCoupons.push(checkbox.value); }); @@ -312,8 +312,8 @@ }); // Example usage for single coupon deletion - document.querySelectorAll('.delete-coupon').forEach(function (button) { - button.addEventListener('click', function () { + document.querySelectorAll('.delete-coupon').forEach(function(button) { + button.addEventListener('click', function() { var couponId = this.getAttribute('data-id'); deleteCoupons([couponId]); }); @@ -321,7 +321,7 @@ // Select or deselect all checkboxes - document.getElementById('select-all').addEventListener('change', function () { + document.getElementById('select-all').addEventListener('change', function() { var checkboxes = document.querySelectorAll('input[name="coupon_ids[]"]'); for (var checkbox of checkboxes) { checkbox.checked = this.checked; @@ -329,29 +329,29 @@ }); {literal} - + {/literal}