-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
347 lines (343 loc) · 15 KB
/
index.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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<?php get_header(); ?>
<div id="modalvideo" class="modal">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat"><i class="icon-cancel-circle"></i></a>
<div class="modal-content">
<?php
$query = new WP_Query(array('post_type' => 'page', 'post_status' => 'publish', 'p' => 89));
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
?>
<div class="video-container"><?php the_content(); ?></div>
<?php
endwhile; endif;
wp_reset_postdata();
?>
</div>
</div>
<div class="main" id="fullpage">
<section class="color-1 section" id="section-1">
<main class="valign-wrapper">
<h6 class="sub-title" data-anim="fadeInLeft">Bienvenidos</h6>
<div class="valign"><div class="big" data-anim="fadeInLeft">
<?php
$query = new WP_Query(array('post_type' => 'page', 'post_status' => 'publish', 'p' => 65));
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
?>
<?php the_content(); ?>
<?php
endwhile; endif;
wp_reset_postdata();
?>
</div>
<p><a href="<?php echo get_permalink(72) ?>" class="btn-large btn-black btn-page" data-section="section.color-1" data-class="new-perfil" data-anim="fadeInUp"><i class="material-icons icon-angle-right right small" aria-hidden="true"></i> Inscríbete</a></p>
</div>
</main>
</section>
<!-- // -->
<?php
$query = new WP_Query(array('post_type' => 'premio', 'post_status' => 'publish', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'menu_order'));
$premios = array();
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
$title=get_the_title( $ID );
$color=get_field('color', $ID );
$img=wp_get_attachment_image_src( get_post_thumbnail_id($ID), 'full' );
$desc=get_the_content( );
array_push($premios,array('id'=>$ID,'title'=>$title,'color'=>$color,'img'=>$img[0],'desc'=>$desc));
endwhile; endif;
wp_reset_postdata();
?>
<section class="color-2 section" id="section-2" style="background-image: url(<?php echo $premios[0]['img'] ?>)">
<main>
<div class="row">
<div class="col m7 s12">
<h6 class="sub-title" data-anim="fadeInLeft">Premios</h6>
<div class="tab-tabs">
<div class="valign" data-anim="fadeIn">
<div class="big"><p>Estos son los <b>premios</b> que <b>podrás ganar</b> contestando nuestras encuestas</p></div>
<ul id="tabs" class="tabs linear">
<?php $n=0;foreach($premios as $premio): ?>
<li class="tab col s3"><a href="#award-cont-<?php echo $premio['id'] ?>"<?php echo $n==0?' class="active"':'';?>><?php echo $premio['title'] ?></a></li>
<?php $n++;endforeach; ?>
</ul>
</div>
</div>
</div>
<div class="col m5 s12"><div class="valign-wrapper">
<div class="valign" data-anim="fadeInRight">
<div class="tab-cont">
<?php $n=0;foreach($premios as $premio): ?>
<div id="award-cont-<?php echo $premio['id'] ?>" class="col s12" data-color="<?php echo $premio['color'] ?>" data-img="<?php echo $premio['img'] ?>">
<img src="<?php echo $premio['img'] ?>" style="display: none">
<?php echo $premio['desc'] ?>
</div>
<?php $n++;endforeach; ?>
</div>
</div></div>
</div>
</div>
</main>
</section>
<!-- // -->
<section class="color-3 section" id="section-3">
<?php
$query = new WP_Query(array('post_type' => 'encuesta', 'post_status' => 'publish', 'posts_per_page' => -1, 'order' => 'DESC', 'orderby' => 'menu_order'));
$encuestas = array();
$enc_name = array();
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
$title=get_the_title( $ID );
$users=get_field('usuarios', $ID );
$desc=get_the_content( );
array_push($enc_name,$title);
array_push($encuestas,array('id'=>$ID,'title'=>$title,'users'=>$users,'desc'=>$desc));
endwhile; endif;
wp_reset_postdata();
?>
<main>
<div class="row">
<div class="sub-title" data-anim="fadeInDown">
<div class="col s6">
<h6>Ganadores</h6>
</div>
<div class="col s12"><form id="searchwin">
<div class="input-group">
<input type="search" id="search-input" placeholder="Busca tu encuesta" class="autocomplete">
<button type="submit" class="sufix"><i class="material-icons icon-search"></i></button>
</div>
<span>*Ingresa aquí el nombre de la encuesta que participaste</span>
</form></div>
</div>
<div class="col m6 s12 txt">
<div class="valign-wrapper"><div class="valign" style="z-index: 99;">
<div class="big" data-anim="fadeIn"><p><b>Busca aquí</b> si eres uno de los <b>ganadores</b></p></div>
<div class="input-field" data-anim="fadeInLeft">
<select class="black-select" id="select-ganadores">
<option value="" disabled selected>Selecciona Encuesta</option>
<?php $n=0;foreach($encuestas as $encuesta): ?>
<option value="<?php echo $encuesta['id'] ?>"><?php echo $encuesta['title'] ?></option>
<?php $n++;endforeach; ?>
</select>
</div>
</div></div>
</div>
<div class="col m6 s12">
<div class="valign-wrapper"><div class="valign">
<div class="center-align">
<ul class="collection with-header" data-anim="fadeInRight">
</ul>
</div>
</div></div>
</div>
</main>
<script>
function autocompleteInit(){
//autocomplete
$('input.autocomplete').autocomplete({
data: {
"<?php echo implode('": null,"',$enc_name); ?>": null
},
limit: 5, // The max amount of results that can be shown at once. Default: Infinity.
});
};
</script>
</section>
<!-- // -->
<?php
$query = new WP_Query(array('post_type' => 'page', 'post_status' => 'publish', 'p' => 67));
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
$desc=get_the_content( );
$img=wp_get_attachment_image_src( get_post_thumbnail_id($ID), 'full' );
endwhile; endif;
wp_reset_postdata();
?>
<section class="color-4 section" id="section-4" style="background-image: url(<?php echo $img[0]; ?>)">
<main>
<div class="row">
<div class="col m12 s12">
<h6 class="sub-title" data-anim="fadeInLeft">Encuesta Destacada</h6>
<div class="valign-wrapper"><div class="valign" >
<?php echo $desc; ?>
<p><a href="<?php the_field('url',$ID); ?>" target="_blank" class="btn-large btn-black btn-purple" data-anim="fadeInUp"><i class="material-icons icon-angle-right right small" aria-hidden="true"></i> Contesta aquí</a></p>
</div></div>
</div>
</main>
</section>
<!-- // -->
<section class="color-5 section" id="section-5">
<?php
$query = new WP_Query(array('post_type' => 'page', 'post_status' => 'publish', 'p' => 69));
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
$title=get_the_title( $ID );
$desc=get_the_content( );
endwhile; endif;
wp_reset_postdata();
?>
<main>
<div class="row">
<div class="col m7 s12">
<h6 class="sub-title" data-anim="fadeInLeft">Invita a un amigo</h6>
<div class="valign-wrapper"><div class="valign">
<h2 class="big" data-anim="fadeInLeft"><?php echo $title; ?></h2>
<p><a href="#" class="btn-large btn-black btn-share" data-anim="fadeInLeft"><i class="material-icons icon-angle-right right small" aria-hidden="true"></i> invítalos</a>
<div class="share">
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode(get_bloginfo('url')); ?>" target="_blank"><i class="icon-facebook-1"></i></a>
<a href="https://twitter.com/share/?text=<?php echo urlencode(get_bloginfo('description')); ?>&url=<?php echo urlencode(get_bloginfo('url')); ?>&via=cademonline" target="_blank"><i class="icon-twitter"></i></a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(get_bloginfo('url')); ?>&title=<?php echo urlencode(get_bloginfo('name')); ?>&summary=<?php echo urlencode(get_bloginfo('description')); ?>" target="_blank"><i class="icon-linkedin"></i></a>
<!--<a href="https://plus.google.com/share?<?php echo urlencode(get_bloginfo('url')); ?>" target="_blank"><i class="icon-gplus"></i></a>-->
</div>
</p>
</div></div>
</div>
<div class="col m5 s12">
<div class="valign-wrapper">
<?php echo $desc; ?>
</div>
</div>
</main>
</section>
<!-- //
<section class="color-6 section">
<main>
<div class="row">
<div class="col m7 s12">
<h6 class="sub-title" data-anim="fadeInLeft">Tu Perfil</h6>
<div class="valign-wrapper"><div class="valign">
<h2 class="big" data-anim="fadeInLeft"><strong>Bienvenid@</strong><br>
Ya eres parte de Cadem Online</h2>
<p><a href="#" class="btn-large btn-black" data-anim="fadeInLeft"><i class="material-icons icon-angle-right right small" aria-hidden="true"></i> tu perfil</a></p>
</div></div>
</div>
<div class="col m5 s12">
<div class="valign-wrapper"><div class="valign" data-anim="fadeInRight">
Aquí podrás actualizar tus datos, revisar qué encuestas has contestado y qué otras puedes contestar
</div></div>
</div>
</div>
</main>
</section>
// -->
<section class="color-6 section" id="section-6">
<main>
<?php
$query = new WP_Query(array('post_type' => 'page', 'post_status' => 'publish', 'p' => 31));
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
?>
<div class="row">
<div class="col m6 s12">
<h6 class="sub-title" data-anim="fadeInLeft">Qué es Cadem Online</h6>
<div class="valign-wrapper"><div class="valign" data-anim="fadeInLeft">
<h2 class="big"><?php the_title(); ?></h2>
</div></div>
</div>
<div class="col m6 s12">
<div class="valign-wrapper"><div class="valign" data-anim="fadeInRight">
<?php the_content(); ?>
</div></div>
</div>
<?php
endwhile; endif;
wp_reset_postdata();
?>
</main>
</section>
<!-- // -->
<section class="color-7 section" id="section-7">
<?php
$query = new WP_Query(array('post_type' => 'faqs', 'post_status' => 'publish', 'posts_per_page' => -1, 'order' => 'DESC', 'orderby' => 'menu_order'));
$faqs = array();
$contents = array();
if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $ID=$post->ID;
$img=wp_get_attachment_image_src( get_post_thumbnail_id($ID), 'full' );
$title=get_the_title( $ID );
$link=get_permalink( $ID );
$desc=get_the_content( );
array_push($contents,$desc);
array_push($faqs,array('id'=>$ID,'title'=>$title,'desc'=>$desc,'img'=>$img[0],'link'=>$link));
endwhile; endif;
wp_reset_postdata();
?>
<main>
<div class="row">
<div class="col m5 s12">
<h6 class="sub-title" data-anim="fadeInLeft">Preguntas Frecuentes</h6>
<div class="valign-wrapper"><div class="valign" style="z-index: 99;">
<div class="input-field" data-anim="fadeInLeft">
<select class="black-select select-jump">
<?php $n=0;foreach($faqs as $faq): ?>
<option value="<?php echo $n ?>"<?php echo $n==0?' selected':'';?>><?php echo $faq['title'] ?></option>
<?php $n++;endforeach; ?>
</select>
</div>
</div></div>
</div>
<div class="col m7 s12">
<div class="valign-wrapper"><div class="valign" data-anim="fadeInRight">
<div class="grande">
<h6 class="title">¿Cómo participar?</h6>
<p>Para ser parte de Cadem Online debes registrarte <a href="#">aquí</a>. Una vez que estés registrado, nosotros te enviaremos una invitación por email con un link a la encuesta para que la contestes.</p>
</div>
</div></div>
</div>
</main>
<script type="text/javascript">
var $preguntas=Array(
'<?php echo implode("','",$contents) ?>'
);
</script>
</section>
<!-- // -->
<section class="color-8 section" id="section-8">
<main>
<div class="row">
<div class="col m7 s12">
<h6 class="sub-title" data-anim="fadeInLeft">Contacto</h6>
<div class="valign-wrapper"><div class="valign">
<h2 class="big" data-anim="fadeIn"><strong>Escríbenos!</strong></h2>
<?php
if ( function_exists( 'ninja_forms_display_form' ) ) {
ninja_forms_display_form( 1 );
}
?>
<!--<form enctype="application/x-www-form-urlencoded" method="post" data-anim="fadeInLeft">
<div class="input-field">
<i class="material-icons prefix left icon-usuario small" aria-hidden="true"></i><input placeholder="Nombre" id="nombre_" type="text" class="validate browser-default" required>
</div>
<div class="input-field">
<i class="material-icons prefix left icon-mail small" aria-hidden="true"></i><input placeholder="Email" id="email_" type="email" class="validate browser-default" required>
</div>
<div class="input-field">
<i class="material-icons prefix left icon-paper-plane-empty small" aria-hidden="true"></i><textarea id="mensaje_" class="materialize-textarea browser-default" placeholder="Mensaje" required></textarea>
</div>
<button class="btn btn-black" type="submit"><i class="material-icons icon-angle-right right small" aria-hidden="true"></i> Enviar</button>
</form>-->
</div></div>
</div>
<div class="col m5 hide-on-small-only">
<div class="valign-wrapper"><div class="valign" data-anim="fadeIn">
<p><i class="material-icons prefix left icon-pin small" aria-hidden="true"></i>
<a href="https://goo.gl/maps/eVDabhBFzn72" target="_blank" title="Ver Google Map">Nueva de Lyon 145 Piso 2,<br>Providencia, Santiago Chile.</a></p>
<p><i class="material-icons prefix left icon-mail small" aria-hidden="true"></i>
<a href="mailto:[email protected]" title="Enviar Email a [email protected]">[email protected]</a><br>
<a href="tel:+56224386500" title="Llamar a 224386500">562 2438 6500</a></p>
<div class="rep"><em>Cadem Online es una plataforma de<br><a href="http://www.cadem.cl" target="_blank"><img src="<?php bloginfo('template_url'); ?>/img/logo-cadem-gris.svg" class="mini-logo svg"></a></em></div>
</div></div>
</div>
</div>
</main>
<footer class="page-footer black" data-anim="fadeInUp">
<div class="container"><div class="row">
<div class="col s4">
<a class="white black-text btn btn-double nav-click" href="#5" data-index="5">INVITA A TUS<br>AMIGOS Y GANA</a>
</div>
<div class="col s4 center-align" style="padding-top: 1vh;">
<a href="<?php echo get_permalink(59) ?>" target="_blank" class="white-text link">Términos y condiciones</a>
</div>
<div class="col s4 right-align">
<a href="http://www.cadem.cl" target="_blank"><img src="<?php bloginfo('template_url'); ?>/img/logo-cadem-gris.svg" class="mini-logo svg"></a>
<a href="https://goo.gl/maps/eVDabhBFzn72" target="_blank" title="Ver Google Map" class="white-text"><i class="material-icons icon-pin small" aria-hidden="true"></i></a>
<a href="mailto:[email protected]" class="white-text"><i class="material-icons icon-mail small" aria-hidden="true"></i></a>
</div>
</div></div>
</footer>
</section>
<!-- // -->
</div>
<?php get_footer(); ?>