1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-02 08:56:48 +01:00

Aggiustamenti btn interventi

This commit is contained in:
Luca 2018-05-26 01:59:27 +02:00
parent 8694e83c6b
commit 3f09312ede
3 changed files with 17 additions and 4 deletions

View File

@ -292,6 +292,19 @@ if (!$flag_completato) {
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
<?php
if (count($rs2)==0) {
echo '$(".btn-details").attr("disabled", true);';
echo '$(".btn-details").addClass("disabled");';
echo '$("#showall_dettagli").removeClass("hide");';
echo '$("#dontshowall_dettagli").addClass("hide");';
}else{
echo '$(".btn-details").attr("disabled", false);';
echo '$(".btn-details").removeClass("disabled");';
}
?>
$('.orari').on("dp.change", function(){ $('.orari').on("dp.change", function(){
idriga = $(this).attr('id').split('_')[1]; idriga = $(this).attr('id').split('_')[1];

View File

@ -150,8 +150,8 @@ $_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
<div class="panel-body"> <div class="panel-body">
<div class="pull-right"> <div class="pull-right">
<a class='btn btn-default' onclick="$('.extra').removeClass('hide'); $(this).addClass('hide'); $('#dontshowall_dettagli').removeClass('hide');" id='showall_dettagli'><i class='fa fa-square-o'></i> <?php echo tr('Mostra dettagli costi'); ?></a> <a class='btn btn-default btn-details' onclick="$('.extra').removeClass('hide'); $(this).addClass('hide'); $('#dontshowall_dettagli').removeClass('hide');" id='showall_dettagli'><i class='fa fa-square-o'></i> <?php echo tr('Visualizza dettaglio costi'); ?></a>
<a class='btn btn-info hide' onclick="$('.extra').addClass('hide'); $(this).addClass('hide'); $('#showall_dettagli').removeClass('hide');" id='dontshowall_dettagli'><i class='fa fa-check-square-o'></i> <?php echo tr('Mostra dettagli costi'); ?></a> <a class='btn btn-info btn-details hide' onclick="$('.extra').addClass('hide'); $(this).addClass('hide'); $('#showall_dettagli').removeClass('hide');" id='dontshowall_dettagli'><i class='fa fa-check-square-o'></i> <?php echo tr('Visualizza dettaglio costi'); ?></a>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<br> <br>

View File

@ -13,7 +13,7 @@ switch (post('op')) {
$costo_km_tecnico = post('costo_km_tecnico'); $costo_km_tecnico = post('costo_km_tecnico');
$costo_diritto_chiamata_tecnico = post('costo_diritto_chiamata_tecnico'); $costo_diritto_chiamata_tecnico = post('costo_diritto_chiamata_tecnico');
$tempo_standard = (empty(post('tempo_standard'))) ? 'NULL' : prepare(round((force_decimal($_POST['tempo_standard'])*2),1)/2); $tempo_standard = (empty(post('tempo_standard'))) ? 'NULL' : prepare(round((force_decimal($_POST['tempo_standard'])/2.5),1)*2.5);
$query = 'UPDATE in_tipiintervento SET'. $query = 'UPDATE in_tipiintervento SET'.
' descrizione='.prepare($descrizione).','. ' descrizione='.prepare($descrizione).','.
@ -35,7 +35,7 @@ switch (post('op')) {
$idtipointervento = post('idtipointervento'); $idtipointervento = post('idtipointervento');
$descrizione = post('descrizione'); $descrizione = post('descrizione');
$tempo_standard = (empty(post('tempo_standard'))) ? 'NULL' : prepare(round((force_decimal($_POST['tempo_standard'])*2),1)/2); $tempo_standard = (empty(post('tempo_standard'))) ? 'NULL' : prepare(round((force_decimal($_POST['tempo_standard'])/2.5),1)*2.5);
$query = 'INSERT INTO in_tipiintervento(idtipointervento, descrizione, costo_orario, costo_km, tempo_standard) VALUES ('.prepare($idtipointervento).', '.prepare($descrizione).', 0.00, 0.00, '.$tempo_standard.')'; $query = 'INSERT INTO in_tipiintervento(idtipointervento, descrizione, costo_orario, costo_km, tempo_standard) VALUES ('.prepare($idtipointervento).', '.prepare($descrizione).', 0.00, 0.00, '.$tempo_standard.')';
$dbo->query($query); $dbo->query($query);