forked from mapasculturais/mapasculturais
-
Notifications
You must be signed in to change notification settings - Fork 0
/
panel-em-cartaz.php
60 lines (56 loc) · 2.28 KB
/
panel-em-cartaz.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
<style>
.emcartaz-datepicker{
border:none;
width:90px;
cursor:pointer;
font-size: 1rem;
font-weight: bold;
padding:0;
}
.main-content a{color:#880000}
</style>
<div class="main-content">
<h1>Revista Em Cartaz</h1>
<div class="clearfix">
Filtrar Eventos
<label for="data-de-inicio">de</label>
<input id="from-visible" type="text" class="js-emcartaz-dates emcartaz-datepicker"
readonly="readonly" placeholder="00/00/0000" value="<?php echo $from->format('d/m/Y'); ?>">
<input id="from" name="startsOn" type="hidden" value="<?php echo $from->format('Y-m-d'); ?>">
<label for="data-de-fim">a</label>
<input id="to-visible" type="text" class="js-emcartaz-dates emcartaz-datepicker"
readonly="readonly" placeholder="00/00/0000" value="<?php echo $to->format('d/m/Y'); ?>">
<input id="to" name="until" type="hidden" value="<?php echo $to->format('Y-m-d'); ?>">
</div>
<a href="#" onclick="go('<?php echo $app->createUrl('panel', 'em-cartaz-preview'); ?>')"> Visualizar </a>
|
<a href="#" onclick="go('<?php echo $app->createUrl('panel', 'em-cartaz-download'); ?>')"> Baixar </a>
<br><br>
<div>
<?php echo $content; ?>
</div>
</div>
<script>
$(function(){
$('.js-emcartaz-dates').each(function(){
var fieldSelector = '#'+$(this).attr('id');
var altFieldSelector = $(this).data('alt-field') ? $(this).data('alt-field') : fieldSelector.replace('-visible', '');
if($(altFieldSelector).length == 0){
return;
}
$(this).datepicker({
dateFormat: $(this).data('date-format') ? $(this).data('date-format') : 'dd/mm/yy',
altFormat: $(this).data('alt-format') ? $(this).data('alt-format') : 'yy-mm-dd',
altField: altFieldSelector,
beforeShow: function() {
setTimeout(function(){
$('.ui-datepicker').css('z-index', 99999999999999);
}, 0);
}
});
});
});
function go(url){
location.href=url+'?from='+$('#from').val()+'&to='+$('#to').val();
}
</script>