add new feature "service type" Hotspot PPPoE and Others

ability to display packages according to the user type.
Hotspot users Can now see only hotspot packages
PPPoE users can now see only PPPoE Packages
Others Can see both Hotspot and PPPoE packages
This commit is contained in:
Focuslinkstech
2023-12-14 03:21:55 +01:00
parent 9190660c1c
commit a7a0f84df5
9 changed files with 480 additions and 279 deletions

View File

@ -28,7 +28,8 @@ switch ($action) {
'username' => '%' . $search . '%',
'fullname' => '%' . $search . '%',
'phonenumber' => '%' . $search . '%',
'email' => '%' . $search . '%'
'email' => '%' . $search . '%',
'service_type' => '%' . $search . '%'
], $search);
$d = ORM::for_table('tbl_customers')
->where_raw("(`username` LIKE '%$search%' OR `fullname` LIKE '%$search%' OR `phonenumber` LIKE '%$search%' OR `email` LIKE '%$search%')", [$search, $search, $search, $search])
@ -225,8 +226,9 @@ switch ($action) {
$password = _post('password');
$pppoe_password = _post('pppoe_password');
$email = _post('email');
$address = _post('address');
$address = _post('address');
$phonenumber = _post('phonenumber');
$service_type = _post('service_type');
run_hook('add_customer'); #HOOK
$msg = '';
if (Validator::Length($username, 35, 2) == false) {
@ -253,6 +255,7 @@ switch ($action) {
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = Lang::phoneFormat($phonenumber);
$d->service_type = $service_type;
$d->save();
r2(U . 'customers/list', 's', $_L['account_created_successfully']);
} else {
@ -268,6 +271,7 @@ switch ($action) {
$email = _post('email');
$address = _post('address');
$phonenumber = Lang::phoneFormat(_post('phonenumber'));
$service_type = _post('service_type');
run_hook('edit_customer'); #HOOK
$msg = '';
if (Validator::Length($username, 16, 2) == false) {
@ -320,6 +324,7 @@ switch ($action) {
$d->email = $email;
$d->address = $address;
$d->phonenumber = $phonenumber;
$d->service_type = $service_type;
$d->save();
if ($userDiff || $pppoeDiff || $passDiff) {
$c = ORM::for_table('tbl_user_recharges')->where('username', ($userDiff) ? $oldusername : $username)->find_one();

View File

@ -35,5 +35,8 @@
],
"2023.10.24" : [
"ALTER TABLE `nas` ADD `routers` VARCHAR(32) NOT NULL DEFAULT '' AFTER `description`;"
],
"2023.12.15": [
"ALTER TABLE `tbl_customers` ADD `service_type` ENUM('Hotspot','PPPoE','Others') DEFAULT 'Others' COMMENT 'For selecting user type' AFTER `balance`;"
]
}