-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.cfm
More file actions
88 lines (86 loc) · 1.97 KB
/
contact.cfm
File metadata and controls
88 lines (86 loc) · 1.97 KB
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
<!-- Grab all info we have on our selected contact
The contact UID is passed through the URL
We use a cfqueryparam to ensure that only an integer can be inserted into our query -->
<cfquery name="getContact" datasource="addressbookcf">
SELECT * FROM contacts
WHERE uid = <cfqueryparam value="#url.uid#" CFSQLType="cf_sql_integer">
LIMIT 1
</cfquery>
<table class="table table-striped table-hover" id="contactInfo" style="position: relative; overflow: hidden;">
<cfoutput query="getContact">
<!-- We're using length checks to make sure this user has corresponding info, if not, skip! -->
<cfif len(first_name) or len(second_name)>
<tr>
<td>
<h4 class="glyphicon glyphicon-user"></h4>
<img src="https://www.gravatar.com/avatar/#lcase(Hash(lcase(email)))#?s=100&d=mp" style="border-radius: 50%; position: absolute; right: 10px" />
</td>
<td>
#first_name# #second_name#
</td>
</tr>
</cfif>
<cfif len(phone_mobile)>
<tr>
<td>
<h4 class="glyphicon glyphicon-phone"></h4>
</td>
<td>
#phone_mobile#
</td>
</tr>
</cfif>
<cfif len(phone_home)>
<tr>
<td>
<h4 class="glyphicon glyphicon-phone-alt"></h4>
</td>
<td>
#phone_home#
</td>
</tr>
</cfif>
<cfif len(phone_work)>
<tr>
<td>
<h4 class="glyphicon glyphicon-briefcase"></h4>
</td>
<td>
#phone_work#
</td>
</tr>
</cfif>
<cfif len(email)>
<tr>
<td>
<h4 class="glyphicon glyphicon-envelope"></h4>
</td>
<td>
#email#
</td>
</tr>
</cfif>
<cfif len(address) or len(postcode)>
<tr>
<td>
<h4 class="glyphicon glyphicon-home"></h4>
</td>
<td>
#address# <br>
#postcode#
</td>
</tr>
</cfif>
<cfif len(birthday)>
<tr>
<td>
<h4 class="glyphicon glyphicon-calendar"></h4>
</td>
<td>
<!-- Formatting our dates to standard UK layout -->
#DateFormat(birthday, "dd/mm/yyyy")#
</td>
</tr>
</cfif>
</cfoutput>
</table>