From 24d7ef3f2d8066197f2b491628a374fbb60f4390 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Thu, 23 Mar 2017 02:25:45 +0700 Subject: [PATCH] Fix login, register, dashboard, + pengumuman Tampilan login dan register diubah Error include file diperbaiki logout diperbaiki penambahan pengumuman dan informasi saat registrasi --- .gitignore | 2 +- pages/Announcement.html | 1 + pages/Order_Voucher.html | 2 +- pages/Registration_Info.html | 2 + system/boot.php | 17 +++- system/controllers/logout.php | 2 +- system/controllers/register.php | 8 +- system/install/phpmixbill.sql | 12 +-- system/lan/english/common.lan.php | 4 +- system/lan/indonesia/common.lan.php | 4 +- ui/theme/default/login.tpl | 100 ++++++++++++---------- ui/theme/default/register.tpl | 74 ++++++++++------ ui/theme/default/sections/header.tpl | 24 +++--- ui/theme/default/sections/user-header.tpl | 2 +- ui/theme/default/user-dashboard.tpl | 82 ++++++++++++------ 15 files changed, 211 insertions(+), 125 deletions(-) create mode 100644 pages/Announcement.html create mode 100644 pages/Registration_Info.html diff --git a/.gitignore b/.gitignore index 128783ba..85637033 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /system/config.php .DS_Store .vscode/ -ui/compiled/*.tpl.php \ No newline at end of file +ui/compiled/*.php \ No newline at end of file diff --git a/pages/Announcement.html b/pages/Announcement.html new file mode 100644 index 00000000..3f0a6c99 --- /dev/null +++ b/pages/Announcement.html @@ -0,0 +1 @@ +Pengumuman!!
Besok libur

Announcement!!
Tomorrow holiday
\ No newline at end of file diff --git a/pages/Order_Voucher.html b/pages/Order_Voucher.html index 89490fdb..17ef4b62 100644 --- a/pages/Order_Voucher.html +++ b/pages/Order_Voucher.html @@ -1 +1 @@ -Beli Voucher bisa di sini \ No newline at end of file +You can buy a voucher in my home


Dapatkan Voucher Internet di Warung terdekat \ No newline at end of file diff --git a/pages/Registration_Info.html b/pages/Registration_Info.html new file mode 100644 index 00000000..5ba6b03c --- /dev/null +++ b/pages/Registration_Info.html @@ -0,0 +1,2 @@ +Before you registered, you must Buy Voucher first

+Sebelum mendaftar pastikan anda membeli voucher terlebih dahulu \ No newline at end of file diff --git a/system/boot.php b/system/boot.php index 372a3474..71ec8a29 100644 --- a/system/boot.php +++ b/system/boot.php @@ -111,12 +111,25 @@ if (isset($_SESSION['notify'])) { unset($_SESSION['ntype']); } +// on some server, it getting error because of slash is backwards function _autoloader($class) { if (strpos($class, '_') !== false) { $class = str_replace('_','/',$class); - include 'autoload/' . $class . '.php'; + if(file_exists('autoload/' . $class . '.php')){ + include 'autoload/' . $class . '.php'; + }else{ + $class = str_replace("\\","/",$class); + if(file_exists(__DIR__.'/autoload/' . $class . '.php')) + include __DIR__.'/autoload/' . $class . '.php'; + } } else{ - include 'autoload/' . $class . '.php'; + if(file_exists('autoload/' . $class . '.php')){ + include 'autoload/' . $class . '.php'; + }else{ + $class = str_replace("\\","/",$class); + if(file_exists(__DIR__.'/autoload/' . $class . '.php')) + include __DIR__.'/autoload/' . $class . '.php'; + } } } diff --git a/system/controllers/logout.php b/system/controllers/logout.php index 86c78961..461acee7 100644 --- a/system/controllers/logout.php +++ b/system/controllers/logout.php @@ -7,6 +7,6 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt * @donate PayPal: iesien22@yahoo.com / Bank Mandiri: 130.00.1024957.4 **/ -session_start(); +if (session_status() == PHP_SESSION_NONE) session_start(); session_destroy(); header('location: index.php'); \ No newline at end of file diff --git a/system/controllers/register.php b/system/controllers/register.php index 27cac6a9..75c65d73 100644 --- a/system/controllers/register.php +++ b/system/controllers/register.php @@ -224,11 +224,11 @@ switch($do){ break; - case 'register-display': - $ui->display('register.tpl'); - break; - default: + $ui->assign('username', ""); + $ui->assign('fullname', ""); + $ui->assign('address', ""); + $ui->assign('phonenumber', ""); $ui->display('register.tpl'); break; } diff --git a/system/install/phpmixbill.sql b/system/install/phpmixbill.sql index 0522ca9d..f65bdb58 100644 --- a/system/install/phpmixbill.sql +++ b/system/install/phpmixbill.sql @@ -19,18 +19,18 @@ CREATE TABLE `tbl_appconfig` ( -- Dump Data for `tbl_appconfig` -- -INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("1","CompanyName","PHPMixBill v5.0"); +INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("1","CompanyName","PHPMixBill"); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("2","theme","default"); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("3","currency_code","Rp."); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("4","language","english"); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("5","show-logo","1"); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("6","nstyle","blue"); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("7","timezone","Asia/Jakarta"); -INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("8","dec_point","."); -INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("9","thousands_sep",","); +INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("8","dec_point",","); +INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("9","thousands_sep","."); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("10","rtl","0"); -INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("11","address","Jl. Kubangsari VII No. 31 RT.03/RW.06 Bandung"); -INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("12","phone","081322225141"); +INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("11","address",""); +INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("12","phone",""); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("13","date_format","d M Y"); INSERT INTO tbl_appconfig (`id`,`setting`,`value`) VALUES ("14","note","Thank you..."); @@ -221,7 +221,7 @@ CREATE TABLE `tbl_users` ( -- Dump Data for `tbl_users` -- -INSERT INTO tbl_users (`id`,`username`,`fullname`,`password`,`user_type`,`status`,`last_login`,`creationdate`) VALUES ("1","admin","Ismail Marzuqi","$1$W44.ns/.$MUnR0NeBH9xAcXm0Oku2h1","Admin","Active","2015-10-30 18:27:02","2014-06-23 01:43:07"); +INSERT INTO tbl_users (`id`,`username`,`fullname`,`password`,`user_type`,`status`,`last_login`,`creationdate`) VALUES ("1","admin","Administrator","$1$W44.ns/.$MUnR0NeBH9xAcXm0Oku2h1","Admin","Active","2015-10-30 18:27:02","2014-06-23 01:43:07"); -- -------------------------------------------------------- -- Structure for 'tbl_voucher' diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php index 3f11f068..51970375 100644 --- a/system/lan/english/common.lan.php +++ b/system/lan/english/common.lan.php @@ -14,6 +14,8 @@ Contributor: Ibnu Maksum (@ibnux) $_L['Login'] = 'Log-in'; $_L['Register'] = 'Register'; +$_L['Announcement'] = 'Announcement'; +$_L['Registration_Info'] = 'Registration Info'; $_L['Register_Voucher_Failed'] = 'Voucher not found, please buy voucher befor register'; $_L['Register_Success'] = 'Register Success! You can login now'; $_L['Sign_In_Member'] = 'Log in to Member Panel'; @@ -217,7 +219,7 @@ $_L['Account_Information'] = 'Your Account Information'; $_L['Welcome_Text_User'] = 'Welcome to the Panel Members page, on this page you can:'; $_L['Welcome_Text_Admin'] = 'PHPMixBill is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate with router. If you get more profit with this application, please donate us.
Watch project in here'; -//update +//update $_L['Invalid_Username_or_Password'] = 'Invalid Username or Password'; $_L['Do_Not_Access'] = 'You do not have permission to access this page'; $_L['Incorrect_Current_Password'] = 'Incorrect Current Password'; diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index bba5eaa0..45dc5f29 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -12,8 +12,10 @@ Contributor: Ibnu Maksum (@ibnux) ------------------------------------ */ -$_L['Login'] = 'Masuk'; +$_L['Login'] = 'Masuk'; $_L['Register'] = 'Daftar'; +$_L['Announcement'] = 'Pengumuman'; +$_L['Registration_Info'] = 'Info Pendaftaran'; $_L['Register_Voucher_Failed'] = 'Voucher tidak ditemukan, mohon beli dulu Voucher sebelum mendaftar'; $_L['Register_Success'] = 'Pendaftaran sukses!
silahkan masuk'; $_L['Sign_In_Member'] = 'Masuk ke Member Panel'; diff --git a/ui/theme/default/login.tpl b/ui/theme/default/login.tpl index c69d0493..e95f9091 100644 --- a/ui/theme/default/login.tpl +++ b/ui/theme/default/login.tpl @@ -6,14 +6,6 @@ {$_title} - {$_L['Login']} - - - - - - - - @@ -23,51 +15,67 @@ - -
-
-
-
-
-

{$_c['CompanyName']}

-
{$_L['Sign_In_Member']}
-
- {if isset($notify)} + +
+ +
+

{$_c['CompanyName']}

+
+
+ {if isset($notify)} +
+
{$notify} - {/if} -
-
-
- - -
+
+
+ {/if} +
+
+
+
{$_L['Announcement']}
+
+ {include file="$_path/../pages/Announcement.html"} +
+
+
+
+
+
{$_L['Sign_In_Member']}
+
+
+ +
+ + +
-
- - -
+
+ + +
-
-
- + -
-
-
- -
- -
- +
+
+ +
+ +
+ +
-
+
diff --git a/ui/theme/default/register.tpl b/ui/theme/default/register.tpl index 69338d8f..39afc3d7 100644 --- a/ui/theme/default/register.tpl +++ b/ui/theme/default/register.tpl @@ -24,19 +24,35 @@ -
-
-
-
-
-

{$_c['CompanyName']}

-
{$_L['Register_Member']}
-
- {if isset($notify)} - {$notify} - {/if} -
-
+ +
+ +
+

{$_c['CompanyName']}

+
+
+ {if isset($notify)} +
+
+ {$notify} +
+
+ {/if} +
+
+
+
{$_L['Registration_Info']}
+
+ {include file="$_path/../pages/Registration_Info.html"} +
+
+
+ +
+
+
1. {$_L['Register_Member']}
+
+
@@ -45,14 +61,6 @@
-
- - -
-
- - -
@@ -61,6 +69,24 @@
+
+
+
+
+
+
+
2. {$_L['Register_Member']}
+
+
+
+ + +
+
+ + +
+
@@ -73,12 +99,12 @@ {$_L['Cancel']}
- - +
-
+ +
diff --git a/ui/theme/default/sections/header.tpl b/ui/theme/default/sections/header.tpl index ea82ad95..a032341f 100644 --- a/ui/theme/default/sections/header.tpl +++ b/ui/theme/default/sections/header.tpl @@ -235,6 +235,19 @@
  • {$_L['Pool']}
  • +
  • + + + {$_L['Static_Pages']} + + + +
  • @@ -249,17 +262,6 @@
  •  
  • -
  • - - - {$_L['Static_Pages']} - - - -
  • diff --git a/ui/theme/default/sections/user-header.tpl b/ui/theme/default/sections/user-header.tpl index 60147ea4..18947d58 100644 --- a/ui/theme/default/sections/user-header.tpl +++ b/ui/theme/default/sections/user-header.tpl @@ -86,7 +86,7 @@