-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
executable file
·113 lines (81 loc) · 2.59 KB
/
main.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
<?php
/*
* Author: bixbyte
* For: The University Of Eastern Africa Baraton
*/
/* Database connection variables ... and more! */
header('X-Powered-By: iara-m4labs');
@session_start();
$inactive = 18000000000000000;
if(isset($_SESSION['timeout'])){
@$session_life = time() - @$_SESSION['timeout'];
if(@$session_life > $inactive){
@session_destroy();
header("Location: index.php");
}
}
@$_SESSION['timeout'] = time();
date_default_timezone_set("Africa/Nairobi");
$this_site = "http://41.89.162.20/roomres/";
//$db = 'roomres'; $host = 'localhost'; $user = 'roomres';
//$pass = '2055160roomres15@#';
$db = "roomres"; $host = "localhost"; $user = "root";
$pass = "746450f7";
/*End of database connection variables*/
if(@$id != ''){
/* if(!isset($_SESSION['currpage'])){
@session_start();
} */
// WARNING ONLY ADD PAGES THAT ARE FULLY CLASSES OR PURELY FUNCTIONS TO THIS ARRAY Else Face the wrath of a broken connection
$ids = array('',
'add_admin.php',
'add_login.php',
'add_recovery.php',
'add_reservant.php',
'add_reservation.php',
'add_residence.php',
'add_room.php',
'add_trimester.php',
'admin_rooms.php',
'alter_admin.php',
'de_allocate.php',
'mailer.php', //Primary
'obsfucate.php', //primary
'search.php', //Primary
'the_connection.php', //Primary
'redirect.php' //Primary
);
$pos = array_search($id, $ids);
if($ids[$pos]==''){$ids[$pos] = 'unknown';}
$_SESSION['currpage'] = "<code style='color:red'>".$ids[$pos]."</code>";
//echo "current page: ".$_SESSION['currpage']."<br />";
/*
include 'add_residence.php';
include 'the_connection.php';
include 'redirect.php';
...
*/
for($i = 0; $i <= (count($ids)-1); $i++){
if($i <> $pos){
if($ids[$i] != ''){
include "$ids[$i]";
}
}
}
//Establish a database connection where required
if(@$connect){
$connection = new connection($db, $host, $user, $pass);
if(@$_SESSION['trim_name'] == '' || @$_SESSION['trim_id'] == ''){
$connection->query("SELECT * FROM trimester ORDER BY id DESC LIMIT 1", false);
$tridtz = $_SESSION['query'];
$_SESSION['query'] = "";
while($trims = mysqli_fetch_array($tridtz)){
$_SESSION['trim_name'] = $trims['name'];
$_SESSION['trim_id'] = $trims['id'];
}
}
}
}else{
die("<center><h2><code style='color:#F00;'>Critical Error:</code><code style='color:green;'> Failed to recognize this page!</code> </h2></center>");
}
?>