From a895c8ad6ca0e76d9d3acbd9440b840fc4554cf3 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Sat, 11 Mar 2017 05:22:27 +0700 Subject: [PATCH] adding gitignore, fix readme, add info to cron --- .gitignore | 4 +++- README.md | 52 +++++++++++++++++++++++++++++++++++++++++++------ system/cron.php | 12 ++++++++---- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 2ce8b0aa..862778a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/system/config.php \ No newline at end of file +/system/config.php +.DS_Store +.vscode/ \ No newline at end of file diff --git a/README.md b/README.md index 05de13e7..a60221af 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,29 @@ # PHP Mikrotik Billing ---- -[![N|phpmixbill](http://4.bp.blogspot.com/-3OWL5OI7pqU/VjocUDdzMDI/AAAAAAAAAiA/s_XJN0_mDlk/s640/Screenshot_8.png) +@ibnux notes: +---- +> The project maybe has been abandoned +> maybe the dev busy +> and nobody donate to him +> i will try to update as far as i can +> any Modification will be update in here + +### iBNuX Todos + + - Self registration, user must have voucher before registration + - SMS Notification for expired account + - PUSH Notification using onesignal + - embedable for mikrotik login template +---- + +![N|phpmixbill](http://4.bp.blogspot.com/-3OWL5OI7pqU/VjocUDdzMDI/AAAAAAAAAiA/s_XJN0_mDlk/s640/Screenshot_8.png) + www.phpmixbill.com by Ismail Marzuqi New Features: -=================================================== +---- - New Coding (ORM & Smarty) - New Design (responsive) - NEW API Mikrotik (PEAR2_Net_RouterOS) @@ -17,7 +34,7 @@ New Features: and many more... STEPS: Installation -=================================================== +---- Auto Installer: 1. Unzip the contents of the zip file to a folder on your computer. 2. Upload the Entire phpmixbill_v5.0 folder to your website / server @@ -37,8 +54,17 @@ To install manually, follow this steps- 5. Import database. Database file is located here- system/install/phpmixbill.sql 6. For security, Delete the install directory inside sysfrm folder. +CRON JOBS +---- +Run Every 4 Hours +```sh +crontab -e +0 0,4,8,12,16,20 * * * /usr/bin/php -f /path/to/phpmixbill/system/cron.php +``` +Every system have different configuration for crontab + System Requirements -==================================================== +---- Most current web servers with PHP & MySQL installed will be capable of running PHPMixBill v5.0. Minimum Requirements @@ -55,5 +81,19 @@ copyright License ---- -GNU General Public License version 2 or later; see LICENSE.txt -@donate PayPal: iesien22@yahoo.com / Bank Mandiri: 130.00.1024957.4 \ No newline at end of file +GNU General Public License version 2 or later +see LICENSE file + +Donate to first Developer +---- + +PayPal: iesien22@yahoo.com +Bank Mandiri: 130.00.1024957.4 + +Donate to ibnux +---- + +[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6RBNGRJMZVV7C) +BCA: 5410454825 +Mandiri: 163-000-1855-793 +a.n Ibnu Maksum \ No newline at end of file diff --git a/system/cron.php b/system/cron.php index 98529af6..942bb791 100644 --- a/system/cron.php +++ b/system/cron.php @@ -32,8 +32,9 @@ foreach ($d as $ds){ if($ds['type'] == 'Hotspot'){ $date_now = strtotime(date("Y-m-d H:i:s")); $expiration = strtotime($ds['expiration'].' '.$ds['time']); - + echo $ds['expiration']." : ".$ds['username']; if ($date_now >= $expiration){ + echo " : EXPIRED \r\n"; $u = ORM::for_table('tbl_user_recharges')->where('id',$ds['id'])->find_one(); $c = ORM::for_table('tbl_customers')->where('id',$ds['customer_id'])->find_one(); $m = ORM::for_table('tbl_routers')->where('name',$ds['routers'])->find_one(); @@ -66,12 +67,14 @@ foreach ($d as $ds){ //update database user dengan status off $u->status = 'off'; $u->save(); - } + }else + echo " : ACTIVE \r\n"; }else{ $date_now = strtotime(date("Y-m-d H:i:s")); $expiration = strtotime($ds['expiration'].' '.$ds['time']); - + echo $ds['expiration']." : ".$ds['username']; if ($date_now >= $expiration){ + echo " : EXPIRED \r\n"; $u = ORM::for_table('tbl_user_recharges')->where('id',$ds['id'])->find_one(); $c = ORM::for_table('tbl_customers')->where('id',$ds['customer_id'])->find_one(); $m = ORM::for_table('tbl_routers')->where('name',$ds['routers'])->find_one(); @@ -102,7 +105,8 @@ foreach ($d as $ds){ $u->status = 'off'; $u->save(); - } + }else + echo " : ACTIVE \r\n"; } }