Exemplo n.º 1
0
 public function testAddDeleteDVD()
 {
     $many_all = get_all("dvd");
     $this->assertTrue(sizeof($many_all) > 0, "should be at least one dvd in the db");
     $it = get_dvd_by_title($this->the_title);
     $this->assertEqual($it['title'], $this->the_title);
 }
Exemplo n.º 2
0
session_start();
require_once "dvd-util.php";
require_once "dvd-db.php";
ensure_authenticated();
if (array_key_exists('title', $_GET)) {
    $title = "";
    if (array_key_exists('title', $_GET)) {
        $title = $_GET['title'];
    } else {
        error("Did you select a DVD?");
        return 1;
    }
    include "../dvd-lib-common/head.php";
    echo "<h2>Please make any necessary changes below</h2><br />";
    $the_dvd = get_dvd_by_title($title);
    $all_genres = get_all_genres();
    $_SESSION['dvd_title'] = $the_dvd[0];
    if ($the_dvd[0] == $_SESSION['last_edit']) {
        echo "<b>DVD Updated!</b><br/>\n";
        $_SESSION['last_edit'] = NULL;
    }
    $title = $the_dvd[0];
    $release_year = $the_dvd[1];
    $director = $the_dvd[2];
    $rating = $the_dvd[3];
    $genre = $the_dvd[4];
    $genre_option_list = "";
    foreach ($all_genres as $g) {
        $selected = "";
        if ($g == $genre) {