-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsearchIdols.php
29 lines (23 loc) · 953 Bytes
/
searchIdols.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
<?php
// configuration
include('functionsCreated.php');
$searchInput=$_REQUEST['searchInput'];
if(isset($searchInput) == false) {
echo "Invalid Access";
return;
}
$testCondition = "%".$searchInput."%";
$q=$db->prepare("SELECT * FROM idols, temples WHERE tirthankar LIKE '$testCondition' AND templeid = tid ORDER BY tirthankar");
$q->execute();
if($q->rowCount() != 0) {
echo '<ol>';
while($row = $q->fetch(PDO::FETCH_ASSOC)) {
echo '<li><a href="?id='.$row['idolid'].'" title="Details of '.$row['tirthankar'].' Idol at '.$row['tname'].'" >'.$row['tirthankar'].'<img src="'.$row['idolimg'].'" class="smallLight" alt="Photo of '.$row['tirthankar'].'" /></a></li>';
}
echo '</ol>';
} else {
echo "<span style='color:red'>Our records don't have an entry for the idol you searched.
If you have any kind of information about that idol please help us to collect the data by adding information
<a href='#'>here</a></span><br /><br />";
}
?>