openstamanager/modules/dashboard/widgets/stampa_calendario.dashboard...

67 lines
1.8 KiB
PHP
Raw Normal View History

2018-05-08 15:55:46 +02:00
<?php
include_once __DIR__.'/../../../core.php';
//trovo id_print della stampa
2018-09-26 10:49:38 +02:00
$id_print = Prints::getModulePredefinedPrint(1)['id'];
2018-05-08 15:55:46 +02:00
echo '
<form action="" method="post" onsubmit="if($(this).parsley().validate()) { return stampa_calendario(); }" >
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
<div class="row">
2019-02-03 10:59:33 +01:00
<div class="col-md-4">
2019-11-22 16:28:03 +01:00
{[ "type": "text", "label": "'.tr('Mese e anno').'", "name": "date", "required": "1", "value": "'.$_SESSION['dashboard']['date'].'" ]}
2018-05-08 15:55:46 +02:00
</div>
2019-11-22 16:28:03 +01:00
2018-05-08 15:55:46 +02:00
<div class="col-md-2">
2019-11-22 16:28:03 +01:00
{[ "type": "select", "label": "'.tr('Formato').'", "name": "format", "required": "1", "values": "list=\"A4\": \"'.tr('A4').'\", \"A3\": \"'.tr('A3').'\"", "value": "'.$_SESSION['dashboard']['format'].'" ]}
2018-05-08 15:55:46 +02:00
</div>
2018-07-03 12:28:38 +02:00
2019-02-03 10:59:33 +01:00
<div class="col-md-4">
2019-11-22 16:28:03 +01:00
{[ "type": "select", "label": "'.tr('Orientamento').'", "name": "orientation", "required": "1", "values": "list=\"L\": \"'.tr('Orizzontale').'\", \"P\": \"'.tr('Verticale').'\"", "value": "'.$_SESSION['dashboard']['orientation'].'" ]}
2018-05-08 15:55:46 +02:00
</div>
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
<div class="col-md-2">
<p style="line-height:14px;">&nbsp;</p>
2019-11-22 16:28:03 +01:00
<button type="submit" class="btn btn-primary btn-block">
<i class="fa fa-print"></i> '.tr('Stampa').'
</button>
2018-05-08 15:55:46 +02:00
</div>
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
</div>
2018-07-03 12:28:38 +02:00
2019-11-22 16:28:03 +01:00
</form>
2018-06-26 14:30:26 +02:00
2019-11-22 16:28:03 +01:00
<script>$(document).ready(init)</script>';
2018-05-08 15:55:46 +02:00
?>
<script>
function stampa_calendario (){
2018-06-26 14:30:26 +02:00
window.open('<?php echo $rootdir; ?>/pdfgen.php?id_print=<?php echo $id_print; ?>');
2019-11-22 16:28:03 +01:00
2018-05-08 15:55:46 +02:00
return false;
}
2019-11-22 16:28:03 +01:00
$('#format').change(function() {
2018-05-08 15:55:46 +02:00
session_set('settings,format', $(this).val(), 0, 0);
});
2019-11-22 16:28:03 +01:00
$('#orientation').change(function() {
2018-05-08 15:55:46 +02:00
session_set('settings,orientation', $(this).val(), 0, 0);
});
$(function() {
2019-11-22 16:28:03 +01:00
$('#date').datetimepicker({
format: 'MMMM YYYY',
locale: globals.locale,
useCurrent: false,
});
2018-07-03 12:28:38 +02:00
2019-11-22 16:28:03 +01:00
$('#date').on('dp.change', function(e) {
session_set('dashboard,date', e.date.format("YYYY-MM-DD"), 0, 0);
2018-05-08 15:55:46 +02:00
});
});
2018-09-26 10:49:38 +02:00
</script>