Phase 1: Update database configuration and schema (OGP to GSP)
Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
ea665c34d5
commit
7f19731158
82 changed files with 730 additions and 730 deletions
|
|
@ -31,7 +31,7 @@ function exec_ogp_module()
|
|||
$service_id = intval($_REQUEST['service_id']);
|
||||
|
||||
// Query for Selected service info.
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM OGP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM GSP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$result_service = $db->resultQuery($qry_service);
|
||||
$row_service = $result_service[0];
|
||||
//Compiling info about invoice to create an invoice order.
|
||||
|
|
@ -93,7 +93,7 @@ function exec_ogp_module()
|
|||
Checking if it's higher than 0 because if it's a non-numeric value, after casting it to an int it'll be 0.
|
||||
*/
|
||||
if($service_id !== 0) $where_service_id = " WHERE service_id=".$db->realEscapeSingle($service_id); else $where_service_id = "";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$qry_services = "SELECT * FROM GSP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
foreach ($services as $key => $row) {
|
||||
if($max_players < $row['slot_min_qty'] || $qty < 1){
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ function exec_ogp_module()
|
|||
$cart_id = $db->realEscapeSingle($cart_id);
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin )
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
else
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
|
||||
$cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$cart = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$tempdate = date_create( $cart[0]['date']);
|
||||
$paid_date = date_format($tempdate,"d M Y H:m");
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ function exec_ogp_module()
|
|||
|
||||
$coupon_savings = 0;
|
||||
if($cart[0]['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT discount from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
$result = $db->resultquery("SELECT discount from GSP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal2 * ($coupon['discount'] / 100);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function assignOrdersToCart($user_id,$tax_amount,$currency,$coupon_id){
|
|||
//discount coupon
|
||||
if (!isset($coupon_id)) $coupon_id = "0";
|
||||
$fields['coupon_id'] = $coupon_id;
|
||||
$check_expired = $db->resultquery("SELECT id from OGP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
$check_expired = $db->resultquery("SELECT id from GSP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
if ($check_expired <= 0) $fields['coupon_id'] = 0;
|
||||
return $db->resultInsertId( 'billing_carts', $fields );
|
||||
}
|
||||
|
|
@ -52,10 +52,10 @@ function exec_ogp_module()
|
|||
|
||||
if( isset($_POST["update_cart"] )) {
|
||||
//print_r($_POST);
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET max_players= ".$_POST['slots']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET qty= ".$_POST['qty']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET invoice_duration = 'month' WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$_POST['slots']." WHERE home_id=".$db->realEscapeSingle($_POST['homeid']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders SET max_players= ".$_POST['slots']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders SET qty= ".$_POST['qty']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders SET invoice_duration = 'month' WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXgame_mods SET max_players= ".$_POST['slots']." WHERE home_id=".$db->realEscapeSingle($_POST['homeid']));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ function exec_ogp_module()
|
|||
if( isset($_POST["coupon_code"] ) && $_POST["coupon_code"] != "") {
|
||||
$coupon_id = 0;
|
||||
$coupon_code = "";
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_coupons WHERE code= '". $_POST['coupon_code'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_coupons WHERE code= '". $_POST['coupon_code'] . "'");
|
||||
$coupon_name = "<b style='color:red'>NON-EXISTING COUPON</b>";
|
||||
$coupon_discount = 0;
|
||||
foreach($result as $couponDB){
|
||||
|
|
@ -150,7 +150,7 @@ function exec_ogp_module()
|
|||
if( isset( $_POST["extend"] ) or isset( $_POST["extend_and_pay_paypal"] ))
|
||||
{
|
||||
|
||||
$orders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$orders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
|
||||
// *****************************************
|
||||
//FIGURE OUT IF THIS IS ALREADY BEEN UPDATED
|
||||
|
|
@ -175,7 +175,7 @@ function exec_ogp_module()
|
|||
$status = 0;
|
||||
$finish_date = $order['finish_date'];
|
||||
$services = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
FROM GSP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
$service = $services[0];
|
||||
//Calculating Price
|
||||
|
|
@ -196,7 +196,7 @@ function exec_ogp_module()
|
|||
//save the EXPIRED finish date into NEW finish date. Then check if FINISH DATE !=0 and move that + 1 month into status
|
||||
$order_id = saveOrderToDb($user_id,$service_id,$home_name,$ip,$max_players,$qty,$invoice_duration,$price,$remote_control_password,$ftp_password,$cart_id,$home_id,$status,$finish_date,"1");
|
||||
//Change the old order expiration to -3 so it can not be extended, since there is a new order managing the same game home.
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET status=-3
|
||||
WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
|
||||
|
|
@ -221,11 +221,11 @@ function exec_ogp_module()
|
|||
unset($_SESSION['coupon_id']);
|
||||
}
|
||||
$order_id = $_POST['order_id'];
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($order_id) );
|
||||
$orders_in_cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($order_id) );
|
||||
$orders_in_cart = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
if( !$orders_in_cart )
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -262,7 +262,7 @@ function exec_ogp_module()
|
|||
$carts[0] = $_SESSION['CART'];
|
||||
}
|
||||
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
|
||||
|
||||
if( $user_carts >=1 )
|
||||
|
|
@ -273,8 +273,8 @@ function exec_ogp_module()
|
|||
{
|
||||
$cart_id = $user_cart['cart_id'];
|
||||
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
OGP_DB_PREFIXbilling_orders AS orders
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
GSP_DB_PREFIXbilling_orders AS orders
|
||||
ON orders.cart_id=cart.cart_id
|
||||
WHERE orders.status IN (0, -1 , -2) AND (cart.cart_id=".$db->realEscapeSingle($cart_id). ") order by order_id asc");
|
||||
}
|
||||
|
|
@ -465,7 +465,7 @@ function exec_ogp_module()
|
|||
//get max_slots and min_slots from the billing_services for this game.
|
||||
|
||||
$services = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
FROM GSP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($order['service_id']) );
|
||||
$service = $services[0];
|
||||
$min = $service['slot_min_qty'];
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
|
|
@ -35,14 +35,14 @@ function exec_ogp_module()
|
|||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$query = "INSERT INTO GSP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function exec_ogp_module()
|
|||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
|
|
@ -35,14 +35,14 @@ function exec_ogp_module()
|
|||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$query = "INSERT INTO GSP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function exec_ogp_module()
|
|||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ function exec_ogp_module()
|
|||
if(isset($_GET['cart_id'])){
|
||||
$cart_id = $_GET['cart_id'];
|
||||
}
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin ){
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
} else {
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
}
|
||||
if( !empty($orders) and !empty($cart_paid) )
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ function exec_ogp_module()
|
|||
$extended = $order['extended'] == "1" ? TRUE : FALSE;
|
||||
//Query service info
|
||||
$service = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
FROM GSP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
|
||||
if( !empty( $service[0] ) )
|
||||
|
|
@ -131,7 +131,7 @@ function exec_ogp_module()
|
|||
|
||||
//Add IP:Port Pair to the Game Home
|
||||
//need to get the IP_ID for this remote server.
|
||||
$result = $db->resultQuery("SELECT ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
$result = $db->resultQuery("SELECT ip_id FROM GSP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
foreach ($result as $rs)
|
||||
{
|
||||
$ip_id = $rs['ip_id'];
|
||||
|
|
@ -336,33 +336,33 @@ function exec_ogp_module()
|
|||
|
||||
}
|
||||
// set order status
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET status='" . $db->realEscapeSingle($status) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// set the order expiration
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET finish_date='" . $db->realEscapeSingle($finish_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// Save home id created by this order
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET home_id='" . $db->realEscapeSingle($home_id) . "' WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
}
|
||||
|
||||
//Update Cart Payment Status as 3(paid and installed)
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=3
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
// Set payment/creation date
|
||||
$date = date('d M Y');
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET date='" . $db->realEscapeSingle($date) . "'
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
|
||||
|
||||
//Refresh to Game Monitor.
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ if (strcmp ($res, "VERIFIED") == 0) {
|
|||
$receiver_email = $_POST['receiver_email'];
|
||||
$payer_email = $_POST['payer_email'];
|
||||
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
fwrite($fpx, "IPN Processed\n");
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ $module_menus = array(
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_services`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_services` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_services`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_services` (
|
||||
`service_id` int(11) NOT NULL auto_increment,
|
||||
`home_cfg_id` int(11) NOT NULL,
|
||||
`mod_cfg_id` int(11) NOT NULL,
|
||||
|
|
@ -58,8 +58,8 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`service_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
|
|
@ -81,16 +81,16 @@ $install_queries[0] = array(
|
|||
);
|
||||
|
||||
$install_queries[1] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_carts`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_carts` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_carts`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_carts` (
|
||||
`cart_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`paid` int(11) NULL,
|
||||
PRIMARY KEY (`cart_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
|
|
@ -111,25 +111,25 @@ $install_queries[1] = array(
|
|||
);
|
||||
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `date`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `home_path`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `paid`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `home_id` varchar(255) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `status` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `date` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `tax_amount` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `currency` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `date`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `home_path`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `paid`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `home_id` varchar(255) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `status` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `date` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `tax_amount` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `currency` varchar(3) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `finish_date` varchar(16) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `finish_date` varchar(16) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[4] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `extended` tinyint(1) NOT NULL;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_services` ADD `enabled` int(11) NOT NULL;"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `extended` tinyint(1) NOT NULL;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_services` ADD `enabled` int(11) NOT NULL;"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ function exec_ogp_module()
|
|||
|
||||
if(isset($_POST['remove']))
|
||||
{
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
if(isset($_POST['paid']))
|
||||
{
|
||||
$query_set_as_paid = $db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$query_set_as_paid = $db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ function exec_ogp_module()
|
|||
echo "<h1>Accounting</h1>";
|
||||
$servercount = 0;
|
||||
$income = 0;
|
||||
$paidOrders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE status > 0");
|
||||
$paidOrders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE status > 0");
|
||||
foreach($paidOrders as $inc)
|
||||
{
|
||||
$servercount = $servercount +1;
|
||||
|
|
@ -70,9 +70,9 @@ function exec_ogp_module()
|
|||
{
|
||||
{
|
||||
if ($isAdmin){
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." order by cart_id DESC");
|
||||
$carts = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." order by cart_id DESC");
|
||||
}else{
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid=3 AND user_id = " . $user_id ." order by cart_id DESC");
|
||||
$carts = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE paid=3 AND user_id = " . $user_id ." order by cart_id DESC");
|
||||
}
|
||||
if( $carts > 0 )
|
||||
{
|
||||
|
|
@ -97,7 +97,7 @@ function exec_ogp_module()
|
|||
}?>
|
||||
</tr>
|
||||
<?php
|
||||
$orders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart['cart_id'])." order by order_id DESC" );
|
||||
$orders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart['cart_id'])." order by order_id DESC" );
|
||||
$subtotal = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ function exec_ogp_module()
|
|||
//obter as informações de cupom usadas neste pedido
|
||||
$coupon_savings = 0;
|
||||
if($cart['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart['coupon_id'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_coupons WHERE id = '". $cart['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal * ($coupon['discount']/ 100);
|
||||
echo "Sub-total c/discount <b>$" .number_format( ($subtotal - $coupon_savings) , 2 ).$cart['currency']."</b></br><td>";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ global $db,$view,$settings;
|
|||
$loadpage = "?m=billing&p=paid";
|
||||
$count = $_POST['count'] + 1;
|
||||
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_carts WHERE cart_id= '". $_POST['cart_id'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_carts WHERE cart_id= '". $_POST['cart_id'] . "'");
|
||||
foreach($result as $cartID){
|
||||
$paid = $cartID['paid'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ $debug = $settings['debug'];
|
|||
|
||||
if(!empty($cart_id))
|
||||
{
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
//get couponID then discount for this cart
|
||||
$result= $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
$result= $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
foreach ($result as $cartDB){
|
||||
$coupon_id = $cartDB['id'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$service = $db->realEscapeSingle($_POST['service']);
|
||||
|
||||
//Create UPDATE query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_services
|
||||
SET remote_server_id = '".$new_remote_server_id."',
|
||||
price_monthly ='".$new_price_monthly."',
|
||||
remote_server_id = '".$new_remote_server_id."',
|
||||
|
|
@ -28,7 +28,7 @@ function exec_ogp_module()
|
|||
//Querying UPDATE enabled/disabled remote servers DB
|
||||
if (isset($_POST['update_remote_servers']))
|
||||
{
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXremote_servers");
|
||||
foreach($result as $rs)
|
||||
{
|
||||
$server_enabled = 0;
|
||||
|
|
@ -40,7 +40,7 @@ function exec_ogp_module()
|
|||
}
|
||||
|
||||
//update the table with current value
|
||||
$query = "UPDATE OGP_DB_PREFIXremote_servers SET enabled = '".$server_enabled."' WHERE remote_server_id=".$rs['remote_server_id'];
|
||||
$query = "UPDATE GSP_DB_PREFIXremote_servers SET enabled = '".$server_enabled."' WHERE remote_server_id=".$rs['remote_server_id'];
|
||||
$db->query($query);
|
||||
|
||||
}
|
||||
|
|
@ -83,14 +83,14 @@ function exec_ogp_module()
|
|||
if(isset($_POST['allow_ftp_usage']))$access_rights .= $db->realEscapeSingle($_POST['allow_ftp_usage']);
|
||||
if(isset($_POST['allow_custom_fields']))$access_rights .= $db->realEscapeSingle($_POST['allow_custom_fields']);
|
||||
|
||||
$qry_add_service = "INSERT INTO OGP_DB_PREFIXbilling_services(service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, out_of_stock, slot_max_qty , slot_min_qty, price_daily, price_monthly, price_year, description, img_url, ftp, install_method, manual_url, access_rights,enabled) VALUES(NULL, '".$home_cfg_id."', '".$mod_cfg_id."', '".$service_name."', '".$remote_server_id."', 0,'".$slot_max_qty."', '".$slot_min_qty."', '".$price_daily."', '".$price_monthly."', '".$price_year."', '".$description."', '".$img_url."', '".$ftp."', '".$install_method."', '".$manual_url."', '".$access_rights."', '" . $enabled . "')";
|
||||
$qry_add_service = "INSERT INTO GSP_DB_PREFIXbilling_services(service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, out_of_stock, slot_max_qty , slot_min_qty, price_daily, price_monthly, price_year, description, img_url, ftp, install_method, manual_url, access_rights,enabled) VALUES(NULL, '".$home_cfg_id."', '".$mod_cfg_id."', '".$service_name."', '".$remote_server_id."', 0,'".$slot_max_qty."', '".$slot_min_qty."', '".$price_daily."', '".$price_monthly."', '".$price_year."', '".$description."', '".$img_url."', '".$ftp."', '".$install_method."', '".$manual_url."', '".$access_rights."', '" . $enabled . "')";
|
||||
$db->query($qry_add_service);
|
||||
}
|
||||
|
||||
//Querying REMOVE service FROM DB
|
||||
if (isset($_POST['service_id']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_services WHERE service_id=" . $db->realEscapeSingle($_POST['service_id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_services WHERE service_id=" . $db->realEscapeSingle($_POST['service_id']) );
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -106,7 +106,7 @@ function exec_ogp_module()
|
|||
<td>
|
||||
<select name="modcfgid">
|
||||
<?php
|
||||
$mod_qry = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE home_cfg_id=" . $db->realEscapeSingle($_POST['home_cfg_id']));
|
||||
$mod_qry = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM GSP_DB_PREFIXconfig_mods NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE home_cfg_id=" . $db->realEscapeSingle($_POST['home_cfg_id']));
|
||||
foreach($mod_qry as $array_mods)
|
||||
{
|
||||
if($array_mods['mod_name'] == "none")$array_mods['mod_name']=$array_mods['game_name'];
|
||||
|
|
@ -128,7 +128,7 @@ function exec_ogp_module()
|
|||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$result3 = $db->resultQuery("SELECT DISTINCT remote_server_id, remote_server_name, agent_ip, ogp_user FROM OGP_DB_PREFIXremote_servers");
|
||||
$result3 = $db->resultQuery("SELECT DISTINCT remote_server_id, remote_server_name, agent_ip, ogp_user FROM GSP_DB_PREFIXremote_servers");
|
||||
?>
|
||||
<td><?php print_lang('remote_server');?></td>
|
||||
<td>
|
||||
|
|
@ -146,7 +146,7 @@ function exec_ogp_module()
|
|||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$mods = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE mod_cfg_id=" . $db->realEscapeSingle($_POST['modcfgid']));
|
||||
$mods = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM GSP_DB_PREFIXconfig_mods NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE mod_cfg_id=" . $db->realEscapeSingle($_POST['modcfgid']));
|
||||
foreach($mods as $mod)
|
||||
{
|
||||
?>
|
||||
|
|
@ -257,7 +257,7 @@ function exec_ogp_module()
|
|||
<h2>Enable/Disable Server Locations</h2>
|
||||
<?php
|
||||
//ENABLE OR DISABLE REMOTE SERVERS FOR GAMES
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXremote_servers");
|
||||
echo "<form method='post' action=''>";
|
||||
echo "<input type='hidden' name='update_remote_servers' value='update' />";
|
||||
foreach($result as $rs)
|
||||
|
|
@ -278,7 +278,7 @@ function exec_ogp_module()
|
|||
<br><br>";
|
||||
//end ENABLE REMOTE SERVERS
|
||||
|
||||
$services = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_services ORDER BY service_name");
|
||||
$services = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_services ORDER BY service_name");
|
||||
if ($services > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function exec_ogp_module()
|
|||
$new_description = str_replace("\\r\\n", "<br>", $_POST['description']);
|
||||
$service = $_POST['service_id'];
|
||||
|
||||
$change_description = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
$change_description = "UPDATE GSP_DB_PREFIXbilling_services
|
||||
SET description ='".$db->realEscapeSingle($new_description)."'
|
||||
WHERE service_id=".$db->realEscapeSingle($service);
|
||||
$save = $db->query($change_description);
|
||||
|
|
@ -63,7 +63,7 @@ THIS IS WHAT WE DISPLAY ON THE SHOP PAGE AT THE TOP
|
|||
|
||||
// Shop Form
|
||||
if(intval($_REQUEST['service_id']) !==0) $where_service_id = " WHERE enabled = 1 and service_id=".intval($_REQUEST['service_id']); else $where_service_id = " where enabled = 1";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$qry_services = "SELECT * FROM GSP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
|
||||
if (isset($_REQUEST['service_id']) && $services === false) {
|
||||
|
|
@ -208,7 +208,7 @@ if ($row['price_monthly'] == 0.0) {
|
|||
//loop through each of the assigned servers and see if its disabled
|
||||
foreach($rsiArray as $rsi)
|
||||
{
|
||||
$query = "SELECT * FROM OGP_DB_PREFIXremote_servers WHERE remote_server_id = ".$rsi;
|
||||
$query = "SELECT * FROM GSP_DB_PREFIXremote_servers WHERE remote_server_id = ".$rsi;
|
||||
$result = $db->resultQuery($query);
|
||||
foreach($result as $rs)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue