gest366/modules/documenti/edit_numero.php

82 lines
2.3 KiB
PHP
Raw Permalink Normal View History

2021-02-24 20:40:04 +00:00
<?php
include_once(__DIR__."/../../core.php");
$idmodulo = $html->form('idmodule');
$module_name=get_module_name_by_id($idmodulo);
$iddocumento = $html->form('iddocumento');
$idriga = $html->form('idriga');
$dir = get_var_tipodoc2($iddocumento,"dir");
//Info documento
$q = "SELECT * FROM co_documenti WHERE id='".$iddocumento."'";
$rs = $dbo->fetchArray($q);
( $rs[0]['numero_esterno'] != '' ) ? $numero=$rs[0]['numero_esterno'] : $numero=$rs[0]['numero'];
$idanagrafica = $rs[0]['idanagrafica'];
$idconto_fattura = $rs[0]['idconto'];
//Info riga inserita
$q = "SELECT * FROM co_righe_documenti WHERE iddocumento='".$iddocumento."' AND id='".$idriga."'";
$rsr = $dbo->fetchArray($q);
$idconto_fattura = $rsr[0]['idconto'];
/*
Form di modifica 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='editnumero'>\n";
echo " <input type='hidden' name='idriga' value='".$idriga."'>\n";
echo " <input type='hidden' name='backto' value='record-edit'>\n";
echo " <input type='hidden' name='dir' value='".$dir."'>\n";
echo "<br>";
echo "<div class='panel panel-primary'>";
echo "<div class='panel-body'>";
echo " <div class='row'>\n";
//Qta
echo " <div class='col-md-6'>\n";
echo " <div class='form-group'>\n";
echo " <label>Nuovo numero ( mantenero il formato indicato );</label>\n";
echo " <div class='input-group'>\n";
echo " <input type='text' class='form-control' id='new_numero' maxlength='8' name='new_numero' value=\"".$numero."\">\n";
echo " </div>\n";
echo " </div>\n";
echo " </div>\n";
echo " </div>\n";
echo " </div>\n";
echo " </div>\n";
echo " <a onclick=\"addriga();\" class=\"btn btn-primary pull-right\"><i class=\"fa fa-edit\"></i> Aggiorna</a>\n";
echo "</form>\n";
?>
<script type="text/javascript">
function addriga(){
if( $('#descrizione').val()!='' && $('#idiva option:selected').val()!='' ){
$("#link_form").submit();
}
}
$(document).ready( function(){
start_superselect();
start_inputmask();
});
</script>
<div class="clearfix"></div>