function IndexCategoryList() { echo "<table>"; $i = 0; while (1) { if (numberToCategory($i) == "Category doesn't exist") { break; } else { echo "<tr ><td id ='indextable'><a value=\"{$i}\" href = 'search.php?y={$i}'>"; echo numberToCategory($i); echo "</a></td></tr>"; } $i++; } echo "</table>"; }
function createCategoryList() { if (ctype_digit($_GET['category'])) { $x = $_GET['category']; } else { $x = 999; } echo "<option>All Categories</option>"; $i = 0; while (1) { if (numberToCategory($i) == "Category Does Not Exist") { break; } else { echo " <option value=\"{$i}\" "; if ($i == $x) { echo ' SELECTED '; } echo " >"; echo numberToCategory($i); echo "</option>"; } $i++; } }
function page_link($y) { if ($y == -1) { echo "<div id='selected_link'><a href='index.php?y=-1'> All categories</a></div>"; } else { echo "<div id='page_link'><a href='index.php?y=-1'> All categories</a></div>"; } $i = 0; while (1) { if (numberToCategory($i) == "Category Does Not Exist") { break; } if ($i != $y) { echo "<div id='page_link'><a href='index.php?y={$i}'>" . numberToCategory($i) . "</a></div>"; } else { echo "<div id='selected_link'><a href='index.php?y={$i}'>" . numberToCategory($i) . "</a></div>"; } $i++; } }