diff --git a/admin/registration_receivedforms.php b/admin/registration_receivedforms.php
index a249c0b..8de602c 100644
--- a/admin/registration_receivedforms.php
+++ b/admin/registration_receivedforms.php
@@ -174,6 +174,7 @@ echo mysql_Error();
{
echo i18n("This form has already been received. Registration is complete");
echo "
";
+ echo "".i18n("Click here to unregister this project")."";
echo "
";
echo "
";
}
@@ -279,6 +280,14 @@ echo mysql_Error();
echo notice(i18n("Registration of form %1 cancelled",array($_POST['registration_number'])));
}
+ else if($_GET['action']=="unregister" && $_GET['registration_number']) {
+ $reg_num=intval(trim($_GET['registration_number']));
+ $q=mysql_query("SELECT registrations.id AS reg_id, projects.id AS proj_id FROM projects,registrations WHERE projects.registrations_id=registrations.id AND registrations.year='{$config['FAIRYEAR']}' AND registrations.num='$reg_num'");
+ $r=mysql_fetch_object($q);
+ mysql_query("UPDATE projects SET projectnumber=null WHERE id='$r->proj_id' AND year='{$config['FAIRYEAR']}'");
+ mysql_query("UPDATE registrations SET status='open' WHERE id='$r->reg_id' AND year='{$config['FAIRYEAR']}'");
+ echo happy(i18n("Successfully unregistered project"));
+ }
if($showformatbottom)