if (!empty($strInputSuburb) || !empty($strInputStreet)) { //Connect to database server and table include "connection.php"; @mysqli_select_db($conn, "cl57-henningdb") or die("Database not available"); $querySql1 = "select * from Infringement \n\t\t\t\t\t\t\t where suburb like '%" . mysqli_real_escape_string($conn, $strInputSuburb) . "%' and Street1 like '%" . mysqli_real_escape_string($conn, $strInputStreet) . "%'\n \t\t\t\t order by Suburb, Fines DESC"; $result1 = mysqli_query($conn, $querySql1) or die("No information return..."); $count = mysqli_num_rows($result1); $i = 1; if (!$count == 0) { echo "<div class='row' id='tableTop'>"; //table-responsive, scroll the table horizontally echo "<div class='col-md-10 col-md-offset-1 table-responsive'>"; echo "<table class='table table-bordered table-hover' id='showTable'>"; echo "<tr><th>#</th><th>Location</th><th>Suburb</th><th>No. of Infringements</th><th>Fines(\$)</th></tr>"; while ($Row = mysqli_fetch_array($result1)) { echo "<tr><td>" . $i . "</td><td>Intersection of " . $Row['Street1'] . " and " . $Row['Street2'] . "</td><td>" . $Row['Suburb'] . "</td><td>" . NUMBER_FORMAT($Row['NoOfInfringement'], 0, '.', ',') . "</td><td>" . NUMBER_FORMAT($Row['Fines'], 0, '.', ',') . "</td></tr>"; $i++; } echo "</table>"; echo "</div>"; echo "</div>"; } else { echo "<div style='padding:9px 0 0 5px;color:grey' id='Alertposition' class='col-md-3 col-md-offset-2'>"; echo "<div class='alert alert-danger' role='alert'>"; echo "No data found! Please search again!"; echo "</div>"; echo "</div>"; } //Release the SQL clause mysqli_free_result($result1); //Close the connection to database
} else { // If there was more than one word, highlight each individual word $output = $row["outblab"]; for ($i = 0; $i < $term_count; $i++) { $output = preg_replace("/" . $terms[$i] . "/", "<b style=\"background-color:#990000;\">\$1</b>", $output); } } print " <tr>\n"; print " <td width=\"20\" align=\"center\" valign=\"top\">\n"; print " <img src=\"/images/dot-red.gif\" width=\"6\" height=\"6\" border=\"0\">\n"; print " </td>\n"; print " <td width=\"330\" align=\"left\" valign=\"top\">\n"; printf("<a href=\"bioitem.php?p_bio_id=%s&p_term=%s\">", $row["bio_id"], $p_term); // printf("%s</a> ",$row["outdate"]); printf("%s</a> ", $row["bioyear"]); printf("(%s%)<br />", NUMBER_FORMAT($row["score"] * 10, 2, '.', ',')); printf(" <i>%s...</i><br /><br />\n", $output); print " </td>\n"; print " </tr>\n"; } print " </table><br /><br />\n"; print " </td>\n"; print " </tr>\n"; print "</table>\n"; print "</div>\n"; include "elements/footers.php"; } else { $pagetitle = "My Bio: Search: No Results"; // default html header with comments include "elements/header.php"; print "<body>\n";
function TABLEDIR_FOOTER($BGC, $FGC) { /* This function write the data in the footer of the dirtreeview table. */ if (empty($BGC)) { $BGC = "MAROON"; } if (empty($FGC)) { $FGC = "WHITE"; } ?> <Tr BGCOLOR="<?php echo $BGC; ?> " ALIGN="center" VALIGN="top"> <Td COLSPAN="14"><B><I><Font COLOR="<?php echo $FGC; ?> ">This page has been created in <?php echo NUMBER_FORMAT($_SESSION['Total_Time'], 2, ',', '.'); ?> seconds</Td> </Tr> </Table> <Br> <?php }