D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
stickain
/
public_html
/
itosu-ryu.us
/
Filename :
newsview.php
back
Copy
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF"> Edit Page <?PHP include 'body.inc'; include './includes/dbinfo.php'; echo $ID; echo "<table border=1><td>Select your choice of filters: <td><a href=$PHP_SELF?id=$id>All</a><td><a href=$PHP_SELF?id=$id&site=m>Itosu Ryu only</a><td><a href=$PHP_SELF?id=$id&site=dp>Dana Point only</a><td><a href=$PHP_SELF?id=$id&site=sc>San Clemente only</a><td><a href=$PHP_SELF?id=$id&site=occ>OCC only</a><td><tr></table>"; $site2="All Editable Sections"; if($site=="m"){$site2="Itosu Ryu USA";} if($site=="dp"){$site2="Dana Point";} if($site=="occ"){$site2="Orange Coast College";} if($site=="sc"){$site2="San Clemente";} echo "<center><font size=4><b>Currently Viewing $site2</b></font></center>"; ?> <?php // if change is set, then this updates record if (isset($change)) { // $sql = "UPDATE `kei_news` SET `headline` = '$headline', `body` = '$body' WHERE `newsID` = '$id' LIMIT 1"; // if (@mysql_query($sql)) { echo("<p>The news would have been updated.</p>"); $change = ""; // } //else { // echo("<p>Error Updating news: " . // mysql_error() . "</p>"); // } } // end change ?> <?php $query = "SELECT * FROM kei_news WHERE `newsID`='$id'"; $result = mysql_query($query); $numrows = mysql_num_rows($result); // echo "You have $numrows members in the database<br>"; // echo "<table border=2 width=80%><td>Section</a><td>Headline</a><td>body</a><td>edit<tr>"; while($row = mysql_fetch_array($result)) { echo "<br>$row[Section]"; $newsID=$id; $body=("$row[body]"); $headline=("$row[headline]"); } ?> <?php // displays selected book in the editing fields if($edit <> "Y"){ echo("<!--- "); } ?> <table border=1> <form action="<?php echo $PHP_SELF ?>" method="POST"> <td>1. Headline <td><input type="text" name="headline" value="<?php echo "$headline" ?>" size=90><br><tr> <td>2. body<td> <textarea name="body" cols="80" rows="5"><?php echo "$body" ?></textarea><br><tr> <td><td><input type="hidden" name="change" value="Y"><input type="hidden" name="id" value=<?php echo $newsID; ?>><input type="submit" value="Save News Changes"><tr> </form></table> <?php if($edit <> "Y"){ echo("---> "); } ?></table> <?php if(isset($site)){ $query = "SELECT * FROM kei_news Where `dojo`='$site' "; }else{ $query = "SELECT * FROM kei_news"; } $result = mysql_query($query); $numrows = mysql_num_rows($result); // echo "You have $numrows members in the database<br>"; echo "<table border=2 width=80%><td>Section</a><td>Headline</a><td>body</a><td>Click to edit<tr>"; while($row = mysql_fetch_array($result)) { echo "<td>$row[Section]"; echo "<td>$row[headline]"; echo "<td>$row[body] </font><td><a href=$PHP_SELF?edit=Y&id=$row[newsID]"; if(isset($site)){ echo ("&site="); echo "$site"; } echo ">Edit</a><tr>"; } echo "</table>"; ?> <? include 'bottom.inc'; ?>