Copyright (C) 2011 Dennis Spanogle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> SFIAB Evaluations Schemes Editor Schemes Editor

"; if($_POST['action']=="edit") { if($_POST['id'] && $_POST['name'] && $_POST['equation'] ) { $q=mysql_query("SELECT scheme_id FROM eval_schemes WHERE scheme_id='".$_POST['id']."' "); if(mysql_num_rows($q) && $_POST['saveid']!=$_POST['id']) { echo "Scheme ID ".$_POST['id']." already exists!"; } else { mysql_query("UPDATE eval_schemes SET ". "scheme_id='".$_POST['id']."', ". "scheme_name='".$_POST['name']."', ". "assignto_project_when='".$_POST['equation']."' ". "WHERE scheme_id='".$_POST['saveid']."' "); echo "Scheme Saved!"; } } else { echo "Error: All fields are required!"; } } if($_POST['action']=="new") { if($_POST['id'] && $_POST['name'] && $_POST['equation'] ) { $q=mysql_query("SELECT scheme_id FROM eval_schemes WHERE scheme_id='".$_POST['id']."' "); if(mysql_num_rows($q) && $_POST['saveid']!=$_POST['id']) { echo "Scheme ID ".$_POST['id']." already exists!"; } else { mysql_query("INSERT INTO eval_schemes (scheme_id, scheme_name, assignto_project_when) VALUES ( ". "'".$_POST['id']."', ". "'".$_POST['name']."', ". "'".$_POST['equation']."' ) "); echo "Scheme Saved!"; } } else { echo "Error: All fields are required!"; } } if($_GET['action']=="remove" && $_GET['remove']) { mysql_query("DELETE FROM eval_schemes where scheme_id='".$_GET['remove']."' "); echo "Scheme successfully removed"; } echo "
"; if(! ($_GET['action']=="edit" || $_GET['action']=="new") ) { echo " Add New Scheme \n"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; } if($_GET['action']=="edit" || $_GET['action']=="new") { echo "\n"; if($_GET['action']=="edit") { echo "\n"; $q=mysql_query("SELECT * FROM eval_schemes WHERE scheme_id='".$_GET['edit']."' "); $schemer=mysql_fetch_object($q); $buttontext="Save"; } else if($_GET['action']=="new") { $buttontext="Add"; } echo "
Scheme ID Scheme Name Selection Statement Actions
"; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo ""; echo " "; echo " "; echo " "; echo ""; echo " "; echo ""; } else { $q=mysql_query("SELECT * FROM eval_schemes ORDER BY scheme_id"); while($r=mysql_fetch_object($q)) { echo ""; echo " "; echo " "; echo " "; echo " "; echo ""; } } echo "
Scheme ID Scheme Name Selection Statement Actions
scheme_id\" />scheme_name\" />assignto_project_when\" />
$r->scheme_id $r->scheme_name $r->assignto_project_when "; echo "scheme_id\">Edit"; echo "   "; echo "scheme_id\">Remove"; echo "
"; echo "
"; echo"You should assign the 'Scheme ID's in numerical order, starting with 1."; echo ""; echo ""; // send_footer(); ?>