-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsearchreturn.php
More file actions
executable file
·99 lines (75 loc) · 2.02 KB
/
searchreturn.php
File metadata and controls
executable file
·99 lines (75 loc) · 2.02 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
<div class="searchbox">
<style>
.searchbox{ position:absolute; margin-top:-6px; margin-left:-2px; color:#000;}
.td{
height:25px;
text-decoration:none;}
.a{ text-decoration:none;
color:#000;}
.hr:hover{
background:#CCC;}
.dewey{
font-size:20px;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;}
hr{
background:#999;
color:#CCC;}
</style>
<table width="412" border="0" cellspacing="1" style=" background:#060;font-size:12px; font-family:Verdana, Geneva, sans-serif;">
<?php
include('config.php');
if(isset($_POST))
{
$q=$_POST['searchword'];
$sql_res="select * from borrower where lname like '$q%' or fname like '$q%' limit 8";
}
$r=mysql_query($sql_res);
$items = 0;
?>
<?php while($row=mysql_fetch_array($r))
{
$j="<a href='index.php?returnBooks&studentid=$row[card_no]' class='a'>";
//$d="<a href='?del&idnumber=$row[idnumber]' class='a'>";
$items++;
$fname=$row['fname'];
$lname=$row['lname'];
$mi=$row['mi'];
$re_idnumber='<b>'.$q.'</b>';
$rfname='<b>'.$q.'</b>';
$rlname='<b>'.$q.'</b>';
$rmi='<b>'.$q.'</b>';
$final_idnumber = str_ireplace($q, $re_idnumber, $idnumber);
$ffname = str_ireplace($q, $rfname, $fname);
$flname = str_ireplace($q, $rlname, $lname);
$fmi = str_ireplace($q, $rmi, $mi);
?>
<tr bgcolor="#FFFFFF" class="hr" height="25">
<td><?php echo $j; ?>
<div class="td"><div style="padding-top:10px;">
<?php echo $ffname; ?></div>
</div></a>
</td>
<td><?php echo $j; ?>
<div class="td"><div style="padding-top:10px;">
<?php echo $flname; ?></div>
</div></a>
</td>
<td><?php echo $j; ?>
<div class="td"><div style="padding-top:10px;">
<?php echo $fmi; ?></div>
</div></a>
</td>
</tr>
<?php
}echo "
";
?>
</table>
<?php
if($items==0){ ?>
<div style=" text-align:left; margin-left:0px; height:20px; background:#FFF; width:; color:#F00; font-size:12px; font-family:Verdana, Geneva, sans-serif; margin-top:5px;">
"<?php echo $_POST['searchword']; ?>"
Search Not Found</div>
<?php } ?>
</div>