diff --git a/index.php b/index.php
index 9db203db..7334f59c 100644
--- a/index.php
+++ b/index.php
@@ -338,7 +338,7 @@ function ogpHome()
{
$servercount=$servercount + 1;
}
- if ((!isAdmin) && ($servercount == 0))
+ if ((!$isAdmin) && ($servercount == 0))
{
$view->refresh("home.php?m=billing&p=shop",2);
diff --git a/modules/gamemanager/server_monitor.php b/modules/gamemanager/server_monitor.php
index 2c6af740..dd4a1c09 100644
--- a/modules/gamemanager/server_monitor.php
+++ b/modules/gamemanager/server_monitor.php
@@ -341,37 +341,33 @@ echo "
= -2" ;
+ $query = "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE home_id = " . $db->realEscapeSingle($server_home['home_id']) . " AND status >= -2 ORDER BY order_id DESC LIMIT 1" ;
$results = $db->resultQuery($query);
- if(!is_null($results[0]['status']))
+ if($results && isset($results[0]['status']))
{
- //there is an end date
- if($results[0]['status'] > 0)
- {
- $expire_date = $results[0]['finish_date'];
- $expiration_dates = "" . read_expire($expire_date) . "";
- }
+ $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
- if($results[0]['status'] == 0)
- {
- $expire_date = $results[0]['finish_date'];
- $expiration_dates = "". read_expire($expire_date) . " Invoice";
- }
-
- // -1 its expire, invoice printed
- if($results[0]['status'] == -1)
- {
- $expire_date = $results[0]['finish_date'];
- $expiration_dates = "". read_expire($expire_date) . " Invoice";
- }
- // -2 its suspended, invoice still available
- if($results[0]['status'] == -2)
- {
- $expire_date = $results[0]['finish_date'];
- $expiration_dates = " SUSPENDED Invoice";
- }
-
- }//end isnull
+ 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']) )
@@ -532,7 +528,7 @@ echo "Agent Offline";
}
$user = $db->getUserById($server_home['user_id_main']);
- $query = "SELECT * FROM ogp_billing_orders WHERE home_id = " . $server_home['home_id'] . " AND status > 0" ;
+ $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 = "";
@@ -629,5 +625,3 @@ echo "Put the log file here
";
-
-