forked from science-ation/science-ation
- Move some GETs to POSTs
- Sort out the header sizes, I think.
This commit is contained in:
parent
8f29090c38
commit
986b762f4e
@ -52,20 +52,20 @@ case 'award_create':
|
|||||||
|
|
||||||
case 'awardinfo_save':
|
case 'awardinfo_save':
|
||||||
/* Scrub the data while we save it */
|
/* Scrub the data while we save it */
|
||||||
$id=intval($_GET['id']);
|
$id=intval($_POST['id']);
|
||||||
|
|
||||||
$q = "UPDATE award_awards SET
|
$q = "UPDATE award_awards SET
|
||||||
name='".mysql_escape_string(stripslashes($_GET['name']))."',
|
name='".mysql_escape_string(stripslashes($_POST['name']))."',
|
||||||
`order`='".intval($_GET['order'])."',
|
`order`='".intval($_POST['order'])."',
|
||||||
sponsors_id='".intval($_GET['sponsors_id'])."',
|
sponsors_id='".intval($_POST['sponsors_id'])."',
|
||||||
award_types_id='".intval($_GET['award_types_id'])."',
|
award_types_id='".intval($_POST['award_types_id'])."',
|
||||||
presenter='".mysql_escape_string(stripslashes($_GET['presenter']))."',
|
presenter='".mysql_escape_string(stripslashes($_POST['presenter']))."',
|
||||||
excludefromac='".(($_GET['excludefromac'] == 1) ? 1 : 0)."',
|
excludefromac='".(($_POST['excludefromac'] == 1) ? 1 : 0)."',
|
||||||
cwsfaward='".(($_GET['cwsfaward'] == 1) ? 1 : 0)."',
|
cwsfaward='".(($_POST['cwsfaward'] == 1) ? 1 : 0)."',
|
||||||
self_nominate='".(($_GET['self_nominate'] == 'yes') ? 'yes' : 'no')."',
|
self_nominate='".(($_POST['self_nominate'] == 'yes') ? 'yes' : 'no')."',
|
||||||
schedule_judges='".(($_GET['schedule_judges'] == 'yes') ? 'yes' : 'no')."',
|
schedule_judges='".(($_POST['schedule_judges'] == 'yes') ? 'yes' : 'no')."',
|
||||||
criteria='".mysql_escape_string(stripslashes($_GET['criteria']))."',
|
criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."',
|
||||||
description='".mysql_escape_string(stripslashes($_GET['description']))."'
|
description='".mysql_escape_string(stripslashes($_POST['description']))."'
|
||||||
WHERE id='$id'";
|
WHERE id='$id'";
|
||||||
echo happy(i18n('Award Info Saved'));
|
echo happy(i18n('Award Info Saved'));
|
||||||
mysql_query($q);
|
mysql_query($q);
|
||||||
@ -89,10 +89,10 @@ case 'award_create':
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'eligibility_save':
|
case 'eligibility_save':
|
||||||
$id = intval($_GET['id']);
|
$id = intval($_POST['id']);
|
||||||
|
|
||||||
//now add the new ones
|
//now add the new ones
|
||||||
if(!is_array($_GET['categories']) || !is_array($_GET['divisions'])) {
|
if(!is_array($_POST['categories']) || !is_array($_POST['divisions'])) {
|
||||||
echo error(i18n("Invalid data"));
|
echo error(i18n("Invalid data"));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ case 'award_create':
|
|||||||
//wipe out any old award-category links
|
//wipe out any old award-category links
|
||||||
mysql_query("DELETE FROM award_awards_projectcategories WHERE award_awards_id='$id'");
|
mysql_query("DELETE FROM award_awards_projectcategories WHERE award_awards_id='$id'");
|
||||||
|
|
||||||
foreach($_GET['categories'] AS $key=>$cat) {
|
foreach($_POST['categories'] AS $key=>$cat) {
|
||||||
mysql_query("INSERT INTO award_awards_projectcategories (award_awards_id,projectcategories_id,year)
|
mysql_query("INSERT INTO award_awards_projectcategories (award_awards_id,projectcategories_id,year)
|
||||||
VALUES ('$id','$cat','{$config['FAIRYEAR']}')");
|
VALUES ('$id','$cat','{$config['FAIRYEAR']}')");
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ case 'award_create':
|
|||||||
mysql_query("DELETE FROM award_awards_projectdivisions WHERE award_awards_id='$id'");
|
mysql_query("DELETE FROM award_awards_projectdivisions WHERE award_awards_id='$id'");
|
||||||
|
|
||||||
//now add the new ones
|
//now add the new ones
|
||||||
foreach($_GET['divisions'] AS $key=>$div) {
|
foreach($_POST['divisions'] AS $key=>$div) {
|
||||||
mysql_query("INSERT INTO award_awards_projectdivisions (award_awards_id,projectdivisions_id,year)
|
mysql_query("INSERT INTO award_awards_projectdivisions (award_awards_id,projectdivisions_id,year)
|
||||||
VALUES ('$id','$div','{$config['FAIRYEAR']}')");
|
VALUES ('$id','$div','{$config['FAIRYEAR']}')");
|
||||||
}
|
}
|
||||||
@ -169,19 +169,18 @@ case 'award_create':
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'prize_save':
|
case 'prize_save':
|
||||||
print_R($_GET);
|
$id = intval($_POST['id']);
|
||||||
$id = intval($_GET['id']);
|
|
||||||
$q="UPDATE award_prizes SET
|
$q="UPDATE award_prizes SET
|
||||||
prize='".mysql_escape_string(stripslashes($_GET['prize']))."',
|
prize='".mysql_escape_string(stripslashes($_POST['prize']))."',
|
||||||
cash='".intval($_GET['cash'])."',
|
cash='".intval($_POST['cash'])."',
|
||||||
scholarship='".intval($_GET['scholarship'])."',
|
scholarship='".intval($_POST['scholarship'])."',
|
||||||
value='".intval($_GET['value'])."',
|
value='".intval($_POST['value'])."',
|
||||||
number='".intval($_GET['number'])."',
|
number='".intval($_POST['number'])."',
|
||||||
excludefromac='".(($_GET['excludefromac']==1)? 1 : 0)."',
|
excludefromac='".(($_POST['excludefromac']==1)? 1 : 0)."',
|
||||||
trophystudentkeeper='".(($_GET['trophystudentkeeper']==1) ? 1 : 0)."',
|
trophystudentkeeper='".(($_POST['trophystudentkeeper']==1) ? 1 : 0)."',
|
||||||
trophystudentreturn='".(($_GET['trophystudentreturn']==1) ? 1 : 0)."',
|
trophystudentreturn='".(($_POST['trophystudentreturn']==1) ? 1 : 0)."',
|
||||||
trophyschoolkeeper='".(($_GET['trophyschoolkeeper']==1) ? 1 : 0)."',
|
trophyschoolkeeper='".(($_POST['trophyschoolkeeper']==1) ? 1 : 0)."',
|
||||||
trophyschoolreturn='".(($_GET['trophyschoolreturn']==1) ? 1 : 0)."'
|
trophyschoolreturn='".(($_POST['trophyschoolreturn']==1) ? 1 : 0)."'
|
||||||
WHERE id='$id'";
|
WHERE id='$id'";
|
||||||
mysql_query($q);
|
mysql_query($q);
|
||||||
// echo $q;
|
// echo $q;
|
||||||
@ -233,7 +232,7 @@ function update_awardinfo()
|
|||||||
|
|
||||||
function awardinfo_save()
|
function awardinfo_save()
|
||||||
{
|
{
|
||||||
$("#awardinfo_info").load("<?$_SERVER['PHP_SELF']?>?action=awardinfo_save", $("#awardinfo").serialize());
|
$("#awardinfo_info").post("<?$_SERVER['PHP_SELF']?>?action=awardinfo_save", $("#awardinfo").serialize());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,13 +310,13 @@ function edit_prize(id)
|
|||||||
|
|
||||||
function eligibility_save()
|
function eligibility_save()
|
||||||
{
|
{
|
||||||
$("#eligibility_info").load("<?$_SERVER['PHP_SELF']?>?action=eligibility_save", $("#eligibility").serialize());
|
$("#eligibility_info").post("<?$_SERVER['PHP_SELF']?>?action=eligibility_save", $("#eligibility").serialize());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function prize_save()
|
function prize_save()
|
||||||
{
|
{
|
||||||
$("#prizeinfo_info").load("<?$_SERVER['PHP_SELF']?>?action=prize_save", $("#prizeinfo").serialize());
|
$("#prizeinfo_info").post("<?$_SERVER['PHP_SELF']?>?action=prize_save", $("#prizeinfo").serialize());
|
||||||
update_prizeinfo();
|
update_prizeinfo();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -372,7 +371,6 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selected: -1,
|
selected: -1,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -391,7 +389,7 @@ $(document).ready(function() {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="editor_tab_awardinfo">
|
<div id="editor_tab_awardinfo">
|
||||||
<h2><?=i18n("Award Info")?></h2>
|
<h4><?=i18n("Award Info")?></h4>
|
||||||
<div id="awardinfo_info"></div>
|
<div id="awardinfo_info"></div>
|
||||||
<form id="awardinfo">
|
<form id="awardinfo">
|
||||||
<input type="hidden" name="id" id="awardinfo_id" value="0" />
|
<input type="hidden" name="id" id="awardinfo_id" value="0" />
|
||||||
@ -432,7 +430,7 @@ $(document).ready(function() {
|
|||||||
<td class="right"><textarea class="translatable" id="awardinfo_description" name="description" rows="3" cols="50">Loading...</textarea></td></tr>
|
<td class="right"><textarea class="translatable" id="awardinfo_description" name="description" rows="3" cols="50">Loading...</textarea></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Options</h2>
|
<h4>Options</h4>
|
||||||
<table class="tableedit">
|
<table class="tableedit">
|
||||||
<tr><td class="left">
|
<tr><td class="left">
|
||||||
<input type="checkbox" id="awardinfo_excludefromac" name="excludefromac" value="1"></td>
|
<input type="checkbox" id="awardinfo_excludefromac" name="excludefromac" value="1"></td>
|
||||||
@ -452,7 +450,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
<? /* Next Tab */ ?>
|
<? /* Next Tab */ ?>
|
||||||
<div id="editor_tab_eligibility">
|
<div id="editor_tab_eligibility">
|
||||||
<h3><?=i18n("Eligibility")?></h3>
|
<h4><?=i18n("Eligibility")?></h4>
|
||||||
<div id="eligibility_info"></div>
|
<div id="eligibility_info"></div>
|
||||||
<form id="eligibility">
|
<form id="eligibility">
|
||||||
<input type="hidden" id="eligibility_id" name="id" value="" />
|
<input type="hidden" id="eligibility_id" name="id" value="" />
|
||||||
@ -490,7 +488,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
<div id="editor_tab_prizes">
|
<div id="editor_tab_prizes">
|
||||||
<div id="prizeinfo_info"></div>
|
<div id="prizeinfo_info"></div>
|
||||||
<h3><?=i18n("Prizes")?></h3>
|
<h4><?=i18n("Prizes")?></h4>
|
||||||
<br />
|
<br />
|
||||||
<table id="prizelist" class="tableview">
|
<table id="prizelist" class="tableview">
|
||||||
<tr class="nodrop nodrag">
|
<tr class="nodrop nodrag">
|
||||||
@ -507,7 +505,7 @@ $(document).ready(function() {
|
|||||||
<br >
|
<br >
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<br /><h3 id="prizeinfo_edit_header">Click on a prize to edit</h3><br />
|
<br /><h4 id="prizeinfo_edit_header">Click on a prize to edit</h4><br />
|
||||||
<form id="prizeinfo">
|
<form id="prizeinfo">
|
||||||
<input type="hidden" id="prizeinfo_id" name="id" value=""/>
|
<input type="hidden" id="prizeinfo_id" name="id" value=""/>
|
||||||
<input type="hidden" id="prizeinfo_award_awards_id" name="award_awards_id" value=""/>
|
<input type="hidden" id="prizeinfo_award_awards_id" name="award_awards_id" value=""/>
|
||||||
|
Loading…
Reference in New Issue
Block a user