-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.reglist.php
More file actions
140 lines (105 loc) · 3.63 KB
/
search.reglist.php
File metadata and controls
140 lines (105 loc) · 3.63 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
<style>
.logo{
margin-left:700px;
}
.img{
width:75px;
height:75px;
border-radius:100px
}
</style>
<?php
include ('loginvalidation.php');
$conn=mysqli_connect('localhost','root','');
mysqli_select_db($conn, 'health');
$query=mysqli_query($conn, "select * from registra where id='".$_SESSION['ad']."'")or die(mysqli_error());
while($deal=mysqli_fetch_array($query)){
$fn= $deal['firstname'];
$surname= $deal['secondname'];
$image= $deal['image'];
$reg=$deal['Registration_no'];
}
?>
<script src="dashboard/js/tinymce/tinymce.min.js"></script>
<script src="dashboard/js/tinymce/script.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/cms-home.css">
<link rel="stylesheet" type="text/css" href="css/material-icons.css">
<link rel="stylesheet" type="text/css" href="css/style.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/demo.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
<link rel="stylesheet" href="css/loginstyle.css">
<link href="dashboard/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="navi_registra.php"><img src="img/kenya.png" width="30%">Ministry of Health</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="healthhomepage.php">Menu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="login.php">Login</a>
</li>
</ul>
<div class="logo">
<img src="<?php echo $image?>" class="img"> <br>
<?php
echo $fn." ".$surname; echo"<br>";
echo $reg; echo "<br>";
echo '<a href="signout.php">Sign out</a>';
?>
</div>
</nav>
<form action="" method="post" class="form-inline my-2 my-lg-0"class="navbar-right">
<input type="search" name="id" size="35" placeholder="use id to search" ariel-label="search"><br></br>
<br><button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="search">Search</button></br>
</form>
<?php
$conn=mysqli_connect("localhost","root","")or die(mysqli_error());
mysqli_select_db($conn,"health")or die (mysqli_error());
if (isset($_POST['search'])){
$search=$_POST['id'];
$result = mysqli_query($conn,"SELECT username, password, firstname,middlename,surname,id_no,nurse_no FROM registration where id='$search'") or die (mysqli_error($conn));
$row=mysqli_num_rows($result);
if($row==1){
echo "<table border='1' class='table'>
<tr>
<th>username</th>
<th>password</th>
<th>firstname</th>
<th>middlename</th>
<th>surname</th>
<th>id_no</th>
<th>nurse_no</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['firstname'] . "</td>";
echo "<td>" . $row['middlename'] . "</td>";
echo "<td>" . $row['surname'] . "</td>";
echo "<td>" . $row['id_no'] . "</td>";
echo "<td>" . $row['nurse_no'] . "</td>";
echo "</tr>";
}
echo "</table>";
}
}
mysqli_close($conn);
?>
<footer>
<div class="container-fluid padding">
<div class="row text-center">
<div class="col-12">
<hr class="light">
<h5>© timothy.com</h5>
<a href="reglist.php" button type="button" class="btn btn-default">Back</button>
</div>
</div>
</div>
</footer>