forked from science-ation/science-ation
- Add status area on each page for award div
- Redirect all ajax load output to a debug div (which can be turned on with debug=true). The output has to go somewhere, and it can't go to the notification div, because it will overwrite what's already there. The ajax methods emit javascript now to add notifications.
This commit is contained in:
parent
1f830c7845
commit
d2535f46bc
@ -65,7 +65,7 @@
|
|||||||
criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."',
|
criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."',
|
||||||
description='".mysql_escape_string(stripslashes($_POST['description']))."'
|
description='".mysql_escape_string(stripslashes($_POST['description']))."'
|
||||||
WHERE id='$id'";
|
WHERE id='$id'";
|
||||||
echo happy(i18n('Award Info Saved'));
|
happy_("Award Information Saved.");
|
||||||
mysql_query($q);
|
mysql_query($q);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -111,7 +111,7 @@
|
|||||||
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']}')");
|
||||||
}
|
}
|
||||||
echo happy(i18n("Saved."));
|
happy_("Saved.");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'prize_order':
|
case 'prize_order':
|
||||||
@ -122,7 +122,7 @@
|
|||||||
mysql_query("UPDATE `award_prizes` SET `order`='$order' WHERE `id`='$id'");
|
mysql_query("UPDATE `award_prizes` SET `order`='$order' WHERE `id`='$id'");
|
||||||
}
|
}
|
||||||
// print_r($_GET);
|
// print_r($_GET);
|
||||||
// echo happy(i18n("Order Updated."));
|
happy_("Order Updated.");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'award_order':
|
case 'award_order':
|
||||||
@ -132,7 +132,7 @@
|
|||||||
$order++;
|
$order++;
|
||||||
mysql_query("UPDATE `award_awards` SET `order`='$order' WHERE `id`='$id'");
|
mysql_query("UPDATE `award_awards` SET `order`='$order' WHERE `id`='$id'");
|
||||||
}
|
}
|
||||||
// echo happy(i18n("Order Updated."));
|
happy_("Order Updated.");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'prizeinfo_load':
|
case 'prizeinfo_load':
|
||||||
@ -183,14 +183,14 @@
|
|||||||
mysql_query($q);
|
mysql_query($q);
|
||||||
// echo $q;
|
// echo $q;
|
||||||
// echo mysql_error();
|
// echo mysql_error();
|
||||||
echo happy(i18n("Prize saved"));
|
happy_("Prize saved");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'prize_delete':
|
case 'prize_delete':
|
||||||
$id = intval($_GET['id']);
|
$id = intval($_GET['id']);
|
||||||
mysql_query("DELETE FROM award_prizes WHERE id='$id'");
|
mysql_query("DELETE FROM award_prizes WHERE id='$id'");
|
||||||
// echo "DELETE FROM award_prizes WHERE id='$id'";
|
// echo "DELETE FROM award_prizes WHERE id='$id'";
|
||||||
echo happy(i18n("Prize deleted"));
|
happy_("Prize deleted");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
case 'feeder_load':
|
case 'feeder_load':
|
||||||
@ -207,6 +207,7 @@
|
|||||||
|
|
||||||
case 'feeder_save':
|
case 'feeder_save':
|
||||||
// print_r($_POST);
|
// print_r($_POST);
|
||||||
|
|
||||||
$id = intval($_POST['award_awards_id']);
|
$id = intval($_POST['award_awards_id']);
|
||||||
$dl = is_array($_POST['feeder_dl']) ? $_POST['feeder_dl'] : array();
|
$dl = is_array($_POST['feeder_dl']) ? $_POST['feeder_dl'] : array();
|
||||||
$ul = is_array($_POST['feeder_ul']) ? $_POST['feeder_ul'] : array();
|
$ul = is_array($_POST['feeder_ul']) ? $_POST['feeder_ul'] : array();
|
||||||
@ -245,6 +246,7 @@ function update_awardinfo()
|
|||||||
{
|
{
|
||||||
var id = award_id;
|
var id = award_id;
|
||||||
// alert("id="+award_id);
|
// alert("id="+award_id);
|
||||||
|
notice_div_id('award_notice');
|
||||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=awardinfo_load&id="+id,
|
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=awardinfo_load&id="+id,
|
||||||
function(json){
|
function(json){
|
||||||
$("#awardinfo_id").val(json.id);
|
$("#awardinfo_id").val(json.id);
|
||||||
@ -265,13 +267,14 @@ function update_awardinfo()
|
|||||||
|
|
||||||
function awardinfo_save()
|
function awardinfo_save()
|
||||||
{
|
{
|
||||||
$("#awardinfo_info").load("<?$_SERVER['PHP_SELF']?>?action=awardinfo_save", $("#awardinfo").serializeArray());
|
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=awardinfo_save", $("#awardinfo").serializeArray());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_eligibility()
|
function update_eligibility()
|
||||||
{
|
{
|
||||||
var id = award_id;
|
var id = award_id;
|
||||||
|
notice_div_id('eligibility_notice');
|
||||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=eligibilty_load&id="+id,
|
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=eligibilty_load&id="+id,
|
||||||
function(json){
|
function(json){
|
||||||
$("#eligibility_id").val(json.id);
|
$("#eligibility_id").val(json.id);
|
||||||
@ -299,6 +302,7 @@ function prizelist_refresh()
|
|||||||
function update_prizeinfo()
|
function update_prizeinfo()
|
||||||
{
|
{
|
||||||
var id = award_id;
|
var id = award_id;
|
||||||
|
notice_div_id('prize_notice');
|
||||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=prizeinfo_load&id="+id,
|
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=prizeinfo_load&id="+id,
|
||||||
function(json) {
|
function(json) {
|
||||||
$(".prizelist_tr").remove();
|
$(".prizelist_tr").remove();
|
||||||
@ -343,13 +347,13 @@ function edit_prize(id)
|
|||||||
|
|
||||||
function eligibility_save()
|
function eligibility_save()
|
||||||
{
|
{
|
||||||
$("#eligibility_info").load("<?$_SERVER['PHP_SELF']?>?action=eligibility_save", $("#eligibility").serializeArray());
|
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=eligibility_save", $("#eligibility").serializeArray());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function prize_save()
|
function prize_save()
|
||||||
{
|
{
|
||||||
$("#prizeinfo_info").load("<?$_SERVER['PHP_SELF']?>?action=prize_save", $("#prizeinfo").serializeArray());
|
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=prize_save", $("#prizeinfo").serializeArray());
|
||||||
update_prizeinfo();
|
update_prizeinfo();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -383,7 +387,7 @@ function prize_create()
|
|||||||
function update_feeder()
|
function update_feeder()
|
||||||
{
|
{
|
||||||
var id = award_id;
|
var id = award_id;
|
||||||
notice_div_id('feeder_info');
|
notice_div_id('feeder_notice');
|
||||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=feeder_load&id="+id,
|
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=feeder_load&id="+id,
|
||||||
function(json) {
|
function(json) {
|
||||||
$("#feeder_id").val(id);
|
$("#feeder_id").val(id);
|
||||||
@ -396,7 +400,7 @@ function update_feeder()
|
|||||||
|
|
||||||
function feeder_save()
|
function feeder_save()
|
||||||
{
|
{
|
||||||
$("#feeder_info").load("<?$_SERVER['PHP_SELF']?>?action=feeder_save", $("#feeder_form").serializeArray());
|
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=feeder_save", $("#feeder_form").serializeArray());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +451,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
<div id="editor_tab_awardinfo">
|
<div id="editor_tab_awardinfo">
|
||||||
<h4><?=i18n("Award Info")?></h4>
|
<h4><?=i18n("Award Info")?></h4>
|
||||||
<div id="awardinfo_info"></div>
|
<div id="award_notice" class="notice_area"></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" />
|
||||||
<table class="tableedit">
|
<table class="tableedit">
|
||||||
@ -506,7 +510,7 @@ $(document).ready(function() {
|
|||||||
<? /* Next Tab */ ?>
|
<? /* Next Tab */ ?>
|
||||||
<div id="editor_tab_eligibility">
|
<div id="editor_tab_eligibility">
|
||||||
<h4><?=i18n("Eligibility")?></h4>
|
<h4><?=i18n("Eligibility")?></h4>
|
||||||
<div id="eligibility_info"></div>
|
<div id="eligibility_notice" class="notice_area"></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="" />
|
||||||
<table class="tableedit">
|
<table class="tableedit">
|
||||||
@ -542,7 +546,7 @@ $(document).ready(function() {
|
|||||||
<? /* Next Tab */ ?>
|
<? /* Next Tab */ ?>
|
||||||
|
|
||||||
<div id="editor_tab_prizes">
|
<div id="editor_tab_prizes">
|
||||||
<div id="prizeinfo_info"></div>
|
<div id="prize_notice" class="notice_area"></div>
|
||||||
<h4><?=i18n("Prizes")?></h4>
|
<h4><?=i18n("Prizes")?></h4>
|
||||||
<br />
|
<br />
|
||||||
<table id="prizelist" class="tableview">
|
<table id="prizelist" class="tableview">
|
||||||
@ -607,7 +611,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
<? /* Next Tab */ ?>
|
<? /* Next Tab */ ?>
|
||||||
<div id="editor_tab_feeder">
|
<div id="editor_tab_feeder">
|
||||||
<div style="position: fixed; display: hidden; border:1px" id="feeder_info"></div>
|
<div id="feeder_notice" class="notice_area"></div>
|
||||||
<h4><?=i18n("Feeder Fairs")?></h4>
|
<h4><?=i18n("Feeder Fairs")?></h4>
|
||||||
<p><?=("Select which feeder fairs can download this award and upload winners.")?></p>
|
<p><?=("Select which feeder fairs can download this award and upload winners.")?></p>
|
||||||
<form id="feeder_form">
|
<form id="feeder_form">
|
||||||
|
@ -602,6 +602,7 @@ if(substr($config['version'], -1) % 2 != 0)
|
|||||||
}
|
}
|
||||||
echo "<a target=\"blank\" href=\"http://www.sfiab.ca\">SFIAB Version ".$config['version']."{$extra}</a>";
|
echo "<a target=\"blank\" href=\"http://www.sfiab.ca\">SFIAB Version ".$config['version']."{$extra}</a>";
|
||||||
?>
|
?>
|
||||||
|
<div id="debug" style="display:<?=($_SESSION['debug']=='true')?'block':'none'?>"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
28
sfiab.js
28
sfiab.js
@ -44,33 +44,33 @@ var _notice_div_id = 'notice_div';
|
|||||||
|
|
||||||
function notice_delete(id)
|
function notice_delete(id)
|
||||||
{
|
{
|
||||||
$("notice_"+_notice_id).remove();
|
$("#notice_"+id).slideUp('slow', function() {
|
||||||
|
$("#notice_"+id).remove();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function notice_create(type,str,timeout)
|
function notice_create(type,str,timeout)
|
||||||
{
|
{
|
||||||
_notice_id++;
|
_notice_id++;
|
||||||
var style="padding: 0.1em 0; text-align: center;";
|
var style="padding: 0.1em 0; text-align: center; position: relative; ";
|
||||||
$("#"+_notice_div_id).append("<div id=\"notice_"+_notice_id+"\" class=\""+type+"\" style=\""+style+"\">"+str+"</div><br />");
|
$("#"+_notice_div_id).append("<div id=\"notice_"+_notice_id+"\" class=\""+type+"\" style=\""+style+"\">"+str+"</div>");
|
||||||
$("#"+_notice_div_id).fadeTo('fast', 0.75);
|
$("#"+_notice_div_id).fadeTo('fast', 0.85);
|
||||||
setTimeout(function() {
|
$("#notice_"+_notice_id).effect('bounce');
|
||||||
$("#notice_"+_notice_id).slideUp('slow', function() { notice_delete(_notice_id); });
|
setTimeout("notice_delete("+_notice_id+")", timeout);
|
||||||
}, timeout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function notice_div_id(id)
|
function notice_div_id(id)
|
||||||
{
|
{
|
||||||
|
if(id == '') id = 'notice_div';
|
||||||
|
|
||||||
var par = $("#"+id).parent();
|
var par = $("#"+id).parent();
|
||||||
var o = par.offset();
|
var o = par.offset();
|
||||||
var w = par.outerWidth();
|
var w = par.outerWidth();
|
||||||
// var h = par.outerHeight();
|
$("#"+id).css( { left: o.left+"px", top: o.top+"px", width: w+"px"} );
|
||||||
// $("#"+id).css( { "left": 0, "top": 0 } );
|
// $("#"+id).css( { left: 0, top: 0, width: "100%" });
|
||||||
$("#"+id).css( { left: o.left+"px", top: o.top+"px" } );
|
|
||||||
$("#"+id).css( { width: w+"px"} );
|
|
||||||
$("#"+id).show();
|
$("#"+id).show();
|
||||||
|
|
||||||
if(id == '') _notice_div_id = 'notice_div';
|
_notice_div_id = id;
|
||||||
else _notice_div_id = id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -331,6 +331,7 @@ tr.externalaward {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#FadeScreenDiv {
|
#FadeScreenDiv {
|
||||||
|
filter:alpha(opacity=50);
|
||||||
-moz-opacity:.50;
|
-moz-opacity:.50;
|
||||||
opacity:.50;
|
opacity:.50;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -371,6 +372,10 @@ tr.externalaward {
|
|||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.notice_area {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
/* The popup windows created with jquery-ui use the following classes:
|
/* The popup windows created with jquery-ui use the following classes:
|
||||||
* div.ui-dialog
|
* div.ui-dialog
|
||||||
* div.ui-dialog-titlebar - includes the next 2 items in the div
|
* div.ui-dialog-titlebar - includes the next 2 items in the div
|
||||||
|
Loading…
Reference in New Issue
Block a user