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 Levels Editor Levels Editor

"; if($_POST['action']=="edit") { if($_POST['scheme_id'] && $_POST['level_id'] && $_POST['level_value'] && $_POST['level_name'] && $_POST['spec_use'] ) { //$q=mysql_query("SELECT id FROM eval_criteria WHERE id='".$_POST['id']."' "); //if(mysql_num_rows($q) && $_POST['saveid']!=$_POST['id']) //{ // echo "Criteria ID ".$_POST['id']." already exists!"; //} //else //{ $t = mysql_query("UPDATE eval_levels SET ". "scheme_id='".$_POST['scheme_id']."', ". "level_id='".$_POST['level_id']."', ". "level_value='".$_POST['level_value']."', ". "level_name='".$_POST['level_name']."', ". "spec_use='".$_POST['spec_use']."', ". "spec_use_code='".$_POST['spec_use_code']."' ". "WHERE id='".$_POST['saveid']."' "); echo "Level Saved!"; //} } else { echo "Error: All fields are required!"; } } if($_POST['action']=="new") { if($_POST['scheme_id'] && $_POST['level_id'] && $_POST['level_value'] && $_POST['level_name'] && $_POST['spec_use'] ) { // $q=mysql_query("SELECT id FROM eval_criteria WHERE 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_levels ( scheme_id, level_id, level_value, level_name, spec_use, spec_use_code) VALUES ( ". "'".$_POST['scheme_id']."', ". "'".$_POST['level_id']."', ". "'".$_POST['level_value']."', ". "'".$_POST['level_name']."', ". "'".$_POST['spec_use']."', ". "'".$_POST['spec_use_code']."' ) "); echo "Level Saved!"; // } } else { echo "Error: All fields are required!"; } } if($_GET['action']=="remove" && $_GET['remove']) { mysql_query("DELETE FROM eval_levels where id='".$_GET['remove']."' "); echo "Level successfully removed"; } echo "
"; if(! ($_GET['action']=="edit" || $_GET['action']=="new") ) { echo " Add New Level \n"; echo ""; echo ""; //echo "\n"; echo "\n"; echo "\n"; echo "\n"; 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_levels WHERE id='".$_GET['edit']."' "); $lvlr=mysql_fetch_object($q); $buttontext="Save"; } else if($_GET['action']=="new") { $buttontext="Add"; } echo "
rec ID Scheme ID Level ID Level Value Level Name Special Use Special Use Code Actions
"; echo ""; //echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo ""; //echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; echo " "; echo ""; } else { $q=mysql_query("SELECT * FROM eval_levels ORDER BY scheme_id, level_id"); while($r=mysql_fetch_object($q)) { echo ""; //echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; } } echo "
rec ID Scheme ID Level ID Level Value Level Name Special Use Special Use Code Actions
id\" />scheme_id\" />level_id\" />level_value\" />level_name\" />spec_use\" />spec_use_code\" />
$r->id $r->scheme_id $r->level_id $r->level_value $r->level_name $r->spec_use $r->spec_use_code "; echo "id\">Edit"; echo "   "; echo "id\">Remove"; echo "
"; echo "
"; echo"Scheme ID Must exist in Schemes!"; echo ""; echo ""; exit; ?>