forked from science-ation/science-ation
projects should be assigned a project number once registration forms have been received, whether or not they still owe money. Resolves issue 101.
This commit is contained in:
parent
a169e422e6
commit
808290f631
@ -188,10 +188,14 @@ echo mysql_Error();
|
||||
|
||||
|
||||
}
|
||||
else if($_POST['action']=="receivedyes" && $_POST['registration_number'])
|
||||
else if(($_POST['action']=="receivedyes" || $_POST['action']=="receivedyesnocash") && $_POST['registration_number']) {
|
||||
|
||||
$checkNumQuery=mysql_query("SELECT projectnumber FROM projects, registrations WHERE projects.registrations_id = registrations.id AND "
|
||||
. "num='".$_POST['registration_number']."'");
|
||||
$checkNumResults=mysql_fetch_object($checkNumQuery);
|
||||
$projectnum=$checkNumResults->projectnumber;
|
||||
if($projectnum == null)
|
||||
{
|
||||
//actually set it to 'closed'
|
||||
mysql_query("UPDATE registrations SET status='complete' WHERE num='".$_POST['registration_number']."'");
|
||||
$q=mysql_query("SELECT id FROM registrations WHERE num='".$_POST['registration_number']."'");
|
||||
$r=mysql_fetch_object($q);
|
||||
$reg_id=$r->id;
|
||||
@ -237,17 +241,26 @@ echo mysql_Error();
|
||||
|
||||
$projectnumber=str_replace('N',$Nnum,$projectnumber);
|
||||
mysql_query("UPDATE projects SET projectnumber='$projectnumber' WHERE registrations_id='$reg_id' AND year='".$config['FAIRYEAR']."'");
|
||||
echo happy(i18n("Assigned Project Number: %1",array($projectnumber)));
|
||||
}
|
||||
if($_POST['action']=="receivedyes")
|
||||
{
|
||||
//actually set it to 'closed'
|
||||
mysql_query("UPDATE registrations SET status='complete' WHERE num='".$_POST['registration_number']."'");
|
||||
|
||||
|
||||
echo happy(i18n("Registration of form %1 successfully completed",array($registration_number)));
|
||||
echo happy(i18n("Assigned Project Number: %1",array($projectnumber)));
|
||||
|
||||
|
||||
}
|
||||
else if($_POST['action']=="receivedyesnocash" && $_POST['registration_number'])
|
||||
else if($_POST['action']=="receivedyesnocash")
|
||||
{
|
||||
//actually set it to 'closed'
|
||||
mysql_query("UPDATE registrations SET status='paymentpending' WHERE num='".$_POST['registration_number']."'");
|
||||
echo happy(i18n("Registration of form %1 marked as payment pending",array($registration_number)));
|
||||
}
|
||||
|
||||
}
|
||||
else if($_POST['action']=="receivedno" && $_POST['registration_number'])
|
||||
{
|
||||
echo notice(i18n("Registration of form %1 cancelled",array($registration_number)));
|
||||
|
Loading…
Reference in New Issue
Block a user