-
Notifications
You must be signed in to change notification settings - Fork 1
/
cola.php
257 lines (219 loc) · 5.74 KB
/
cola.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php
$ogimage = $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . "/php/image.php?" . $_SERVER['QUERY_STRING'];
$url = 'http://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
?>
<html>
<head>
<meta charset="UTF-8">
<meta property="og:title"
content="Meus candidatos para o Conselho Participativo Municipal" />
<meta property="og:site_name" content="#OCUPACONSELHO"/>
<meta property="og:url" content="<?php echo $url; ?>">
<meta property="og:image" content="<?php echo 'http://' . $ogimage ?>">
<meta property="og:image:type" content="image/png">
<meta property="og:type" content="website">
<meta property="og:image:width" content="600">
<meta property="og:image:height" content="300">
<title>#OCUPACONSELHO</title>
<!-- Load jQuery and Sheetrock from CDNJS -->
<script src="js/jquery.min.js"></script>
<script src="js/sheetrock.min.js"></script>
<script src="js/handlebars.min.js"></script>
<script src="js/typeahead.bundle.js"></script>
<script src="js/config.js"></script>
<script src="js/misc.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<link rel="stylesheet" href="css/main.css" >
<link rel="stylesheet" href="css/misc.css" >
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
<!-- Latest compiled and minified JavaScript -->
<script src="js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
<script>
Handlebars.registerHelper('split', function(text) {
var t = text.split(" ");
return "<span class='tag'>" + t.join("</span> <span class='tag'>") + "</span>";
});
var getQuery = function () {
q = []
var candidatos = gup("candidatos").split(",");
for (i in candidatos) {
q.push(" E = " + candidatos[i])
}
return 'select * where ' + q.join(" OR ")
}
$().ready(function (){
// Compile the Handlebars template for HR leaders.
var HRTemplate = Handlebars.compile($('#hr-template').html());
var HRLocalTemplate = Handlebars.compile($('#hr-local-template').html());
// Load top five HR leaders.
if (gup("candidatos") != '') {
$('#hr').sheetrock({
url: candidatos_sheet,
query: getQuery(),
rowTemplate: HRTemplate
});
}
if (gup('nome') != '') {
$('#hr-local').sheetrock({
url: local_sheet,
query: "select * where B contains '"+gup('nome')+"'",
fetchSize: 2,
rowTemplate: HRLocalTemplate
});
}
var ogimage = "http://ocupaconselho.org.br/vote/php/image.php?nome=" + gup("nome") + "&candidatos=" + gup("candidatos");
$('meta[property="og:image"]').attr('content', ogimage);
});
</script>
<style>
#hr {
text-align: center;
clear:both;
min-height: 315px;
width:600px;
padding-left:0px;
}
.card {
width:182px;
height:220px;
text-align: center;
float:left;
margin:3px;
margin-bottom: 10px;
background-color: #F2F2F2;
border:5px solid #F2F2F2;
}
.foto {
margin-top:3px;
margin-left:3px;
width:82px;
height:82px;
background-color: #FFF;
float:left;
}
.numero {
font-size:23px;
float:right;
padding:10px;
}
.numero .lab {
font-size: 11px;
}
.top {
height:125px;
clear:both;
}
.nome {
height:50px;
font-size: 15px;
padding:3px;
line-height: 1;
}
.bottom {
height:37px;
clear:both;
background-color: #8C3438;
}
.tags {
color:#FFF;
}
#hr-local {
clear:both;
width:600px;
text-align: left;
height:140px;
}
.local {
width:600px;
height:100px;
background-color: #8C3438;
color:#FFFFFF;
text-align: center;
float:right;
padding-left:15px;
}
.local-legenda {
font-size: 15px;
font-weight: 600;
}
.legenda {
clear:both;
}
.escolha {
text-align: center;
background-color: #8C3438;
width: 945px;
height: 47px;
color:#FFFFFF;
font-weight: 600;
font-size: 23px;
margin:0 auto;
clear:both;
vertical-align: middle;
margin-top:15px;
}
.tagline {
width:600px;
color:#FFFFFF;
background-color: #8C3438;
}
.middle {
width:600px;
}
.fb-share-button {
padding-top:10px;
}
@media print {
.fb-share-button {
display:none !important;
}
}
</style>
</head>
<body class="cola">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=803138933106775";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="tagline">
<h2>AS ELEIÇÕES SERÃO DIA 06/12</h2>
</div>
<div class="middle">
<div id="hr">
<script id="hr-template" type="text/x-handlebars-template">
<div class="card" onclick="javascript:toggle(this);">
<div class="top">
<img class="foto" src="{{cells.PICT}}" />
<div class="numero">
<span class="lab">Nº DE URNA</span><br />
<span>{{cells.Numero}}</span>
</div>
</div>
<div class="nome">{{cells.Nome}}</div>
<div class="bottom">
<div class="tags">
{{{split cells.Tags}}}
</div>
<!-- <div class="label label-warning">{{cells.Subprefeitura}}</div> -->
</div>
</div>
</script>
</div>
<div id="hr-local">
<script id="hr-local-template" type="text/x-handlebars-template">
<div class="local">
<div class="local-legenda">Seu local de votação:</div>
<b>{{cells.NOME}}</b>
<div>{{cells.ENDEREÇO}}</div>
<div class="fb-share-button" data-href="<?php echo $url; ?>" data-layout="button"></div>
</div>
</script>
</div>
</div>
</body>
</html>