diff --git a/docs/index.html b/docs/index.html index 9009d140..5c01af71 100644 --- a/docs/index.html +++ b/docs/index.html @@ -326,7 +326,7 @@ Error message and password prompt {"created":"20240712071211426","creator":"ibnux","title":"$:/state/tabs/controlpanel/toolbars-1345989671","text":"$:/core/ui/ControlPanel/Toolbars/ViewToolbar","modified":"20250211062334510","modifier":"ibnux"}, {"title":"$:/status/RequireReloadDueToPluginChange","text":"no"}, {"created":"20240712071004482","creator":"i","title":"$:/status/UserName","text":"ibnux","modified":"20240712071005201","modifier":"ibnu"}, -{"title":"$:/StoryList","created":"20250311074232407","creator":"ibnux","text":"","list":"GettingStarted [[API Rest Documentation]]","modified":"20250311074232407","modifier":"ibnux"}, +{"title":"$:/StoryList","created":"20250317074031413","creator":"ibnux","text":"","list":"GettingStarted [[Reminder with payment link]]","modified":"20250317074031413","modifier":"ibnux"}, {"created":"20240712071159691","creator":"ibnux","title":"$:/theme","text":"$:/themes/tiddlywiki/snowwhite","modified":"20250218074405827","modifier":"ibnux"}, {"title":"$:/themes/tiddlywiki/readonly","name":"ReadOnly","author":"JeremyRuston","core-version":">=5.0.0","plugin-type":"theme","description":"Hides the ability to edit tiddlers","dependents":"$:/themes/tiddlywiki/snowwhite","version":"5.3.5","type":"application/json","text":"{\"tiddlers\":{\"$:/themes/tiddlywiki/readonly/styles.tid\":{\"title\":\"$:/themes/tiddlywiki/readonly/styles.tid\",\"tags\":\"[[$:/tags/Stylesheet]]\",\"text\":\"\\\\define button-selector(title)\\nbutton.$title$, .tc-drop-down button.$title$, div.$title$\\n\\\\end\\n\\n\\\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\\n\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fclone>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fdelete>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fedit>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-here>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-journal-here>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fimport>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fmanager>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-image>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-journal>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-tiddler>> {\\n\\tdisplay: none;\\n}\"}}}"}, {"title":"$:/themes/tiddlywiki/snowwhite","name":"Snow White","author":"JeremyRuston","core-version":">=5.0.0","plugin-type":"theme","description":"Emphasises individual tiddlers","dependents":"$:/themes/tiddlywiki/vanilla","plugin-priority":"0","version":"5.3.5","type":"application/json","text":"{\"tiddlers\":{\"$:/themes/tiddlywiki/snowwhite/base\":{\"title\":\"$:/themes/tiddlywiki/snowwhite/base\",\"tags\":\"[[$:/tags/Stylesheet]]\",\"text\":\"\\\\define sidebarbreakpoint-minus-one()\\n\u003C$text text={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] }}}/>\\n\\\\end\\n\\n\\\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\\n\\n.tc-sidebar-header {\\n\\ttext-shadow: 0 1px 0 \u003C\u003Ccolour sidebar-foreground-shadow>>;\\n}\\n\\n.tc-tiddler-info {\\n\\t\u003C\u003Cbox-shadow \\\"inset 1px 2px 3px rgba(0,0,0,0.1)\\\">>\\n}\\n\\n@media screen {\\n\\t.tc-tiddler-frame {\\n\\t\\t\u003C\u003Cbox-shadow \\\"1px 1px 5px rgba(0, 0, 0, 0.3)\\\">>\\n\\t}\\n}\\n\\n@media (max-width: \u003C\u003Csidebarbreakpoint-minus-one>>) {\\n\\t.tc-tiddler-frame {\\n\\t\\t\u003C\u003Cbox-shadow none>>\\n\\t}\\n}\\n\\n.tc-page-controls button svg, .tc-tiddler-controls button svg, .tc-topbar button svg {\\n\\t\u003C\u003Ctransition \\\"fill 150ms ease-in-out\\\">>\\n}\\n\\n.tc-tiddler-controls button.tc-selected,\\n.tc-page-controls button.tc-selected {\\n\\t\u003C\u003Cfilter \\\"drop-shadow(0px -1px 2px rgba(0,0,0,0.25))\\\">>\\n}\\n\\n.tc-tiddler-frame input.tc-edit-texteditor,\\n.tc-tiddler-frame select.tc-edit-texteditor {\\n\\t\u003C\u003Cbox-shadow \\\"inset 0 1px 8px rgba(0, 0, 0, 0.15)\\\">>\\n}\\n\\n.tc-edit-tags {\\n\\t\u003C\u003Cbox-shadow \\\"inset 0 1px 8px rgba(0, 0, 0, 0.15)\\\">>\\n}\\n\\n.tc-tiddler-frame .tc-edit-tags input.tc-edit-texteditor {\\n\\t\u003C\u003Cbox-shadow \\\"none\\\">>\\n\\tborder: none;\\n\\toutline: none;\\n}\\n\\ntextarea.tc-edit-texteditor {\\n\\tfont-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};\\n}\\n\\ncanvas.tc-edit-bitmapeditor {\\n\\t\u003C\u003Cbox-shadow \\\"2px 2px 5px rgba(0, 0, 0, 0.5)\\\">>\\n}\\n\\n.tc-drop-down {\\n\\tborder-radius: 4px;\\n\\t\u003C\u003Cbox-shadow \\\"2px 2px 10px rgba(0, 0, 0, 0.5)\\\">>\\n}\\n\\n.tc-block-dropdown {\\n\\tborder-radius: 4px;\\n\\t\u003C\u003Cbox-shadow \\\"2px 2px 10px rgba(0, 0, 0, 0.5)\\\">>\\n}\\n\\n.tc-modal {\\n\\tborder-radius: 6px;\\n\\t\u003C\u003Cbox-shadow \\\"0 3px 7px rgba(0,0,0,0.3)\\\">>\\n}\\n\\n.tc-modal-footer {\\n\\tborder-radius: 0 0 6px 6px;\\n\\t\u003C\u003Cbox-shadow \\\"inset 0 1px 0 #fff\\\">>;\\n}\\n\\n\\n.tc-alert {\\n\\tborder-radius: 6px;\\n\\t\u003C\u003Cbox-shadow \\\"0 3px 7px rgba(0,0,0,0.6)\\\">>\\n}\\n\\n.tc-notification {\\n\\tborder-radius: 6px;\\n\\t\u003C\u003Cbox-shadow \\\"0 3px 7px rgba(0,0,0,0.3)\\\">>\\n\\ttext-shadow: 0 1px 0 rgba(255,255,255, 0.8);\\n}\\n\\n.tc-sidebar-lists .tc-tab-set .tc-tab-divider {\\n\\tborder-top: none;\\n\\theight: 1px;\\n\\t\u003C\u003Cbackground-linear-gradient \\\"left, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.0) 100%\\\">>\\n}\\n\\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button {\\n\\t\u003C\u003Cbackground-linear-gradient \\\"left, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0.1) 100%\\\">>\\n}\\n\\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button.tc-tab-selected {\\n\\t\u003C\u003Cbackground-linear-gradient \\\"left, rgba(0,0,0,0.05) 0%, rgba(255,255,255,0.05) 100%\\\">>\\n}\\n\\n.tc-message-box img {\\n\\t\u003C\u003Cbox-shadow \\\"1px 1px 3px rgba(0,0,0,0.5)\\\">>\\n}\\n\\n.tc-plugin-info {\\n\\t\u003C\u003Cbox-shadow \\\"1px 1px 3px rgba(0,0,0,0.5)\\\">>\\n}\\n\"}}}"}, @@ -350,7 +350,7 @@ Error message and password prompt {"created":"20240713062428411","creator":"ibnux","text":"Customer just self services, Customer register to get an account, Order the plan and automatically activate for the account.\n\nThen customer just login to Internet with account they register it.\n\nThis need Payment Gateway, PHPNuxBill can support multiple Payment Gateway.\n\nGo to [ext[Plugin Manager|../?_route=pluginmanager]], and install Payment Gateway you need\n\nThen go to [ext[Payment Gateway Settings|../?_route=paymentgateway]], You can activate Multiple Payment Gateway, configure it based the payment Gateway settings, and add it to walled Garden.\n\nDone, you now can selling Internet services.\n\nbut maybe you need to configure [[Mikrotik Login Template]], ","title":"Payment Gateway","modified":"20240714053605590","modifier":"ibnux"}, {"created":"20240713062019848","creator":"ibnux","text":"!Step to create PPPOE Plan\n\nPPPOE System based on the Mikrotik Feature inside `PPP`\n\n\n!! For Radius System with Mysql\n \n# [[Add NAS]]\n# [ext[Create Pool|../?_route=pool/list]]\n# [[Create Bandwidth Plan]]\n# [[Create PPPOE Plan]]\n\n!! Integrated Radius System\n\n# [ext[Create Pool|../?_route=pool/list]]\n# [[Create Bandwidth Plan]]\n# [[Create PPPOE Plan]]\n\n!! Without Radius\n\n# [[Add Mikrotik]]\n# [ext[Create Pool|../?_route=pool/list]]\n# [[Create Bandwidth Plan]]\n# [[Create PPPOE Plan]]\n\nAfter That, how do you want to sell Internet Plan?\n\n* Customer self services buy internet using Payment Gateway\n* Customer Buy Voucher and activate it at PHPNuxBill\n\nWhich one do you want?\n\n\u003Cbutton>[[Payment Gateway]]\u003C/button> \u003Cbutton>[[Voucher]]\u003C/button>\n","title":"PPPOE System","modified":"20240715043559596","modifier":"ibnux"}, {"created":"20240712074107108","creator":"ibnux","text":"Radius System is complicated, PHPNuxBill will connect to Radius Database, and Freeradius will check from that database\n\n\n```\n ┌──────────────┐\n │ PHPNUXBILL │\n └──────────────┘\n ▲ \n │ \n ▼ \n ┌──────────────┐\n │ Database │\n │ Mysql/MariaDB│\n └──────────────┘\n ▲ \n │ \n ▼ \n ┌──────────────┐\n │ Freeradius │\n └──────────────┘\n ▲ \n │ \n ▼ \n ┌──────────┐ \n │ Mikrotik │ \n └──────────┘ \n```\n\nDid you check Radius System when install PHPNuxBill?\n\nIf no, then you must import Radius Database, download [[SQL File|https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/install/radius.sql]], import it by command line or using PHPMyAdmin.\n\nIf yes, or done import the SQL, Go to [ext[Settings|../index.php?_route=settings/app]] and Enable Radius.\n\nHave you install Freeradius? if no, then follow [[this Guide|https://github.com/hotspotbilling/phpnuxbill/wiki/FreeRadius]] to install Freeradius with Mysql, The Tutorial is not good enough, you need to fix it yourself.\n\nYou want to sell Hotspot or PPPOE?\n\n\u003Cbutton>[[Hotspot System]]\u003C/button>\n\u003Cbutton>[[PPPOE System]]\u003C/button>\n","title":"Radius System with Mysql","modified":"20240713053714715","modifier":"ibnux","tags":"radius"}, -{"created":"20241105015644306","creator":"ibnux","text":"When sending Reminder or Expired notification, you can add payment link so customer can directly click link to pay\n\n\nAdd `[[payment_link]]` and use your domain url before that\n\nEXAMPLE\n\n```\nhttps://nuxbill.ibnux.com/[[payment_link]]\n```\n\n```\nhttps://nuxbill.ibnux.com/folder/[[payment_link]]\n```\n```\nhttps://192.168.88.2/[[payment_link]]\n```\n```\nhttps://192.168.88.2/folder/[[payment_link]]\n```\n\nWhen customer get notification, can click the link to pay directly, link will be expired after 24 hours after the link created. and customer need to login again.","title":"Reminder with payment link","modified":"20241105021934130","modifier":"ibnux"}, +{"created":"20241105015644306","creator":"ibnux","text":"When sending Reminder or Expired notification, you can add payment link so customer can directly click link to pay\n\n\nAdd `[[payment_link]]` and use your domain url before that\n\nEXAMPLE\n\n```\nhttps://nuxbill.ibnux.com/[[payment_link]]\n```\n\n```\nhttps://nuxbill.ibnux.com/folder/[[payment_link]]\n```\n```\nhttps://192.168.88.2/[[payment_link]]\n```\n```\nhttps://192.168.88.2/folder/[[payment_link]]\n```\n\nWhen customer get notification, can click the link to pay directly, link will be expired after 24 hours after the link created. and customer need to login again.\n\n!! INVOICE LINK\n\nAdd `[[invoice_link]]` and use your domain url before that\n\nEXAMPLE\n\n```\nhttps://nuxbill.ibnux.com/[[invoice_link]]\n```\n\n```\nhttps://nuxbill.ibnux.com/folder/[[invoice_link]]\n```\n```\nhttps://192.168.88.2/[[invoice_link]]\n```\n```\nhttps://192.168.88.2/folder/[[invoice_link]]\n```\n\n\n\n\u003C\u003C\u003C\nMostly script run from command line, script cannot detect domain used from billing\n\u003C\u003C\u003C\n","title":"Reminder with payment link","modified":"20250317074300132","modifier":"ibnux"}, {"created":"20250311045849165","creator":"ibnux","text":"\n\u003C\u003C\u003C\nsettings >> User Notification \n\u003C\u003C\u003C\n\nFor Reminder and Expired Message, you can send different message for PPPOE and HOTSPOt, use `\u003Cdivider>` to create different message, above `\u003Cdivider>` for Hotspot, and below `\u003Cdivider>` for PPPOE\n\nExample:\n\n```\nHello [[name]], \nyour Hotspot package *[[package]]* will be expired in 7 days.\n[[package]] [[price]] \n[[bills]]\n\u003Cdivider>\nHello [[name]], \nyour PPPOE package *[[package]]* will be expired in 7 days.\n[[package]] [[price]] \n[[bills]]\n```","title":"User Notification Text","modified":"20250311052731156","modifier":"ibnux"} ]
diff --git a/system/autoload/Message.php b/system/autoload/Message.php index e8109311..725d8f39 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -308,7 +308,7 @@ class Message public static function sendInvoice($cust, $trx) { - global $config; + global $config, $db_pass; $textInvoice = Lang::getNotifText('invoice_paid'); $textInvoice = str_replace('[[company_name]]', $config['CompanyName'], $textInvoice); $textInvoice = str_replace('[[address]]', $config['address'], $textInvoice); @@ -333,6 +333,10 @@ class Message $textInvoice = str_replace('[[password]]', $cust['password'], $textInvoice); $textInvoice = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($trx['expiration'], $trx['time']), $textInvoice); $textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice); + + $inv_url = "?_route=voucher/invoice/$trx[id]/" . md5($trx['id'] . $db_pass); + $textInvoice = str_replace('[[invoice_link]]', $inv_url, $textInvoice); + // Calculate bills and additional costs list($bills, $add_cost) = User::getBills($cust['id']); diff --git a/system/controllers/plan.php b/system/controllers/plan.php index e77155af..15c0d7e3 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -279,6 +279,8 @@ switch ($action) { $ui->assign('wlogo', $width); $ui->assign('hlogo', $height); } + + $ui->assign('public_url', getUrl("voucher/invoice/$id/".md5($id. $db_pass))); $ui->assign('logo', $logo); $ui->assign('_title', 'View Invoice'); $ui->display('admin/plan/invoice.tpl'); diff --git a/system/controllers/voucher.php b/system/controllers/voucher.php index 6e935056..5be88fbd 100644 --- a/system/controllers/voucher.php +++ b/system/controllers/voucher.php @@ -4,11 +4,47 @@ * PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/) * by https://t.me/ibnux **/ -_auth(); + $ui->assign('_title', Lang::T('Voucher')); $ui->assign('_system_menu', 'voucher'); $action = $routes['1']; +if(!_auth(false)){ + if($action== 'invoice'){ + $id = $routes[2]; + $sign = $routes[3]; + if($sign != md5($id. $db_pass)) { + die("beda"); + } + if (empty($id)) { + $in = ORM::for_table('tbl_transactions')->order_by_desc('id')->find_one(); + } else { + $in = ORM::for_table('tbl_transactions')->where('id', $id)->find_one(); + } + if ($in) { + Package::createInvoice($in); + $UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH); + $logo = ''; + if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) { + $logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.png'; + $imgsize = getimagesize($logo); + $width = $imgsize[0]; + $height = $imgsize[1]; + $ui->assign('wlogo', $width); + $ui->assign('hlogo', $height); + } + $ui->assign('public_url', getUrl("voucher/invoice/$id/".md5($id. $db_pass))); + $ui->assign('logo', $logo); + $ui->display('customer/invoice-customer.tpl'); + die(); + } else { + r2(getUrl('voucher/list-activated'), 'e', Lang::T('Not Found')); + } + }else{ + r2(getUrl('login')); + } +} + $user = User::_info(); $ui->assign('_user', $user); @@ -74,6 +110,7 @@ switch ($action) { $ui->assign('wlogo', $width); $ui->assign('hlogo', $height); } + $ui->assign('public_url', getUrl("voucher/invoice/$id/".md5($id. $db_pass))); $ui->assign('logo', $logo); $ui->display('customer/invoice-customer.tpl'); } else { diff --git a/system/lan/english.json b/system/lan/english.json index 7dbb534a..875f60b4 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -1148,5 +1148,6 @@ "Continue_the_process_of_sending_messages": "Continue the process of sending messages", "Yours_Balances": "Yours Balances", "Friend_username": "Friend username", - "This_will_sync_dan_send_Customer_active_package_to_Mikrotik": "This will sync dan send Customer active package to Mikrotik" + "This_will_sync_dan_send_Customer_active_package_to_Mikrotik": "This will sync dan send Customer active package to Mikrotik", + "Payment_History": "Payment History" } \ No newline at end of file diff --git a/ui/ui/admin/plan/invoice.tpl b/ui/ui/admin/plan/invoice.tpl index 47afd2f6..b939c402 100644 --- a/ui/ui/admin/plan/invoice.tpl +++ b/ui/ui/admin/plan/invoice.tpl @@ -38,7 +38,8 @@ class="btn btn-success text-black btn-sm hidden-xs hidden-sm" target="_blank"> NuxPrint - +