Example #1
0
             $blCreateBy = $cbU1 . " " . $cbU2;
         }
     }
 } elseif ($impoExpo == "I") {
     // ------------------
     // BUQUE IMPORT
     // ------------------
     unset($idBarco);
     $puerto = getPuerto($pod);
     $sql2 = "\n                        SELECT Id_barco\n                        FROM BARCO\n                        WHERE Nombre='{$vessel}' and Viaje='{$voyage}' and Puerto='{$puerto}' and Impo_expo='{$impoExpo}'\n                        ";
     $db2->query($sql2);
     while ($db2->next_record()) {
         $idBarco = $db2->f('Id_barco');
     }
     if (empty($idBarco)) {
         $idBarco = nuevoBuque($vessel, $voyage, $eta, $puerto, $impoExpo, $vesselCode, $vesselPortLoc);
     }
     // Actualizar ETA y ETD Reales
     if ($impoExpo == 'I' && !empty($localETA) && $idBarco > 0) {
         // Actualizar...
         $sql2 = "update BARCO set Eta1='{$localETA}' where id_barco='{$idBarco}' ";
         $db2->query($sql2);
     }
     $companyX = $cng;
 }
 // -----------------------------------------------------
 // ------------------------------------------------------------------------------
 // CARGAR BLS A SION
 // ------------------------------------------------------------------------------
 if ($cur != 'USD') {
     //echo "THC_CC: $thcCC $cur  | $ori | $pol | $pod | $des | $bl | $company | $eta  <br>";
Example #2
0
     }
     $companyX = $company;
     //echo "$bl / $eta / idBarco: $idBarco <br>";
 } elseif ($impoExpo == "I") {
     // ------------------
     // BUQUE IMPORT
     // ------------------
     unset($idBarco);
     $puerto = getPuerto($pod);
     $sql2 = "\n                        SELECT Id_barco\n                        FROM BARCO\n                        WHERE Nombre='{$vessel}' and Viaje='{$voyage}' and Eta1='{$eta}' and Puerto='{$puerto}' and Impo_expo='{$impoExpo}'\n                        ";
     $result = mysql_query($sql2, $dbSION);
     while ($row = mysql_fetch_array($result)) {
         $idBarco = $row['Id_barco'];
     }
     if (empty($idBarco)) {
         $idBarco = nuevoBuque($vessel, $voyage, $eta, $puerto, $impoExpo);
     }
     $companyX = $cng;
 }
 // 2. Cargar info de MscLink a SION.
 // Comprobar que no exista el Bl en la B.D.
 unset($row);
 unset($idBl);
 unset($result);
 $blSion = str_replace("MSCU", "", $bl);
 $sql2 = "select Id_expo from EXPO where Bl='{$blSion}' ";
 $result = mysql_query($sql2, $dbSION);
 while ($row = mysql_fetch_array($result)) {
     $idBl = $row['Id_expo'];
 }
 if (empty($idBl)) {