-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
42 lines (34 loc) · 944 Bytes
/
index.php
File metadata and controls
42 lines (34 loc) · 944 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>AllMedical</title>
<?php
session_start();
if(!isset($_SESSION['email'])) {
header("Location: /wad/login"); }
define('DB_HOST', 'localhost');
define('DB_NAME', 'wad');
define('DB_USER','root');
define('DB_PASSWORD','');
$con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
$db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
$uid = $_SESSION['email'];
$query = mysql_query("SELECT * FROM `user-info` where uid = '$uid'") or die(mysql_error());
$row = mysql_fetch_array($query) or die("Failed " . mysql_error());
$usertype = $row['usertype'];
switch ($usertype) {
case "admin":
include 'admin_home.php';
break;
case "doctor":
include 'doctor_home.php';
break;
case "pacient":
include 'pacient_home.php';
break;
}
?>
</head>
<body>
</body>
</html>