?> <link rel="stylesheet" type="text/css" href="stylesheets/controlpanel.css"> <?php $admin = logged_in(); global $connection; $errors = errors(); ?> <?php echo message(); ?> <?php echo form_errors($errors); compress_table("events"); ?> <div id="tabstogglepanel"> <div style="text-align: center;" class="shortrow">Tab Control</div> <div class="tabcontrolwrap"> <div class="tabname">Home</div> <div class="checkboxwrap"> <div class="checkbox" onclick="flipStatus()" ></div> </div> </div> <div class="tabcontrolwrap"> <div class="tabname">About</div> <div class="checkboxwrap"> <div class="checkbox" onclick="flipStatus()" ></div> </div>
$query .= " id, videocode"; $query .= ") VALUES ("; $query .= " {$moveid}, '{$deleteditem['videocode']}'"; $query .= ")"; $result = mysqli_query($connection, $query); confirm_query($result); // Finished. $_SESSION["message"] = "Video positions updated!"; redirect_to("index.php?redirect=videos"); } } } ?> <?php compress_table($active_page); echo form_errors($errors); ?> <?php if (isset($_SESSION["message"])) { generate_prompt("Notification", message(), 'videos'); echo "<script type=\"text/javascript\">prompt_popup('videos', true);</script>"; } ?> <?php if ($admin) { ?> <form action="videos.php" method="post"> <?php
function remove_from_table($id, $table, $activepage) { global $connection; $query = "DELETE FROM {$table} "; $query .= "WHERE id = {$id} "; $query .= "LIMIT 1"; $result = mysqli_query($connection, $query); if ($result && mysqli_affected_rows($connection) == 1) { // Success $_SESSION["message"] = "Item deleted."; compress_table($table); // Shrink the table down. } else { // FAILURE. Awwwwww $_SESSION["message"] = "Item deletion failed!"; } redirect_to("index.php?redirect={$activepage}"); }