Skip to content

Commit dce2561

Browse files
committed
Initial Commit
1 parent 644a75c commit dce2561

File tree

3 files changed

+179
-49
lines changed

3 files changed

+179
-49
lines changed

doctor-panel.php

+22-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<?php
33
include('func1.php');
4-
4+
$con=mysqli_connect("localhost","root","","myhmsdb");
5+
$doctor = $_SESSION['dname'];
56
if(isset($_GET['cancel']))
67
{
78
$query=mysqli_query($con,"update appointmenttb set doctorStatus='0' where ID = '".$_GET['ID']."'");
@@ -11,24 +12,24 @@
1112
}
1213
}
1314

14-
if(isset($_GET['prescribe'])){
15-
$doctor = $_SESSION['dname'];
16-
$pid = $_GET['pid'];
17-
$ID = $_GET['ID'];
18-
$appdate = $_GET['appdate'];
19-
$apptime = $_GET['apptime'];
20-
$disease = $_GET['disease'];
21-
$allergy = $_GET['allergy'];
22-
$prescription = $_GET['prescription'];
23-
$query=mysqli_query($con,"insert into prestb(doctor,pid,ID,appdate,apptime,disease,allergy,prescription) values ('$dname',$pid,$ID,'$appdate','$apptime','$disease','$allergy','$prescription');");
24-
if($query)
25-
{
26-
echo "<script>alert('Prescribed successfully!');</script>";
27-
}
28-
else{
29-
echo "<script>alert('Unable to process your request. Try again!');</script>";
30-
}
31-
}
15+
// if(isset($_GET['prescribe'])){
16+
17+
// $pid = $_GET['pid'];
18+
// $ID = $_GET['ID'];
19+
// $appdate = $_GET['appdate'];
20+
// $apptime = $_GET['apptime'];
21+
// $disease = $_GET['disease'];
22+
// $allergy = $_GET['allergy'];
23+
// $prescription = $_GET['prescription'];
24+
// $query=mysqli_query($con,"insert into prestb(doctor,pid,ID,appdate,apptime,disease,allergy,prescription) values ('$doctor',$pid,$ID,'$appdate','$apptime','$disease','$allergy','$prescription');");
25+
// if($query)
26+
// {
27+
// echo "<script>alert('Prescribed successfully!');</script>";
28+
// }
29+
// else{
30+
// echo "<script>alert('Unable to process your request. Try again!');</script>";
31+
// }
32+
// }
3233

3334

