File: 0.04.14b/server/web/eval.action.php (View as Code)

1: 2: /* ------------------------------------------------------------- 3: This file is part of FreeNATS 4: 5: FreeNATS is (C) Copyright 2008 PurplePixie Systems 6: 7: FreeNATS is free software: you can redistribute it and/or modify 8: it under the terms of the GNU General Public License as published by 9: the Free Software Foundation, either version 3 of the License, or 10: (at your option) any later version. 11: 12: FreeNATS is distributed in the hope that it will be useful, 13: but WITHOUT ANY WARRANTY; without even the implied warranty of 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15: GNU General Public License for more details. 16: 17: You should have received a copy of the GNU General Public License 18: along with Foobar. If not, see www.gnu.org/licenses 19: 20: For more information see www.purplepixie.org/freenats 21: -------------------------------------------------------------- */ 22: 23: ob_start(); 24: require("include.php"); 25: $NATS->Start(); 26: if (!$NATS_Session->Check($NATS->DB)) 27: { 28: header("Location: ./?login_msg=Invalid+Or+Expired+Session"); 29: exit(); 30: } 31: if ($NATS_Session->userlevel<5) UL_Error("Action Test Eval"); 32: 33: switch ($_REQUEST['action']) 34: { 35: case "create": 36: // screw this for the moment 37: // get the highest weight for this testid 38: //$q="SELECT weight FROM fneval WHERE testid=\"".ss($_REQUEST['testid'])." 39: $q="INSERT INTO fneval(testid,eoperator,evalue,eoutcome) VALUES(\"".ss($_REQUEST['testid'])."\","; 40: $q.="\"".ss($_REQUEST['eoperator'])."\",\"".ss($_REQUEST['evalue'])."\",\"".ss($_REQUEST['eoutcome'])."\")"; 41: $NATS->DB->Query($q); 42: //echo $q; 43: //exit(); 44: if ($_REQUEST['testid'][0]=="L") 45: { 46: $ltid=substr($_REQUEST['testid'],1,128); 47: header("Location: localtest.edit.php?localtestid=".$ltid); 48: exit(); 49: } 50: header("Location: main.php"); 51: exit(); 52: case "delete": 53: $q="DELETE FROM fneval WHERE evalid=".ss($_REQUEST['evalid']); 54: $NATS->DB->Query($q); 55: if (isset($_REQUEST['back'])) header("Location: ".$_REQUEST['back']); 56: else header("Location: main.php?message=Evaluator+Deleted"); 57: exit(); 58: default: 59: header("Location: main.php?message=Unknown+Test+Eval+Action"); 60: exit(); 61: } 62: 63: ?> 64: