1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-18 11:19:17 +01:00
openstamanager/modules/dashboard/widgets/stampa_calendario.dashboard.php

86 lines
2.4 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">
2018-07-03 12:28:38 +02:00
2019-02-03 10:59:33 +01:00
<div class="col-md-4">
2018-07-03 12:28:38 +02:00
{[ "type": "text", "label": "'.tr('Anno Mese').'", "name": "anno-mese", "required": "1", "extra":"readonly", "value": "'.$_SESSION['period']['month'].'" ]}
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">
{[ "type": "select", "label": "'.tr('Formato').'", "name": "format", "required": "1", "values": "list=\"A4\": \"'.tr('A4').'\", \"A3\": \"'.tr('A3').'\"", "value": "'.$_SESSION['settings']['format'].'" ]}
</div>
2018-07-03 12:28:38 +02:00
2019-02-03 10:59:33 +01:00
<div class="col-md-4">
2018-05-08 15:55:46 +02:00
{[ "type": "select", "label": "'.tr('Orientamento').'", "name": "orientation", "required": "1", "values": "list=\"L\": \"'.tr('Orizzontale').'\", \"P\": \"'.tr('Verticale').'\"", "value": "'.$_SESSION['settings']['orientation'].'" ]}
</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-02-03 10:59:33 +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
2018-05-08 15:55:46 +02:00
</form>';
2018-06-26 14:30:26 +02:00
2019-07-26 18:05:19 +02:00
echo '<script>$(document).ready(init)</script>';
2018-06-28 18:23:06 +02:00
echo '<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css">';
2018-05-08 15:55:46 +02:00
?>
<style>
.ui-datepicker-calendar, .ui-datepicker-current{
display:none;
}
</style>
<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; ?>');
2018-05-08 15:55:46 +02:00
//$('button[type=submit]').removeAttr("disabled");
//$('button[type=submit]').prop("disabled", false);
return false;
}
$( '#format' ).change(function() {
session_set('settings,format', $(this).val(), 0, 0);
});
$( '#orientation' ).change(function() {
session_set('settings,orientation', $(this).val(), 0, 0);
});
$(function() {
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
$('#anno-mese').datepicker( {
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'MM yy',
todayBtn: false,
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
onClose: function(dateText, inst) {
$(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1));
session_set('period,month', $('#anno-mese').val(), 0, 0);
},
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
beforeShow : function(input, inst) {
session_set('period,month', '', 1, 0);
}
2018-07-03 12:28:38 +02:00
2018-05-08 15:55:46 +02:00
});
});
2018-09-26 10:49:38 +02:00
</script>