-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
180 lines (149 loc) · 6.04 KB
/
search.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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['damsid']==0)) {
header('location:logout.php');
} else{
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>DAMS || Search Appointment Detail</title>
<link rel="stylesheet" href="libs/bower/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="libs/bower/material-design-iconic-font/dist/css/material-design-iconic-font.css">
<!-- build:css assets/css/app.min.css -->
<link rel="stylesheet" href="libs/bower/animate.css/animate.min.css">
<link rel="stylesheet" href="libs/bower/fullcalendar/dist/fullcalendar.min.css">
<link rel="stylesheet" href="libs/bower/perfect-scrollbar/css/perfect-scrollbar.css">
<link rel="stylesheet" href="assets/css/bootstrap.css">
<link rel="stylesheet" href="assets/css/core.css">
<link rel="stylesheet" href="assets/css/app.css">
<!-- endbuild -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,900,300">
<script src="libs/bower/breakpoints.js/dist/breakpoints.min.js"></script>
<script>
Breakpoints();
</script>
</head>
<body class="menubar-left menubar-unfold menubar-light theme-primary">
<!--============= start main area -->
<?php include_once('includes/header.php');?>
<?php include_once('includes/sidebar.php');?>
<!-- APP MAIN ==========-->
<main id="app-main" class="app-main">
<div class="wrap">
<section class="app-content">
<div class="row">
<!-- DOM dataTable -->
<div class="col-md-12">
<div class="widget">
<header class="widget-header">
<form id="basic-form" method="post">
<div class="form-group">
<label>Search by Appointment No./Name/Mobile No.</label>
<input id="searchdata" type="text" name="searchdata" required="true" class="form-control" placeholder="Appointment No./Name/Mobile No."></div>
<br>
<button type="submit" class="btn btn-primary" name="search" id="submit">Search</button>
</form>
</header><!-- .widget-header -->
<?php
if(isset($_POST['search']))
{
$sdata=$_POST['searchdata'];
?>
<h4 align="center">Result against "<?php echo $sdata;?>" keyword </h4>
<div class="widget-body">
<div class="table-responsive">
<table class="table table-bordered table-hover js-basic-example dataTable table-custom">
<thead>
<tr>
<th>S.No</th>
<th>Appointment Number</th>
<th>Patient Name</th>
<th>Mobile Number</th>
<th>Email</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$docid=$_SESSION['damsid'];
$sql="SELECT * from tblappointment where AppointmentNumber like '$sdata%' || Name like '$sdata%' || MobileNumber like '$sdata%' && Doctor=:docid";
$query = $dbh -> prepare($sql);
$query-> bindParam(':docid', $docid, PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $row)
{ ?>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlentities($row->AppointmentNumber);?></td>
<td><?php echo htmlentities($row->Name);?></td>
<td><?php echo htmlentities($row->MobileNumber);?></td>
<td><?php echo htmlentities($row->Email);?></td>
<?php if($row->Status==""){ ?>
<td><?php echo "Not Updated Yet"; ?></td>
<?php } else { ?> <td><?php echo htmlentities($row->Status);?>
</td>
<?php } ?>
<td><a href="view-appointment-detail.php?editid=<?php echo htmlentities ($row->ID);?>&&aptid=<?php echo htmlentities ($row->AppointmentNumber);?>" class="btn btn-primary">View</a></td>
</tr>
</tbody>
<tfoot>
<tr>
<th>S.No</th>
<th>Appointment Number</th>
<th>Patient Name</th>
<th>Mobile Number</th>
<th>Email</th>
<th>Status</th>
<th>Action</th>
</tr>
</tfoot>
<?php
$cnt=$cnt+1;
} } else { ?>
<tr>
<td colspan="8"> No record found against this search</td>
</tr>
<?php } }?>
</table>
</div>
</div><!-- .widget-body -->
</div><!-- .widget -->
</div><!-- END column -->
</div><!-- .row -->
</section><!-- .app-content -->
</div><!-- .wrap -->
<!-- APP FOOTER -->
<?php include_once('includes/footer.php');?>
<!-- /#app-footer -->
</main>
<!--========== END app main -->
<!-- APP CUSTOMIZER -->
<?php include_once('includes/customizer.php');?>
<!-- build:js assets/js/core.min.js -->
<script src="libs/bower/jquery/dist/jquery.js"></script>
<script src="libs/bower/jquery-ui/jquery-ui.min.js"></script>
<script src="libs/bower/jQuery-Storage-API/jquery.storageapi.min.js"></script>
<script src="libs/bower/bootstrap-sass/assets/javascripts/bootstrap.js"></script>
<script src="libs/bower/jquery-slimscroll/jquery.slimscroll.js"></script>
<script src="libs/bower/perfect-scrollbar/js/perfect-scrollbar.jquery.js"></script>
<script src="libs/bower/PACE/pace.min.js"></script>
<!-- endbuild -->
<!-- build:js assets/js/app.min.js -->
<script src="assets/js/library.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/app.js"></script>
<!-- endbuild -->
<script src="libs/bower/moment/moment.js"></script>
<script src="libs/bower/fullcalendar/dist/fullcalendar.min.js"></script>
<script src="assets/js/fullcalendar.js"></script>
</body>
</html>
<?php } ?>