forked from onetwothreeneth/HospitalManagementSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservices.php
More file actions
154 lines (138 loc) · 9.36 KB
/
services.php
File metadata and controls
154 lines (138 loc) · 9.36 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
150
151
152
153
154
<?php
require_once 'bones/a_assets.php';
require_once 'bones/a_header.php';
?>
<div id="page-content-wrapper">
<div id="page-content">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="dashboard-box dashboard-box-chart bg-white content-box">
<div class="panel">
<div class="panel-body">
<h1 class="title-hero">
<div class="col-sm-12">
<b>Patient Records</b>
</div><br><br><br>
<div class="col-sm-7"></div>
<form action="services.php?5" method="post">
<div class="col-sm-4">
<input type="text" class="form-control" name="search" placeholder="Search" required>
</div>
<div class="col-sm-1">
<button name="search_services" class="btn btn-primary">Search</button>
</div><br><br><br>
</form>
</h1>
<div class="example-box-wrapper">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th style="text-align:center;"></th>
<th style="text-align:center;">Name</th>
<th style="text-align:center;">Category</th>
<th style="text-align:center;">Description</th>
<th style="text-align:center;">Price</th>
<th style="text-align:center;"></th>
</tr>
</thead>
<tbody>
<?php
if(isset($_POST['search_services'])){
$search = filters('search');
$services = fetch("$s services $w status='1' and
name like '%$search%' or
category like '%$search%' or
description like '%$search%' or
price like '%$search%'
");
if($services<=0){
echo "<tr><td colspan='6' style='text-align:center; width:100%;'>No Results Found !</td></tr>";
} else {
foreach ($services as $s) {
echo "<tr>
<td style='text-align:center; width:14.28%;'>$s->services_id</td>
<td style='text-align:center; width:14.28%;'>$s->name</td>
<td style='text-align:center; width:14.28%;'>$s->category</td>
<td style='text-align:center; width:14.28%;'>$s->description</td>
<td style='text-align:center; width:14.28%;'>$s->price</td>
<td style='text-align:center; width:14.28%;'>
<a href='edit_services.php?5&services_id=$s->services_id' class='btn btn-success'>Edit</a>
<form action='services.php?5' method='post' style='display:inline;'>
<input type='hidden' name='services_id' value='$s->services_id'>
<button name='archive_services' class='btn btn-danger'>Trash</button>
</form>
</td>
</tr> ";
}
}
} else {
$services = fetch("$s services $w status='1'");
if($services<=0){
echo "<tr><td colspan='6' style='text-align:center; width:100%;'>No Services yet !</td></tr>";
} else {
foreach ($services as $s) {
echo "<tr>
<td style='text-align:center; width:14.28%;'>$s->services_id</td>
<td style='text-align:center; width:14.28%;'>$s->name</td>
<td style='text-align:center; width:14.28%;'>$s->category</td>
<td style='text-align:center; width:14.28%;'>$s->description</td>
<td style='text-align:center; width:14.28%;'>$s->price</td>
<td style='text-align:center; width:14.28%;'>
<a href='edit_services.php?5&services_id=$s->services_id' class='btn btn-success'>Edit</a>
<form action='services.php?5' method='post' style='display:inline;'>
<input type='hidden' name='services_id' value='$s->services_id'>
<button name='archive_services' class='btn btn-danger'>Trash</button>
</form>
</td>
</tr> ";
}
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="assets/assets/widgets/datatable/datatable.js"></script>
<script type="text/javascript" src="assets/assets/widgets/datatable/datatable-bootstrap.js"></script>
<script type="text/javascript" src="assets/assets/widgets/datatable/datatable-tabletools.js"></script>
<script type="text/javascript">
/* Datatables basic */
$(document).ready(function() {
$('#datatable-example').dataTable();
});
/* Datatables hide columns */
$(document).ready(function() {
var table = $('#datatable-hide-columns').DataTable( {
"scrollY": "300px",
"paging": false
} );
$('#datatable-hide-columns_filter').hide();
$('a.toggle-vis').on( 'click', function (e) {
e.preventDefault();
// Get the column API object
var column = table.column( $(this).attr('data-column') );
// Toggle the visibility
column.visible( ! column.visible() );
} );
} );
/* Datatable row highlight */
$(document).ready(function() {
var table = $('#datatable-row-highlight').DataTable();
$('#datatable-row-highlight tbody').on( 'click', 'tr', function () {
$(this).toggleClass('tr-selected');
} );
});
$(document).ready(function() {
$('.dataTables_filter input').attr("placeholder", "Search...");
});
</script>
<?php require_once "bones/a_footer.php"; ?>