forked from science-ation/science-ation
Make safety questions require a question to be filled in (or at least something in the question box)
This commit is contained in:
parent
b9bf8fba6c
commit
ab294df97b
@ -29,7 +29,9 @@
|
||||
|
||||
if($_POST['action']=="save" && $_POST['save'])
|
||||
{
|
||||
mysql_query("UPDATE safetyquestions SET
|
||||
if($_POST['question'])
|
||||
{
|
||||
mysql_query("UPDATE safetyquestions SET
|
||||
question='".mysql_escape_string(stripslashes($_POST['question']))."',
|
||||
`type`='".mysql_escape_string(stripslashes($_POST['type']))."',
|
||||
`required`='".mysql_escape_string(stripslashes($_POST['required']))."',
|
||||
@ -37,23 +39,29 @@
|
||||
WHERE id='".$_POST['save']."' AND year='".$config['FAIRYEAR']."'");
|
||||
echo mysql_error();
|
||||
|
||||
echo happy(i18n("Safety question successfully saved"));
|
||||
|
||||
echo happy(i18n("Safety question successfully saved"));
|
||||
}
|
||||
else
|
||||
echo error(i18n("Question is required"));
|
||||
}
|
||||
|
||||
if($_POST['action']=="new")
|
||||
{
|
||||
mysql_query("INSERT INTO safetyquestions (question,type,required,ord,year) VALUES (
|
||||
'".mysql_escape_string(stripslashes($_POST['question']))."',
|
||||
'".mysql_escape_string(stripslashes($_POST['type']))."',
|
||||
'".mysql_escape_string(stripslashes($_POST['required']))."',
|
||||
'".mysql_escape_string(stripslashes($_POST['ord']))."',
|
||||
'".$config['FAIRYEAR']."'
|
||||
)");
|
||||
echo mysql_error();
|
||||
|
||||
echo happy(i18n("Safety question successfully added"));
|
||||
|
||||
if($_POST['question'])
|
||||
{
|
||||
mysql_query("INSERT INTO safetyquestions (question,type,required,ord,year) VALUES (
|
||||
'".mysql_escape_string(stripslashes($_POST['question']))."',
|
||||
'".mysql_escape_string(stripslashes($_POST['type']))."',
|
||||
'".mysql_escape_string(stripslashes($_POST['required']))."',
|
||||
'".mysql_escape_string(stripslashes($_POST['ord']))."',
|
||||
'".$config['FAIRYEAR']."'
|
||||
)");
|
||||
echo mysql_error();
|
||||
|
||||
echo happy(i18n("Safety question successfully added"));
|
||||
}
|
||||
else
|
||||
echo error(i18n("Question is required"));
|
||||
}
|
||||
|
||||
if($_GET['action']=="remove" && $_GET['remove'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user