From b4f0e1edfe36f93b883d7b7e44695d574167ca38 Mon Sep 17 00:00:00 2001 From: Frank Harris Date: Mon, 24 Nov 2025 09:42:03 -0500 Subject: [PATCH] Fixed calls to old billing module --- .vscode/settings.json | 6 +- includes/config.inc.php | 4 +- index.php | 19 +- modules/dashboard/dashboard.php | 76 +------- modules/dashboard/dashboard.php.save | 243 ------------------------- modules/gamemanager/server_monitor.php | 35 +--- 6 files changed, 15 insertions(+), 368 deletions(-) delete mode 100644 modules/dashboard/dashboard.php.save diff --git a/.vscode/settings.json b/.vscode/settings.json index 3b664107..a8ca8320 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ -{ - "git.ignoreLimitWarning": true -} \ No newline at end of file +{ + "git.ignoreLimitWarning": true +} diff --git a/includes/config.inc.php b/includes/config.inc.php index 1abb9f1a..f88bcb56 100644 --- a/includes/config.inc.php +++ b/includes/config.inc.php @@ -2,8 +2,8 @@ ############################################### # Site configuration ############################################### -$db_host="localhost"; -$db_user="localuser"; +$db_host="mysql.iaregamer.com"; +$db_user="remoteuser"; $db_pass="Pkloyn7yvpht!"; $db_name="panel"; $table_prefix="gsp_"; diff --git a/index.php b/index.php index 7334f59c..0072a9cc 100644 --- a/index.php +++ b/index.php @@ -331,24 +331,7 @@ function ogpHome() print_success( get_lang("logging_in") ."..."); $db->logger( get_lang("logging_in") ."..."); $db->query("DELETE FROM `OGP_DB_PREFIXban_list` WHERE client_ip='$client_ip';"); - //find number of servers user has. if zero, then redirect to the shop page. - $result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status IN ('in-cart', 'unknown') "); - $servercount = 0; - foreach($result as $servers) - { - $servercount=$servercount + 1; - } - if ((!$isAdmin) && ($servercount == 0)) - { - $view->refresh("home.php?m=billing&p=shop",2); - - //send to shop page. - } - else - { - $view->refresh("home.php?$default_page",2); - - } + $view->refresh("home.php?$default_page",2); diff --git a/modules/dashboard/dashboard.php b/modules/dashboard/dashboard.php index cd2d25f4..6a3202a5 100644 --- a/modules/dashboard/dashboard.php +++ b/modules/dashboard/dashboard.php @@ -46,66 +46,6 @@ function exec_ogp_module() } - //show if new server created - $cartresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = 'paid'"); - $newServices=0; - foreach($cartresult as $res){ - $newServices=$newServices + 1; - } - //Popup notification - if($newServices > 0) { - echo'
- - - - GOOD NEWS! You have a new server!
-
- - -
- -
'; - } - //Invoice is due. - $orderresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = 'invoiced'"); - $invoicesDue=0; - foreach($orderresult as $res){ - $invoicesDue=$invoicesDue + 1; - } - //Popup notification WARNING - if($invoicesDue > 0) { - echo'
- - You have an Invoice Due
-
- - - -
'; - } - //Server is suspended DANGER - $orderresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = 'suspended'"); - $invoicesDue=0; - foreach($orderresult as $res){ - $invoicesDue=$invoicesDue + 1; - } - //Popup notification - if($invoicesDue > 0) { - echo'
- - Warning! You have an OVERDUE invoice
- - - -
'; - } - if( isset($settings['welcome_title']) && $settings['welcome_title'] == "1" ) { if( isset($settings['welcome_title_message']) && !empty($settings['welcome_title_message'] )) @@ -126,10 +66,10 @@ function exec_ogp_module() $title = array(); $content = array(); $href = array(); - // Order History - $title[1] = "Order History"; // get_lang('orders'); - $content[1] = 'View all your orders, invoices and expiration dates. '; - $href[1] = 'home.php?m=billing&p=orders'; + // Account Overview + $title[1] = "Account Overview"; + $content[1] = 'Review your assigned servers and jump straight into the Game Monitor.'; + $href[1] = 'home.php?m=gamemanager&p=game_monitor'; // Recent News //$xml=simplexml_load_file("modules/news/data/listings.xml"); @@ -143,10 +83,10 @@ function exec_ogp_module() $content[3] = 'View all your notifications. '; $href[3] = 'home.php?m=circular&p=show_circular&list=true'; - // Invoices - $title[4] = 'Current Invoices'; - $content[4] ='An Invoice will be created before your server expires. Click here to view current invoices.
Invoices Due : '. $invoicesDue ; - $href[4] = 'home.php?m=billing&p=cart'; + // Support Resources quick link + $title[4] = 'Support Resources'; + $content[4] ='Need help? Visit the support section to open tickets or review documentation.'; + $href[4] = 'home.php?m=tickets'; // Support $title[5] = (isset($settings['support_widget_title']) && $settings['support_widget_title'] != "") ? diff --git a/modules/dashboard/dashboard.php.save b/modules/dashboard/dashboard.php.save deleted file mode 100644 index 827bc5e4..00000000 --- a/modules/dashboard/dashboard.php.save +++ /dev/null @@ -1,243 +0,0 @@ - - -isAdmin($_SESSION['user_id']); - $user_id = $_SESSION['user_id']; - - $page_user = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1; // thanks for Adjokip - $limit_user = isset($_GET['limit']) ? $_GET['limit'] : 10; - - if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){ - $limit_user = $loggedInUserInfo["users_page_limit"]; - } - - $RecentNews = "Are you ready to get your own server? Click on the SHOP menu"; - $RecentNewsTitle = "Rent a GameServer"; -$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND end_date IN (0, -1 , -2) "); - $invoicesDue=0; - foreach($result as $res){ - $invoicesDue=$invoicesDue + 1; -} - - if( isset($settings['welcome_title']) && $settings['welcome_title'] == "1" ) - { - if( isset($settings['welcome_title_message']) && !empty($settings['welcome_title_message'] )) - { - echo "
" . $settings['welcome_title_message'] . "
"; - } - } - - - require_once("includes/refreshed.php"); - $refresh = new refreshed(); - $OnlineServers .= "

