forked from kevinowino869/mitrobill
View Order
This commit is contained in:
@ -19,55 +19,63 @@ class Lang
|
||||
public static function moneyFormat($var)
|
||||
{
|
||||
global $config;
|
||||
return $config['currency_code'] . ' ' .number_format($var, 0, $config['dec_point'], $config['thousands_sep']);
|
||||
return $config['currency_code'] . ' ' . number_format($var, 0, $config['dec_point'], $config['thousands_sep']);
|
||||
}
|
||||
|
||||
public static function phoneFormat($phone)
|
||||
{
|
||||
global $config;
|
||||
if(Validator::UnsignedNumber($phone) && !empty($config['country_code_phone'])){
|
||||
if (Validator::UnsignedNumber($phone) && !empty($config['country_code_phone'])) {
|
||||
return preg_replace('/^0/', $config['country_code_phone'], $phone);
|
||||
}else{
|
||||
} else {
|
||||
return $phone;
|
||||
}
|
||||
}
|
||||
|
||||
public static function dateFormat($date){
|
||||
public static function dateFormat($date)
|
||||
{
|
||||
global $config;
|
||||
return date($config['date_format'], strtotime($date));
|
||||
}
|
||||
|
||||
public static function dateTimeFormat($date){
|
||||
public static function dateTimeFormat($date)
|
||||
{
|
||||
global $config;
|
||||
if(strtotime($date) < strtotime("2000-01-01 00:00:00")){
|
||||
if (strtotime($date) < strtotime("2000-01-01 00:00:00")) {
|
||||
return "";
|
||||
}else{
|
||||
return date($config['date_format']. ' H:i', strtotime($date));
|
||||
} else {
|
||||
return date($config['date_format'] . ' H:i', strtotime($date));
|
||||
}
|
||||
}
|
||||
|
||||
public static function dateAndTimeFormat($date, $time){
|
||||
public static function dateAndTimeFormat($date, $time)
|
||||
{
|
||||
global $config;
|
||||
return date($config['date_format']. ' H:i', strtotime("$date $time"));
|
||||
return date($config['date_format'] . ' H:i', strtotime("$date $time"));
|
||||
}
|
||||
|
||||
public static function nl2br($text){
|
||||
public static function nl2br($text)
|
||||
{
|
||||
return nl2br($text);
|
||||
}
|
||||
|
||||
public static function arrayCount($arr){
|
||||
if(is_array($arr)){
|
||||
public static function arrayCount($arr)
|
||||
{
|
||||
if (is_array($arr)) {
|
||||
return count($arr);
|
||||
}else{
|
||||
} else if (is_object($arr)) {
|
||||
return count($arr);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getNotifText($key){
|
||||
public static function getNotifText($key)
|
||||
{
|
||||
global $_notifmsg, $_notifmsg_default;
|
||||
if(isset($_notifmsg[$key])){
|
||||
if (isset($_notifmsg[$key])) {
|
||||
return $_notifmsg[$key];
|
||||
}else{
|
||||
} else {
|
||||
return $_notifmsg_default[$key];
|
||||
}
|
||||
}
|
||||
|
@ -36,20 +36,30 @@ switch ($action) {
|
||||
$ui->assign('_title', 'Order Plan');
|
||||
$ui->assign('_system_menu', 'package');
|
||||
if(!empty($_SESSION['nux-router'])){
|
||||
$routers = ORM::for_table('tbl_routers')->where('id',$_SESSION['nux-router'])->find_many();
|
||||
$rs = [];
|
||||
foreach($routers as $r){
|
||||
$rs[] = $r['name'];
|
||||
if($_SESSION['nux-router']=='radius'){
|
||||
$radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius',1)->where('type', 'PPPOE')->find_many();
|
||||
$radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius',1)->where('type', 'Hotspot')->find_many();
|
||||
}else{
|
||||
$routers = ORM::for_table('tbl_routers')->where('id',$_SESSION['nux-router'])->find_many();
|
||||
$rs = [];
|
||||
foreach($routers as $r){
|
||||
$rs[] = $r['name'];
|
||||
}
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius',0)->where('type', 'PPPOE')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius',0)->where('type', 'Hotspot')->find_many();
|
||||
}
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('type', 'PPPOE')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('type', 'Hotspot')->find_many();
|
||||
}else{
|
||||
$radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius',1)->where('type', 'PPPOE')->find_many();
|
||||
$radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius',1)->where('type', 'Hotspot')->find_many();
|
||||
|
||||
$routers = ORM::for_table('tbl_routers')->find_many();
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'PPPOE')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Hotspot')->find_many();
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius',0)->where('type', 'PPPOE')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius',0)->where('type', 'Hotspot')->find_many();
|
||||
}
|
||||
$plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many();
|
||||
$ui->assign('routers', $routers);
|
||||
$ui->assign('radius_pppoe', $radius_pppoe);
|
||||
$ui->assign('radius_hotspot', $radius_hotspot);
|
||||
$ui->assign('plans_pppoe', $plans_pppoe);
|
||||
$ui->assign('plans_hotspot', $plans_hotspot);
|
||||
$ui->assign('plans_balance', $plans_balance);
|
||||
|
@ -477,7 +477,6 @@ switch ($action) {
|
||||
$d->save();
|
||||
}
|
||||
|
||||
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'country_code_phone')->find_one();
|
||||
if ($d) {
|
||||
$d->value = $country_code_phone;
|
||||
@ -489,6 +488,37 @@ switch ($action) {
|
||||
$d->save();
|
||||
}
|
||||
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'radius_plan')->find_one();
|
||||
if ($d) {
|
||||
$d->value = _post('radius_plan');
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = 'radius_plan';
|
||||
$d->value = _post('radius_plan');
|
||||
$d->save();
|
||||
}
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'hotspot_plan')->find_one();
|
||||
if ($d) {
|
||||
$d->value = _post('hotspot_plan');
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = 'hotspot_plan';
|
||||
$d->value = _post('hotspot_plan');
|
||||
$d->save();
|
||||
}
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'pppoe_plan')->find_one();
|
||||
if ($d) {
|
||||
$d->value = _post('pppoe_plan');
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = 'pppoe_plan';
|
||||
$d->value = _post('pppoe_plan');
|
||||
$d->save();
|
||||
}
|
||||
|
||||
$currency_code = $_POST['currency_code'];
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'currency_code')->find_one();
|
||||
$d->value = $currency_code;
|
||||
|
@ -404,3 +404,4 @@ $_L['Sync'] = 'Sync';
|
||||
$_L['Failed_to_create_PaymeTrust_transaction'] = 'Failed to create PaymeTrust transaction.';
|
||||
$_L['Location'] = 'Location';
|
||||
$_L['Radius_Plans'] = 'Radius Plans';
|
||||
$_L['Change_title_in_user_Plan_order'] = 'Change title in user Plan order';
|
||||
|
Reference in New Issue
Block a user