echo '<div class="top-spacer_20 center error">Error - missing ID value</div>';
    } elseif ($action == "update") {
        $year_end_staff_pick = get_year_end_staff_pick($id);
        echo "<form action=\"year_end_staff_picks_update.php?id=" . $id . "\" method=\"post\" class=\"form-internal inline input-seperation\" id=\"admin\">";
        require "partials/_year_end_staff_picks_form.php";
        echo "</form>";
    } else {
        $order = $_POST['order'];
        $html = $_POST['html'];
        if (!$order || !$html) {
            echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>';
        } else {
            $result = update_year_end_staff_picks($id, $order, $html);
            if ($result) {
                echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>';
                display_year_end_staff_pick(get_year_end_staff_pick($id));
                echo "</div>";
            }
        }
    }
    ?>
    <div class="top-spacer_20">
      <a href="year_end_staff_picks_view_all.php">View all Year End Staff Picks</a>
      <p>
      <a href="cp.php">Control Panel</a>
    </div>
  </div>
</div> <!-- end of row div -->
<?php 
}
require "partials/_footer.php";
예제 #2
0
function view_all_year_end_staff_picks()
{
    $query = "SELECT * FROM year_end_staff_picks WHERE deleted = 'n' ORDER BY order_id";
    $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_year_end_staff_pick($info);
        echo '[ <a href="year_end_staff_picks_update.php?id=' . $info[id] . '">Edit</a> | <a href="year_end_staff_picks_delete.php?id=' . $info[id] . '">Delete</a> ] <p>';
    }
    echo '</ol>';
}