Location: PHPKode > projects > K-12 OSS Web Software Project > equest_0.1/teacher/links.php
<?php
include("../config.php");

session_start();
if (!(isset($_SESSION['teacher']))) {
       header("Location: ../index.php");
       exit();
   }

$query = "SELECT poster_unique FROM posters WHERE poster_unique='{$_REQUEST["poster"]}'"; 
$result = mysql_query($query) or die(mysql_error());
$res = mysql_fetch_array($result);
?>

<html><head>
<title>Engima Poster System</title>
<link type="text/css" rel="stylesheet" href="./styles.css">

</head>
<body>
<table class="maintable" bordercolor="#000066" cellspacing="0" cellpadding="3" align="center" border="1" width="600">
<tbody>
<?php include("./header.php"); ?>

<!-- start teacher list block -->
  <tr>
    <td class="text" bgcolor="#ffffff" valign="top">
<blockquote>
<blockquote>
<ul>
<li><a href="members.php">Return to student poster list</a>
</ul>
</blockquote>
<hr>
	<form ACTION="links_post.php" NAME="user" METHOD="POST">
	<input TYPE="hidden" NAME="poster_unique" value="<?php echo $res["poster_unique"];?>">
		<blockquote>
			<h2>Links</h2>
			<p>Make your changes and click "Update!" to make corrections to your poster</p>
			<blockquote>
			
				<ol>
<?php
	$query = "SELECT link_title,link_url FROM links WHERE link_unique='1' AND link_poster='{$res["poster_unique"]}'";
	$result = mysql_query($query) or die(mysql_error());
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))	
	{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label1\" size=\"50\" value=\"{$row["link_title"]}\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link1\" VALUE=\"{$row["link_url"]}\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update1\" VALUE=\"insert\">\n";
	}
$numrows=mysql_num_rows($result);
if ($numrows == 0)
{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label1\" size=\"50\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link1\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update1\" VALUE=\"update\">\n";
}
?>
<?php
	$query = "SELECT link_title,link_url FROM links WHERE link_unique='2' AND link_poster='{$res["poster_unique"]}'";
	$result = mysql_query($query) or die(mysql_error());
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))	
	{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label2\" size=\"50\" value=\"{$row["link_title"]}\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link2\" VALUE=\"{$row["link_url"]}\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update2\" VALUE=\"insert\">\n";
	}
$numrows=mysql_num_rows($result);
if ($numrows == 0)
{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label2\" size=\"50\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link2\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update2\" VALUE=\"update\">\n";
}
?>
<?php
	$query = "SELECT link_title,link_url FROM links WHERE link_unique='3' AND link_poster='{$res["poster_unique"]}'";
	$result = mysql_query($query) or die(mysql_error());
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))	
	{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label3\" size=\"50\" value=\"{$row["link_title"]}\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link3\" VALUE=\"{$row["link_url"]}\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update3\" VALUE=\"insert\">\n";
	}
$numrows=mysql_num_rows($result);
if ($numrows == 0)
{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label3\" size=\"50\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link3\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update3\" VALUE=\"update\">\n";
}
?>
<?php
	$query = "SELECT link_title,link_url FROM links WHERE link_unique='4' AND link_poster='{$res["poster_unique"]}'";
	$result = mysql_query($query) or die(mysql_error());
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))	
	{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label4\" size=\"50\" value=\"{$row["link_title"]}\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link4\" VALUE=\"{$row["link_url"]}\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update4\" VALUE=\"insert\">\n";
	}
$numrows=mysql_num_rows($result);
if ($numrows == 0)
{
	print "<li>Label:&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"label4\" size=\"50\"><br>\n";
	print "URL:&nbsp;&nbsp;&nbsp;<input TYPE=\"text\" NAME=\"link4\" size=\"50\"><br><br>\n";
	print "<input TYPE=\"hidden\" NAME=\"update4\" VALUE=\"update\">\n";
}
?>
				</ol>
			
			</blockquote>
	<hr>

	<b>Reason for changes:</b>
	<br>
	<blockquote>
	<p></p>
	<p>Please enter the reasons for your student to see why you made these changes (max 254 characters)</p>
	<input TYPE="text" NAME="reason_change" size="80"><input TYPE="hidden" NAME="reason_page" value="image">	
	</blockquote>
			<hr>
		</blockquote>
		<div align="center">
			<input TYPE="submit" value="Update!">
		</div>
	</form>
    </td>
  </tr>
<!-- end teacher list block -->

<?php include("./footer.php"); ?>
Return current item: K-12 OSS Web Software Project