Update of /cvsroot/openfirst/manual
In directory sc8-pr-cvs1:/tmp/cvs-serv19432
Modified Files:
index.php
Log Message:
Allow multiple documents to have manuals (this should make this module a lot more useful).
Index: index.php
===================================================================
RCS file: /cvsroot/openfirst/manual/index.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** index.php 1 Jun 2003 04:26:58 -0000 1.1.1.1
--- index.php 12 Aug 2003 21:01:08 -0000 1.2
***************
*** 30,39 ****
?>
! <h1>openFIRST Manual</h1>
<?php
mysql_select_db($sqldatabase);
! if(isset($_GET["chapter"]) == false && isset($_GET["id"]) == false && isset($_POST["ID"]) == false) {
echo("<h2>Table of Contents</h2>");
! $query = "SELECT ID, title, chapter from ofirst_manual ORDER BY chapter, title;";
$q = mysql_query($query);
while($t = mysql_fetch_object($q)) {
--- 30,47 ----
?>
! <h1>Manual</h1>
<?php
mysql_select_db($sqldatabase);
! if(isset($_GET["chapter"]) == false && isset($_GET["id"]) == false && isset($_POST["ID"]) == false && isset($_GET["doc"]) == false) {
! echo("<p>The following manuals exist, and are able to be read and commented on:</p>");
! $query = mysql_query("SELECT document FROM ofirst_manual GROUP BY document;");
! if(mysql_num_rows($query) == 0) { echo("<p>There is currently no documentation available.</p>"); }
! while($q = mysql_fetch_object($query)) {
! echo($q->document);
! }
! }
! if(isset($_GET["chapter"]) == false && isset($_GET["id"]) == false && isset($_POST["ID"]) == false && isset($_GET["doc"]) == true) {
echo("<h2>Table of Contents</h2>");
! $query = "SELECT ID, title, chapter FROM ofirst_manual ORDER BY chapter, title WHERE document='" . $_GET["doc"] . "';";
$q = mysql_query($query);
while($t = mysql_fetch_object($q)) {
***************
*** 47,50 ****
--- 55,59 ----
if(isset($_POST["ID"]) == true) {
$id = $_POST["ID"];
+ $doc = $_POST["doc"];
echo("<p><strong>Note Added.</strong></p>");
$query = "SELECT notes FROM ofirst_manual WHERE ID='$id';";
***************
*** 57,61 ****
$_POST["name"] . " - " .
$_POST["email"] . "<br /> " .
! $_POST["note"] . "' WHERE ID='$id';";
$q = mysql_query($query);
} else {
--- 66,70 ----
$_POST["name"] . " - " .
$_POST["email"] . "<br /> " .
! $_POST["note"] . "' WHERE ID='$id' AND document='$doc';";
$q = mysql_query($query);
} else {
***************
*** 63,67 ****
}
! $query = "SELECT * FROM ofirst_manual WHERE ID='$id';";
$q = mysql_query($query);
$f = mysql_fetch_object($q);
--- 72,76 ----
}
! $query = "SELECT * FROM ofirst_manual WHERE ID='$id' AND document='" . $doc . "';";
$q = mysql_query($query);
$f = mysql_fetch_object($q);
***************
*** 114,117 ****
--- 123,127 ----
<table>
<tr><td><input type='hidden' name='ID' value='$f->ID'>Note Title
+ <input type='hidden' name='doc' value='$f->document'>
</td><td> <input type='text' name='title' />
</td></tr><tr><td>Your E-mail Address</td><td><input type='text' name='email' />
|