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

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

<html><head>
<title>eQuest Web Quest 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"); ?>
<?
if (!get_magic_quotes_gpc()) { 
$desc1 = $_POST["desc1"];
$desc2 = $_POST["desc2"];
$desc3 = $_POST["desc3"];
$desc4 = $_POST["desc4"];
$desc5 = $_POST["desc5"];
$desc6 = $_POST["desc6"];
$desc7 = $_POST["desc7"];
$desc8 = $_POST["desc8"];
$desc9 = $_POST["desc9"];
$desc10 = $_POST["desc10"];
$mytitle = $_POST["mytitle"];
$intro = $_POST["intro"];
$task = $_POST["task"];
$process = $_POST["process"];
$resource = $_POST["resource"];
$evalu = $_POST["evalu"];
$conc = $_POST["conc"];
}

$link1 = $_POST["link1"];
$link2 = $_POST["link2"];
$link3 = $_POST["link3"];
$link4 = $_POST["link4"];
$link5 = $_POST["link5"];
$link6 = $_POST["link6"];
$link7 = $_POST["link7"];
$link8 = $_POST["link8"];
$link9 = $_POST["link9"];
$link10 = $_POST["link10"];

$update1 = $_POST["update1"];
$update2 = $_POST["update2"];
$update3 = $_POST["update3"];
$update4 = $_POST["update4"];
$update5 = $_POST["update5"];
$update6 = $_POST["update6"];
$update7 = $_POST["update7"];
$update8 = $_POST["update8"];
$update9 = $_POST["update9"];
$update10 = $_POST["update10"];
$quest_unique = $_POST["quest_unique"];
$quest_teacher = $_POST["quest_teacher"];
$pic = $_POST["pic"];

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

$insertSQL = "UPDATE quests SET 
              quest_teacher='$quest_teacher',
              quest_title='$mytitle',
              quest_image='$pic',
              quest_intro='$intro',
              quest_task='$task',
              quest_process='$process',
              quest_resource='$resource',
              quest_eval='$evalu',
              quest_conclusion='$conc',
              quest_date='$mydate' WHERE quest_unique='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());

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

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

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

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

if($update5 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$desc5',
              link_url='$link5' WHERE
              link_unique='5' AND link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($desc5!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$desc5',
              link_url='$link5',
              link_unique='5',
	      link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}

if($update6 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$desc6',
              link_url='$link6' WHERE
              link_unique='6' AND link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($desc6!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$desc6',
              link_url='$link6',
              link_unique='6',
	      link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($update7 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$desc7',
              link_url='$link7' WHERE
              link_unique='7' AND link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($desc7!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$desc7',
              link_url='$link7',
              link_unique='7',
	      link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($update8 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$desc8',
              link_url='$link8' WHERE
              link_unique='8' AND link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($desc8!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$desc8',
              link_url='$link8',
              link_unique='8',
	      link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($update9 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$desc9',
              link_url='$link9' WHERE
              link_unique='9' AND link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($desc9!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$desc9',
              link_url='$link9',
              link_unique='9',
	      link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($update10 == "insert") {
$insertSQL = "UPDATE links SET
	      link_title='$desc10',
              link_url='$link10' WHERE
              link_unique='10' AND link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
elseif($desc10!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$desc10',
              link_url='$link10',
              link_unique='10',
	      link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
?>

<!-- start teacher list block -->
  <tr>
    <td class="text" bgcolor="#ffffff" valign="top">
<center>
<blockquote>
<h2>Your Web Quest has been updated!</h2>
<p><a href="members.php">Click here to return to your web quests</a></p>
</blockquote>
</center>
    </td>
  </tr>
<!-- end teacher list block -->


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