Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // modify_news.php
- // Make sure that the user has authenticated
- include("connect.php");
- include("check_auth.php");
- ?>
- <html>
- <link href="style.css" rel="stylesheet" type="text/css">
- <title>Modify News</title>
- <head>
- <script type="text/javascript">
- <!--
- function checkApply(sel,rid) {
- if (sel.options[sel.selectedIndex].value) {
- // alert(rid);
- document.status_form["change_list["+rid+"]"].checked = true;
- }
- }
- -->
- </script>
- </head>
- <body>
- <div id="wrapper">
- <font color="red"><? echo $_GET[message] ?></font>
- <table>
- <tr>
- <th>Headline</th><th>Author</th><th>Create Date</th><th>Status</th><th>Apply</th>
- </tr>
- <?
- $query = "SELECT * FROM news_articles ";
- $query .= "ORDER BY create_date DESC";
- $results = mysql_query($query);
- echo ( "<form method=\"post\" action=\"process_news.php\" name=\"status_form\">\n" );
- echo ( "<input type=\"hidden\" name=\"task\" value=\"cs_delete\" />\n" );
- while( $row = mysql_fetch_array($results) ) {
- echo ( "<tr><td><a href=\"news_form.php?id=$row[id]\" title=\"Last modified $row[modify_date]\">" .
- "$row[headline]</a></td>" .
- "<td>$row[author]</td><td>$row[create_date]</td>\n" );
- $selected[$row[status]] = ' selected="selected"';
- echo ( "<td class=\"thethe\"><select name=\"status[$row[id]]\" onchange=\"checkApply(this,$row[id])\">" );
- echo ( "<option value=\"enabled\"$selected[enabled]>Enabled</option>\n" );
- echo ( "<option value=\"disabled\"$selected[disabled]>Disabled</option>\n" );
- echo ( "<option value=\"archived\"$selected[archived]>Archived</option>\n" );
- echo ( "<option value=\"delete\">Delete</option>\n" );
- echo ( "</select></td>\n" );
- echo ( "<td><input type=\"checkbox\" name=\"change_list[$row[id]]\" value=\"$row[id]\" /></td></tr>\n" );
- // clear the $selected hash
- unset( $selected );
- }
- ?>
- <tr><td colspan="5">
- <input type="submit" value="Process Articles"></td></tr>
- </form>
- </table>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment