-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASAVE.php
59 lines (57 loc) · 2.14 KB
/
ASAVE.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
<?php require('connection.php');?>
<html>
<head>
<title>Add Appointments</title>
<link rel="stylesheet" href="css/bootstrap.css"/>
</head>
<body>
<table class="table table-bordered">
<tr bgcolor=blue><td align=center><font SIZE=6 color=white>HOSPITAL
MANAGEMENT SYSTEM</font></td></tr>
<tr><td><table align=center width=750 cellspacing=0 cellpadding=5>
<tr><td align=center><a href=dlist.php>Doctors</td><td align=center><a
href=plist.php>Patients</td><td align=center><a
href=alist.php>Appointments</td>
</table></td></tr>
<tr bgcolor=red><td ><font size=4 color=white>Save
Appointments</font></td></tr>
<?php
$pat=trim($_POST["pat"]);
$doc=trim($_POST["doc"]);
$tim=trim($_POST["tim"]);
$dat=trim($_POST["dat"]);
$error=0;
if ($pat=="") { $error=1; echo "<tr><td><font color=red size=4>Patient's Name
can't empty</font></td></tr>"; }
if ($doc=="") { $error=1; echo "<tr><td><font color=red
size=4>doctor Id can't empty</font></td></tr>"; }
if ($tim=="") { $error=1; echo "<tr><td><font color=red
size=4>Time can't empty</font></td></tr>"; }
if ($dat=="") { $error=1; echo "<tr><td><font color=red
size=4>Date can't empty</font></td></tr>"; }
if ($error==0) {
mysql_query("insert into appt(adoctor,apatient,atime,adate,ashow)
values('".$doc."','".$pat."','".$tim."','".$dat."','Y')");
echo "<tr><td align=center><font size=4 color=green>Successfully
Records Inserted</font></td></tr>";
}
else {
echo "<form name=fdadd method=post action=asave.php>";
echo "<tr><td><table width=750 cellspacing=0 cellpadding=5>";
echo "<tr><td>Patient Id</td><td><input type=text name=name
size=30 maxlength=30 value='".$pat."'></td></tr>";
echo "<tr><td>Doctor Id</td><td><input type=text name=spec
size=30 maxlength=30 value='".$doc."'></td></tr>";
echo "<tr><td>Time</td><td><input type=text name=spec
size=30 maxlength=30 value='".$tim."'></td></tr>";
echo "<tr><td>Date</td><td><input type=text name=spec
size=30 maxlength=30 value='".$dat."'></td></tr>";
echo "</table></td></tr>";
echo "<tr><td align=center><input type=submit
value=Submit></td></tr>";
echo "</form>";
}
echo "<tr><td align=center><a
href=alist.php>Continue...</a></td></tr>";
echo "</table>";
echo "</body></html>";