diff --git a/.gitignore b/.gitignore
index 2b53984b..e9361f19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,4 +53,8 @@ docker-compose.yml
docs/**
!docs/*.html
!docs/*.md
-.htaccess
\ No newline at end of file
+.htaccess
+.idea
+!docs/insomnia.rest.json
+!system/uploads/paid.png
+system/uploads/invoices/**
diff --git a/docs/index.html b/docs/index.html
index ee5efda2..5c01af71 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -185,6 +185,12 @@ Error message and password prompt
diff --git a/docs/insomnia.rest.json b/docs/insomnia.rest.json
new file mode 100644
index 00000000..4f206aa1
--- /dev/null
+++ b/docs/insomnia.rest.json
@@ -0,0 +1 @@
+{"_type":"export","__export_format":4,"__export_date":"2025-03-11T07:38:04.536Z","__export_source":"insomnia.desktop.app:v2022.7.5","resources":[{"_id":"req_b1a123a4680e47858199ae1bef19e8d5","parentId":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","modified":1741676224920,"created":1741675671281,"url":"{{ _.api_url }}","name":"template api","description":"","method":"GET","body":{},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""}],"headers":[],"authentication":{},"metaSortKey":-1741675671281,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","parentId":null,"modified":1722392348283,"created":1722392348283,"name":"PHPNuxBill","description":"","scope":"collection","_type":"workspace"},{"_id":"req_60bdc4349a2d47129e87c1ab3d14711a","parentId":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","modified":1741676216255,"created":1741675209738,"url":"{{ _.api_url }}","name":"login","description":"","method":"POST","body":{"mimeType":"application/x-www-form-urlencoded","params":[{"id":"pair_637d448b0b374f2684c1a88f54669de4","name":"username","value":"admin","description":""},{"id":"pair_14449ba043264407bdad04d166dabab9","name":"password","value":"admin","description":""}]},"parameters":[{"id":"pair_b62a65cf20884c4b9694d82195a9d592","name":"r","value":"admin/post","description":""}],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"}],"authentication":{},"metaSortKey":-1741675439941,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_adca9e44d68943c1b2b327df3cfe74ee","parentId":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","modified":1741676218232,"created":1741675745490,"url":"{{ _.api_url }}","name":"dashboard","description":"","method":"GET","body":{},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"dashboard","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""}],"headers":[],"authentication":{},"metaSortKey":-1741675324271,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_af22c9443acc41b4a1a11d28f07d7b75","parentId":"fld_682b0477cf584c51b46c76f88626a95b","modified":1741677918253,"created":1741676023272,"url":"{{ _.api_url }}","name":"list","description":"","method":"GET","body":{},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"customers","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""},{"name":"search","value":"","id":"pair_3914f88950304b4d9f369add2f240a0d"},{"name":"order","value":"username","id":"pair_9d4a935df1d844a9b2e66625bd3b640a","description":"username fullname lastname created_at"},{"name":"filter","value":"Active","id":"pair_049ed0a57faf4efeb8230be8aa51185b","description":"check result statuses"},{"name":"orderby","value":"asc","id":"pair_b28d0c0d38754a0eb5d12bf8d4959d25","description":"asc dsc"},{"name":"p","value":"1","id":"pair_3dc7656a37144898bb4eb5622e53d95d","description":"start from 1"}],"headers":[],"authentication":{},"metaSortKey":-1740458260971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_682b0477cf584c51b46c76f88626a95b","parentId":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","modified":1741676212719,"created":1741675208601,"name":"customers","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1741675208601,"_type":"request_group"},{"_id":"req_0b90d08bb5744b5faf28b7467c885de3","parentId":"fld_682b0477cf584c51b46c76f88626a95b","modified":1741676309494,"created":1741676231087,"url":"{{ _.api_url }}","name":"view activation","description":"","method":"GET","body":{},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"customers/view/1/activation","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""},{"name":"p","value":"1","id":"pair_3dc7656a37144898bb4eb5622e53d95d"}],"headers":[],"authentication":{},"metaSortKey":-1739849786612.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4e2da7e9b44b4fa5ac9f71b671858a50","parentId":"fld_682b0477cf584c51b46c76f88626a95b","modified":1741678442213,"created":1741676293748,"url":"{{ _.api_url }}","name":"view order","description":"","method":"GET","body":{},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"customers/view/{% prompt 'Customer ID', 'id', '1', 'customer_id', false, true %}/order","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""},{"name":"p","value":"1","id":"pair_3dc7656a37144898bb4eb5622e53d95d"}],"headers":[],"authentication":{},"metaSortKey":-1739545549433.25,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_bcea205bec4e4f2281adaa30c748127b","parentId":"fld_682b0477cf584c51b46c76f88626a95b","modified":1741678215286,"created":1741677744403,"url":"{{ _.api_url }}","name":"add","description":"","method":"POST","body":{"mimeType":"multipart/form-data","params":[{"id":"pair_82956539392844e18a4d566f4cfe8453","name":"username","value":"","description":""},{"id":"pair_9d5391c3b595498ca45c6e1f0ce4bf22","name":"fullname","value":"","description":""},{"id":"pair_079109342c0c4312b0f1b7f59f123767","name":"email","value":"","description":""},{"id":"pair_e32aaef0b26344aba71c240deeca21f3","name":"phonenumber","value":"","description":""},{"id":"pair_993483915a1842278b459efe0d9b7d87","name":"password","value":"","description":""},{"id":"pair_8ad5e531c4e24e96b520786c8d3c9dfb","name":"address","value":"","description":""},{"id":"pair_0c819bcdfe154adcb8f0746a0f5d7ec6","name":"service_type","value":"Hotspot","description":"Hotspot PPPoE VPN Others"},{"id":"pair_564420f23dad4a4eaa5ab1da983cbea3","name":"account_type","value":"Personal","description":"Personal Business"},{"id":"pair_6c9b05ddfe8e497c822dd11b2ce53336","name":"coordinates","value":"-6.465422, 3.406448","description":""},{"id":"pair_0a566c92232242269b62fe1301734a6e","name":"pppoe_username","value":"","description":""},{"id":"pair_7d751a8c7b6245ee8476b54cccaa0369","name":"pppoe_password","value":"","description":""},{"id":"pair_d67dbdc6f2f64e5395942474231b9861","name":"pppoe_ip","value":"","description":""},{"id":"pair_fc20c43a80ac427c8030e3f52df7ca9a","name":"send_welcome_message","value":"1","description":"","disabled":true},{"id":"pair_f342fe2bcd7f4446934d74974a422d32","name":"sms","value":"1","description":"send_welcome_message","disabled":true},{"id":"pair_0a37da8e76964c5589f77333f22fb9a7","name":"wa","value":"1","description":"send_welcome_message","disabled":true},{"id":"pair_5f571164a7914b7195b75fc006a90256","name":"mail","value":"1","description":"send_welcome_message","disabled":true},{"id":"pair_da0b570ff3814b27972d7b6da82f3b50","name":"city","value":"Bandung","description":""},{"id":"pair_3de758aa6663440b9e894e587ce799f0","name":"district","value":"Cimahi","description":""},{"id":"pair_f73e236cb3ab4d93996e10f5f28d492a","name":"state","value":"Jawa Barat","description":""},{"id":"pair_b084a506eb1443ca98f673b86a5b8c41","name":"zip","value":"40534","description":""}]},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"customers/add-post","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""}],"headers":[{"name":"Content-Type","value":"multipart/form-data"}],"authentication":{},"metaSortKey":-1739393430843.625,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5d01a329a8104db5b541a945389de1c4","parentId":"fld_682b0477cf584c51b46c76f88626a95b","modified":1741678313015,"created":1741678219894,"url":"{{ _.api_url }}","name":"edit","description":"","method":"POST","body":{"mimeType":"multipart/form-data","params":[{"id":"pair_82956539392844e18a4d566f4cfe8453","name":"username","value":"","description":""},{"id":"pair_9d5391c3b595498ca45c6e1f0ce4bf22","name":"fullname","value":"","description":""},{"id":"pair_079109342c0c4312b0f1b7f59f123767","name":"email","value":"","description":""},{"id":"pair_e32aaef0b26344aba71c240deeca21f3","name":"phonenumber","value":"","description":""},{"id":"pair_993483915a1842278b459efe0d9b7d87","name":"password","value":"","description":""},{"id":"pair_8ad5e531c4e24e96b520786c8d3c9dfb","name":"address","value":"","description":""},{"id":"pair_0c819bcdfe154adcb8f0746a0f5d7ec6","name":"service_type","value":"Hotspot","description":"Hotspot PPPoE VPN Others"},{"id":"pair_564420f23dad4a4eaa5ab1da983cbea3","name":"account_type","value":"Personal","description":"Personal Business"},{"id":"pair_6c9b05ddfe8e497c822dd11b2ce53336","name":"coordinates","value":"-6.465422, 3.406448","description":""},{"id":"pair_0a566c92232242269b62fe1301734a6e","name":"pppoe_username","value":"","description":""},{"id":"pair_7d751a8c7b6245ee8476b54cccaa0369","name":"pppoe_password","value":"","description":""},{"id":"pair_d67dbdc6f2f64e5395942474231b9861","name":"pppoe_ip","value":"","description":""},{"id":"pair_fc20c43a80ac427c8030e3f52df7ca9a","name":"send_welcome_message","value":"1","description":"","disabled":true},{"id":"pair_f342fe2bcd7f4446934d74974a422d32","name":"sms","value":"1","description":"send_welcome_message","disabled":true},{"id":"pair_0a37da8e76964c5589f77333f22fb9a7","name":"wa","value":"1","description":"send_welcome_message","disabled":true},{"id":"pair_5f571164a7914b7195b75fc006a90256","name":"mail","value":"1","description":"send_welcome_message","disabled":true},{"id":"pair_da0b570ff3814b27972d7b6da82f3b50","name":"city","value":"Bandung","description":""},{"id":"pair_3de758aa6663440b9e894e587ce799f0","name":"district","value":"Cimahi","description":""},{"id":"pair_f73e236cb3ab4d93996e10f5f28d492a","name":"state","value":"Jawa Barat","description":""},{"id":"pair_b084a506eb1443ca98f673b86a5b8c41","name":"zip","value":"40534","description":""},{"id":"pair_53c1252c07fb40c8a8f0bec9b5d9cc3c","name":"id","value":"","description":"customer ID"}]},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"customers/edit-post","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""}],"headers":[{"name":"Content-Type","value":"multipart/form-data"}],"authentication":{},"metaSortKey":-1739317371548.8125,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_d1b878590c384970b0fd76532f3a0560","parentId":"fld_682b0477cf584c51b46c76f88626a95b","modified":1741678547932,"created":1741678464770,"url":"{{ _.api_url }}","name":"delete","description":"","method":"GET","body":{"mimeType":"multipart/form-data","params":[]},"parameters":[{"id":"pair_a5d79aa80cfe404cbb9cdcdcb18d23ef","name":"r","value":"customers/delete/{% prompt 'Delete Customer', 'Customer ID', '1', 'customer_id', false, true %}","description":""},{"id":"pair_d66de068199f43128d5690e27cf07fa0","name":"token","value":"{% response 'body', 'req_60bdc4349a2d47129e87c1ab3d14711a', 'b64::JC5yZXN1bHQudG9rZW4=::46b', 'when-expired', 600 %}","description":""}],"headers":[{"name":"Content-Type","value":"multipart/form-data"}],"authentication":{},"metaSortKey":-1739279341901.4062,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_5e5440f3ed0befaf534143bec5b0cdcff3a045fc","parentId":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","modified":1741675272973,"created":1722392348289,"name":"Base Environment","data":{"api_url":"https://nuxbill.ibnux.com/system/api.php"},"dataPropertyOrder":{"&":["api_url"]},"color":null,"isPrivate":false,"metaSortKey":1722392348289,"_type":"environment"},{"_id":"jar_5e5440f3ed0befaf534143bec5b0cdcff3a045fc","parentId":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","modified":1741678205393,"created":1722392348290,"name":"Default Jar","cookies":[{"key":"PHPSESSID","value":"d8kfbchmuf1q1dpcm9e3s28sp7","domain":"phpmixbill.ibnux.org","path":"/","hostOnly":true,"creation":"2024-07-31T02:19:53.181Z","lastAccessed":"2024-07-31T02:19:53.181Z","id":"5563233410191446"},{"key":"aid","value":"1.1741678205.1360dae24ca2df459bb3a0f6b6d7903c0ca53a80","expires":"2025-03-18T07:30:05.000Z","maxAge":604800,"domain":"phpmixbill.ibnux.org","path":"/","httpOnly":true,"extensions":["SameSite=Lax"],"hostOnly":true,"creation":"2025-03-11T06:47:16.907Z","lastAccessed":"2025-03-11T07:30:05.393Z","id":"55636410862489"}],"_type":"cookie_jar"},{"_id":"spc_346a80f2cbc84a4ca164fd0b2a171ec1","parentId":"wrk_08fc208cb0084a0f97abc58ad2e4ba1f","modified":1722392348284,"created":1722392348284,"fileName":"PHPNuxBill","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"env_13bf6070e4c846e6a4551b776654fff6","parentId":"env_5e5440f3ed0befaf534143bec5b0cdcff3a045fc","modified":1741675301149,"created":1741675273757,"name":"nuxbill.ibnux.com","data":{"api_url":"https://nuxbill.ibnux.com/system/api.php"},"dataPropertyOrder":{"&":["api_url"]},"color":null,"isPrivate":false,"metaSortKey":1741675273757,"_type":"environment"},{"_id":"env_8c0a213472744d3bafd756bf1d04d6d9","parentId":"env_5e5440f3ed0befaf534143bec5b0cdcff3a045fc","modified":1741675342707,"created":1741675303006,"name":"phpmixbill.ibnux.org","data":{"api_url":"http://phpmixbill.ibnux.org/system/api.php"},"dataPropertyOrder":{"&":["api_url"]},"color":null,"isPrivate":false,"metaSortKey":1741675303006,"_type":"environment"}]}
\ No newline at end of file
diff --git a/init.php b/init.php
index 3059f859..c3c279ba 100644
--- a/init.php
+++ b/init.php
@@ -42,7 +42,7 @@ spl_autoload_register('_autoloader');
if (!file_exists($root_path . 'config.php')) {
$root_path .= '..' . DIRECTORY_SEPARATOR;
if (!file_exists($root_path . 'config.php')) {
- r2(getUrl('install'));
+ r2('./install');
}
}
@@ -56,6 +56,7 @@ $UPLOAD_PATH = $root_path . File::pathFixer('system/uploads');
$CACHE_PATH = $root_path . File::pathFixer('system/cache');
$PAGES_PATH = $root_path . File::pathFixer('pages');
$PLUGIN_PATH = $root_path . File::pathFixer('system/plugin');
+$WIDGET_PATH = $root_path . File::pathFixer('system/widgets');
$PAYMENTGATEWAY_PATH = $root_path . File::pathFixer('system/paymentgateway');
$UI_PATH = 'ui';
@@ -111,6 +112,24 @@ $result = ORM::for_table('tbl_appconfig')->find_many();
foreach ($result as $value) {
$config[$value['setting']] = $value['value'];
}
+
+if(empty($config['dashboard_Admin'])){
+ $config['dashboard_Admin'] = "12.7,5.12";
+}
+
+if(empty($config['dashboard_Agent'])){
+ $config['dashboard_Agent'] = "12.7,5.12";
+}
+
+if(empty($config['dashboard_Sales'])){
+ $config['dashboard_Sales'] = "12.7,5.12";
+}
+
+if(empty($config['dashboard_Customer'])){
+ $config['dashboard_Customer'] = "6,6";
+}
+
+
$_c = $config;
if (empty($http_proxy) && !empty($config['http_proxy'])) {
$http_proxy = $config['http_proxy'];
@@ -349,7 +368,7 @@ function _alert($text, $type = 'success', $url = "home", $time = 3)
$ui->assign('type', $type);
$ui->assign('time', $time);
$ui->assign('url', $url);
- $ui->display('alert.tpl');
+ $ui->display('admin/alert.tpl');
die();
}
@@ -367,7 +386,7 @@ function displayMaintenanceMessage(): void
}
http_response_code(503);
$ui->assign('companyName', $config['CompanyName']);
- $ui->display('maintenance.tpl');
+ $ui->display('admin/maintenance.tpl');
die();
}
diff --git a/install/css/bootstrap.css b/install/css/bootstrap.css
index 037dd056..4740a5a2 100644
--- a/install/css/bootstrap.css
+++ b/install/css/bootstrap.css
@@ -1374,7 +1374,7 @@ pre {
color: #333;
word-break: break-all;
word-wrap: break-word;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
border: 1px solid #ccc;
border-radius: 4px;
}
@@ -2126,7 +2126,7 @@ th {
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
}
table col[class*="col-"] {
position: static;
@@ -2151,7 +2151,7 @@ table th[class*="col-"] {
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
}
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover,
@@ -3170,7 +3170,7 @@ tbody.collapse.in {
.dropdown-menu > li > a:focus {
color: #262626;
text-decoration: none;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
@@ -4293,7 +4293,7 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
border-radius: 4px;
}
.breadcrumb > li {
@@ -4711,7 +4711,7 @@ a.thumbnail.active {
height: 20px;
margin-bottom: 20px;
overflow: hidden;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
@@ -4854,7 +4854,7 @@ a.list-group-item:hover,
a.list-group-item:focus {
color: #555;
text-decoration: none;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
}
.list-group-item.disabled,
.list-group-item.disabled:hover,
@@ -5023,7 +5023,7 @@ a.list-group-item-danger.active:focus {
}
.panel-footer {
padding: 10px 15px;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
border-top: 1px solid #ddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
@@ -5197,7 +5197,7 @@ a.list-group-item-danger.active:focus {
}
.panel-default > .panel-heading {
color: #333;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
border-color: #ddd;
}
.panel-default > .panel-heading + .panel-collapse > .panel-body {
@@ -5329,7 +5329,7 @@ a.list-group-item-danger.active:focus {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
- background-color: #f5f5f5;
+ background-color: #f6f8fa;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
diff --git a/install/phpnuxbill.sql b/install/phpnuxbill.sql
index 6e3baa45..4f7eb158 100644
--- a/install/phpnuxbill.sql
+++ b/install/phpnuxbill.sql
@@ -251,6 +251,16 @@ CREATE TABLE `tbl_customers_inbox` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+DROP TABLE IF EXISTS `tbl_port_pool`;
+CREATE TABLE IF NOT EXISTS `tbl_port_pool` (
+ `id` int(10) NOT NULL AUTO_INCREMENT,
+ `public_ip` varchar(40) NOT NULL,
+ `port_name` varchar(40) NOT NULL,
+ `range_port` varchar(40) NOT NULL,
+ `routers` varchar(40) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
CREATE TABLE IF NOT EXISTS `tbl_meta` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`tbl` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Table name',
@@ -277,6 +287,28 @@ CREATE TABLE IF NOT EXISTS `tbl_coupons` (
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+CREATE TABLE IF NOT EXISTS `tbl_widgets` (
+ `id` int NOT NULL AUTO_INCREMENT,
+ `orders` int NOT NULL DEFAULT '99',
+ `position` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1. top 2. left 3. right 4. bottom',
+ `user` ENUM('Admin','Agent','Sales','Customer') NOT NULL DEFAULT 'Admin',
+ `enabled` tinyint(1) NOT NULL DEFAULT '1',
+ `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `widget` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
+ `content` text COLLATE utf8mb4_general_ci NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+CREATE TABLE tbl_message_logs (
+ `id` SERIAL PRIMARY KEY,
+ `message_type` VARCHAR(50),
+ `recipient` VARCHAR(255),
+ `message_content` TEXT,
+ `status` VARCHAR(50),
+ `error_message` TEXT,
+ `sent_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
ALTER TABLE `rad_acct`
ADD PRIMARY KEY (`id`),
ADD KEY `username` (`username`),
@@ -397,3 +429,48 @@ VALUES (
'2022-09-06 16:09:50',
'2014-06-23 01:43:07'
);
+
+INSERT INTO `tbl_widgets` (`id`, `orders`, `position`, `user`, `enabled`, `title`, `widget`, `content`) VALUES
+(1, 1, 1, 'Admin', 1, 'Top Widget', 'top_widget', ''),
+(2, 2, 1, 'Admin', 1, 'Default Info', 'default_info_row', ''),
+(3, 1, 2, 'Admin', 1, 'Graph Monthly Registered Customers', 'graph_monthly_registered_customers', ''),
+(4, 2, 2, 'Admin', 1, 'Graph Monthly Sales', 'graph_monthly_sales', ''),
+(5, 3, 2, 'Admin', 1, 'Voucher Stocks', 'voucher_stocks', ''),
+(6, 4, 2, 'Admin', 1, 'Customer Expired', 'customer_expired', ''),
+(7, 1, 3, 'Admin', 1, 'Cron Monitor', 'cron_monitor', ''),
+(8, 2, 3, 'Admin', 1, 'Mikrotik Cron Monitor', 'mikrotik_cron_monitor', ''),
+(9, 3, 3, 'Admin', 1, 'Info Payment Gateway', 'info_payment_gateway', ''),
+(10, 4, 3, 'Admin', 1, 'Graph Customers Insight', 'graph_customers_insight', ''),
+(11, 5, 3, 'Admin', 1, 'Activity Log', 'activity_log', ''),
+
+(30, 1, 1, 'Agent', 1, 'Top Widget', 'top_widget', ''),
+(31, 2, 1, 'Agent', 1, 'Default Info', 'default_info_row', ''),
+(32, 1, 2, 'Agent', 1, 'Graph Monthly Registered Customers', 'graph_monthly_registered_customers', ''),
+(33, 2, 2, 'Agent', 1, 'Graph Monthly Sales', 'graph_monthly_sales', ''),
+(34, 3, 2, 'Agent', 1, 'Voucher Stocks', 'voucher_stocks', ''),
+(35, 4, 2, 'Agent', 1, 'Customer Expired', 'customer_expired', ''),
+(36, 1, 3, 'Agent', 1, 'Cron Monitor', 'cron_monitor', ''),
+(37, 2, 3, 'Agent', 1, 'Mikrotik Cron Monitor', 'mikrotik_cron_monitor', ''),
+(38, 3, 3, 'Agent', 1, 'Info Payment Gateway', 'info_payment_gateway', ''),
+(39, 4, 3, 'Agent', 1, 'Graph Customers Insight', 'graph_customers_insight', ''),
+(40, 5, 3, 'Agent', 1, 'Activity Log', 'activity_log', ''),
+
+(41, 1, 1, 'Sales', 1, 'Top Widget', 'top_widget', ''),
+(42, 2, 1, 'Sales', 1, 'Default Info', 'default_info_row', ''),
+(43, 1, 2, 'Sales', 1, 'Graph Monthly Registered Customers', 'graph_monthly_registered_customers', ''),
+(44, 2, 2, 'Sales', 1, 'Graph Monthly Sales', 'graph_monthly_sales', ''),
+(45, 3, 2, 'Sales', 1, 'Voucher Stocks', 'voucher_stocks', ''),
+(46, 4, 2, 'Sales', 1, 'Customer Expired', 'customer_expired', ''),
+(47, 1, 3, 'Sales', 1, 'Cron Monitor', 'cron_monitor', ''),
+(48, 2, 3, 'Sales', 1, 'Mikrotik Cron Monitor', 'mikrotik_cron_monitor', ''),
+(49, 3, 3, 'Sales', 1, 'Info Payment Gateway', 'info_payment_gateway', ''),
+(50, 4, 3, 'Sales', 1, 'Graph Customers Insight', 'graph_customers_insight', ''),
+(51, 5, 3, 'Sales', 1, 'Activity Log', 'activity_log', ''),
+
+(60, 1, 2, 'Customer', 1, 'Account Info', 'account_info', ''),
+(61, 3, 1, 'Customer', 1, 'Active Internet Plan', 'active_internet_plan', ''),
+(62, 4, 1, 'Customer', 1, 'Balance Transfer', 'balance_transfer', ''),
+(63, 1, 1, 'Customer', 1, 'Unpaid Order', 'unpaid_order', ''),
+(64, 2, 1, 'Customer', 1, 'Announcement', 'announcement', ''),
+(65, 5, 1, 'Customer', 1, 'Recharge A Friend', 'recharge_a_friend', ''),
+(66, 2, 2, 'Customer', 1, 'Voucher Activation', 'voucher_activation', '');
\ No newline at end of file
diff --git a/radius.php b/radius.php
index daee1926..0055ba68 100644
--- a/radius.php
+++ b/radius.php
@@ -207,7 +207,7 @@ try {
if (!$tur) {
// if check if pppoe_username
$c = ORM::for_table('tbl_customers')->select('username')->select('pppoe_password')->whereRaw("BINARY pppoe_username = '$username'")->find_one();
- if($c){
+ if ($c) {
$username = $c['username'];
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY username = '$username'")->find_one();
}
@@ -274,7 +274,7 @@ try {
}
header("HTTP/1.1 200 ok");
$d = ORM::for_table('rad_acct')
- ->whereRaw("BINARY username = '$username' AND macaddr = '"._post('macAddr')."' AND nasid = '"._post('nasid')."'")
+ ->whereRaw("BINARY username = '$username' AND macaddr = '" . _post('macAddr') . "' AND nasid = '" . _post('nasid') . "'")
->findOne();
if (!$d) {
$d = ORM::for_table('rad_acct')->create();
@@ -292,19 +292,27 @@ try {
$d->username = $username;
$d->realm = _post('realm');
$d->nasipaddress = _post('nasIpAddress');
- $d->acctsessiontime = intval(_post('acctSessionTime'));
+ $d->acctsessiontime = intval(_post('acctSessionTime'));
$d->nasid = _post('nasid');
$d->nasportid = _post('nasPortId');
$d->nasporttype = _post('nasPortType');
$d->framedipaddress = _post('framedIPAddress');
- if(in_array(_post('acctStatusType'), ['Start', 'Stop'])){
+ if (in_array(_post('acctStatusType'), ['Start', 'Stop'])) {
$d->acctstatustype = _post('acctStatusType');
}
$d->macaddr = _post('macAddr');
$d->dateAdded = date('Y-m-d H:i:s');
// pastikan data akunting yang disimpan memang customer aktif phpnuxbill
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY username = '$username' AND `status` = 'on' AND `routers` = 'radius'")->find_one();
- if($tur){
+ if (!$tur) {
+ // check if pppoe_username
+ $c = ORM::for_table('tbl_customers')->select('username')->whereRaw("BINARY pppoe_username = '$username'")->find_one();
+ if ($c) {
+ $username = $c['username'];
+ $tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY username = '$username'")->find_one();
+ }
+ }
+ if ($tur) {
$d->save();
if (_post('acctStatusType') == 'Start') {
$plan = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
@@ -349,15 +357,15 @@ function process_radiust_rest($tur, $code)
$plan = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
$bw = ORM::for_table("tbl_bandwidth")->find_one($plan['id_bw']);
// Count User Onlines
- $USRon = ORM::for_table('rad_acct')
- ->whereRaw("BINARY username = '".$tur['username']."' AND acctStatusType = 'Start'")
+ $USRon = ORM::for_table('rad_acct')
+ ->whereRaw("BINARY username = '" . $tur['username'] . "' AND acctStatusType = 'Start'")
->find_array();
// get all the IP
$ips = array_column($USRon, 'framedipaddress');
// check if user reach shared_users limit but IP is not in the list active
- if (count($USRon) >= $plan['shared_users'] && $plan['type'] == 'Hotspot' && !in_array(_post('framedIPAddress'), $ips)) {
- show_radius_result(["control:Auth-Type" => "Accept", 'Reply-Message' => 'You are already logged in - access denied ('.$USRon.')'], 401);
- }
+ if (count($USRon) >= $plan['shared_users'] && $plan['type'] == 'Hotspot' && !in_array(_post('framedIPAddress'), $ips)) {
+ show_radius_result(["control:Auth-Type" => "Accept", 'Reply-Message' => 'You are already logged in - access denied (' . $USRon . ')'], 401);
+ }
if ($bw['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
} else {
diff --git a/scan/index.php b/scan/index.php
index 7151913d..965914fa 100644
--- a/scan/index.php
+++ b/scan/index.php
@@ -4,25 +4,66 @@
-
QRCode Scanner
+
QR Code Scanner
-
-
+
+
QR Code Scanner
+
+
+
+
-