Пример #1
0
         if (sentToMscFTP($fileEDIE) == 0) {
             // Si retorna "false" entonces regresa a 0 el campo flg_edicodeco en tabla ENTRADA.
             // 2 = Listo para enviar a FTP
             // 1 = Enviado.
             // 0 = No enviado.
             $sql = "update ENTRADA set flg_edicodeco='0' where flg_edicodeco='2' and id_naviera='1' ";
             $db->query($sql);
             $flgFtpOK = 0;
         } else {
             $sql = "update ENTRADA set flg_edicodeco='1' where flg_edicodeco='2' and id_naviera='1' ";
             $db->query($sql);
             $flgFtpOK = 1;
         }
     }
     if (!empty($fileEDIS)) {
         if (sentToMscFTP($fileEDIS) == 0) {
             $sql = "update SALIDA set flg_edicodeco='0' where flg_edicodeco='2' and id_naviera='1' ";
             $db->query($sql);
             $flgFtpOK = 0;
         } else {
             $sql = "update SALIDA set flg_edicodeco='1' where flg_edicodeco='2' and id_naviera='1' ";
             $db->query($sql);
             $flgFtpOK = 1;
         }
     }
     if ($flgFtpOK == 1) {
         sendMail($fileEDIE, $fileEDIS, 'Mediterranean Shipping Company Mexico');
     } elseif ($flgFtpOK == 0) {
         sendMailError("MSC", "FTP Fallo la conexion");
     }
 }
Пример #2
0
         // 2 = Listo para enviar a FTP
         // 1 = Enviado.
         // 0 = No enviado.
         $sql = "update ENTRADA_LLENO set flg_edicodeco='0' where flg_edicodeco='2' and id_naviera='{$idNav}' ";
         $db->query($sql);
         $flgFtpOK[] = "ERROR";
         sendMailError("MSC", "FTP Fallo la conexion");
     } else {
         $sql = "update ENTRADA_LLENO set flg_edicodeco='1' where flg_edicodeco='2' and id_naviera='{$idNav}' ";
         $db->query($sql);
         $flgFtpOK[] = "OK";
     }
 }
 if (!empty($fileEdiEF)) {
     // ++ ENTRADAS DESCONSOLIDADOS ++
     if (sentToMscFTP($fileEdiED) == 0) {
         // Si retorna "false" entonces regresa a 0 el campo flg_edicodeco en tabla ENTRADA.
         // 2 = Listo para enviar a FTP
         // 1 = Enviado.
         // 0 = No enviado.
         $sql = "update ENTRADA set flg_edicodeco='0' where flg_edicodeco='2' and id_naviera='{$idNav}' and flg_descon='1' ";
         $db->query($sql);
         $flgFtpOK[] = "ERROR";
         sendMailError("MSC", "FTP Fallo la conexion");
     } else {
         $sql = "update ENTRADA set flg_edicodeco='1' where flg_edicodeco='2' and id_naviera='{$idNav}' and flg_descon='1' ";
         $db->query($sql);
         $flgFtpOK[] = "OK";
     }
 }
 if (in_array("OK", $flgFtpOK)) {