-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.php
More file actions
87 lines (75 loc) · 1.96 KB
/
test.php
File metadata and controls
87 lines (75 loc) · 1.96 KB
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
<?php
/*function __autoload($class_name) {
include 'class.' . $class_name . '.inc';
}
*/
include_once 'includes/classes.php';
session_start();
$userid = '';
$password = '';
$admin = new Admin;
$adminDetails = $admin->getDetails($_SESSION['user_id']);
/*
if(isset($_POST['submitPatient'])) {
echo "this is a test";
$userid = intval($_POST['patient']);
$password = ($_POST['patientPassword']);
echo var_dump('userid');
$patient = $admin->register_Patient($userid, $password);
if($patient) {
echo "<script> alert('Patient account successfully created'); </script>";
header('Location: index.php');
}
}
elseif (isset($_POST['submitDoctor'])) {
$userid = $_POST['doctorID'];
$password = $_POST['doctorPassword'];
$doctor = $admin->register_Doctor($user_id, $password);
if($doctor) {
echo "<script> alert('Doctor account successfully created'); </script>";
}
}
$user_id = 1005;
$password = 'kuiler';
$error = " ";
$user = new User(array(
'id' => $user_id,
'password' => $password,
));
$userinfo = array();
$userinfo = $user->login();
if($userinfo) {
if($userinfo['user_status'] == 3) {
$_SESSION['user_id'] = $userinfo['user_id'];
header('Location: patient.php');
}
elseif ($userinfo['user_status'] == 1) {
$_SESSION['user_id'] = $userinfo['user_id'];
header('Location: admin.php');
}
elseif ($userinfo['user_status'] == 2) {
$_SESSION['user_id'] = $userinfo['user_id'];
header('Location: doctor.php');
}
elseif ($userinfo['user_status'] == 4) {
$_SESSION['user_id'] = $userinfo['user_id'];
header('Location: pharm.html');
}
else {
header('Location: index.php');
}
}
else {
echo "<span>$user->error_message</span>";
$doc = new DOMDocument();
$a = $doc->getElementById('error');
}*/
$admin = new Admin;
$Doctor = new Doctor;
$user_id = "10264985";
$password = 'juilersa';
$user = $Doctor->ValidateID($user_id);
if($user) {
echo "Successful";
}
?>