forked from science-ation/science-ation
Add a way to unregister projects. Simply re-enter their registration number, and click the link.
This commit is contained in:
parent
431c8d9036
commit
e320230a3e
@ -174,6 +174,7 @@ echo mysql_Error();
|
|||||||
{
|
{
|
||||||
echo i18n("This form has already been received. Registration is complete");
|
echo i18n("This form has already been received. Registration is complete");
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
|
echo "<a href=\"registration_receivedforms.php?action=unregister®istration_number=$reg_num\">".i18n("Click here to unregister this project")."</a>";
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo "<hr />";
|
echo "<hr />";
|
||||||
}
|
}
|
||||||
@ -279,6 +280,14 @@ echo mysql_Error();
|
|||||||
echo notice(i18n("Registration of form %1 cancelled",array($_POST['registration_number'])));
|
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)
|
if($showformatbottom)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user