From ab7725b0fb2113ed32d7aedcc127587463e26ce7 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 21 May 2024 10:56:11 +0700 Subject: [PATCH] Rollback installation --- system/controllers/community.php | 14 +++++++- system/lan/english.json | 21 +++++++++++- ui/ui/community-rollback.tpl | 55 ++++++++++++++++++++++++++++++++ ui/ui/community.tpl | 3 +- update.php | 5 +++ 5 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 ui/ui/community-rollback.tpl diff --git a/system/controllers/community.php b/system/controllers/community.php index c52b000a..cb923b7a 100644 --- a/system/controllers/community.php +++ b/system/controllers/community.php @@ -11,4 +11,16 @@ $ui->assign('_system_menu', 'community'); $action = $routes['1']; $ui->assign('_admin', $admin); -$ui->display('community.tpl'); \ No newline at end of file +switch ($action) { + case 'rollback': + $ui->assign('_title', 'Rollback Update'); + $masters = json_decode(Http::getData("https://api.github.com/repos/hotspotbilling/phpnuxbill/commits",['User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0']), true); + $devs = json_decode(Http::getData("https://api.github.com/repos/hotspotbilling/phpnuxbill/commits?sha=Development",['User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0']), true); + + $ui->assign('masters', $masters); + $ui->assign('devs', $devs); + $ui->display('community-rollback.tpl'); + break; + default: + $ui->display('community.tpl'); +} \ No newline at end of file diff --git a/system/lan/english.json b/system/lan/english.json index e890b2fe..5197bd84 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -604,5 +604,24 @@ "Scheduled_maintenance_is_currently_in_progress__Please_check_back_soon_": "Scheduled maintenance is currently in progress. Please check back soon.", "We_apologize_for_any_inconvenience_": "We apologize for any inconvenience.", "The": "The", - "Team": "Team" + "Team": "Team", + "Extend_Package_Expiry": "Extend Package Expiry", + "No": "No", + "Yes": "Yes", + "If_user_buy_same_internet_plan__expiry_date_will_extend": "If user buy same internet plan, expiry date will extend", + "Tax_System": "Tax System", + "Enable_Tax_System": "Enable Tax System", + "Tax_will_be_calculated_in_Internet_Plan_Price": "Tax will be calculated in Internet Plan Price", + "Tax_Rate": "Tax Rate", + "0_5_": "0.5%", + "1_": "1%", + "1_5_": "1.5%", + "2_": "2%", + "5_": "5%", + "10_": "10%", + "Custom": "Custom", + "Tax_Rates_in_percentage": "Tax Rates in percentage", + "Custom_Tax_Rate": "Custom Tax Rate", + "Enter_Custom_Tax_Rate": "Enter Custom Tax Rate", + "Enter_the_custom_tax_rate__e_g___3_75_for_3_75__": "Enter the custom tax rate (e.g., 3.75 for 3.75%)" } \ No newline at end of file diff --git a/ui/ui/community-rollback.tpl b/ui/ui/community-rollback.tpl new file mode 100644 index 00000000..40159854 --- /dev/null +++ b/ui/ui/community-rollback.tpl @@ -0,0 +1,55 @@ +{include file="sections/header.tpl"} + +
+

+
+
+
+
+

Master

+
+ + + {foreach $masters as $data} + + + + + + {/foreach} + +
{nl2br($data['commit']['message'])}{Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))} + + update + +
+
+
+
+
+
+

Development

+
+ + + {foreach $devs as $data} + + + + + + {/foreach} + +
{nl2br($data['commit']['message'])}{Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))} + + update + +
+
+
+
+{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/community.tpl b/ui/ui/community.tpl index 7184c1a7..b8260a26 100644 --- a/ui/ui/community.tpl +++ b/ui/ui/community.tpl @@ -152,8 +152,9 @@
Install Latest Version Download Latest Version + class="btn btn-warning btn-sm btn-block text-black">Download Latest Version
+
Select Old Version