diff --git a/.gitignore b/.gitignore index 1025436..c9ad216 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -system/config.php +config.php .DS_Store .vscode/ ui/compiled/*.php diff --git a/system/config.sample.php b/config.sample.php similarity index 90% rename from system/config.sample.php rename to config.sample.php index 764696d..d23e7f0 100644 --- a/system/config.sample.php +++ b/config.sample.php @@ -1,9 +1,9 @@ - - - - - PHPMixBill Installer - - - - - - - - - - -
-
-
- -
-
- -
-
-

PHPMixBill Installer

-
Please Read Before Continue
-

Informasi Aplikasi
- Application Name: PHPMixBill
- Release Date: 30/10/2015
- By: PHPMixBill [ https://github.com/ibnux/phpmixbill ]
- Donasi Paypal: me@ibnux.et
-
- Syarat Penggunaan:
- Syarat Penggunaan ini berlaku untuk semua versi.

-

    -
  • Silahkan Anda menggunakan aplikasi ini dengan bijak, Anda dapat mendesain ulang script maupun tampilan pada - aplikasi ini sesuai dengan kebutuhan anda, memperbayak jumlah copy atau mendistribusikan aplikasi ini. - Dengan catatan tidak menghapus link developer.
  • -
  • Tidak ada garansi dari kami jika anda mengalami error atau merasa rugi ketika menggunakan aplikasi ini, - Anda hanya dapat memberikan feedback yang berisi laporan error, dengan syarat dan ketentuan yang berlaku.
  • -
  • Semua yang terkait biaya atau donasi apapun versi-nya, Anda dapat update seumur hidup atau selama aplikasi - ini masih dikembangkan. Mohon jangan salah pengertian bahwa kami tim pengembang mengkomersilkan produk ini - dan anda membeli produk kami.
  • -
  • Aplikasi ini bersifat sosial untuk dapat dikembangkan bersama. Karena itu kami juga mengundang relawan-relawan - yang mau menjadi pengembangkan aplikasi ini.
  • -
  • Penulis berhak setiap saat untuk mengubah ketentuan Syarat Penggunaan tanpa pemberitahuan sebelumnya.
  • -
-
- -
- -
- - - + + + + + PHPMixBill Installer + + + + + + + + + + +
+
+
+ +
+
+ +
+
+

PHPMixBill Installer

+
Please Read Before Continue
+

Informasi Aplikasi
+ Application Name: PHPMixBill
+ Release Date: 30/10/2015
+ By: PHPMixBill [ https://github.com/ibnux/phpmixbill ]
+ Donasi Paypal: me@ibnux.et
+
+ Syarat Penggunaan:
+ Syarat Penggunaan ini berlaku untuk semua versi.

+

    +
  • Silahkan Anda menggunakan aplikasi ini dengan bijak, Anda dapat mendesain ulang script maupun tampilan pada + aplikasi ini sesuai dengan kebutuhan anda, memperbayak jumlah copy atau mendistribusikan aplikasi ini. + Dengan catatan tidak menghapus link developer.
  • +
  • Tidak ada garansi dari kami jika anda mengalami error atau merasa rugi ketika menggunakan aplikasi ini, + Anda hanya dapat memberikan feedback yang berisi laporan error, dengan syarat dan ketentuan yang berlaku.
  • +
  • Semua yang terkait biaya atau donasi apapun versi-nya, Anda dapat update seumur hidup atau selama aplikasi + ini masih dikembangkan. Mohon jangan salah pengertian bahwa kami tim pengembang mengkomersilkan produk ini + dan anda membeli produk kami.
  • +
  • Aplikasi ini bersifat sosial untuk dapat dikembangkan bersama. Karena itu kami juga mengundang relawan-relawan + yang mau menjadi pengembangkan aplikasi ini.
  • +
  • Penulis berhak setiap saat untuk mengubah ketentuan Syarat Penggunaan tanpa pemberitahuan sebelumnya.
  • +
+
+ +
+ +
+ + + \ No newline at end of file diff --git a/system/install/phpmixbill.sql b/install/phpmixbill.sql similarity index 100% rename from system/install/phpmixbill.sql rename to install/phpmixbill.sql diff --git a/system/install/step2.php b/install/step2.php similarity index 97% rename from system/install/step2.php rename to install/step2.php index abbaddc..e16874d 100644 --- a/system/install/step2.php +++ b/install/step2.php @@ -1,70 +1,70 @@ - - - - - PHPMixBill Installer - - - - - - - - - - -
-
-
- -
-
- -
-

PHPMixBill Installer

- = 0) { - $ltext .= 'To Run PHPMixBill You need at least PHP version 7.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested ---PASSED---
"; - $passed .= '1'; - } else { - $ltext .= 'To Run PHPMixBill You need at least PHP version 7.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested ---FAILED---
"; - $passed .= '0'; - } - - if (extension_loaded('PDO')) { - $ltext .= 'PDO is installed on your server: ' . "Tested ---PASSED---
"; - $passed .= '1'; - } else { - $ltext = 'PDO is installed on your server: ' . "Tested ---FAILED---
"; - $passed .= '0'; - } - - if (extension_loaded('pdo_mysql')) { - $ltext .= 'PDO MySQL driver is enabled on your server: ' . "Tested ---PASSED---
"; - $passed .= '1'; - } else { - $ltext .= 'PDO MySQL driver is not enabled on your server: ' . "Tested ---FAILED---
"; - $passed .= '0'; - } - - if ($passed == '111') { - echo ("
$ltext
Great! System Test Completed. You can run PHPMixBill on your server. Click Continue For Next Step. -

- Continue

Update System"); - } else { - echo ("
$ltext
Sorry. The requirements of PHPMixBill is not available on your server. - Please contact with us- iesien22@yahoo.com with this code- $passed Or contact with your server administrator -

- Correct The Problem To Continue"); - } - ?> -
-
- - - + + + + + PHPMixBill Installer + + + + + + + + + + +
+
+
+ +
+
+ +
+

PHPMixBill Installer

+ = 0) { + $ltext .= 'To Run PHPMixBill You need at least PHP version 7.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested ---PASSED---
"; + $passed .= '1'; + } else { + $ltext .= 'To Run PHPMixBill You need at least PHP version 7.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested ---FAILED---
"; + $passed .= '0'; + } + + if (extension_loaded('PDO')) { + $ltext .= 'PDO is installed on your server: ' . "Tested ---PASSED---
"; + $passed .= '1'; + } else { + $ltext = 'PDO is installed on your server: ' . "Tested ---FAILED---
"; + $passed .= '0'; + } + + if (extension_loaded('pdo_mysql')) { + $ltext .= 'PDO MySQL driver is enabled on your server: ' . "Tested ---PASSED---
"; + $passed .= '1'; + } else { + $ltext .= 'PDO MySQL driver is not enabled on your server: ' . "Tested ---FAILED---
"; + $passed .= '0'; + } + + if ($passed == '111') { + echo ("
$ltext
Great! System Test Completed. You can run PHPMixBill on your server. Click Continue For Next Step. +

+ Continue

Update System"); + } else { + echo ("
$ltext
Sorry. The requirements of PHPMixBill is not available on your server. + Please contact with us- iesien22@yahoo.com with this code- $passed Or contact with your server administrator +

+ Correct The Problem To Continue"); + } + ?> +
+
+ + + \ No newline at end of file diff --git a/system/install/step3.php b/install/step3.php similarity index 97% rename from system/install/step3.php rename to install/step3.php index 29db1b3..422a3ca 100644 --- a/system/install/step3.php +++ b/install/step3.php @@ -1,72 +1,72 @@ - - - - PHPMixBill Installer - - - - - - - - - - -
-
-
- -
-
- -
-

PHPMixBill Installer

- Unable to Connect Database, Please make sure database info is correct and try again ! '; - }// - - $cururl = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')|| $_SERVER['SERVER_PORT'] == 443)?'https':'http').'://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - $appurl = str_replace('/install/step3.php', '', $cururl); - $appurl = str_replace('?_error=1', '', $appurl); - $appurl = str_replace('/system', '', $appurl); - ?> - -
-
- Database Connection & Site config - -
- - - Application url without trailing slash at the end of url (e.g. http://172.16.10.10). Please keep default, if you are unsure. -
-
- - -
-
- - -
-
- - -
- -
- - -
- - -
-
-
-
- - - - + + + + PHPMixBill Installer + + + + + + + + + + +
+
+
+ +
+
+ +
+

PHPMixBill Installer

+ Unable to Connect Database, Please make sure database info is correct and try again ! '; + }// + + $cururl = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')|| $_SERVER['SERVER_PORT'] == 443)?'https':'http').'://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; + $appurl = str_replace('/install/step3.php', '', $cururl); + $appurl = str_replace('?_error=1', '', $appurl); + $appurl = str_replace('/system', '', $appurl); + ?> + +
+
+ Database Connection & Site config + +
+ + + Application url without trailing slash at the end of url (e.g. http://172.16.10.10). Please keep default, if you are unsure. +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ + +
+
+
+
+ + + + diff --git a/system/install/step4.php b/install/step4.php similarity index 96% rename from system/install/step4.php rename to install/step4.php index 4027c90..2ff69f6 100644 --- a/system/install/step4.php +++ b/install/step4.php @@ -1,102 +1,102 @@ - PDO::ERRMODE_EXCEPTION)); - $cn = '1'; -} -catch(PDOException $ex){ - $cn = '0'; -} - -if ($cn == '1') { - $input = '$input"); - - fwrite($fh, $input); - fclose($fh); - - $sql = file_get_contents('phpmixbill.sql'); - - $qr = $dbh->exec($sql); - -} else { - header("location: step3.php?_error=1"); - exit; -} - -?> - - - - PHPMixBill Installer - - - - - - - - - - -
-
-
- -
-
- -
-

PHPMixBill Installer

- -

Config File Created and Database Imported.

-
-
- Click Continue - -
-
- -

MySQL Connection was successfull. An error occured while adding data on MySQL. Unsuccessfull - Installation. Please refer manual installation in the website github.com/ibnux/phpmixbill or Contact phpmixbill@ibnux.com for - helping on installation

- -

MySQL Connection Failed.

- -
-
- - - - - + PDO::ERRMODE_EXCEPTION)); + $cn = '1'; +} +catch(PDOException $ex){ + $cn = '0'; +} + +if ($cn == '1') { + $input = '$input"); + + fwrite($fh, $input); + fclose($fh); + + $sql = file_get_contents('phpmixbill.sql'); + + $qr = $dbh->exec($sql); + +} else { + header("location: step3.php?_error=1"); + exit; +} + +?> + + + + PHPMixBill Installer + + + + + + + + + + +
+
+
+ +
+
+ +
+

PHPMixBill Installer

+ +

Config File Created and Database Imported.

+
+
+ Click Continue + +
+
+ +

MySQL Connection was successfull. An error occured while adding data on MySQL. Unsuccessfull + Installation. Please refer manual installation in the website github.com/ibnux/phpmixbill or Contact phpmixbill@ibnux.com for + helping on installation

+ +

MySQL Connection Failed.

+ +
+
+ + + + + diff --git a/system/install/step5.php b/install/step5.php similarity index 96% rename from system/install/step5.php rename to install/step5.php index 5c72f25..4466382 100644 --- a/system/install/step5.php +++ b/install/step5.php @@ -1,46 +1,46 @@ - - - - PHPMixBill Installer - - - - - - - - - - -
-
-
- -
-
- -
-

PHPMixBill Installer

-

- Congratulations!
- You have just install PHPMixBill !
- To Login Admin Portal:
- Use this link - - ' . $appurl . '/admin'; - ?> -
- Username: admin
- Password: admin
- For security, Delete the install directory inside system folder. -

-
-
- - + + + + PHPMixBill Installer + + + + + + + + + + +
+
+
+ +
+
+ +
+

PHPMixBill Installer

+

+ Congratulations!
+ You have just install PHPMixBill !
+ To Login Admin Portal:
+ Use this link - + ' . $appurl . '/admin'; + ?> +
+ Username: admin
+ Password: admin
+ For security, Delete the install directory inside system folder. +

+
+
+ + \ No newline at end of file diff --git a/system/install/update.php b/install/update.php similarity index 100% rename from system/install/update.php rename to install/update.php diff --git a/system/boot.php b/system/boot.php index 971a3e3..c17c0e9 100644 --- a/system/boot.php +++ b/system/boot.php @@ -17,10 +17,10 @@ function r2($to, $ntype = 'e', $msg = '') exit; } -if (file_exists('system/config.php')) { - require('system/config.php'); +if (file_exists('config.php')) { + require('config.php'); } else { - r2('system/install'); + r2('install'); } @@ -220,8 +220,7 @@ function _admin($login = true) function _raid($l) { - $r = substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l); - return $r; + return substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l); } function _log($description, $type = '', $userid = '0') @@ -263,6 +262,7 @@ function alphanumeric($str, $tambahan = "") function sendTelegram($txt) { global $_c; + run_hook('send_telegram'); #HOOK if (!empty($_c['telegram_bot']) && !empty($_c['telegram_target_id'])) { file_get_contents('https://api.telegram.org/bot' . $_c['telegram_bot'] . '/sendMessage?chat_id=' . $_c['telegram_target_id'] . '&text=' . urlencode($txt)); } @@ -272,6 +272,7 @@ function sendTelegram($txt) function sendSMS($phone, $txt) { global $_c; + run_hook('send_sms'); #HOOK if (!empty($_c['sms_url'])) { $smsurl = str_replace('[number]', urlencode($phone), $_c['sms_url']); $smsurl = str_replace('[text]', urlencode($txt), $smsurl); @@ -282,6 +283,7 @@ function sendSMS($phone, $txt) function sendWhatsapp($phone, $txt) { global $_c; + run_hook('send_whatsapp'); #HOOK if (!empty($_c['wa_url'])) { $waurl = str_replace('[number]', urlencode($phone), $_c['wa_url']); $waurl = str_replace('[text]', urlencode($txt), $waurl); diff --git a/system/cron.php b/system/cron.php index 8f3c685..1fc2b28 100644 --- a/system/cron.php +++ b/system/cron.php @@ -3,7 +3,7 @@ * PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/) **/ -require('config.php'); +require('../config.php'); require('orm.php'); use PEAR2\Net\RouterOS; diff --git a/system/radius.php b/system/radius.php index 6de89c6..e3ad01e 100644 --- a/system/radius.php +++ b/system/radius.php @@ -7,7 +7,7 @@ if(php_sapi_name() !== 'cli'){ die("RUN ON COMMAND LINE ONLY BY RADIUS ENGINE"); } -require(__DIR__.'/config.php'); +require(__DIR__.'/../config.php'); require(__DIR__.'/orm.php'); use PEAR2\Net\RouterOS;