コード例 #1
0
ファイル: story_update.php プロジェクト: ynotradio/site
        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 {
        $headline = $_POST['headline'];
        $story = $_POST['story'];
        $start_date = $_POST['start_date'];
        $end_date = $_POST['end_date'];
        $pic = $_POST['pic'];
        $pic_url = $_POST['pic_url'];
        $priority = $_POST['priority'];
        if (!$start_date || !$end_date || !$headline || !$story || !$pic || !$pic_url || !$priority) {
            echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>';
        } else {
            $result = update_story($id, $headline, $story, $start_date, $end_date, $pic, $pic_url, $priority);
            if ($result) {
                echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>';
                display_story(get_story($id));
                echo "</div>";
            }
        }
    }
    ?>
    <div class="top-spacer_20">
      <a href="story_view_all.php">View all Stories</a>
      <p>
      <a href="cp.php">Control Panel</a>
    </div>
  </div>
</div> <!-- end of row div -->
<?php 
}
require "partials/_footer.php";
コード例 #2
0
ファイル: story_fns.php プロジェクト: ynotradio/site
function view_all_stories()
{
    $query = "SELECT * FROM stories WHERE deleted = 'n' AND end_date >= now() ORDER BY priority";
    $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_story($info);
        echo '<br>[ <a href="story_update.php?id=' . $info[id] . '">Edit</a> | <a href="story_delete.php?id=' . $info[id] . '">Delete</a> ] <p>';
    }
    echo '</ol>';
}