Пример #1
0
date_default_timezone_set(TIME_ZONE);
if (isset($_GET["key"])) {
    $key = trim(strip_tags($_GET["key"]), " \n");
    $verhuring = getVerhuringFromConfirm($key);
    $vid = $verhuring[0];
    $hid = $verhuring[1];
    $rid = $verhuring[2];
    if ($rid === -1 || $hid === -1) {
        confirmDecline();
    } else {
        // First check if it can actually be updated
        $updatable = isReserveringConfirmable($rid);
        //If so, update DB to confirmed and send email
        if ($updatable) {
            reserveringConfirmed($rid);
            $huurder = getInfoFromHid($hid);
            $name = $huurder[0];
            $mail = $huurder[1];
            sendConfirmEmailEllen($name, $mail);
            //TODO send email with huurcontract and voorwaarden
            sendDocuments($name, $mail, $key);
            confirmAccept();
        } else {
            confirmAlready();
        }
    }
}
/**
* Shows the message that indicates the Verhuring is confirmed
*/
function confirmAccept()
Пример #2
0
 }
 // Check if there are already Reservations during the time frame and if so indicate this for the success message
 if (alreadyReserved($start, $end) == True) {
     $alreadyReserved = True;
 }
 //First create Huurder
 $hid = -1;
 $groep = "NULL";
 //Check if either the groepscode is filled in (so made by one of our own groups) or if it is filled in by an external party
 if ($groepscode != "" && $area != "" && $aantalPers != "") {
     //Get information based on the group code and process the request
     $hid = getHuurderIDFromCode($groepscode);
     if ($hid == -1) {
         incompleteData("de groepscode is incorrect");
     }
     $info = getInfoFromHid($hid);
     $naam = $info[0];
     $mail = $info[1];
     $groep = $naam;
     $contact = $naam;
 } elseif ($naam != "" && $contact != "" && filter_var($mail, FILTER_VALIDATE_EMAIL) && $telefoon != "" && $adres != "" && $postcode != "" && $plaats != "" && $aantalPers != "" && $area != "") {
     //Filled in by external party (not own group)
     $hid = getHuurder($naam, $contact, $mail, $telefoon, $adres, $postcode, $plaats);
 } else {
     //Some empty fields
     missingData();
 }
 //Validate huurderID that was fetched
 if ($hid === -1) {
     errorDatabase();
 }