This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
head.php
129 lines (119 loc) · 4.71 KB
/
head.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
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<meta name='description' content=''>
<meta name='author' content=''>
<script type='text/javascript' src='js/firebase/firebase.js'></script>
<script type='text/javascript' src='js/firebase/idle.js'></script>
<script type='text/javascript' src='js/tokbox/TB.min.js'></script>
<script type='text/javascript' src='js/jquery/jquery-1.10.2.min.js'></script>
<script type='text/javascript' src='js/bootstrap/bootstrap.min.js'></script>
<script type='text/javascript' src='js/bootstrap/offcanvas.js'></script>
<script type='text/javascript' src='js/chat.js'></script>
<link rel='stylesheet' href='styles/bootstrap/bootstrap.css' type='text/css'/>
<link rel='stylesheet' href='styles/bootstrap/jumbotron.css' type='text/css'>
<link rel='stylesheet' href='styles/bootstrap/offcanvas.css' type='text/css'>
<!--<link rel='stylesheet' href='styles/styles.css' type='text/css'/>-->
<link rel='icon' type='image/png' href='img/favicon.png'>
<?php
//Report all errors
ini_set('display_errors',1);
error_reporting(E_ALL);
//Start the session
session_start();
//db and other functions
require_once 'functionsneeded.php';
//tokbox SDK
require_once 'tokbox/Opentok-PHP-SDK/OpenTokSDK.php';
require_once 'tokbox/Opentok-PHP-SDK/OpenTokArchive.php';
require_once 'tokbox/Opentok-PHP-SDK/OpenTokSession.php';
//For video communication
require_once 'tok.php';
$userstr = 'Guest';
$user = 'Guest';
//Check to see if the user is logged-in
if(isset($_SESSION['user'])) {
$user = $_SESSION['user'];
$logInStatus = TRUE;
$userstr = "";
//Count the user as being online (for Firebase)
echo "<script type='text/javascript' src='js/onlineList.js'></script>";
//Print the user as a globally accessible javascript variable
echo "<script type='text/javascript'>var user = " . $_SESSION['user'] . ";</script>";
} else {
$logInStatus = FALSE;
}
//Place the rest of the head and the start of the body
echo "<title>MedConnect - $userstr</title>
</head>
<body>";
//Fixed navbar
echo
"<div class='navbar navbar-inverse navbar-fixed-top'>
<div class='container'>
<div class='navbar-header'>
<button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>
<span class='icon-bar'></span>
<span class='icon-bar'></span>
<span class='icon-bar'></span>
</button>
<a class='navbar-brand' href='index.php'>MedConnect</a>
</div>
<div class='navbar-collapse collapse'>
<ul class='nav navbar-nav'>
<li class='active'><a href='index.php'>Home</a></li>";
if($logInStatus) {
echo "<li><a href='webcam.php'>Consult</a></li>";
} else {
echo "<li><a href='about.php'>About</a></li>";
}
echo
"<li><a href='listOfDoctors.php'>List of Doctors</a></li>";
if($logInStatus) {
echo "<li class='dropdown'>
<a href='#' class='dropdown-toggle' data-toggle='dropdown'>My MedConnect<b class='caret'></b></a>
<ul class='dropdown-menu'>
<li><a href='#'>Manage Favorites</a></li>
<li><a href='viewProfile.php?userToDisplay=$user'>View Profile</a></li>
<li class='divider'></li>
<li><a href='editProfile.php'>Edit My Profile</a></li>
<li><a href='#'>Settings</a></li>
</ul>
</li>";
}
echo
"</ul>
<!--<form method='post' action='search.php' width='75px'>
<div class='form-group' width='75px'>
<input type='text' name='search' placeholder='Search MedConnect' class='form-control' width='75px'>
<button type='submit' class='btn btn-success'>Search</button>
</div>
</form>-->";
if(!$logInStatus) { //If they are not logged in, let them log in or register
echo
"<form class='navbar-form navbar-right' action='createAccount.php'>
<button type='submit' class='btn btn-success'>Register</button>
</form>
<form class='navbar-form navbar-right' method='post' action='login.php'>
<div class='form-group'>
<input type='text' placeholder='Email' maxlength='16' name='enteredUsername' class='form-control'>
</div>
<div class='form-group'>
<input type='password' placeholder='Password' maxlength='16' name='enteredPass' class='form-control'>
</div>
<button type='submit' class='btn btn-success'>Sign in</button>
</form>";
} else { //They are logged in, show them profile info
echo
"<form class='navbar-form navbar-right' action='logout.php'>
<button type='submit' class='btn btn-success'>Log Out</button>
</form>";
}
echo
"</div><!--/.navbar-collapse -->
</div>
</div>";
?>