-
Notifications
You must be signed in to change notification settings - Fork 1
/
dataDisplay.php
47 lines (44 loc) · 1.75 KB
/
dataDisplay.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
<?php
$headerTitle = "The Oregon State Book Exchange || Recent Posts";
$dataDisplayNav = "active";
?>
<?php include("_header.php");?>
<h3>Library</h3>
<form action="searchResults.php" method="post">
<div>
<input type="text" name="keyword" class="form-control" placeholder="Search" />
</div>
</form>
<?php
//Create Table Head
echo "<table class='table' id='postTable'>";
echo "<thead>";
echo "<tr>";
echo "<th>Date</th>";
echo "<th>Post</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
//Fill Table With Contents
if ($result = $mysqli->query("select tbTitle,tbAuthor,isbn,crn,date,location,userName from tbList ORDER BY id DESC LIMIT 30")) {
while($obj = $result->fetch_object()){
echo "<tr>";
echo "<td>".htmlspecialchars($obj->date)."</td>";
echo "<td><h2>".htmlspecialchars($obj->tbTitle)."</h2>";
echo "<h4>".htmlspecialchars($obj->tbAuthor)."</h4>";
echo "<p><span>ISBN: </span>".htmlspecialchars($obj->isbn)." ";
echo "<span>CRN: </span>".htmlspecialchars($obj->crn)."</p>";
echo "<p><span>Location: </span>".htmlspecialchars($obj->location)." ";
echo "<form action='contactFormSend.php' method='post'>";
echo " <input type='hidden' name='sellerId' value='".$obj->userName."'/>";
echo "<input type='submit' class='btn btn-default' value='Contact Seller'/>";
echo "</form></p></td>";
echo "</tr>";
}
$result->close();
}
echo "</table>";
?>
<button class="btn btn-info btn-block" onclick="showMorePosts()">Show More</button>
</br>
<?php include("_footer.php");?>