Recent updates and changes

"; - $RecentNews .= ""; - $RecentNews .= "

"; - ?> -
- View all your servers from the Game Monitor. This is where you can START/STOP and configure your server. '; - $href[1] = 'home.php?m=gamemanager&p=game_monitor'; - // Online Server - $title[2] = $RecentNewsTitle; - $content[2] = $RecentNews; - $href[2] = 'home.php?m=billing&p=shop'; - // Currently Online - $title[3] = "Something else"; - $content[3] = "Something Else content"; - $href[3] = null; - // Invoices - $title[4] = 'View Invoices'; - $content[4] ='An Invoice will be created before your server expires. Click here to view all your past and current invoices.Invoices Due : '. $invoicesDue . ''; - - $href[4] = 'home.php?m=billing&p=cart'; - // Support - $title[5] = (isset($settings['support_widget_title']) && $settings['support_widget_title'] != "") ? - $settings['support_widget_title'] : get_lang('support'); - $content[5] = (isset($settings['support_widget_content']) && $settings['support_widget_content'] != "") ? - $settings['support_widget_content'] : '' . get_lang('dashboard_support_text'); - $href[5] = (isset($settings['support_widget_link']) && $settings['support_widget_link'] != "") ? - $settings['support_widget_link'] : ''; - - - $widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no"); - if(!$widgets) - { - if($db->createUserWidgets($_SESSION['user_id'])) - $widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no"); - } - - if($widgets) - { - $colhtml[1] = '
'; - $colhtml[2] = '
'; - $colhtml[3] = '
'; - foreach($widgets as $widget) - { - if( (!isset($settings['old_dashboard_behavior']) or $settings['old_dashboard_behavior'] == 0) AND $widget['widget_id'] == "3" ) - continue; - $colhtml[$widget['column_id']] .= '
'. - '

'; - if(!is_null($title[$widget['widget_id']])) - $colhtml[$widget['column_id']] .= $title[$widget['widget_id']]; - - $colhtml[$widget['column_id']] .= '

'; - } - if( $isAdmin AND $db->isModuleInstalled('status') ) - { - echo "".get_lang('server_status')."
"; - $servers = $db->getRemoteServers(); - - echo "
-
-

".get_lang('select_remote_server')."

-
-
-
- - - - - -
-

-
-
-
\n"; - - if( isset($_GET['remote_server_id']) AND ( $_GET['remote_server_id'] == "webhost" or $_GET['remote_server_id'] == "" ) ) - unset($_GET['remote_server_id']); - - if( isset($_GET['remote_server_id']) ) - $remote_server = "&remote_server_id=".$_GET['remote_server_id']; - else - $remote_server = ""; - - if( isset($_GET['remote_server_id']) OR function_exists('exec') ) - echo $refresh->getdiv($refresh->add("home.php?m=status&type=cleared".$remote_server)); - } - -?> -
- - - - - diff --git a/modules/gamemanager/server_monitor.php b/modules/gamemanager/server_monitor.php index dd4a1c09..030acb82 100644 --- a/modules/gamemanager/server_monitor.php +++ b/modules/gamemanager/server_monitor.php @@ -340,34 +340,6 @@ echo "= -2 ORDER BY order_id DESC LIMIT 1" ; - $results = $db->resultQuery($query); - if($results && isset($results[0]['status'])) - { - $status = (int)$results[0]['status']; - $expire_date = $results[0]['finish_date']; - //there is an end date - if($status > 0 && !empty($expire_date)) - { - $expiration_dates = "" . read_expire($expire_date) . ""; - } - // 0 its expire, invoice printed - elseif($status == 0 && !empty($expire_date)) - { - $expiration_dates = "". read_expire($expire_date) . " Invoice"; - } - // -1 its expire, invoice printed - elseif($status == -1 && !empty($expire_date)) - { - $expiration_dates = "". read_expire($expire_date) . " Invoice"; - } - // -2 its suspended, invoice still available - elseif($status == -2 && !empty($expire_date)) - { - $expiration_dates = " SUSPENDED Invoice"; - } - }//end has result if( !isset($server_home['mod_id']) ) @@ -527,10 +499,7 @@ echo "
Agent Offline"; } - $user = $db->getUserById($server_home['user_id_main']); - $query = "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE home_id = " . $db->realEscapeSingle($server_home['home_id']) . " AND status > 0" ; -//DISABLE SHOWING EXPIRATION DATES -//$expiration_dates = ""; + $user = $db->getUserById($server_home['user_id_main']); // Template @@ -623,5 +592,3 @@ echo "
Put the log file here
"; ?> - -