$msg .= "9+"; } if ($_POST['protocollo'] <= 0) { $msg .= "10+"; } if (empty($_POST['numdocumen'])) { $msg .= "11+"; } $ctrldatreg = mktime (0,0,0,$_POST['date_reg_M'], $_POST['date_reg_D'], $_POST['date_reg_Y']); $ctrldatdoc = mktime (0,0,0,$_POST['date_doc_M'], $_POST['date_doc_D'], $_POST['date_doc_Y']); if ($ctrldatreg < $ctrldatdoc) { $msg .= "12+"; } // controllo se ci documenti con lo stesso numero e anno dello stesso fornitore (duplicato) if ($_POST['cod_partner']>0){ $dupli = gaz_dbi_record_count($gTables['tesmov'] , "caucon = '".substr($_POST['codcausale'],0,3)."' AND numdoc = '".trim(substr($_POST['numdocumen'],0,20))."' AND seziva = ".intval($_POST['sezioneiva'])." AND clfoco = ".intval($_POST['cod_partner'])." AND YEAR(datdoc) = ".intval($_POST['date_doc_Y'])); if ($dupli > 1 || ($dupli == 1 && $toDo == 'insert')) { $msg .= "14+"; } } } if ($msg == "") { // nessun errore $calc = new Schedule; //se è un update recupero i vecchi righi per trovare quelli da inserire/modificare/cancellare //formatto le date $datareg = $_POST['date_reg_Y']."-".$_POST['date_reg_M']."-".$_POST['date_reg_D']; $datadoc = $_POST['date_doc_Y']."-".$_POST['date_doc_M']."-".$_POST['date_doc_D']; if ($_POST['inserimdoc'] == 0 and $_POST['registroiva'] == 0) { //se non sono richisti i dati documenti e iva $_POST['sezioneiva'] = 0; $_POST['protocollo'] = 0;
function recordnav($table, $where, $limit, $passo) { global $limit, $passo; $this->table = $table; $this->where = $where; $this->limit = $limit; $this->passo = $passo; // faccio il conto totale dei record selezionati dalla query $this->count = gaz_dbi_record_count($table, $where); $this->last = $this->count - $this->count % $this->passo; //return $last; }
// // La cancellazione dell'effetto è stata confermata! // // Rilegge i dati dell'effetto. $effetto = gaz_dbi_get_row($gTables['effett'], "id_tes", intval($_POST['id_tes'])); // elimina subito la registrazione. if ($effetto['id_con'] > 0) { gaz_dbi_del_row($gTables['tesmov'], 'id_tes', $effetto['id_con']); gaz_dbi_del_row($gTables['rigmoc'], 'id_tes', $effetto['id_con']); } $result = gaz_dbi_del_row($gTables['effett'], "id_tes", intval($_POST['id_tes'])); // i dati univoci della fattura che ha originato l'effetto $where = "protoc=$effetto[protoc] AND seziva=$effetto[seziva] AND datfat='$effetto[datfat]'"; // se la fattura non ha altri effetti associati resettiamo il flag geneff $altri_effetti = gaz_dbi_record_count($gTables['effett'], $where); if (!$altri_effetti) { gaz_dbi_query("UPDATE $gTables[tesdoc] SET geneff = '' WHERE $where AND tipdoc LIKE 'F%'"); } header("Location: ".$ritorno); exit; } else { // // Legge i dati dell'effetto di cui è stata richiesta // la cancellazione, assieme a tutto quello che cui // l'effetto da cancellare è collegato. // $form = gaz_dbi_get_row($gTables['effett'], "id_tes", intval($_GET['id_tes'])); $cliente = gaz_dbi_get_row($gTables['clfoco'],"codice",$form['clfoco']); $pagame = gaz_dbi_get_row($gTables['pagame'],"codice",$form['pagame']);