diff --git a/README.md b/README.md index a27f2d56..e7ea9545 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ > 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. +> any Modification will be update in here. ### iBNuX Todos @@ -38,10 +38,10 @@ 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 +2. Upload the Entire phpmixbill folder to your website / server 3. Next you can rename the folder to whatever you like (billing, finance, manage etc..) 4. Now visit the uploaded location using your web browser to run the installer process. -5. Follow the instructions on screen to install PHPMixBill v5.0. +5. Follow the instructions on screen to install PHPMixBill 6. For security, Delete the install directory inside system folder. 7. If you see blank page after installation, it might be your compiled folder permissoon is not writable. Please make permission 755 compiled directory inside ui folder to store the generated contents from theme. @@ -49,11 +49,11 @@ Manual Install: To install manually, follow this steps- 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 +2. Upload the Entire phpmixbill folder to your website / server 3. Next you can rename the folder to whatever you like (billing, finance, manage etc..) 4. Sample config file is available here- system/config.sample.php . Rename it to config.php & put it in same location (/system/config.php) Open config file using a text editor & Put the database info and url. 5. Import database. Database file is located here- system/install/phpmixbill.sql -6. For security, Delete the install directory inside sysfrm folder. +6. For security, Delete the install directory inside system folder. CRON JOBS ---- diff --git a/index.php b/index.php index d4614ef4..97649503 100644 --- a/index.php +++ b/index.php @@ -7,6 +7,8 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt * @donate PayPal: iesien22@yahoo.com / Bank Mandiri: 130.00.1024957.4 **/ - +ini_set('display_errors', 1); +ini_set('display_startup_errors', 1); +error_reporting(E_ALL); require ('system/boot.php'); App::_run(); diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index 5eec56d6..a95ded1b 100644 --- a/system/controllers/dashboard.php +++ b/system/controllers/dashboard.php @@ -56,4 +56,25 @@ $ui->assign('dlog',$dlog); $log = ORM::for_table('tbl_logs')->count(); $ui->assign('log',$log); +// Count stock +$tmp = $v = ORM::for_table('tbl_plans')->select('id')->select('name_plan')->find_many(); +$plans = array(); +$stocks = array("used"=>0,"unused"=>0); +$n = 0; +foreach($tmp as $plan){ + $plans[$n]['name_plan'] = $plan['name_plan']; + $plans[$n]['unused'] = ORM::for_table('tbl_voucher') + ->where('id_plan',$plan['id']) + ->where('status',0)->count();; + $stocks["unused"] += $plans[$n]['unused']; + $plans[$n]['used'] = ORM::for_table('tbl_voucher') + ->where('id_plan',$plan['id']) + ->where('status',1)->count();; + $stocks["used"] += $plans[$n]['used']; + $n++; +} + +$ui->assign('stocks',$stocks); +$ui->assign('plans',$plans); + $ui->display('dashboard.tpl'); \ No newline at end of file diff --git a/system/controllers/prepaid.php b/system/controllers/prepaid.php index fda5e2cf..bc5feb3c 100644 --- a/system/controllers/prepaid.php +++ b/system/controllers/prepaid.php @@ -392,11 +392,20 @@ switch ($action) { $code = _post('code'); if ($code != ''){ + $ui->assign('code',$code); $paginator = Paginator::bootstrap('tbl_voucher','code','%'.$code.'%'); - $d = ORM::for_table('tbl_plans')->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))->where_like('tbl_plans.code','%'.$code.'%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $d = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where_like('tbl_plans.code','%'.$code.'%') + ->offset($paginator['startpoint']) + ->limit($paginator['limit']) + ->find_many(); }else{ $paginator = Paginator::bootstrap('tbl_voucher'); - $d = ORM::for_table('tbl_plans')->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $d = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->offset($paginator['startpoint']) + ->limit($paginator['limit'])->find_many(); } $ui->assign('d',$d); @@ -416,6 +425,32 @@ switch ($action) { $ui->display('voucher-add.tpl'); break; + case 'print-voucher': + $from_id = _post('from_id')*1; + $pagebreak = _post('pagebreak'); + if ($from_id != ''){ + $v = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status','0') + ->where_gt('tbl_voucher.id',$from_id) + ->find_many(); + }else{ + $v = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status','0') + ->find_many(); + } + + $ui->assign('_title', $_L['Voucher_Hotspot'].' - '. $config['CompanyName']); + $ui->assign('from_id',$from_id); + if($pagebreak<1) $pagebreak = 6; + $ui->assign('pagebreak',$pagebreak); + + $ui->assign('v',$v); + //for counting pagebreak + $ui->assign('jml',0); + $ui->display('print-voucher.tpl'); + break; case 'voucher-post': $type = _post('type'); $plan = _post('plan'); diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php index 70ad9dc1..d7d44b8d 100644 --- a/system/lan/english/common.lan.php +++ b/system/lan/english/common.lan.php @@ -175,10 +175,12 @@ $_L['Number_of_Vouchers'] = 'Number of Vouchers'; $_L['Length_Code'] = 'Length Code'; $_L['Code_Voucher'] = 'Code Voucher'; $_L['Voucher'] = 'Voucher'; +$_L['Voucher_Hotspot'] = 'Hotspot Voucher'; $_L['Status_Voucher'] = 'Status Voucher'; $_L['Add_Voucher'] = 'Add Vouchers'; $_L['Voucher_Successfully'] = 'Create Vouchers Successfully'; $_L['Generate'] = 'Generate'; +$_L['Print_Info'] = 'Print side by side, it will easy to cut'; $_L['From_Date'] = 'From Date'; $_L['To_Date'] = 'To Date'; diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index 273c15c5..06d7cee9 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -174,10 +174,12 @@ $_L['Number_of_Vouchers'] = 'Jumlah Voucher'; $_L['Length_Code'] = 'Panjang Kode'; $_L['Code_Voucher'] = 'Kode Voucher'; $_L['Voucher'] = 'Voucher'; +$_L['Voucher_Hotspot'] = 'Voucher Hotspot'; $_L['Status_Voucher'] = 'Status Voucher'; -$_L['Add_Voucher'] = 'Tambah Voucher'; +$_L['Add_Voucher'] = 'Tambah'; $_L['Voucher_Successfully'] = 'Berhasil membuat Voucher baru'; $_L['Generate'] = 'Generate'; +$_L['Print_Info'] = 'Print bolak balik, biar mudah dipotong dan hemat kertas'; $_L['From_Date'] = 'Dari Tanggal'; $_L['To_Date'] = 'Hingga Tanggal'; diff --git a/ui/theme/default/dashboard.tpl b/ui/theme/default/dashboard.tpl index 5fb0c599..7519e80d 100644 --- a/ui/theme/default/dashboard.tpl +++ b/ui/theme/default/dashboard.tpl @@ -1,12 +1,12 @@ {include file="sections/header.tpl"} {if ($_admin['user_type']) eq 'Admin' || ($_admin['user_type']) eq 'Sales'} -
+  
- +
@@ -51,6 +51,7 @@ {/foreach}
+
{$paginator['contents']} diff --git a/ui/theme/default/voucher.tpl b/ui/theme/default/voucher.tpl index ebfcb16a..472516be 100644 --- a/ui/theme/default/voucher.tpl +++ b/ui/theme/default/voucher.tpl @@ -20,13 +20,21 @@
- {$_L['Add_Voucher']} +
+ +
+ Print +
+
  - +
- + + @@ -39,6 +47,7 @@ {foreach $d as $ds} + @@ -52,6 +61,7 @@ {/foreach}
ID {$_L['Type']} {$_L['Routers']} {$_L['Plan_Name']}
{$ds['id']} {$ds['type']} {$ds['routers']} {$ds['name_plan']}
+
{$paginator['contents']}