Thanks,
Aaron
Code: Select all
<html>
<head>
<script language="JavaScript">
function test1(form) {
document.form1.update.click();
}
</script>
<title>Edit Findings</title>
<style>
.bg {color: white;.background-color: navy}
</style>
</head>
<body>
<h3>Edit Findings</h3>
<?php
//connect to db;
include('findings.inc');
//error_reporting(0);
//instantiate class
$mydb = new Findings();
//connect to db
$mydb->SQL_connect();
$tablename = "study_findings";
//select fields of study selected
$cur1 = MYSQL_QUERY ("select * from $tablename where study_id_fk = '$study_id' AND sf_id='$sf_id'");
$short_title = stripslashes($short_title);
echo "<h4><i>$short_title</i></h4>";
//loop through results to display
while ($row = mysql_fetch_array($cur1, MYSQL_ASSOC)) {
//display individual study for editing
?>
<form name="form1" method="post" action="update.php">
<table width="75%" border="1">
<tr>
<td align=top>Citation</td>
<td> <TEXTAREA NAME="citation" ROWS="3" COLS="67"><?php echo $row['citation']; ?></TEXTAREA></td>
</tr>
<tr>
<td>Finding Type</td>
<td>
<?php
if ($row['publications']) {
echo "<input type='checkbox' name='publications' checked>publications";
}
else {
echo "<input type='checkbox' name='publications'>publications";
}
if ($row['reports_briefs']) {
echo "<input type='checkbox' name='reports_briefs' checked>reports & briefs";
}
else {
echo "<input type='checkbox' name='reports_briefs'>reports & briefs";
}
if ($row['presentations']) {
echo "<input type='checkbox' name='presentations' checked>presentations";
}
else {
echo "<input type='checkbox' name='presentations'>presentations";
}
if ($row['other']) {
echo "<input type='checkbox' name='other' checked>other";
}
else {
echo "<input type='checkbox' name='other'>other";
}
?>
</td>
</tr>
<tr>
<td>Citation Date</td>
<td><input type="text" name="citation_date" value="<?php echo $row['citation_date']; ?>"></td>
</tr>
<tr>
<td><p>Date Entered</p></td>
<td><?php echo $row['date_entered']; ?></td>
</tr>
<tr>
<td><p>Date Modified</p></td>
<td>Automatic</td>
</tr>
<tr>
<td><p>Blank Space</p></td>
<td><input type="text" name="blank_space" value="<?php echo $row['blank_space']; ?>"></td>
<td><input type='hidden' name='short_title' value='<?php echo $short_title; ?>'></td>
<td WIDTH = 50><INPUT TYPE='HIDDEN' NAME='study_id' value="<?php echo $study_id; ?>"></TD>
<td WIDTH = 50><INPUT TYPE='HIDDEN' NAME='sf_id' value="<?php echo $sf_id; ?>"></TD>
</tr>
<tr>
<td ALIGN=LEFT WIDTH=120></td><td align=right><INPUT TYPE="submit" NAME="update" VALUE="Update"> <INPUT TYPE="SUBMIT" NAME="delete" VALUE="Delete"></td>
</tr>
</table>
</form>
<table width="75%" border="1">
<tr>
<td>
</form>
<form enctype="multipart/form-data" action="update.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadfile[]" value="uploadfile" type="file" /><br />
Upload one pager: <input name="uploadfile[]" value="onepager" type="file" /><br />
</td>
<tr>
<td align=right width=100><input type="submit" name="upload" value="Upload File" onClick="test1(this.form);"></td>
</tr>
</form>
</table>
</body>
</html>
<?php
} //end mysql_fetch_array
?>