forked from science-ation/science-ation
Add ability to remove all current divisional awards when running this script (bug 233)
This commit is contained in:
parent
2c6a491710
commit
ac450aefdf
@ -24,6 +24,7 @@
|
||||
<?
|
||||
require("../common.inc.php");
|
||||
require_once("../user.inc.php");
|
||||
require_once("awards.inc.php");
|
||||
user_auth_required('committee', 'admin');
|
||||
|
||||
send_header('Create All Divisional Awards',
|
||||
@ -38,12 +39,22 @@
|
||||
if($_GET['award_types_id']) $award_types_id=$_GET['award_types_id'];
|
||||
else if($_POST['award_types_id']) $award_types_id=$_POST['award_types_id'];
|
||||
|
||||
if($_GET['force'] == "true") {
|
||||
$q=mysql_query("SELECT id FROM award_awards WHERE award_types_id='1' AND year='{$config['FAIRYEAR']}'");
|
||||
while($r=mysql_fetch_object($q)) {
|
||||
award_delete($r->id);
|
||||
}
|
||||
}
|
||||
|
||||
//first, we can only do this if we dont have any type=divisional awards created yet
|
||||
$q=mysql_query("SELECT COUNT(id) AS num FROM award_awards WHERE award_types_id='1' AND year='{$config['FAIRYEAR']}'");
|
||||
$r=mysql_fetch_object($q);
|
||||
if($r->num)
|
||||
{
|
||||
echo error(i18n("%1 Divisional awards already exist. There must not be any divisional awards in order to run this wizard",array($r->num)));
|
||||
echo "<p><a href='award_awardcreatedivisional.php?force=true'>" . i18n("Proceed Anyways?") . "</a> ";
|
||||
echo i18n("This will delete all existing divisional awards.");
|
||||
echo "</p>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -172,7 +183,7 @@
|
||||
echo "</select>";
|
||||
echo "</td></tr>";
|
||||
|
||||
echo "<tr><td>".i18n("Prizes")."</td><td><a href=\"award_prizes.php?award_awards_id=-1\">Edit prize template for divisional awards</a>";
|
||||
echo "<tr><td>".i18n("Prizes")."</td><td><a href=\"award_awards.php?action=edit_prize_template\">Edit prize template for divisional awards</a>";
|
||||
//the 'generic' template prizes for the awards are stored with year =-1 and award_awards_id=0
|
||||
|
||||
$q=mysql_query("SELECT * FROM award_prizes WHERE year='-1' AND award_awards_id='0' ORDER BY `order`");
|
||||
|
Loading…
Reference in New Issue
Block a user