gest366/modules/documenti/add_riga_g.php

67 lines
2.1 KiB
PHP
Raw Normal View History

2021-02-24 20:40:04 +00:00
<?php
include_once(__DIR__."/../../core.php");
$iddocumento = $html->form('iddocumento');
$dir = get_var_tipodoc2($iddocumento,"dir");
$module_name=query_secca("","name","zz_modules","where id ='".$_SESSION['id_module']."'");
$rs = $dbo->fetchArray("SELECT * FROM co_documenti WHERE id='".$iddocumento."'");
$idanagrafica = $rs[0]['idanagrafica'];
$idconto = $rs[0]['idconto'];
( $rs[0]['numero_esterno'] != '' ) ? $numero=$rs[0]['numero_esterno'] : $numero=$rs[0]['numero'];
$matricola_primaria_des = $rs[0]['matricola'];
$id_impianto = $rs[0]['id_impianto'];
$nome_impianto = $rs[0]['nome_impianto'];
// Info matricola
$qana = "SELECT id,nome FROM my_impianti WHERE matricola='".$rs[0]['matricola']."'";
$rs_matricola = $dbo->fetchArray($qana);
$matricola_primaria=$rs_matricola[0]['nome'];
$id_matricola_primaria=$rs_matricola[0]['id'];
/*
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='addriga_g'>\n";
echo " <input type='hidden' name='dir' value='".$dir."'>\n";
echo " <input type='hidden' name='backto' value='record-edit'>\n";
//Descrizione
echo " <div class='row'>\n";
echo " <div class='col-md-12'>\n";
echo " <div class='form-group'>\n";
echo " <label>Descrizione</label>\n";
echo " <textarea name=\"descrizione\" id=\"descrizione\" class='form-control' ></textarea>\n";
echo " </div>\n";
echo " </div>\n";
echo " </div>\n";
?>
<script type="text/javascript">
function addriga(){
if( $('#descrizione').val()!='' ){
$("#link_form").submit();
}
}
</script>
<script src="<?php echo $rootdir; ?>/lib/init.js"></script>
<?php
echo " <a onclick=\"addriga();\" class=\"btn btn-primary pull-right\"><i class=\"fa fa-plus\"></i> Aggiungi</a>\n";
echo "</form>\n";
?>
<div class="clearfix"></div>