-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetail.php
More file actions
149 lines (123 loc) · 3.64 KB
/
detail.php
File metadata and controls
149 lines (123 loc) · 3.64 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>AllMedical</title>
<style title="MainDiv">
body {
background-image: url(img/background.jpg);
font-family: Helvetica;
font-weight: bold;
font-size: 12px;
color: #424242;
}
div {
background-color: #BFBFBF;
alignment-adjust: central;
background-image: url(img/background-div.png);
}
img {
border: 20px solid rgba(255, 0, 0, 0);
background-clip: padding-box;
}
a:link {
color: #373737;
text-decoration: none;
}
a:visited {
color: #373737;
}
a:hover {
color: #5B5B5B;
}
a:active {
color: #373737;
}
#center {
margin-left: auto;
margin-right: auto;
width: 500px;
border-radius: 1px;
box-shadow: 0px 0px 0px 8px rgba(0,0,0,0.3);
}
#create {
background-color: rgba(0, 0, 0, 0);
width: 274px;
height: 48px;
background-image: url(img/create.png);
}
#logo {
background-color: rgba(0, 0, 0, 0);
width: 416px;
height: 95px;
background-image: url(img/AllMedical-logo.png);
}
#home {
background-color: rgba(0, 0, 0, 0);
width: 98px;
height: 50px;
background-image: url(img/home.png);
}
#alert {
background-color: rgba(0, 0, 0, 0);
}
</style>
<?php
session_start();
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());
$email = (isset($_POST['usermail']) ? $_POST['usermail'] : null);
$firstname = (isset($_POST['firstname']) ? $_POST['firstname'] : null);
$lastname = (isset($_POST['lastname']) ? $_POST['lastname'] : null);
$uid = (isset($_GET['uid']) ? $_GET['uid'] : null);
if ($uid !=null) {
$query = mysql_query("SELECT * FROM `user-info` where uid = '$uid'") or die(mysql_error()); }
else if ($email != null){
$query = mysql_query("SELECT * FROM `user-info` where email = '$email'") or die(mysql_error()); }
else {
$query = mysql_query("SELECT * FROM `user-info` where firstname = '$firstname' and lastname = '$lastname'") or die(mysql_error()); }
$row = mysql_fetch_array($query);
if(mysql_num_rows($query) < 1 || $row['usertype'] != 'pacient') { header('Location: /wad/create.php?alert=2'); }
else if (mysql_num_rows($query) > 1) { header('Location: /wad/create.php?alert=1'); }
else { $uid = $row['uid'];}
?>
</head>
<body>
<br /><br /><br />
<div id="center" align="center">
<br><br><br><br>
<div id="logo"></div><br>
<a href = "/wad/"><div id="home"></div></a>
<div id="create"></div>
<br>
<p>Input appointment information.</p>
<form action="/wad/details.php?uid=<?php print $uid; ?>" method="post">
<table>
<tr>
<td><label for="date">Date<font color="#990033">*</font></lable></td>
<td><input type="date" name="date" required autofocus></td>
</tr>
<tr>
<td><label for="time">Time<font color="#990033">*</font></label></td>
<td><input type="time" name="time" required></td>
</tr>
<tr>
<td><label for="notes">Notes</label></td>
<td><input type="text" name="notes" maxlength="100"></td>
</tr>
<tr>
<td><label for="pnotes">Pacient notes</label></td>
<td><input type="text" name="pnotes" maxlength="100" ></td>
</tr>
</table>
<br>
<input type="submit" value="Submit">
</form>
<br><br><br><br>
</div>
<br><br><br><br>
</body>
</html>