File: 0.00.0a/web/eval.action.php (View as HTML)

  1: <?php
  2: ob_start();
  3: require("include.php");
  4: $NATS->Start();
  5: if (!$NATS_Session->Check($NATS->DB))
  6: 	{
  7: 	header("Location: ./?login_msg=Invalid+Or+Expired+Session");
  8: 	exit();
  9: 	}
 10: if ($NATS_Session->userlevel<5) UL_Error("Action Test Eval");
 11: 
 12: switch ($_REQUEST['action'])
 13: 	{
 14: 	case "create":
 15: 		// screw this for the moment
 16: 		// get the highest weight for this testid
 17: 		//$q="SELECT weight FROM fneval WHERE testid=\"".ss($_REQUEST['testid'])."
 18: 		$q="INSERT INTO fneval(testid,eoperator,evalue,eoutcome) VALUES(\"".ss($_REQUEST['testid'])."\",";
 19: 		$q.="\"".ss($_REQUEST['eoperator'])."\",\"".ss($_REQUEST['evalue'])."\",\"".ss($_REQUEST['eoutcome'])."\")";
 20: 		$NATS->DB->Query($q);
 21: 		//echo $q;
 22: 		//exit();
 23: 		if ($_REQUEST['testid'][0]=="L")
 24: 			{
 25: 			$ltid=substr($_REQUEST['testid'],1,128);
 26: 			header("Location: localtest.edit.php?localtestid=".$ltid);
 27: 			exit();
 28: 			}
 29: 		header("Location: main.php");
 30: 		exit();
 31: 	case "delete":
 32: 		$q="DELETE FROM fneval WHERE evalid=".ss($_REQUEST['evalid']);
 33: 		$NATS->DB->Query($q);
 34: 		if (isset($_REQUEST['back'])) header("Location: ".$_REQUEST['back']);
 35: 		else header("Location: main.php?message=Evaluator+Deleted");
 36: 		exit();
 37: 	default:
 38: 		header("Location: main.php?message=Unknown+Test+Eval+Action");
 39: 		exit();
 40: 	}
 41: 
 42: ?>
 43: