require "partials/_ondemand_form.php"; echo "</form>\n <div class=\"footnote\">** if any links are over 128 characters: use <a href=\"http://www.bit.ly\" target=_new>bit.ly</a> to shorten the url</div>"; } else { $date = $_POST['date']; $image = $_POST['image']; $headline = $_POST['headline']; $note = $_POST['note']; $songs = $_POST['songs']; $audio_id = $_POST['audio_id']; if (!$date || !$image || !$headline || !$note || !$songs || !$audio_id) { echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>'; } else { $result = update_on_demand($id, $date, $image, $headline, $note, $songs, $audio_id); if ($result) { echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>'; display_on_demand(get_on_demand($id)); echo "</div>"; } } } ?> <div class="top-spacer_20"> <a href="ondemand_view_all.php">View all On Demands</a> <p> <a href="cp.php">Control Panel</a> </div> </div> </div> <!-- end of row div --> <?php } require "partials/_footer.php";
function view_all_on_demands() { $query = "SELECT * FROM ondemand WHERE deleted = 'no' ORDER BY date Desc"; $result = mysql_query($query); if (!$result) { echo "error: " . $query; die('Invalid'); } echo '<ol>'; for ($i = 1; $i <= mysql_num_rows($result); $i++) { $info = mysql_fetch_assoc($result); display_on_demand($info); echo '<br>[ <a href="ondemand.php?id=' . $info[id] . '" target=_new >Listen</a> | <a href="ondemand_update.php?id=' . $info[id] . '">Edit</a> | <a href="ondemand_delete.php?id=' . $info[id] . '">Delete</a> ] <p>'; } echo '</ol>'; }