// --- PREPARA --- $tmail=array(); $tmail[WEB] = $_POST[GERWEB]; $tmail[EMPRESA] = $_POST[GEREMPRESA]; $tmail[FECHA_ALTA] = $fecha_envio; $tmail[HORA_ALTA] = $hora_envio; $tmail[TIPO] = "DIVIDENDO"; $tmail[MAIL_DE] = "ayudasdividendo@grupolasser.com"; $tmail[MAIL_PARA] = $t[destinatarios]; $tmail[MAIL_CCO] = ""; $tmail[ASUNTO] = "ADAPTACIÓN AL 2º DIVIDENDO DIGITAL"; $tmail[CUERPO] = "DIVIDENDO"; $tmail[CUERPO_WEB] = $_POST[GERWEB]; $tmail[CUERPO_EMPRESA] = $_POST[GEREMPRESA]; $tmail[ADJUNTO1] = ""; $tmail[ADJUNTO2] = ""; $tmail[ADJUNTO3] = ""; $tmail[CAMPOS] = ""; $tmail[VALORES] = ""; $tmail[ESTADO] = "Pendiente"; $tmail[FECHA] = ""; $tmail[HORA] = ""; $tmail[DOCU_TIPO] = " "; $tmail[DOCU_SIZE] = "0"; $tmail[DOCU] = "0x1"; $tmail[ACUSE] = "N"; $tmail[NOTIFICA] = "N"; $tmail[DIV_ENVIOS_MAIL_ID]= $t[idenvio]; // // --- INSERT --- $sk=$sv=""; $swhere=""; foreach ($tmail as $k => $v) { if(strlen($sk)>0) $sk.=", "; $sk.=$k; if(strlen($sv)>0) $sv.=", "; $sv.="'" . str_replace("'", "''", trim($v)) . "'"; // if($k!="CAMPOS" && $k!="VALORES" && $k!="DOCU") { if(strlen($swhere)>0) $swhere.=" and "; $swhere.=$k . " = '" . str_replace("'", "''", trim($v)) . "'"; } } $buffer = "insert into XM_MAIL (" . $sk . ") values(" . $sv . ")"; $conn->ger_exec ($cursor2, $buffer); if ($io_test>=2) echo "gerrc($gerrc), buffer($buffer)\n"; // // IDENTI $rc2=""; $tm=array(); $buffer ="select IDENTI from XM_MAIL (NOLOCK)"; $buffer.=" where " . $swhere; $buffer.=" order by IDENTI desc"; $conn->ger_exec ($cursor2, $buffer); $rc2= gerdb_fetch ($cursor2, $tm); if ($io_test>=2) echo "rc2($rc2), buffer($buffer)\n"; if($rc2=="") {