openstamanager/modules/fatture/controller_before.php

48 lines
1.2 KiB
PHP
Raw Normal View History

2018-03-20 00:57:36 +01:00
<?php
/*deve sempre essere impostato almeno un sezionale
if (isset($_SESSION[$id_module]['id_segment'])){
$id_segment = $_SESSION[$id_module]['id_segment'];
2018-03-20 00:57:36 +01:00
}
else{
if ($id_module=='14')
(!empty($_SESSION[$id_module]['id_segment'])) ? $id_segment = $_SESSION[$id_module]['id_segment'] :$id_segment = get_var("Sezionale predefinito fatture di vendita");
2018-03-20 00:57:36 +01:00
if ($id_module=='15')
$id_segment = get_var('Sezionale predefinito fatture di acquisto');
2018-03-20 00:57:36 +01:00
$_SESSION[$id_module]['id_segment'] = $id_segment;
2018-03-20 00:57:36 +01:00
}
*/
?>
<div class="row">
<div class="col-md-4 pull-right">
{[ "type": "select", "label": "Sezionale", "name": "idsezionale_", "required": 0, "class": "", "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module = '<?php echo $id_module; ?>'", "value": "<?php echo $_SESSION[$id_module]['id_segment']; ?>", "extra": "" ]}
2018-03-20 00:57:36 +01:00
</div>
</div>
<script>
$(document).ready(function () {
$("#idsezionale_").on("change", function(){
if ($(this).val()<1){
session_set('<?php echo $id_module; ?>,id_segment', '', 1, 1);
2018-03-20 00:57:36 +01:00
}else{
session_set('<?php echo $id_module; ?>,id_segment', $(this).val(), 0, 1);
2018-03-20 00:57:36 +01:00
}
});
});
</script>