diff --git a/admin/award_awardcreatedivisional.php b/admin/award_awardcreatedivisional.php index e442aff..f69ef4e 100644 --- a/admin/award_awardcreatedivisional.php +++ b/admin/award_awardcreatedivisional.php @@ -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 "
" . i18n("Proceed Anyways?") . " "; + echo i18n("This will delete all existing divisional awards."); + echo "
"; } else { @@ -172,7 +183,7 @@ echo ""; echo ""; - echo "