'); //file della fornitura $file_pl = $nomeFornitura.".".$EstFornitura; $file_pl_blob = $nomeFornitura."_ELENCO.".$EstFornitura; $result = 0; $comand_schede = "awk -F '|' -f ".$path_awk."/dati_metrici.awk ".$path_input."/".$file_pl." > ".$path_output."/dati_metrici.".$nomeFornitura.".dat"; passthru($comand_schede, $result); //print('1-'. $result . ' ' . $comand_schede . '
'); $result = 0; $comand_schede = "awk -F '|' -f ".$path_awk."/scheda_planimetrica.awk ".$path_input."/".$file_pl." > ".$path_output."/schede_pln.".$nomeFornitura.".dat"; passthru($comand_schede, $result); //print('2-'. $result . ' ' . $comand_schede . '
'); //echo $comand_schede; $result = 0; $comand_schede = "awk -F '|' -f ".$path_awk."/elenco_blob.awk ".$path_input."/".$file_pl_blob." > ".$path_output."/plan.".$nomeFornitura.".dat"; passthru($comand_schede, $result); //print('3-'. $result . ' ' . $comand_schede . '
'); } $arrCod = getCodComSezFile($path_output."/schede_pln.".$nomeFornitura.".dat"); $codCom = $arrCod['codcom']; $codSez = $arrCod['sez']; $ti07_codstato = ''; list($err,$arrTi07Prot) = getSelectProtocollo ( $conn, array( 'codcom' => $codCom, 'sez' => $codSez, 'tipocatasto' => 'F' ) ); $ti07_protocollo_staging = getPlanimProt($arrTi07Prot); //controllo validita data fornitura if ($err == 'NODATA' || $ti07_protocollo_staging == '') { //nuova funzione inserimento protocollo staging $arrPrm = array( 'keycom' => $codCom, 'keysez' => $codSez, 'periodo_da' => '', 'periodo_a' => $dataOracle, 'tipo_fornitura' => '', 'tipo_processo' => 'F', 'nome_fornitura' => $nomeFornitura ); $arrNewStag = newStag($conn,$arrPrm); if ($arrNewStag['err'] == '') { $err = $arrNewStag['err']; $numProt = $arrNewStag['protocollo']; $ti07_protocollo_staging = $arrNewStag['protocollo_stag']; $ti07_tipo_fornitura = $arrNewStag['tipo_fornitura']; $ti07_periodo_da = $arrNewStag['periodo_da']; $ti07_periodo_a = $arrNewStag['periodo_a']; } else { jError('E011',$err,0); js_redirect ("LSTV_file_frame.php"); exit(); } $arrArgErrlog = array( 'TCW17_STEP' => 1, 'TCW17_DESCR_ERR' => 'IMPDBERR', 'TCW17_LAST_RECORD' => 1, 'TCW17_DATE' => $dataOracle, 'TCW17_PROTOCOLLO' => $ti07_protocollo_staging ); unset($err); $err = insetTcw17_errlog($conn,$arrArgErrlog); if($err != '') { jError('E008',$err,1); } } elseif($err != '') { //errore db jError('E001',$err,1); } else { //$ti07_protocollo_staging = getPlanimProt($arrTi07Prot); $tabelle_vuote = isEmpty_table($conn,$ti07_protocollo_staging,3); unset($arrTcw17); $arrTcw17 = getTcw17_errlog($conn,$ti07_protocollo_staging); if (!isset($arrTcw17['err'])) { $arrtmp = returnLastErrLog($arrTcw17); $cod_tabella = $arrTcw17[0]['TCW17_STEP']; $cod_err = $arrTcw17[0]['TCW17_DESCR_ERR']; $rec_err = $arrTcw17[0]['TCW17_LAST_RECORD']; $date_err = $arrTcw17[0]['TCW17_DATE']; } elseif($arrTcw17['err'] != 'NODATA') { jError($arrTcw17['err'],$arrTcw17['message'],1); } $flagDelete = protIsDeleted($conn,$ti07_protocollo_staging); if ($flagDelete) { $agg_errore_del = "UPDATE tcw17_errlog SET TCW17_DESCR_ERR = 'IMPDBERR',TCW17_DATE=$form_data WHERE TCW17_DESCR_ERR='IMPDBDELETE' and tcw17_protocollo = $ti07_protocollo_staging"; list ($stmt, $ocierr) = exec_sql($conn, $agg_errore_del,1); } //richiesto ripristino 1 //ripristino effettuato 2 if ($ripristina_staging == 1) { //stringhe SQL $stringa_lancio_ripristino ="LSTV_planimetrie.php?gl_ripr=1&ripristino=1&awk=1&ripristina_staging=2&num_file_input=$cod_tabella&num_rec=$rec_err&ti07_protocollo_staging=$ti07_protocollo_staging&fileselected=$req_fileselected"; $agg_errore_del ="UPDATE tcw17_errlog SET TCW17_DESCR_ERR = 'IMPDBDELETE',TCW17_DATE=$form_data WHERE TCW17_DESCR_ERR='IMPDBERR' and tcw17_protocollo = $ti07_protocollo_staging"; //28/05/2004 12.33 AGGIUNTO PROTOCOLLO STAGING $agg_errore_rip ="UPDATE tcw17_errlog SET TCW17_DESCR_ERR = 'IMPDBRIPR', TCW17_DATE=$form_data WHERE TCW17_DESCR_ERR='IMPDBERR' and tcw17_protocollo = $ti07_protocollo_staging"; //28/05/2004 12.33 AGGIUNTO PROTOCOLLO STAGING $new_rec_err ="insert into tcw17_errlog values ($cod_tabella,'IMPDBERR', $rec_err,$form_data,$ti07_protocollo_staging)"; ?>

Impianto DB - STAGING


Intervallo Record in elaborazione:     

________________________________________________________________

Tabelle staging:
Tabella evidenziata in corso di elaborazione
'); $rit_impianto = file_unpack($conn,true,$file_input,$byte,$num_rec,$num_rec_prox,$num_file_input,$logf,$ripristino,$ti07_protocollo_staging,$_REQUEST['fileselected']); //print('DOPO DI RIT_IMPIANTO
'); ?>