-
Notifications
You must be signed in to change notification settings - Fork 6
/
validate.php
234 lines (220 loc) · 10.8 KB
/
validate.php
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?php
session_start();
include 'configuration/connection.php'; //connection
include 'controller/InsertController.php'; // insertion Controller
include 'controller/AuthController.php'; // Auth Controller
require 'controller/SelectController.php'; // Select Controller
require 'controller/FuncController.php'; // Function Controller
require 'controller/EmailController.php'; // Function Controller
require 'controller/DeleteController.php'; // Function Controller
$c_Del = new Delete_Controller(); // Delete controller declarati0n
$c_con = new ClassConnection(); // connection declaration
$c_InsertControl = new Insert_Controller(); // Insertion controller declaration
$c_Auth = new Auth_Controller(); // Auth controller Decleration
$c_Select = new Select_Controller(); // Select controller declaration
$c_Func = new Func_Controller(); // Select controller declaration
$c_email = new Email_Controller(); // Delete controller declarati0n
$logsURL = "local";
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
$url = "https://";
else
$url = "https://";
// Append the host(domain name, ip) to the URL.
$url.= $_SERVER['HTTP_HOST']."/aa";
$logsURL = $url;
$conn = $c_con->f_connection();
if ($conn==="fail")
{
echo '<center><h1>Connection Failed</h1></center>';
}
else
{
if(isset($_GET["data"]))
{
$data = $_GET["data"];
if (strtoupper($data) == "LOGIN" ||
strtoupper($data) == "REGISTER" ||
strtoupper($data) == "FORGOTPASS" ||
strtoupper($data) == "LOGOUT" ||
strtoupper($data) == "TWOAUTHFACTOR")
{
echo '<!DOCTYPE html>
<html class="no-js">';
include "view/partial/head.php";
echo '<body class="hold-transition login-page">';
if(strtoupper($data) == "LOGIN")
{
if (isset($_SESSION["username"]))
{
header("Location: ".$url."/home");
}
else
{
include "view/auth/login.front.php";
}
}
else if(strtoupper($data) == "REGISTER")
{
include "view/auth/register.front.php";
}
else if(strtoupper($data) == "FORGOTPASS")
{
include "view/auth/forgotpassword.php";
}
else if(strtoupper($data) == "TWOAUTHFACTOR")
{
include "view/auth/2authfactor.front.php";
}
else if(strtoupper($data) == "LOGOUT")
{
header("Location: ".$url."/logout.php");
}
else
{
print "404";
print $data;
}
include "view/partial/js.php";
echo '</body></html>';
}
else if (strtoupper($data) == "HOME" ||
strtoupper($data) == "RESETPASSWORD" ||
strtoupper($data) == "ADDNEWRESELLER" ||
strtoupper($data) == "ADDQUICKUSER"||
strtoupper($data) == "ADDBULKUSER")
{
if (isset($_SESSION["username"]))
{
echo '<!DOCTYPE html>
<html>';
include 'view/partial/admin.head.php';
echo '<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">';
include 'view/partial/admin.navbar.php';
include 'view/partial/admin.aside.php';;
echo '<div class="content-wrapper">';
if(strtoupper($data) == "HOME")
{
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php';
include 'view/body/dashboard.body.php';
}
else if(strtoupper($data) == "ADDQUICKUSER") //addquickuser
{
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php';
include 'view/body/form.body.php';
}
else if(strtoupper($data) == "ADDBULKUSER") //addquickuser
{
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php';
include 'view/body/form.body.php';
}
else
{
$Dashboard_100 = "404";
include 'view/partial/admin.dashboard.php';
echo '<center><h1> 404 Not Found </h1></center>';
}
echo ' </div>';
include 'view/partial/admin.footer.php';
echo
'<aside class="control-sidebar control-sidebar-dark">
</aside>
</div>';
include 'view/partial/admin.js.php';
echo '</body>
</html>';
}
else
{
header("Location: ".$url."/home/login");
}
}
else if (strtoupper($data) == "HISTORY" ||
strtoupper($data) == "VIEWALLUSER" ||
strtoupper($data) == "VIEWRESELLER" ||
strtoupper($data) == "VIEWBLOCKUSER"||
strtoupper($data) == "VIEWACTIVEUSER")
{
if (isset($_SESSION["username"]))
{
echo '<!DOCTYPE html>
<html>';
include 'view/partial/table.head.php';
echo '<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">';
include 'view/partial/admin.navbar.php';
include 'view/partial/admin.aside.php';;
echo '<div class="content-wrapper">';
if(strtoupper($data) == "HISTORY")
{
$tableLogs = "View All Credits History";
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php';
include 'view/body/viewuser.body.php';
}
else if(strtoupper($data) == "VIEWALLUSER")
{
$tableLogs = "View All Users";
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php'; //viewuser.dashboard.php
include 'view/body/viewuser.body.php';
//print "home/about";
}
else if(strtoupper($data) == "VIEWRESELLER")
{
$tableLogs = "View All Reseller";
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php'; //viewuser.dashboard.php
include 'view/body/viewuser.body.php';
//print "home/about";
}
else if(strtoupper($data) == "VIEWBLOCKUSER")
{
$tableLogs = "View All Block User";
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php'; //viewuser.dashboard.php
include 'view/body/viewuser.body.php';
//print "home/about";
}
else if(strtoupper($data) == "VIEWACTIVEUSER")
{
$tableLogs = "View All Active User";
$Dashboard_100 = strtoupper($data);
include 'view/partial/admin.dashboard.php'; //viewuser.dashboard.php
include 'view/body/viewuser.body.php';
//print "home/about";
}
else
{
$Dashboard_100 = "404";
include 'view/partial/admin.dashboard.php';
echo '<center><h1> 404 Not Found </h1></center>';
}
echo ' </div>';
include 'view/partial/admin.footer.php';
echo
'<aside class="control-sidebar control-sidebar-dark">
</aside>
</div>';
include 'view/partial/table.js.php';
echo '</body>
</html>';
}
else
{
header("Location: ".$url."/home/login");
}
}
else
{
echo '<center><h1>404 BAD REQUEST</h1><center>';
}
}
else{
print "Error";
}
}
?>