3435
?>
@@ -231,8 +232,8 @@ function clickDiv(id) {
231232
<?php if(($row['userStatus']==1) && ($row['doctorStatus']==1))
232233
{ ?>
233234

234-
<a href="doctor-panel.php#list-pres?pid=<?php echo $row['pid']?>&ID=<?php echo $row['ID']?>&appdate=<?php echo $row['appdate']?>&apptime=<?php echo $row['apptime']?>"
235-
onclick="clickDiv('#list-pres-list')" title="prescribe">
235+
<a href="prescribe.php?pid=<?php echo $row['pid']?>&ID=<?php echo $row['ID']?>&appdate=<?php echo $row['appdate']?>&apptime=<?php echo $row['apptime']?>"
236+
tooltip-placement="top" tooltip="Remove" title="prescribe">
236237
<button class="btn btn-success">Prescibe</button></a>
237238
<?php } else {
238239

myhmsdb.sql

+102-27
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- https://www.phpmyadmin.net/
44
--
55
-- Host: localhost
6-
-- Generation Time: Sep 22, 2019 at 09:38 AM
6+
-- Generation Time: Mar 13, 2020 at 01:09 AM
77
-- Server version: 10.1.31-MariaDB
88
-- PHP Version: 7.2.4
99

@@ -47,26 +47,34 @@ INSERT INTO `admintb` (`username`, `password`) VALUES
4747
--
4848

4949
CREATE TABLE `appointmenttb` (
50+
`pid` int(11) NOT NULL,
51+
`ID` int(11) NOT NULL,
5052
`fname` varchar(20) NOT NULL,
5153
`lname` varchar(20) NOT NULL,
54+
`gender` varchar(10) NOT NULL,
5255
`email` varchar(30) NOT NULL,
5356
`contact` varchar(10) NOT NULL,
5457
`doctor` varchar(30) NOT NULL,
5558
`docFees` int(5) NOT NULL,
5659
`appdate` date NOT NULL,
57-
`apptime` time NOT NULL
60+
`apptime` time NOT NULL,
61+
`userStatus` int(5) NOT NULL,
62+
`doctorStatus` int(5) NOT NULL
5863
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
5964

6065
--
6166
-- Dumping data for table `appointmenttb`
6267
--
6368

64-
INSERT INTO `appointmenttb` (`fname`, `lname`, `email`, `contact`, `doctor`, `docFees`, `appdate`, `apptime`) VALUES
65-
('Praveen', 'Kumar', '[email protected]', '9988445566', 'Dinesh', 700, '2019-09-21', '10:00:00'),
66-
('aziz', 'rahman', '[email protected]', '9988667755', 'Dinesh', 700, '2019-09-25', '05:00:00'),
67-
('Ram', 'Kumar', '[email protected]', '7896543210', 'arun', 600, '2019-09-22', '10:00:00'),
68-
('Thiru', 'Selvam', '[email protected]', '8899776655', 'Amit', 1000, '2019-09-30', '10:00:00'),
69-
('Manoj', 'Kumar', '[email protected]', '7799886633', 'ashok', 500, '2019-09-26', '05:00:00');
69+
INSERT INTO `appointmenttb` (`pid`, `ID`, `fname`, `lname`, `gender`, `email`, `contact`, `doctor`, `docFees`, `appdate`, `apptime`, `userStatus`, `doctorStatus`) VALUES
70+
(4, 1, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Ganesh', 550, '2020-02-14', '10:00:00', 1, 0),
71+
(4, 2, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Dinesh', 700, '2020-02-28', '10:00:00', 0, 1),
72+
(4, 3, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Amit', 1000, '2020-02-19', '03:00:00', 0, 1),
73+
(11, 4, 'Shraddha', 'Kapoor', 'Female', '[email protected]', '9768946252', 'ashok', 500, '2020-02-29', '20:00:00', 1, 1),
74+
(4, 5, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Dinesh', 700, '2020-02-28', '12:00:00', 1, 1),
75+
(4, 6, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'Ganesh', 550, '2020-02-26', '15:00:00', 0, 1),
76+
(2, 8, 'Alia', 'Bhatt', 'Female', '[email protected]', '8976897689', 'Ganesh', 550, '2020-03-21', '10:00:00', 1, 1),
77+
(5, 9, 'Gautam', 'Shankararam', 'Male', '[email protected]', '9070897653', 'Ganesh', 550, '2020-03-19', '20:00:00', 1, 0);
7078

7179
-- --------------------------------------------------------
7280

@@ -87,12 +95,14 @@ CREATE TABLE `contact` (
8795

8896
INSERT INTO `contact` (`name`, `email`, `contact`, `message`) VALUES
8997
('Anu', '[email protected]', '7896677554', 'Hey Admin'),
90-
('Pradaap', '[email protected]', '9878765467', 'Nice Job'),
91-
('Pradaap', '[email protected]', '9878765467', 'Nice Job'),
92-
('Guru', '[email protected]', '7897656578', 'Great'),
9398
(' Viki', '[email protected]', '9899778865', 'Good Job, Pal'),
9499
('Ananya', '[email protected]', '9997888879', 'How can I reach you?'),
95-
('Aakash', '[email protected]', '8788979967', 'Love your site');
100+
('Aakash', '[email protected]', '8788979967', 'Love your site'),
101+
('Mani', '[email protected]', '8977768978', 'Want some coffee?'),
102+
('Karthick', '[email protected]', '9898989898', 'Good service'),
103+
('Abbis', '[email protected]', '8979776868', 'Love your service'),
104+
('Asiq', '[email protected]', '9087897564', 'Love your service. Thank you!'),
105+
('Jane', '[email protected]', '7869869757', 'I love your service!');
96106

97107
-- --------------------------------------------------------
98108

@@ -104,20 +114,22 @@ CREATE TABLE `doctb` (
104114
`username` varchar(50) NOT NULL,
105115
`password` varchar(50) NOT NULL,
106116
`email` varchar(50) NOT NULL,
117+
`spec` varchar(50) NOT NULL,
107118
`docFees` int(10) NOT NULL
108119
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
109120

110121
--
111122
-- Dumping data for table `doctb`
112123
--
113124

114-
INSERT INTO `doctb` (`username`, `password`, `email`, `docFees`) VALUES
115-
('ashok', 'ashok123', '[email protected]', 500),
116-
('arun', 'arun123', '[email protected]', 600),
117-
('Dinesh', 'dinesh123', '[email protected]', 700),
118-
('Ganesh', 'ganesh123', '[email protected]', 550),
119-
('Kumar', 'kumar123', '[email protected]', 800),
120-
('Amit', 'amit123', '[email protected]', 1000);
125+
INSERT INTO `doctb` (`username`, `password`, `email`, `spec`, `docFees`) VALUES
126+
('ashok', 'ashok123', '[email protected]', 'General', 500),
127+
('arun', 'arun123', '[email protected]', 'Cardiologist', 600),
128+
('Dinesh', 'dinesh123', '[email protected]', 'General', 700),
129+
('Ganesh', 'ganesh123', '[email protected]', 'Pediatrician', 550),
130+
('Kumar', 'kumar123', '[email protected]', 'Pediatrician', 800),
131+
('Amit', 'amit123', '[email protected]', 'Cardiologist', 1000),
132+
('Abbis', 'abbis123', '[email protected]', 'Neurologist', 1500);
121133

122134
-- --------------------------------------------------------
123135

@@ -126,8 +138,10 @@ INSERT INTO `doctb` (`username`, `password`, `email`, `docFees`) VALUES
126138
--
127139

128140
CREATE TABLE `patreg` (
141+
`pid` int(11) NOT NULL,
129142
`fname` varchar(20) NOT NULL,
130143
`lname` varchar(20) NOT NULL,
144+
`gender` varchar(10) NOT NULL,
131145
`email` varchar(30) NOT NULL,
132146
`contact` varchar(10) NOT NULL,
133147
`password` varchar(30) NOT NULL,
@@ -138,14 +152,75 @@ CREATE TABLE `patreg` (
138152
-- Dumping data for table `patreg`
139153
--
140154

141-
INSERT INTO `patreg` (`fname`, `lname`, `email`, `contact`, `password`, `cpassword`) VALUES
142-
('Ajay', 'Kumar', '[email protected]', '9988776655', 'ajay123', 'ajay123'),
143-
('Kishan', 'Lal', '[email protected]', '9876543210', 'kishan123', 'kishan123'),
144-
('aziz', 'rahman', '[email protected]', '9988667755', 'aziz123', 'aziz123'),
145-
('Praveen', 'Kumar', '[email protected]', '9988445566', 'praveen123', 'praveen123'),
146-
('Ram', 'Kumar', '[email protected]', '7896543210', 'ram123', 'ram123'),
147-
('Thiru', 'Selvam', '[email protected]', '8899776655', 'thiru123', 'thiru123'),
148-
('Manoj', 'Kumar', '[email protected]', '7799886633', 'manoj123', 'manoj123');
155+
INSERT INTO `patreg` (`pid`, `fname`, `lname`, `gender`, `email`, `contact`, `password`, `cpassword`) VALUES
156+
(1, 'Ram', 'Kumar', 'Male', '[email protected]', '9876543210', 'ram123', 'ram123'),
157+
(2, 'Alia', 'Bhatt', 'Female', '[email protected]', '8976897689', 'alia123', 'alia123'),
158+
(3, 'Shahrukh', 'khan', 'Male', '[email protected]', '8976898463', 'shahrukh123', 'shahrukh123'),
159+
(4, 'Kishan', 'Lal', 'Male', '[email protected]', '8838489464', 'kishan123', 'kishan123'),
160+
(5, 'Gautam', 'Shankararam', 'Male', '[email protected]', '9070897653', 'gautam123', 'gautam123'),
161+
(6, 'Sushant', 'Singh', 'Male', '[email protected]', '9059986865', 'sushant123', 'sushant123'),
162+
(7, 'Nancy', 'Deborah', 'Female', '[email protected]', '9128972454', 'nancy123', 'nancy123'),
163+
(8, 'Kenny', 'Sebastian', 'Male', '[email protected]', '9809879868', 'kenny123', 'kenny123'),
164+
(9, 'William', 'Blake', 'Male', '[email protected]', '8683619153', 'william123', 'william123'),
165+
(10, 'Peter', 'Norvig', 'Male', '[email protected]', '9609362815', 'peter123', 'peter123'),
166+
(11, 'Shraddha', 'Kapoor', 'Female', '[email protected]', '9768946252', 'shraddha123', 'shraddha123');
167+
168+
-- --------------------------------------------------------
169+
170+
--
171+
-- Table structure for table `prestb`
172+
--
173+
174+
CREATE TABLE `prestb` (
175+
`doctor` varchar(50) NOT NULL,
176+
`pid` int(11) NOT NULL,
177+
`ID` int(11) NOT NULL,
178+
`appdate` date NOT NULL,
179+
`apptime` time NOT NULL,
180+
`disease` varchar(250) NOT NULL,
181+
`allergy` varchar(250) NOT NULL,
182+
`prescription` varchar(1000) NOT NULL
183+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
184+
185+
--
186+
-- Dumping data for table `prestb`
187+
--
188+
189+
INSERT INTO `prestb` (`doctor`, `pid`, `ID`, `appdate`, `apptime`, `disease`, `allergy`, `prescription`) VALUES
190+
('Ganesh', 0, 0, '0000-00-00', '00:00:00', 'cold', 'nothing', 'tablet'),
191+
('Ganesh', 0, 0, '0000-00-00', '00:00:00', 'cough', 'nothing', 'take a syrup');
192+
193+
--
194+
-- Indexes for dumped tables
195+
--
196+
197+
--
198+
-- Indexes for table `appointmenttb`
199+
--
200+
ALTER TABLE `appointmenttb`
201+
ADD PRIMARY KEY (`ID`);
202+
203+
--
204+
-- Indexes for table `patreg`
205+
--
206+
ALTER TABLE `patreg`
207+
ADD PRIMARY KEY (`pid`);
208+
209+
--
210+
-- AUTO_INCREMENT for dumped tables
211+
--
212+
213+
--
214+
-- AUTO_INCREMENT for table `appointmenttb`
215+
--
216+
ALTER TABLE `appointmenttb`
217+
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
218+
219+
--
220+
-- AUTO_INCREMENT for table `patreg`
221+
--
222+
ALTER TABLE `patreg`
223+
MODIFY `pid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
149224
COMMIT;
150225

151226
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

prescribe.php

+55-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
<!DOCTYPE html>
22
<?php
3+
include('func1.php');
4+
$doctor = $_SESSION['dname'];
5+
$pid = mysql_real_escape_string($_GET['pid']);
6+
$ID = mysql_real_escape_string($_GET['ID']);
7+
$appdate = mysql_real_escape_string($_GET['appdate']);
8+
$apptime = mysql_real_escape_string($_GET['apptime']);
9+
10+
11+
if(isset($_GET['prescribe'])){
12+
13+
14+
$disease = $_GET['disease'];
15+
$allergy = $_GET['allergy'];
16+
$prescription = $_GET['prescription'];
17+
$query=mysqli_query($con,"insert into prestb(doctor,pid,ID,appdate,apptime,disease,allergy,prescription) values ('$doctor',$pid,'$ID','$appdate','$apptime','$disease','$allergy','$prescription');");
18+
if($query)
19+
{
20+
echo "<script>alert('Prescribed successfully!');</script>";
21+
}
22+
else{
23+
echo "<script>alert('Unable to process your request. Try again!');</script>";
24+
}
25+
}
326

427
?>
528

@@ -51,7 +74,7 @@
5174
<div class="collapse navbar-collapse" id="navbarSupportedContent">
5275
<ul class="navbar-nav mr-auto">
5376
<li class="nav-item">
54-
<a class="nav-link" href="logout.php"><i class="fa fa-sign-out" aria-hidden="true"></i>Logout</a>
77+
<a class="nav-link" href="logout1.php"><i class="fa fa-sign-out" aria-hidden="true"></i>Logout</a>
5578
</li>
5679
<li class="nav-item">
5780
<a class="nav-link" href="#"></a>
@@ -66,4 +89,35 @@
6689
#inputbtn:hover{cursor:pointer;}
6790
</style>
6891

92+
<body style="padding-top:50px;">
93+
<div class="container-fluid" style="margin-top:50px;">
94+
<h3 style = "margin-left: 40%; padding-bottom: 20px; font-family: 'IBM Plex Sans', sans-serif;"> Welcome &nbsp<?php echo $doctor ?>
95+
</h3>
96+
97+
<div class="tab-pane" id="list-pres" role="tabpanel" aria-labelledby="list-pres-list">
98+
<form class="form-group" name="prescribeform" method="get" action="prescribe.php">
99+
<div class="row">
100+
<div class="col-md-4"><label>Disease:</label></div>
101+
<div class="col-md-8">
102+
<!-- <input type="text" class="form-control" name="disease" required> -->
103+
<textarea id="disease" cols="86" rows ="5" name="disease" required></textarea>
104+
</div><br><br>
105+
106+
<div class="col-md-4"><label>Allergies:</label></div>
107+
<div class="col-md-8">
108+
<!-- <input type="text" class="form-control" name="allergy" required> -->
109+
<textarea id="allergy" cols="86" rows ="5" name="allergy" required></textarea>
110+
</div><br><br>
111+
<div class="col-md-4"><label>Prescription:</label></div>
112+
<div class="col-md-8">
113+
<!-- <input type="text" class="form-control" name="prescription" required> -->
114+
<textarea id="prescription" cols="86" rows ="10" name="prescription" required></textarea>
115+
</div><br><br>
116+
117+
<input type="submit" name="prescribe" value="Prescribe" class="btn btn-primary">
118+
</form>
119+
</div>
120+
</div>
121+
122+
69123

0 commit comments

Comments
 (0)