Example #1
0
function view_all_cdotw()
{
    $query = "SELECT * FROM cdotw WHERE deleted = 'no' ORDER BY date DESC LIMIT 64";
    $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_cdotw($info);
        echo '<br>[ <a href="cdotw_update.php?id=' . $info[id] . '">Edit</a> | <a href="cdotw_delete.php?id=' . $info[id] . '">Delete</a> ] <p>';
    }
    echo '</ol>';
}
Example #2
0
    } else {
        $artist = $_POST['artist'];
        $title = $_POST['title'];
        $label = $_POST['label'];
        $review = $_POST['review'];
        $cd_pic_url = $_POST['cd_pic_url'];
        $band_url = $_POST['band_url'];
        $reviewer = $_POST['reviewer'];
        $date = $_POST['date'];
        if (!$artist || !$title || !$label || !$review || !$cd_pic_url || !$band_url || !$reviewer || !$date) {
            echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>';
        } else {
            $result = update_cdotw($id, $artist, $title, $label, $review, $cd_pic_url, $band_url, $reviewer, $date);
            if ($result) {
                echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>';
                display_cdotw(get_cdotw($id));
                echo "</div>";
            }
        }
    }
    ?>
    <div class="top-spacer_20">
      <a href="cdotw_view_all.php">View all CD of the Weeks</a>
      <p>
      <a href="cp.php">Control Panel</a>
    </div>
  </div>
</div> <!-- end of row div -->
<?php 
}
require "partials/_footer.php";