-
Notifications
You must be signed in to change notification settings - Fork 0
/
counselling records.php
120 lines (64 loc) · 2.24 KB
/
counselling records.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
<?php
include('dbcon.php');
include('layout.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>counselling records</title>
</head>
<body>
<script src="lib/jquery.min"></script>
<script src="lib/popper.min"></script>
<script src="lib/bootstrap.min"></script>
<div class="container_content" id= "table-id" align="center">
<div >
<br>
</div>
<br>
<br>
<br>
<label for="Search"><strong>Search</strong></label>
<input type="text" name="search" id="search" placeholder="search..." size="115px" class="table-filter" data-table="order-table" align="center" />
<table class="order-table" align="center" >
<tr><th>Patient number</th><th>Patient name</th><th>Counsellor</th><th>Date</th></tr>
<?php
class TableRows extends RecursiveIteratorIterator {
function __construct($it) {
parent::__construct($it, self::LEAVES_ONLY);
}
function current() {
return "<td style='width: 150px; border: 1px solid black;'>" . parent::current(). "</td>";
}
function beginChildren() {
echo "<tr>";
}
function endChildren() {
echo "</tr>" . "\n";
}
}
try { $sql = 'SELECT * from consellingdata ORDER BY ttimes DESC' ;
$result = mysqli_query($conn, $sql);
$i = 1;
while ($row = mysqli_fetch_assoc($result )) {
$recptnumber=$row['ptnumber'];
$recreason=$row['reason'];
echo '<td><button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal'.$row['id'].'" > '.$row['ptnumber']. '</button> </td>';
echo '<td>'. $row['pname'].'</td>';
echo '<td>'. $row['counsellor'].'</td>';
echo '<td>'. $row['ttimes'].'</td>';
?>
<?php
include 'modal3.php';
$i++;
echo'</tr>';
}
}
catch(PDOException $e) {
echo "Error: " . $e->getMessage();
}
echo'</table>';
?>
</body>
</html>