mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-03 09:17:37 +01:00
Salvataggio row-edit e row-serial via ajax nei documenti
This commit is contained in:
parent
6d924749e2
commit
590104dabc
@ -21,7 +21,7 @@ $result['id'] = isset($result['id']) ? $result['id'] : null;
|
||||
|
||||
// Form di inserimento riga documento
|
||||
echo '
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post" id="submit-form">
|
||||
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
|
||||
<input type="hidden" name="hash" value="tab_'.$id_plugin.'">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
@ -41,10 +41,26 @@ echo '
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fa '.$icon.'"></i> '.$button.'</button>
|
||||
<button type="button" class="btn btn-primary pull-right" onclick="submitForm()"><i class="fa '.$icon.'"></i> '.$button.'</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
echo '
|
||||
<script>$(document).ready(init)</script>';
|
||||
|
||||
echo '
|
||||
<script>
|
||||
function submitForm() {
|
||||
var form = input("#submit-form");
|
||||
salvaForm("#submit-form", {
|
||||
id_module: "'.$id_module.'",
|
||||
id_record: "'.$id_record.'",
|
||||
}).then(function(response) {
|
||||
form.getElement().closest("div[id^=bs-popup").modal("hide");
|
||||
caricaRighe(null);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>';
|
@ -93,7 +93,7 @@ $rs = $dbo->fetchArray('SELECT mg_articoli.id AS idarticolo, mg_articoli.codice,
|
||||
echo '
|
||||
<h4 class="text-center">'.tr('Articolo').': '.$rs[0]['codice'].' - '.$rs[0]['descrizione'].'</h4>
|
||||
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post" id="serial-form">
|
||||
<input type="hidden" name="op" value="add_serial">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="idriga" value="'.$idriga.'">
|
||||
@ -277,10 +277,26 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-10 text-right">
|
||||
<button type="submit" id="aggiorna" class="btn btn-primary pull-right"><i class="fa fa-barcode"></i> '.tr('Aggiorna').'</button>
|
||||
<button type="button" id="aggiorna" class="btn btn-primary pull-right"><i class="fa fa-barcode"></i> '.tr('Aggiorna').'</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
echo '
|
||||
<script>$(document).ready(init)</script>';
|
||||
|
||||
echo '
|
||||
<script>
|
||||
$("#aggiorna").on("click", function() {
|
||||
var form = input("#serial-form");
|
||||
salvaForm("#serial-form", {
|
||||
id_module: "'.$id_module.'",
|
||||
id_record: "'.$id_record.'",
|
||||
}).then(function(response) {
|
||||
form.getElement().closest("div[id^=bs-popup").modal("hide");
|
||||
caricaRighe(null);
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
</script>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user