require "partials/_deejay_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 { $name = $_POST['name']; $show = $_POST['show']; $email = $_POST['email']; $external_connect_text = $_POST['external_connect_text']; $external_connect_url = $_POST['external_connect_url']; $pic = $_POST['pic']; if (!$name || !$email) { echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>'; } else { $result = update_deejay($id, $name, $show, $email, $external_connect_text, $external_connect_url, $pic); if ($result) { echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>'; display_deejay(get_deejay($id)); echo "</div>"; } } } ?> <div class="top-spacer_20"> <a href="deejay_view_all.php">View all Deejays</a> <p> <a href="cp.php">Control Panel</a> </div> </div> </div> <!-- end of row div --> <?php } require "partials/_footer.php";
function view_all_deejays() { $query = "SELECT * FROM deejays WHERE deleted = 'no' ORDER BY name"; $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_deejay($info); echo '<br>[ <a href="deejay_update.php?id=' . $info[id] . '">Edit</a> | <a href="deejay_delete.php?id=' . $info[id] . '">Delete</a> ] <p>'; } echo '</ol>'; }