gest366/modules/contratti/add_figlio.php

89 lines
2.4 KiB
PHP
Raw Normal View History

2021-02-24 20:40:04 +00:00
<?php
include_once(__DIR__."/../../core.php");
$module_name = 'Canoni Assistenza';
$iddocumento = $html->form('iddocumento');
$dir = get_var_tipodoc2($iddocumento,"dir");
$rs = $dbo->fetchArray("select id as idintervento , descrizione from co_tipidocumento");
$n2 = sizeof($rs);
$numero=get_var_tipodoc2($iddocumento,"numero_documento");
/*
Form di inserimento riga documento
*/
echo "<label>Documento numero $numero</label><br><br>\n";
echo "<form id=\"link_form\" action=\"".$rootdir."/editor.php?id_module=".$modules_info[$module_name]['id']."&id_record=".$iddocumento."\" method=\"post\">\n";
echo " <input type='hidden' name='op' value='add_transazione'>\n";
echo " <input type='hidden' name='dir' value='".$dir."'>\n";
echo " <input type='hidden' name='backto' value='record-edit'>\n";
echo " <div class='row'>\n";
//Seleziona tipologia documento
echo " <div class='col-md-6'>\n";
echo " <div class='form-group'>\n";
echo " <label>Tipo documento</label>\n";
if( ($n2) == 0 ){
echo " ... Non ci sono tipologie documenti in archivio ...<br><br>\n";
echo " <input type=\"hidden\" id=\"idintervento\" value=\"\">\n";
}
else{
echo " <select id=\"idintervento\" name=\"idintervento\" class=\"superselect\" onchange=\"$('#descrizione').val( $(this).find(':selected').text() ); ;\">\n";
echo " <option value=\"\">- Seleziona una tipologia -</option>\n";
echo " <optgroup label=\"Tipologie documento (".$n2.")\">\n";
for( $i=0;$i<$n2;$i++ ){
echo " <option value=\"".$rs[$i]['idintervento']."\" >".$rs[$i]['descrizione']." </option>\n";
}
echo " </optgroup>\n";
}
echo " </select>\n";
echo " </div>\n";
echo " </div>\n";
echo " </div>\n";
?>
<script type="text/javascript">
dir = '<?php echo $dir ?>';
function add_transazione(){
if( $('#idintervento option:selected').val()!='' ){
$("#link_form").submit();
} else {
swal("Tipologia documento mancante!")
}
}
$(document).ready( function(){
start_superselect();
start_inputmask();
$('.datepicker').datepicker();
});
</script>
<script src="<?php echo $rootdir; ?>/lib/init.js"></script>
<?php
echo "<a onclick=\"add_transazione();\" class=\"btn btn-primary pull-right\"><i class=\"fa fa-plus\"></i> Crea transazione sucessiva</a>\n";
echo "</form>\n";
?>
<div class="clearfix"></div>