Exemplo n.º 1
1
        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";
Exemplo n.º 2
0
function delete_on_demand($id)
{
    $update = "UPDATE ondemand SET deleted ='yes' where id=" . $id;
    $result = mysql_query($update);
    if (!$result) {
        echo "'Error deleting the on demand entry from the database: " . $update . "<br>";
    } else {
        $ondemand = get_on_demand($id);
        echo "<div class=\"center\"><h1>Success!</h1>" . "<h3>The on demand entry <span class=\"success\">" . $ondemand['headline'] . "</span>, has been deleted.</h3></div>";
    }
}