-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.php
159 lines (143 loc) · 7.22 KB
/
Home.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
<?php
//error_reporting(E_ALL);
//ini_set("display_errors", 1);
ob_start();
session_start();
if(!isset($_SESSION['UserID']) && empty($_SESSION['UserID'])) {
header("Location: index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta charset="UTF-8">
<title>Webchat - Home</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script src="js/jquery211.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.css">
<!-- Optional theme -->
<link rel="stylesheet" href="css/bootstrap-theme.css">
<!-- Latest compiled and minified JavaScript -->
<script src="js/bootstrap.js"></script>
<script src="js/functions.js"></script>
<link rel="stylesheet" href="css/homeStyle.css">
<!-- modernizr cdn -->
<script src="http://cdn.jsdelivr.net/webshim/1.12.4/extras/modernizr-custom.js"></script>
<!-- polyfiller file to detect and load polyfills -->
<script src="http://cdn.jsdelivr.net/webshim/1.12.4/polyfiller.js"></script>
<script>
webshims.setOptions('waitReady', false);
webshims.setOptions('forms-ext', {types: 'date'});
webshims.polyfill('forms forms-ext');
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#privMsg, #ChatMessages").animate({ scrollTop: "+=5000000" }, "slow");
//$(".testclass").html("<a href='Home.php?page=private'><p>Messages<img style='vertical-align:middle' src='http://png-2.findicons.com/files/icons/1676/primo/128/label_blue_new.png' height='25' width='25'/></p></a>");
//jQuery(".testclass[href$='Home.php?page=private']").after("<span style='margin-right:50px;'><img src='http://devps1.marefx.com/pma/themes/pmahomme/img/b_drop.png'><span/>");
});
</script>
<?php
if(isset($_GET['page']) && $_GET['page'] == "country" || isset($_GET['page']) && $_GET['page'] == "social"){
echo '<script src="http://code.highcharts.com/highcharts.js"></script>';
echo '<script src="http://code.highcharts.com/modules/exporting.js"></script>';
echo '<script src="js/charts.js" type="text/javascript"></script>';
}
?>
</head>
<body>
<div id="hiddenOnline"></div>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<button class="navbar-toggle" data-toggle="collapse" data-target="#navHeaderCollapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse" id="navHeaderCollapse">
<ul class="nav navbar-nav navbar-left">
<li><a href="Home.php">Home</a></li>
<li><a href="Home.php?page=profile">Profile</a></li>
<li><a href="Home.php?page=private">Messages</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Statistics<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="Home.php?page=country">Country</a></li>
<li><a href="Home.php?page=social">Social login</a></li>
</ul>
</li>
<?php
include "pages/class.php";
$id = new user();
$id->setUserID($_SESSION['UserID']);
if($id->CheckAdmin()){
echo "<li><a href='Home.php?page=admincp'>AdminCP</a></li>";
}
?>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search users" name="q">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
<ul class="nav navbar-nav navbar-right">
<?php
if(isset($_SESSION['Username'])) {
echo '<li><a href="#" id="UserProfile">Logged in as '. htmlspecialchars($_SESSION['Username']) .'</a></li>';
if(isset($_SESSION) && $_SESSION['Type'] == 2) {
echo '<li><a href="#Logout" id="LogoutUser">Logout</a></li>';
} else {
echo '<li><a href="#Logout" id="LogoutUser">Logout</a></li>';
}
}
?>
</ul>
</div>
</div>
</div>
<div class="container" id="ContMove">
<div class="row">
<?php
if(isset($_GET['page']) && $_GET['page'] == "profile"){
include 'pages/profile.php';
} elseif(isset($_GET['page']) && $_GET['page'] == "private"){
include 'pages/pmsg.php';
} elseif(isset($_GET['page']) && $_GET['page'] == "country" || isset($_GET['page']) && $_GET['page'] == "social"){
include 'pages/stats.php';
} elseif(isset($_GET['q'])){
include 'pages/searchUsers.php';
} elseif(isset($_GET['page']) && $_GET['page'] == "admincp"){
include 'pages/admincp.php';
} else {
?>
<div class="col-xs-10">
<div id="ChatBig">
<div id="ChatMessages">
</div>
<textarea id="ChatText" name="Message" placeholder="Enter message..."></textarea>
</div>
</div>
<div class="col-xs-2">
<div id="OnlineList">
<span style="font-weight: bold;">Users online</span>
<div id="ListOnlineUsers">
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</body>
</html>
<?php
ob_flush();
?>