forked from science-ation/science-ation
- Fix eligibility save
This commit is contained in:
parent
fdeef1f273
commit
39fa2de7bd
@ -78,7 +78,7 @@
|
||||
happy_("Award information saved");
|
||||
exit;
|
||||
|
||||
case 'eligibilty_load':
|
||||
case 'eligibility_load':
|
||||
$id = intval($_GET['id']);
|
||||
//select the current categories that this award is linked to
|
||||
$reg = array();
|
||||
@ -96,7 +96,7 @@
|
||||
exit;
|
||||
|
||||
case 'eligibility_save':
|
||||
$id = intval($_POST['id']);
|
||||
$id = intval($_POST['award_awards_id']);
|
||||
|
||||
//now add the new ones
|
||||
if(!is_array($_POST['categories']) || !is_array($_POST['divisions'])) {
|
||||
@ -111,6 +111,9 @@
|
||||
$c = intval($cat);
|
||||
mysql_query("INSERT INTO award_awards_projectcategories (award_awards_id,projectcategories_id,year)
|
||||
VALUES ('$id','$c','{$config['FAIRYEAR']}')");
|
||||
echo "INSERT INTO award_awards_projectcategories (award_awards_id,projectcategories_id,year)
|
||||
VALUES ('$id','$c','{$config['FAIRYEAR']}')";
|
||||
echo mysql_error();
|
||||
}
|
||||
|
||||
//wipe out any old award-divisions links
|
||||
@ -121,6 +124,7 @@
|
||||
$d = intval($div);
|
||||
mysql_query("INSERT INTO award_awards_projectdivisions (award_awards_id,projectdivisions_id,year)
|
||||
VALUES ('$id','$d','{$config['FAIRYEAR']}')");
|
||||
echo mysql_error();
|
||||
}
|
||||
happy_("Eligibility information saved");
|
||||
exit;
|
||||
@ -349,9 +353,8 @@ function update_eligibility()
|
||||
{
|
||||
if(award_tab_update['eligibility'] == award_id) return;
|
||||
award_tab_update['eligibility'] = award_id;
|
||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=eligibilty_load&id="+award_id,
|
||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=eligibility_load&id="+award_id,
|
||||
function(json){
|
||||
$("#eligibility_id").val(json.id);
|
||||
$("[name=categories\\[\\]]").val(json.categories);
|
||||
$("[name=divisions\\[\\]]").val(json.divisions);
|
||||
});
|
||||
@ -424,6 +427,7 @@ function edit_prize(id)
|
||||
|
||||
function eligibility_save()
|
||||
{
|
||||
$("#eligibility_award_awards_id").val(award_id);
|
||||
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=eligibility_save", $("#eligibility").serializeArray());
|
||||
return false;
|
||||
}
|
||||
@ -604,7 +608,7 @@ $(document).ready(function() {
|
||||
<h4><?=i18n("Eligibility")?></h4>
|
||||
<br />
|
||||
<form id="eligibility">
|
||||
<input type="hidden" id="eligibility_id" name="id" value="" />
|
||||
<input type="hidden" id="eligibility_award_awards_id" name="award_awards_id" value="" />
|
||||
<table class="tableedit">
|
||||
<tr><td class="left"><?=i18n("Age Categories")?>:</td><td class="right">
|
||||
<?
|
||||
|
Loading…
x
Reference in New Issue
Block a user