"; } if(strlen($lastName) == 0) { $errors[] = "Please enter your last name
"; } if(strlen($email) == 0) { $errors[] = "Please enter a valid email address
"; } elseif(validate_email($email) === FALSE) { $errors[] = "Please enter a valid email address
"; } if(strlen($phone) == 0) { $errors[] = "Please enter your phone number
"; } elseif(validate_phone($phone) === FALSE) { $errors[] = "Please enter a valid phone number
"; } if(strlen($cellphone) == 0) { $errors[] = "Please enter parents cell phone number
"; } elseif(validate_phone($cellphone) === FALSE) { $errors[] = "Please enter a valid cell phone number
"; } if($bdate == 0) { $errors[] = "Please enter your date of birth
"; } if(strlen($address) == 0) { $errors[] = "Please enter your address
"; } if(strlen($city) == 0) { $errors[] = "Please enter your city
"; } elseif(preg_match("/^[a-zA-Z\s-]+$/i", $city) === 0) { $errors[] = "City must only include letters, dashes, or spaces
"; } if(strlen($state) == 0) { $errors[] = "Please select your state
"; } if(strlen($zip) == 0) { $errors[] = "Please enter your zip (numbers only)
"; } if(strlen($occupation) == 0) { $errors[] = "Please enter Parent's occupation
"; } if(sizeof($activities) == 0) { $errors[] = "You didn't select any activities
"; } if(strlen($consentName) == 0) { $errors[] = "Please enter Parent's or Guardian's name in consent form
"; } if(strlen($participantname) == 0) { $errors[] = "Please enter participant's name
"; } if(strlen($participantphone) == 0) { $errors[] = "Please enter Parent's or Guardian's phone number
"; } elseif(validate_phone($participantphone) === FALSE) { $errors[] = "Please enter a valid Parent's or Guardian's phone number
"; } if(strlen($healtcard) == 0) { $errors[] = "Please enter the health card number (numbers only no spaces )
"; } if(strlen($emergencyContact) == 0) { $errors[] = "Please enter emergency contact's name
"; } if(strlen($relationship) == 0) { $errors[] = "Please enter the relationship of emergency contact
"; } if(strlen($emergencyPhone) == 0) { $errors[] = "Please enter emergency phone number
"; } elseif(validate_phone($emergencyPhone) === FALSE) { $errors[] = "Please enter a valid emergency phone number
"; } if($accept !== '1') { $errors[] = "You have to accept the terms & conditions
"; } $db_activities = implode(', ', $activities); if(sizeof($errors) == 0) { $sql = " INSERT INTO upis ( name, lastName, email, phone, cellphone, bdate, address, city, state, zip, occupation, activities, consentName, participantname, participantphone, healtcard, emergencyContact, relationship, emergencyPhone, allergies, healthConditions, log_ip ) values ( :name, :lastName, :email, :phone, :cellphone, :bdate, :address, :city, :state, :zip, :occupation, :activities, :consentName, :participantname, :participantphone, :healtcard, :emergencyContact, :relationship, :emergencyPhone, :allergies, :healthConditions, :log_ip ); "; $sql = $dbh->prepare($sql); $sql->bindValue(':name', $name); $sql->bindValue(':lastName', $lastName); $sql->bindValue(':email', $email); $sql->bindValue(':phone', $phone); $sql->bindValue(':cellphone', $cellphone); $sql->bindValue(':bdate', $bdate); $sql->bindValue(':address', $address); $sql->bindValue(':city', $city); $sql->bindValue(':state', $state); $sql->bindValue(':zip', $zip); $sql->bindValue(':occupation', $occupation); $sql->bindValue(':activities', $db_activities); $sql->bindValue(':consentName', $consentName); $sql->bindValue(':participantname', $participantname); $sql->bindValue(':participantphone', $participantphone); $sql->bindValue(':healtcard', $healtcard); $sql->bindValue(':emergencyContact', $emergencyContact); $sql->bindValue(':relationship', $relationship); $sql->bindValue(':emergencyPhone', $emergencyPhone); $sql->bindValue(':allergies', $allergies); $sql->bindValue(':healthConditions', $healthConditions); $sql->bindValue(':log_ip', $ip); $sql->execute(); $to = "info@oplenac.ca"; $subject = "Oplenac - Upisnica"; $headers = "From: info@oplenac.ca"; $message = "Stigla je nova upisnica za Oplenac.\nZa proveru podataka kliknite:\n\nhttp://oplenac.ca/upis/data"; $sent = mail($to, $subject, $message, $headers); header('Location: thanks.php'); exit; } else { $err_msg = join('', $errors); $err_msg =<<
{$err_msg} EOD; } } ?> Oplenac Registration Form / Upisnica

 

REGISTRATION FORM / УПИСНИЦА

 

Fields marked with * are required.

*
*
*
*
*
*
*
*
*

(Please use this format: 555-555-5555)
*

(Please use this format: 555-555-5555)
*
Activities/Секције Please Make Your Selection *