-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathworkshop_form.php.in
92 lines (79 loc) · 2.57 KB
/
workshop_form.php.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
%HEAD%
<title>Workshop Registration</title>
%BODY%
%NAVIGATION%
%OPEN_CONTENT%
<h1>Workshop Registration</h1>
<?php
function submit_form() {
global $_POST;
$registration_types = array(
"all_member_early" => "Workshop/Ball Member Early",
"all_member_late" => "Workshop/Ball Member Late",
"all_nonmember_early" => "Workshop/Ball Non-Member Early",
"all_nonmember_late" => "Workshop/Ball Non-Member Late",
"workshop_member_early" => "Workshop Member Early",
"workshop_member_late" => "Workshop Member Late",
"workshop_nonmember_early" => "Workshop Non-Member Early",
"workshop_nonmember_late" => "Workshop Non-Member Late",
"ball_member_early" => "Ball Member Early",
"ball_member_late" => "Ball Member Late",
"ball_nonmember_early" => "Ball Non-Member Early",
"ball_nonmember_late" => "Ball Non-Member Late",
"ball_spectator" => "Ball Spectator",
"lunch_guest" => "Lunch Guest",
);
if ($_POST['org'] != 'on' || strlen($_POST['total']) < 1) {
echo '<p>Sorry, but the form was not filled out correctly. ';
echo 'Please go back and try again. (Did you forget to check';
echo ' that Scottish Country Dance is fun?)</p>';
return;
}
$email = "Someone (".$_SERVER["REMOTE_ADDR"].") would like to register "
."for the Portland RSCDS ball!\n"
."\n";
$num_dancers = $_POST['num_dancers'];
for ($i = 1; $i <= $num_dancers; $i++) {
if (!array_key_exists('name'.$i, $_POST) ||
strlen($_POST['name'.$i]) < 1)
continue;
$email .= "Name: ".$_POST['name'.$i]."\n"
."Class: ".$_POST['class'.$i]."\n"
."Years: ".$_POST['years'.$i]."\n"
."\n";
}
foreach ($registration_types as $key => $label) {
if (strlen($_POST[$key]) > 0) {
$email .= $label.": ".$_POST[$key]."\n";
}
}
$email .= "\n"
."Address: ".$_POST['address']."\n"
."Phone: ".$_POST['phone']."\n"
."Email: ".$_POST['email']."\n";
if (strlen($_POST['other']) > 0) {
$email .= "Other: ".$_POST['other']."\n";
}
$email .= "\n"
."Total: ".$_POST['total']."\n"
."\n"
."They were using ".$_SERVER["HTTP_USER_AGENT"].".\n";
mail("[email protected]",
"Portland RSCDS Ball Registration",
$email
);
$name = $_POST['name1'];
$total = $_POST['total'];
echo "<p>Thank you, <b>".$name."</b>, for your registration; it will ";
echo "be processed as soon as we receive your payment. Please send ";
echo "your <b>".$total."</b> check, made out to <b>“RSCDS Portland ";
echo "OR Branch”</b>, to ";
?>%WORKSHOP_CHAIR_MAIL%
<?php
echo ". We cannot process your registration until we receive your ";
echo "check.</p>\n";
}
submit_form();
?>
%CLOSE_CONTENT%
%FOOT%