-
Notifications
You must be signed in to change notification settings - Fork 0
/
Contact.php
117 lines (101 loc) · 2.84 KB
/
Contact.php
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php include 'Controls/header.php';
$i=0;
$execLevel = array("President:", "Internal:", "External:", "Finance and Records:", "Spirit:", "Recruitment:", "Social:");
$execMembers;// = array(7);
$execMemberEmails;// = array(7);
$result = GetExecInfo();
while ($rows = mysql_fetch_array($result))
{
//echo $execMembers[$i];
$execMembers[] = $rows['Name'];
$execMemberEmails[] = $rows['Email'];
$i = $i + 1;
}
?>
<div class="ScoopOfTheWeekBackground"></div>
<div class="content">
<table class="contactUsTable">
<?php
$i = 0;
while($i < 7)
{ ?>
<tr>
<td class="execLevel"><?php echo $execLevel[$i]; ?></td>
<td><a target="blank" href="<?php echo "mailto:".$execMemberEmails[$i]; ?>"><?php echo $execMembers[$i]; ?></a></td>
</tr>
<?php $i = $i + 1;
}
?>
</table>
<div class="contactUsEmail">
<form method="post" action="">
<table width="450px">
<tr class="contactUsFormTD">
<td>
Select Member
</td>
<td>
<select name="execMemberDD">
<?php
$i = 0;
while($i < 7)
{
echo "<option value=\"$execMemberEmails[$i]\">$execMembers[$i]</option>";
$i = $i + 1;
}
?>
</select>
</td>
</tr>
<tr>
<td class="contactUsFormTD">
<label>Name</label>
</td>
<td>
<input type="text" name="name" maxlength="50" size="30">
</td>
</tr>
<tr>
<td class="contactUsFormTD">
<label>Email</label>
</td>
<td>
<input type="text" name="email" maxlength="50" size="30">
</td>
</tr>
<tr>
<td class="contactUsFormTD">
<label>Message</label>
</td>
<td valign="top">
<textarea name="comments" maxlength="1000" cols="25" rows="6"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="Send">
</td>
</tr>
</table>
</form>
</div>
<?php if(isset($_POST['comments'])) {
//Get the drop down value
$email_to = $_POST["execMemberDD"];
// validation expected data exists
if(!isset($_POST['name']) || !isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$name = $_POST['name']; // required
$email = $_POST['email']; // required
$headers = "From: RallyCatsSite";
$comments = "From: ".$name."\n\n";
$comments = $comments."Email: ".$email."\n\n";
$comments = $comments.$_POST['comments']; // required
mail($email_to, "Contact Us Ticket: ", $comments, $headers);
// Now show a Thank you message:
?>
<p class="contactUsThankYou">Thank you for the email. The member that you emailed will be in contact with you as soon as possible.</p>
<?php } ?>
<div class="contactUsClearer"></div>
<?php include 'Controls/footer.php'; ?>