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

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

<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>
<?
if (!get_magic_quotes_gpc()) { 
$label1 = $_POST["label1"];
$label2 = $_POST["label2"];
$label3 = $_POST["label3"];
$label4 = $_POST["label4"];
}

$link1 = $_POST["link1"];
$link2 = $_POST["link2"];
$link3 = $_POST["link3"];
$link4 = $_POST["link4"];

$update1 = $_POST["update1"];
$update2 = $_POST["update2"];
$update3 = $_POST["update3"];
$update4 = $_POST["update4"];
$poster_unique = $_POST["poster_unique"];

$mydate = date('Y-m-d H:i:s');

$insertSQL = "INSERT INTO comments SET 
              com_text='$reason_change',
              poster_id='{$_POST["poster_unique"]}',
              com_page='{$_POST["reason_page"]}',
              com_date='$mydate'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());

if($update1 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$label1',
              link_url='$link1' WHERE
              link_unique='1' AND link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($label1!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label1',
              link_url='$link1',
              link_unique='1',
	      link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}

if($update2 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$label2',
              link_url='$link2' WHERE
              link_unique='2' AND link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($label2!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label2',
              link_url='$link2',
              link_unique='2',
	      link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}

if($update3 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$label3',
              link_url='$link3' WHERE
              link_unique='3' AND link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($label3!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label3',
              link_url='$link3',
              link_unique='3',
	      link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}

if($update4 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$label4',
              link_url='$link4' WHERE
              link_unique='4' AND link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($label4!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label4',
              link_url='$link4',
              link_unique='4',
	      link_poster='$poster_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}


$insertSQL = "UPDATE posters SET poster_edited='$mydate' WHERE poster_unique='{$_POST["poster_unique"]}'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
?>

<h3>Changes made to student's poster.</h3>
<hr>
<ul>
<li><a href="members.php">Return to student poster list</a>
</ul>
</blockquote>
    </td>
  </tr>
<!-- end teacher list block -->


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