-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcart.php
More file actions
145 lines (112 loc) · 4.38 KB
/
cart.php
File metadata and controls
145 lines (112 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
#################################################################
## WHMX Billing system for cPanel / WHM ##
##-------------------------------------------------------------##
## Version: 1.00 - ENVATO MARKET ##
##-------------------------------------------------------------##
## Author: Gianck Luiz obviosistemas@gmail.com ##
##-------------------------------------------------------------##
## Copyright ©2016 . All rights reserved. ##
##-------------------------------------------------------------##
#################################################################
session_start();
ob_start();
require_once("adm/config/conexao.class.php");
require_once("adm/config/crud.class.php");
require_once("adm/config/mega.class.php");
$con = new conexao();
$con->connect();
$dbconfig = mysql_query("SELECT * FROM config WHERE id = '1'");
$config = mysql_fetch_array($dbconfig);
$thema = $config['thema'];
use megaphp\view\MVC;
$tpl = new MVC("theme/$thema/cart.html");
$tpl->addFile("NAVBAR", "theme/$thema/inc/navbar.html");
$tpl->addFile("DEMO", "theme/$thema/inc/demo.html");
$tpl->addFile("FOOTER", "theme/$thema/inc/footer.html");
// SESSION
//LOGADO
if ( !isset($_SESSION['id']) ){
$tpl->block("BLOCK_NAO_LOGADO");
} else {
$idbase = $_SESSION['id'];
$cslogin = mysql_query("SELECT * FROM customers WHERE id = + $idbase");
$logado = mysql_fetch_array($cslogin);
$tpl->USER_NAME = $logado['name'];
$tpl->block("CHAT_LOGIN");
$tpl->block("BLOCK_LOGADO");
}
$a = (isset ( $_GET ['a'] ) ? $_GET ['a'] : 'a');
switch ($a) {
case 'hosting' :
$grp = anti_injection($_GET['grp']);
$queryprd = mysql_query("SELECT * FROM products WHERE status = 'S' AND p_group = '$grp' order by id DESC");
$total = mysql_num_rows($queryprd);
while($prd = mysql_fetch_array($queryprd)){
$tpl->PRODUCT_ID = $prd['id'];
$tpl->PRODUCT_NAME = $prd['product'];
$tpl->PRODUCT_DESCRIPTION = $prd['description'];
$tpl->PRODUCT_PRICE = number_format($prd['price'],2,'.','');
$tpl->block("BLOCK_PRODUCTS");
}
break;
case 'confproduct' :
$tpl->IDERPS = anti_injection($_GET['id']);
$idp = $_GET['id'];
$tps = mysql_query("SELECT * FROM temp_cart WHERE id = '$idp'");
$tmp = mysql_fetch_array($tps);
$tld = $tmp['tld'];
$domn = mysql_query("SELECT * FROM tdl WHERE tdl = '$tld'");
$dmn = mysql_fetch_array($domn);
$tpl->DOMAIN = $tmp['domain'];
$tpl->TLD = $tmp['tld'];
$tpl->DNS1 = $tmp['dns1'];
$tpl->DNS2 = $tmp['dns2'];
$tpl->DNS3 = $tmp['dns3'];
$tpl->DNS4 = $tmp['dns4'];
$tpl->PERIOD = $dmn['period'];
$tpl->block("BLOCK_CONFIGDOMAINS");
break;
case 'add' :
$querytld = mysql_query("SELECT * FROM tdl order by id ASC");
while($tld = mysql_fetch_array($querytld)){
$tpl->TLD_TLD = $tld['tdl'];
if($tld['tdl'] == $_GET['tld']) { $tpl->SELECTED = "selected"; } else { $tpl->SELECTED = ""; }
$tpl->block("BLOCK_SELECT_TLD");
}
$tpl->block("BLOCK_FORM");
break;
case 'domain' :
$tld = $_SESSION['tld'];
$domn = mysql_query("SELECT * FROM tdl WHERE tdl = '$tld'");
$dmn = mysql_fetch_array($domn);
$tpl->PRICE_DOMAIN = $dmn['amount'];
$tpl->ACTIVE_DOMAIN = "active";
$tpl->PERIOD = $dmn['period'];
$tpl->block("BLOCK_DOMAINS");
break;
case 'home' :
default :
$tpl->block("BLOCK_NONE");
break;
}
$querygrp = mysql_query("SELECT * FROM groups order by name ASC");
while($grp = mysql_fetch_array($querygrp)){
$tpl->GROUP_ID = $grp['id'];
$tpl->GROUP_NAME = $grp['name'];
if($grp['id'] == $_GET['grp']) { $tpl->ACTIVE_PRODUCT = "active"; } else { $tpl->ACTIVE_PRODUCT = ""; }
$tpl->block("BLOCK_GROUPS");
}
$tpl->TLD = $_GET['tld'];
$tpl->DOMAIN = $_GET['sld'];
$tpl->PPID = $_GET['ppid'];
$tpl->PRICE_P = $_POST['price_p'];
$tpl->TOKEN = rand_char(2);
$tpl->BASE = $config['base'];
$tpl->TITLE = $config['title'];
$tpl->COMPANY = $config['company'];
$tpl->CURRENCY = $config['moeda'];
$tpl->PAGELANG = basename($_SERVER['PHP_SELF']);
// SHOW TPL
$tpl->show();
?>