-
Notifications
You must be signed in to change notification settings - Fork 2
/
Contact.php
113 lines (83 loc) · 2.52 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
<?php
/*
* Contact.php
* LHS Math Club Website
*
* Shows information on how to contact the Math Club.
*/
require_once '.lib/functions.php';
if (user_access('RLA'))
show_page_for_members();
else
show_public_page();
function show_public_page() {
// Make certain links open in a new tab/window
global $use_rel_external_script;
$use_rel_external_script = true;
page_header('Contact');
global $PUBLIC_EMAIL, $WEBMASTER_EMAIL, $ADVISOR_NAME;
$public_captain_email = email_obfuscate($PUBLIC_EMAIL, null, 'at ');
$email_the_webmaster = email_obfuscate($WEBMASTER_EMAIL, 'email the Webmaster', 'If you experience difficulty using this site, please ');
echo <<<HEREDOC
<h1>Contact</h1>
<span class="b">Contact us...</span>
<ul>
<li>
<span class="b">via email:</span><br />
$public_captain_email<br />
<br />
</li>
<li>
<span class="b">via snail mail, at:</span><br />
Math Club<br />
c/o {$ADVISOR_NAME}<br />
<a href="http://lhs.lexingtonma.org/" rel="external">Lexington High School</a><br />
251 Waltham Street, Lexington, MA 02421<br />
<br />
</li>
<li>
<div>$email_the_webmaster</div>
</li>
</ul>
HEREDOC;
}
function show_page_for_members() {
// Make certain links open in a new tab/window
global $use_rel_external_script, $CAPTAIN_EMAIL, $WEBMASTER_EMAIL;
$use_rel_external_script = true;
page_header('Contact');
echo <<<HEREDOC
<h1>Contact</h1>
<ul>
<li>
<span class="b">All Captains</span><br />
<a href="mailto:$CAPTAIN_EMAIL" rel="external">$CAPTAIN_EMAIL</a><br />
<br />
<br />
</li>
HEREDOC;
// Fetch Data
$query = 'SELECT name, email, cell FROM users WHERE permissions="C"';
$result = DB::queryRaw($query);
$row = mysqli_fetch_assoc($result);
while ($row) {
echo " <li>\n"
. " <span class=\"b\">{$row['name']}</span><br />\n"
. " <a href=\"mailto:{$row['email']}\" rel=\"external\">{$row['email']}</a><br />\n";
$cell = format_phone_number($row['cell']);
if ($cell != 'None')
echo " $cell<br />\n";
echo " </li>\n";
$row = mysqli_fetch_assoc($result);
}
echo <<<HEREDOC
<br><li>
If you experience difficulty using this site, please
<a href="mailto:$WEBMASTER_EMAIL" rel="external">
email the Webmaster</a>
</li>
</ul>
<br />
HEREDOC;
}
?>