. */ include("./include/include.php"); include("./include/g_accepted.php"); include("./include/g_body.php"); if( $setup['AuthSystem']=="None" ) { // No login allowed, hide this page header("location: ".$PATH."apply_front.php"); }elseif( $_SESSION['sess_uid']==0 AND !(isset($_REQUEST['login']) OR isset($_REQUEST['logout'])) ) { // User needs to log in first if( strpos($_SERVER['REQUEST_URI'], "?")===false ) header("location: ".$_SERVER['REQUEST_URI']."?login"); else header("location: ".$_SERVER['REQUEST_URI']."&login"); exit(); } page_header(); if( !isset($_SESSION['apply_id_' . EVENTNUMID]) AND isset($_REQUEST['edit']) ) { $query="SELECT `id` FROM `applications` WHERE `username`='".addslashes($_SESSION['sess_name'])."' OR CONCAT(`FirstName`, ' ', `LastName`)='".addslashes($_SESSION['sess_name'])."'"; if( @mysql_num_rows( $res=doquery($query) )==1 ) { // Person did already apply $row = mysql_fetch_array($res); $_SESSION['apply_id_' . EVENTNUMID]=$row['id']; } } if( isset($_POST['login']) ) $_SERVER['REQUEST_METHOD']="GET"; if( (isset($_REQUEST['apply']) OR isset($_REQUEST['edit']) OR $_SERVER['REQUEST_METHOD']=="POST") AND isset($_SESSION['apply_id_' . EVENTNUMID]) AND !isset($_REQUEST['cancel']) ) { // Show applicaton form $appl_id = $_SESSION['apply_id_' . EVENTNUMID]; if( $_SESSION['apply_id_' . EVENTNUMID]==0 ) { echoln("The prefilled fields are loaded from your ".$ldap->getSystemName()." account. If you want to update the data in your ".$ldap->getSystemName()." account, please go to "); echoln("getAccountEditUrl()."\" target=\"_blank\">".$ldap->getAccountEditUrl().". If you want to use your ".$ldap->getSystemName()." account data here as well, log out here, "); echoln("getAccountEditUrl()."\" target=\"_blank\">update your ".$ldap->getSystemName()." account and log in here again (it is important you log in "); echoln("here after you have saved the changes to your ".$ldap->getSystemName()." account. Note that it might take some time for the changes to be available in your application, to "); echoln("be sure, wait an hour. Prefilling only works on new applications, not when editing an application).
"); } include("./include/application.php"); }elseif( isset($_REQUEST['cancel']) ) { // Cancel application if( is_before("EventDateStart") ) { if( isset($_POST['password']) ) { if( $ldap->Auth($_SESSION['sess_name'], $_POST['password']) ) { // Ok $query="UPDATE `applications` SET `Accepted`='cancel', `Log`=CONCAT(`Log`,'\n".date("Y-m-d H:i:s").": application canceled by ".addslashes($_SESSION['sess_name'])."') WHERE `username`='".addslashes($_SESSION['sess_name'])."' AND `id`=".addslashes($_SESSION['apply_id_' . EVENTNUMID])." AND `Accepted`!='arrived' AND `Accepted`!='no'"; if( doquery($query) ) { dolog("apply", "Application (ID=".$_SESSION['apply_id_' . EVENTNUMID].") has been cancelled by ".$_SESSION['sess_name'], "info"); echoln("Your application has been cancelled. Thanks a lot for your help!"); }else { echoln("Failed cancelling your application. You can try again, or send an e-mail to the organizers to cancel."); } echoln("
Back"); }else { // Auth error echoln("Failed cancelling your application. Your password is not valid."); echoln("
Try again with the right password.");
}
}else {
echoln("Cancelling your application means that you will not come to this ".$setup['SetupEventType'].". If you were accepted already, you will also be removed from ");
echoln("the participants list. But, on the other hand, if you cancel, you free places for people on the waiting list, and you help the organizers to better estimate ");
echoln("the number of people that will arrive. Not showing up without noticing them will cause financial loss. Next to that, you run the risk your local will get fewer ");
echoln("places for next ".$setup['SetupEventType'].". So, if you cannot come, please cancel!");
echoln("
It is always possible to withdraw the cancellation (come back to this page), but please keep in mind you'll be put on the waiting list.");
echoln("
To cancel your application, please fill in your password below as confirmation."); echoln("
"); } } }elseif( isset($_REQUEST['reapply']) ) { // Undo cancel if( is_before("EventDateStart") ) { if( !isset($_REQUEST['confirm']) ) { echoln("Are you sure you want to undo the cancellation of your application?"); echoln("Yes No"); }else { $query="UPDATE `applications` SET `Accepted`='-', `Log`=CONCAT(`Log`,'\n".date("Y-m-d H:i:s").": application un-canceled by ".addslashes($_SESSION['sess_name'])."') WHERE `username`='".addslashes($_SESSION['sess_name'])."' AND `id`=".addslashes($_SESSION['apply_id_' . EVENTNUMID])." AND `Accepted`!='arrived' AND `Accepted`!='no'"; if( doquery($query) ) { dolog("apply", "Application (ID=".$_SESSION['apply_id_' . EVENTNUMID].") has been un-cancelled by ".$_SESSION['sess_name'], "info"); echoln("The cancellation of your application has been undone. Thanks a lot for applying again!"); }else { echoln("Failed undoing the cancellation of your application. You can try again, or send an e-mail to the organizers to undo the cancellation."); } echoln("
Back"); } } }else { // Show welcome page $query="SELECT `id`, `FirstName`, `LastName`, `BodyCode`, `Created`, `Modified`, `BoardConfirmed`, `Accepted`, `WorkshopIDSlot1`, `WorkshopIDSlot2`, `ParticipantType`, `ParticipantOrder` FROM `applications` WHERE `username`='".addslashes($_SESSION['sess_name'])."' OR CONCAT(`FirstName`, ' ', `LastName`)='".addslashes($_SESSION['sess_name'])."'"; if( @mysql_num_rows( $res=doquery($query) )==1 ) { // Person did already apply $row = mysql_fetch_array($res); $_SESSION['apply_id_' . EVENTNUMID]=$row['id']; if( $row['Accepted']=="cancel" ) echoln("Your application has been cancelled."); else echoln("You already applied for ".$setup['EventSubject']."."); echoln("
| Application for: | ".$row['FirstName']." ".$row['LastName']." |
| Body: | ".$Body[ $row['BodyCode'] ]." (".$row['BodyCode'].") |
| Application created: | ".get_date($row['Created'])." |
| Application modified: | ".get_date($row['Modified'])." |
| Confirmed by board: | ", false, true); if( $row['BoardConfirmed']=="-" ) echoln("Not handled yet", false, true); elseif( $row['BoardConfirmed']=="no" ) echoln("Rejected", false, true); else echoln(ucwords($row['BoardConfirmed']), false, true); echoln(" |
| Accepted by the organizers: | ", false, true); if( $row['Accepted']=="-" OR (($row['Accepted']=="yes" OR $row['Accepted']=='confirmed' OR $row['Accepted']=='pending') AND $setup['ShowParticipantList']==false) ) echoln("Not handled yet", false, true); else echoln($Accepted_text[ $row['Accepted'] ], false, true); echoln(" |
| Participant type: | ", false, true); if( $row['ParticipantType']=="-" ) echoln("Not handled yet", false, true); else echoln(ucwords($row['ParticipantType'])." - ".$row['ParticipantOrder'], false, true); echoln(" |
Edit your application");
echoln("
Cancel your application");
}else {
echoln("
Undo the cancellation of my application"); } } }else { // Person did not apply yet $_SESSION['apply_id_' . EVENTNUMID]=0; echoln("You did not apply yet for ".$setup['EventSubject'].".
");
if( is_before_ex("EventDateAppStart") ) {
// Application did not open yet
echoln("The application did not open yet, you cannot apply now.");
echoln("
The applications will open on ".$setup['EventDateAppStart'].". Please come back from then on, but before the deadline (".$setup['EventDateAppEnd'].").");
}elseif( $setup['ApplicationAdminOpen']==false ) {
// Application locked by admin
echoln("The application has been locked by the webmaster, as it is not ready to be used yet.");
echoln("
Before the application can open, the chair team and the local organizers have to finalize the setup first, please be a bit patient.");
}elseif( !is_before("EventDateAppEndReal") && (!isset($appl_id) || $appl_id==0) ) {
// Application deadline passed
echoln("The application deadline passed, you cannot apply any more.");
echoln("
The deadline to apply for this event was on ".$setup['EventDateAppEndReal'].". You cannot apply any more. For next time you are suggested to apply well before the deadline.");
}elseif( is_before("EventDateStart") AND $row['Accepted']!="arrived" AND $row['Accepted']!="no" ) {
echoln("
Apply now."); } } } page_footer(); ?>