From 9dd85dc38ec04d3cb1266baddc2bf1bae2227624 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Mon, 5 Sep 2022 15:12:00 +0700 Subject: [PATCH] Change Header --- admin/index.php | 5 -- index.php | 5 -- system/autoload/Admin.php | 5 -- system/autoload/App.php | 5 -- system/autoload/Paginator.php | 5 -- system/autoload/Password.php | 4 - system/autoload/Paymentgateway.php | 115 ++++++++++++++++++++++++++ system/autoload/Router.php | 5 -- system/autoload/Timezone.php | 5 -- system/autoload/User.php | 5 -- system/autoload/Validator.php | 5 -- system/boot.php | 4 - system/controllers/accounts.php | 5 -- system/controllers/admin.php | 5 -- system/controllers/autoload.php | 5 -- system/controllers/bandwidth.php | 5 -- system/controllers/customers.php | 4 - system/controllers/dashboard.php | 5 -- system/controllers/default.php | 5 -- system/controllers/export.php | 5 -- system/controllers/home.php | 5 -- system/controllers/login.php | 4 - system/controllers/logout.php | 5 -- system/controllers/message.php | 5 -- system/controllers/page.php | 5 -- system/controllers/pages.php | 5 -- system/controllers/paymentgateway.php | 22 +++++ system/controllers/pm.php | 5 -- system/controllers/pool.php | 5 -- system/controllers/reports.php | 5 -- system/controllers/routers.php | 5 -- system/controllers/services.php | 4 - system/controllers/settings.php | 4 - system/cron.php | 8 +- system/install/step4.php | 5 -- ui/theme/default/app-settings.tpl | 11 +++ ui/theme/default/sections/header.tpl | 12 +++ ui/theme/default/user-order.tpl | 12 +++ 38 files changed, 173 insertions(+), 161 deletions(-) create mode 100644 system/autoload/Paymentgateway.php create mode 100644 system/controllers/paymentgateway.php create mode 100644 ui/theme/default/user-order.tpl diff --git a/admin/index.php b/admin/index.php index 3a7691db..f917bc87 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,11 +1,6 @@ $trxID, + 'amount' => $amount, + 'description' => $description, + 'customer' => [ + 'mobile_number' => $phone, + ], + 'customer_notification_preference'=>[ + 'invoice_created' => ['whatsapp','sms'], + 'invoice_reminder' => ['whatsapp','sms'], + 'invoice_paid' => ['whatsapp','sms'], + 'invoice_expired' => ['whatsapp','sms'] + ], + 'success_redirect_url' => APP_URL, + 'failure_redirect_url' => APP_URL + ]; + return json_decode(postJsonData($xendit_server, $json, [ + 'Authorization: Basic '.$_c['xendit_secret'] + ]),true); + /* + { + "id": "631597513897510bace2459d", #gateway_trx_id + "external_id": "test-va-success-1662359375", + "user_id": "599bd7f1ccab55b020bb1147", + "status": "PENDING", + "merchant_name": "Xendit", + "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1538466380522_868.png", + "amount": 3000000, + "description": "Test - VA Successful invoice payment", + "expiry_date": "2022-09-06T06:29:37.251Z", + "invoice_url": "https://checkout-staging.xendit.co/web/631597513897510bace2459d" + "created": "2022-09-05T06:29:37.954Z", + "updated": "2022-09-05T06:29:37.954Z" + } + */ +} + +function get_invoice_xendit($xendittrxID){ + global $xendit_server,$_c; + return json_decode(getData($xendit_server.'invoices/'.$xendittrxID, [ + 'Authorization: Basic '.$_c['xendit_secret'] + ]),true); + /* + { + "id": "631597513897510bace2459d", #gateway_trx_id + "external_id": "test-va-success-1662359375", + "user_id": "599bd7f1ccab55b020bb1147", + "status": "PENDING", // CHECK THIS + "merchant_name": "Xendit", + "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1538466380522_868.png", + "amount": 3000000, + "description": "Test - VA Successful invoice payment", + "expiry_date": "2022-09-06T06:29:37.251Z", + "invoice_url": "https://checkout-staging.xendit.co/web/631597513897510bace2459d" + "created": "2022-09-05T06:29:37.954Z", + "updated": "2022-09-05T06:29:37.954Z" + } + */ +} + +function getData($url, $headers) +{ + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, 0); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); + curl_setopt($ch, CURLOPT_TIMEOUT, 15); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $server_output = curl_exec($ch); + curl_close($ch); + return $server_output; +} + + +function postJsonData($url, $array_post, $headers = [], $basic = null) +{ + $headers[] = 'Content-Type: application/json'; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); + curl_setopt($ch, CURLOPT_TIMEOUT, 15); + curl_setopt($ch, CURLOPT_VERBOSE, false); + curl_setopt($ch, CURLINFO_HEADER_OUT, false); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($array_post)); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + if (!empty($basic)) { + curl_setopt($ch, CURLOPT_USERPWD, $basic); + } + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $server_output = curl_exec($ch); + curl_close($ch); + return $server_output; +} diff --git a/system/autoload/Router.php b/system/autoload/Router.php index 4e623b5c..cc4f366f 100644 --- a/system/autoload/Router.php +++ b/system/autoload/Router.php @@ -1,11 +1,6 @@ assign('_title', $_L['My_Account'].'- '. $config['CompanyName']); diff --git a/system/controllers/admin.php b/system/controllers/admin.php index eab37856..73bbfdbf 100644 --- a/system/controllers/admin.php +++ b/system/controllers/admin.php @@ -1,11 +1,6 @@ assign('_title', $_L['Network'].' - '. $config['CompanyName']); diff --git a/system/controllers/bandwidth.php b/system/controllers/bandwidth.php index d0eb1896..d685798e 100644 --- a/system/controllers/bandwidth.php +++ b/system/controllers/bandwidth.php @@ -1,11 +1,6 @@ assign('_title', $_L['Bandwidth_Plans'].' - '. $config['CompanyName']); diff --git a/system/controllers/customers.php b/system/controllers/customers.php index f8d317d7..68710383 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -3,10 +3,6 @@ /** * PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/) - - * @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing - * @license GNU General Public License version 2 or later; see LICENSE.txt - **/ _admin(); $ui->assign('_title', $_L['Customers'] . ' - ' . $config['CompanyName']); diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index 08953148..d385b74d 100644 --- a/system/controllers/dashboard.php +++ b/system/controllers/dashboard.php @@ -1,11 +1,6 @@ assign('_title', $_L['Dashboard'].' - '. $config['CompanyName']); diff --git a/system/controllers/default.php b/system/controllers/default.php index 234efe49..d4e13c7b 100644 --- a/system/controllers/default.php +++ b/system/controllers/default.php @@ -1,11 +1,6 @@ assign('_title', $_L['Reports'].'- '. $config['CompanyName']); diff --git a/system/controllers/home.php b/system/controllers/home.php index d99ad60e..b0489782 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -1,11 +1,6 @@ assign('_title', $_L['Dashboard'].' - '. $config['CompanyName']); diff --git a/system/controllers/login.php b/system/controllers/login.php index d7b2181f..7c18dfe2 100644 --- a/system/controllers/login.php +++ b/system/controllers/login.php @@ -3,10 +3,6 @@ /** * PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/) - - * @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing - * @license GNU General Public License version 2 or later; see LICENSE.txt - **/ if (isset($routes['1'])) { diff --git a/system/controllers/logout.php b/system/controllers/logout.php index 614c7486..7a11b595 100644 --- a/system/controllers/logout.php +++ b/system/controllers/logout.php @@ -1,11 +1,6 @@ assign('_title', $_L['Private_Message'].'- '. $config['CompanyName']); diff --git a/system/controllers/page.php b/system/controllers/page.php index c1aa7651..dcb9cfbe 100644 --- a/system/controllers/page.php +++ b/system/controllers/page.php @@ -1,11 +1,6 @@ assign('_title', $_L['Order_Voucher'].'- '. $config['CompanyName']); diff --git a/system/controllers/pages.php b/system/controllers/pages.php index eaaaf67d..7529ac24 100644 --- a/system/controllers/pages.php +++ b/system/controllers/pages.php @@ -1,11 +1,6 @@ assign('_title', 'Pages - '. $config['CompanyName']); diff --git a/system/controllers/paymentgateway.php b/system/controllers/paymentgateway.php new file mode 100644 index 00000000..f68761f5 --- /dev/null +++ b/system/controllers/paymentgateway.php @@ -0,0 +1,22 @@ +assign('_system_menu', 'paymentgateway'); + +$action = $routes['1']; +$admin = Admin::_info(); +$ui->assign('_admin', $admin); + +switch ($action) { + case 'xendit': + $ui->assign('_title', 'Xendit - Payment Gateway - '. $config['CompanyName']); + $ui->display('a404.tpl'); + break; + case 'midtrans': + $ui->assign('_title', 'Midtrans - Payment Gateway - '. $config['CompanyName']); + + $ui->display('a404.tpl'); + break; +} diff --git a/system/controllers/pm.php b/system/controllers/pm.php index d98444a2..b731bfa8 100644 --- a/system/controllers/pm.php +++ b/system/controllers/pm.php @@ -1,11 +1,6 @@ assign('_title', $_L['Private_Message'].'- '. $config['CompanyName']); diff --git a/system/controllers/pool.php b/system/controllers/pool.php index f80d5b46..2c180ebe 100644 --- a/system/controllers/pool.php +++ b/system/controllers/pool.php @@ -1,11 +1,6 @@ assign('_title', $_L['Network'].' - '. $config['CompanyName']); diff --git a/system/controllers/reports.php b/system/controllers/reports.php index 527df4bb..30b20e26 100644 --- a/system/controllers/reports.php +++ b/system/controllers/reports.php @@ -1,11 +1,6 @@ assign('_title', $_L['Reports'].' - '. $config['CompanyName']); diff --git a/system/controllers/routers.php b/system/controllers/routers.php index bdc82e15..190c91ae 100644 --- a/system/controllers/routers.php +++ b/system/controllers/routers.php @@ -1,11 +1,6 @@ assign('_title', $_L['Network'].' - '. $config['CompanyName']); diff --git a/system/controllers/services.php b/system/controllers/services.php index 01e4c8d1..4e06c0ba 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -3,10 +3,6 @@ /** * PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/) - - * @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing - * @license GNU General Public License version 2 or later; see LICENSE.txt - **/ _admin(); $ui->assign('_title', $_L['Hotspot_Plans'] . ' - ' . $config['CompanyName']); diff --git a/system/controllers/settings.php b/system/controllers/settings.php index 959f7212..358e3120 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -3,10 +3,6 @@ /** * PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/) - - * @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing - * @license GNU General Public License version 2 or later; see LICENSE.txt - **/ _admin(); $ui->assign('_title', $_L['Settings'] . '- ' . $config['CompanyName']); diff --git a/system/cron.php b/system/cron.php index 411dfa4d..c9da1cc9 100644 --- a/system/cron.php +++ b/system/cron.php @@ -1,11 +1,6 @@ status = 'off'; $u->save(); - }else - echo " : ACTIVE \r\n"; + }else echo " : ACTIVE \r\n"; } } diff --git a/system/install/step4.php b/system/install/step4.php index cdfd1be2..0006748b 100644 --- a/system/install/step4.php +++ b/system/install/step4.php @@ -1,11 +1,6 @@ + +
Telegram Notification
diff --git a/ui/theme/default/sections/header.tpl b/ui/theme/default/sections/header.tpl index 646bdc15..9a6705e4 100644 --- a/ui/theme/default/sections/header.tpl +++ b/ui/theme/default/sections/header.tpl @@ -262,6 +262,18 @@
  •  
  • +
  • + + + Payment Gateway + + + +
  • diff --git a/ui/theme/default/user-order.tpl b/ui/theme/default/user-order.tpl new file mode 100644 index 00000000..dcce65e9 --- /dev/null +++ b/ui/theme/default/user-order.tpl @@ -0,0 +1,12 @@ +{include file="sections/user-header.tpl"} +
    +
    +
    +
    {$_L[$pageHeader]}
    +
    + {include file="$_path/../pages/$PageFile.html"} +
    +
    +
    +
    +{include file="sections/user-footer.tpl"}