/** * Write out one or more INPUT elements for the given name-value pair. * * If the value is a string, this function will write a single INPUT element. * If the value is an array, it will write multiple INPUT elements to * recreate the array. * * @param string $name The name of the element. * @param string|array $value The value of the element. */ function printItem($name, $value) { assert('is_string($name)'); assert('is_string($value) || is_array($value)'); if (is_string($value)) { echo '<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />'; return; } // This is an array... foreach ($value as $index => $item) { printItem($name . '[' . $index . ']', $item); } }
</form> <br> <?php if (isset($_POST['item'])) { $item = $_POST['options']; // echo $item; } $item = ucfirst(strtolower($_POST["item"])); if ($item !== null) { $result = executePlainSQL("SELECT * FROM item WHERE type = '" . $item . "' OR iid = '" . $item . "' OR Description LIKE '%" . $item . "%'"); } else { $result = executePlainSQL("SELECT * FROM item"); } printItem($result); function printItem($result) { echo "<div class='Pokeguide'>"; echo "<table>"; echo "<tr><td>IID</td><td>Type</td><td>Description</td></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td></tr>"; } echo "</table>"; echo "</div>"; } ?>
public function getMain() { $output = ""; $output .= "<h2>Bibliography</h2>"; $firstLetter = ""; foreach ($this->items as $item) { // output headers per letter if (isset($item["author"])) { $author = $item["author"]; } else { $author = $item["editor"]; } if ($firstLetter != strtoupper($author[0])) { if ($firstLetter != "") { $output .= "</ul>"; $output .= "<p class='up'><a href='#'>go back up</a></p>"; } $output .= "<h3 id='" . strtoupper($author[0]) . "'>" . strtoupper($author[0]) . "</h3><ul class='bibliography'>"; $firstLetter = strtoupper($author[0]); } $output .= printItem($item['name'], $item); } $output .= "</ul>"; return $output; }
function wTraktTrendingShows() { global $num; $result = traktMethods("shows/trending"); if (!empty($result)) { $i = 0; foreach ($result as $episodes) { //print_r($episodes) $title = $episodes->title; $year = $episodes->year; $url = $episodes->url; $aired = $episodes->first_aired; $country = $episodes->country; $overview = $episodes->overview; $runtime = $episodes->runtime; $network = $episodes->network; $airday = $episodes->air_day; $airtime = $episodes->air_time; $cert = $episodes->certification; $imdb = $episodes->imdb_id; $tvdb = $episodes->tvdb_id; $tvrage = $episodes->tvrage_id; $poster = $episodes->images->poster; $fanart = $episodes->images->fanart; $watchers = $episodes->watchers; if ($i == $num) { printItem('tv', $url, $title, $year, $poster, $overview, $runtime, $imdb, $tvdb); return false; } $i++; } } }
if ($pagesize > 0) { $limit = "LIMIT {$pagesize}"; } unset($offset); if ($page > 0) { $offset = 'OFFSET ' . $page * $pagesize; } unset($orderBy); if (empty($sortMode) || $sortMode == 'new') { $orderBy = 'ORDER BY c.updated DESC'; } else { if ($sortMode == 'alpha') { $orderBy = 'ORDER BY c.name'; // FIXME: i18n } else { if ($sortMode == 'down') { $orderBy = 'ORDER BY c.downloads DESC'; } } } /* else if ($sortMode == 'high') { ratings are not supported } */ $items = db_query($db, "SELECT c.id, c.name, c.version, c.updated, c.created, c.author, c.homepage, c.downloads, c.preview FROM content c LEFT JOIN providers p ON (c.provider = p.id) WHERE {$where} {$orderBy} {$limit} {$offset};"); printHeader($totalItemCount, $pagesize, $page); $itemCount = db_numRows($items); for ($i = 0; $i < $itemCount; ++$i) { list($id, $name, $version, $updated, $created, $author, $homepage, $downloads, $preview) = db_row($items, $i); printItem($id, $name, $version, $updated, $created, '', $author, $homepage, $downloads, $preview); } printFooter();
//Returns true if the keyword is in the owner's name $user_match = strpos(strtolower($keyword), strtolower($ownerInfo[0]["fname"])) || strpos(strtolower($keyword), strtolower($ownerInfo[0]["lname"])); //If either of these are true if ($user_match || $item_match) { //Print the item to the board printItem(trim($item["id"])); //Increment the item count $cnt++; //Break out of the parent for loop break 1; } } } } } else { printItem(trim($item["id"])); } } //If no items were found if ($cnt == 0 && $keyword != "") { //Aplogize echo "We're sorry, but it seems no one has posted "; //If there was a keyword to begin with if (trim($keyword) != "") { //Append the keyword to the apology string echo "'" . $keyword . "'"; } else { echo " this item "; //Be generic } //Finish off the apology string with a link to Amazon
<!-- MENU PAGE end --> <!-- TYPE PAGE begin --> <?php $queryType = "SELECT TYPE_ID, NAME FROM TYPE"; if ($r = mysql_query($queryType)) { while ($row = mysql_fetch_array($r)) { printType($row['TYPE_ID'], $row['NAME']); } } // INDIVIDUAL ITEM PAGE begin.. $query = "SELECT * FROM MENU_ITEM"; if ($r2 = mysql_query($query)) { while ($row2 = mysql_fetch_array($r2)) { printItem($row, $row2); } } // INDIVIDUAL ITEM PAGE end ?> <!--TYPE PAGE end --> <!-- ABOUT US PAGE begin... --> <div data-role="page" id="aboutus-page"> <div class="page-width"> <!-- panel --> <?php printPanel("aboutus-panel"); ?> <!-- /panel -->
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIE, 'api_key=' . getenv("CHANGECALENDARAPIKEY")); $json = curl_exec($ch); curl_close($ch); $rfc = json_decode($json); $print = ''; $count = 0; $closestRfc = ''; $closestCheck = false; if ($rfc != null) { $items = $rfc->item; $print .= '<table id="rfcTable" class="sortable">'; $print .= '<th style="width: 11%;">Date</th><th style="width: 24%;">Name</th><th style="width: 55%;" class="sorttable_nosort">Purpose</th><th style="width: 10%;">Status</th>'; if (is_array($items)) { foreach ($items as $item) { printItem($item, $now); } } else { printItem($items, $now); } $print .= '</table>'; if ($count != 0) { echo $print; } else { echo '<br /><div style="width: 100%; text-align: center; font-weight: bold; margin-bottom: 8px;"><table style="margin-left: auto; margin-right: auto;"><tr><th style="height: 2em; vertical-align: middle;"> There are currently no RFCs. </th></tr></table></div>'; } } else { echo '<br /><div style="width: 100%; text-align: center; font-weight: bold; margin-bottom: 8px;"><table style="margin-left: auto; margin-right: auto;"><tr><th style="height: 2em; vertical-align: middle;"> There are currently no calendar items of any kind. </th></tr></table></div>'; }