-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuestgallery.php
More file actions
50 lines (39 loc) · 1.72 KB
/
Guestgallery.php
File metadata and controls
50 lines (39 loc) · 1.72 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
<?php
function selectgallery($type,$value){
include("dbconnect.php");
if($type=="ALL"){
$sql="SELECT `ID`,`NAME`,`EDITION`,`AUTHOR`,`SUBJECT`,`YEAR`,`BRANCH`,`IMAGE`,`PRICE`,`EMAIL` FROM `Book_details`WHERE `STATUS`='AVAILABLE' Order By `Time` Desc ";
}
else{
$sql="SELECT `ID`,`NAME`,`EDITION`,`AUTHOR`,`SUBJECT`,`YEAR`,`BRANCH`,`IMAGE`,`PRICE`,`EMAIL` FROM `Book_details` WHERE $value AND `STATUS`='AVAILABLE' Order By `Time` Desc ";
}
$query= mysqli_query($conn,$sql);
if(!$query){
die('could not get data:'.mysql_error());
$Result="0 Results";
}
else{
$num=mysqli_num_rows($query);
echo "<span style=\"text-align:left;\" ><h3> Results found: ".$num."</h3></span>";
echo"<div class=\"row \" >";
for( $i=0;$i<$num;$i++){
if($i%4==0){
echo "</div><div class=\"row \" >";
}
$row=mysqli_fetch_array($query);
/* while($row=mysqli_fetch_array($query)){*/
/*echo "<div class=\"col-sm-4\" >".*/
echo "<div class=\"col-sm-3\" >".
"<a class=\"thumbnail\" href=\"Guest_bookdetails.php?id={$row['ID']}\" >".
"<img src=\"{$row["IMAGE"]}\" alt={$row["NAME"]} style=\"height=:100px;\" >".
"<div class = \"caption\">".
"<h6>NAME: {$row["NAME"]}</h6>".
/* "<small>Author: {$row["AUTHOR"]}</small>".*/
"<h6>Price: ₹ {$row["PRICE"]}</h6></div>".
" </a>".
" </div>";
}
echo "</div>";
}
}
?>