This repository has been archived by the owner on Feb 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
listneeded.php
68 lines (68 loc) · 1.51 KB
/
listneeded.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
$page_title = "Needed Plants";
$page_subtitle = "List";
include("templates/header.php");
include("inc/sql_queries.php");
function echo_data($data, $item) {
/*
Echos existing data, makes sure that it exists
*/
if(isset($data[$item]) && !empty($data[$item])) {
echo $data[$item];
}
}
?>
<div class="col-lg-12">
<?php
$data = select_all_needed_plants();
?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Needed Plants</h3>
</div>
<div class="panel-body">
<?php
if(count($data)):
?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Name</th>
<th>Color</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<?php
foreach($data as $row):
?>
<tr>
<td><?php echo $row["CommonName"].(empty($row["ScientificName"]) ? "" : " (".$row['ScientificName'].")"); ?></td>
<td><?php echo $row["Color"]; ?></td>
<td><?php echo $row["Quantity"]; ?></td>
</tr>
<?php
endforeach;
?>
<tbody>
<!--
<tfoot>
<tr>
<th></th>
</tr>
</tfoot>
-->
</table>
<?php
else:
?>
<p>Sorry There is No Data Yet</p>
<?php
endif;
?>
</div>
</div>
</div>
<?php
include("templates/footer.php");
?>