function enviarEmail($emails, $descripcion, $resultado, $archivos)
{
    $correo = new PHPMailer();
    //$correo->IsSMTP();
    //$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
    $correo->SMTPAuth = true;
    $correo->SMTPSecure = 'ssl';
    $correo->Host = "correo.ivss.gob.ve";
    $correo->Port = 25;
    $correo->IsHTML(true);
    $correo->Username = "******";
    $correo->Password = "******";
    $correo->SetFrom("*****@*****.**");
    //$archivo = "Prueba_".date('m-d-Y').".pdf";
    //primer parmetro es el archivo , el segundo es el nombre del archivo adjunto
    //$correo->AddAttachment($archivo,"ArchivoPDF");
    foreach ($archivos as $key => $arch) {
        //$archivo = "Prueba_".date('m-d-Y').".pdf";
        $nombreArch = $arch['STR_NOMBRE_ARCHIVO'];
        $ruta = "../../../public_html/archivos/quejas/" . $nombreArch;
        $correo->AddAttachment("../../../public_html/archivos/quejas/" . $nombreArch . "");
    }
    $correo->Subject = "Asignación de quejas";
    //$correo->Subject = "Test";
    $registros = "";
    /*Imagen no se muestra de inmediato en algunos correos por eso la comento porsiacaso*/
    #<img src='http://desarrollofiscalizacion.ivss.int/public_html/imagenes/logoivss.png' style='float:left;width:100px;'>
    $registros .= "<div style='min-height:800px;'><div style='text-align:justify;margin-bottom:16px;border-bottom:1px dotted gray;overflow:hidden;background:#3B5998;'>\t\t\n\t\t\t\t<div style='text-align:justify;padding:12px 12px 12px 7px;color:white;'>\n\t\t\t\t\tREPÚBLICA BOLIVARIANA DE VENEZUELA<br>\n\t\t\t\t\tMINISTERIO DEL PODER POPULAR PARA EL PROCESO SOCIAL DE TRABAJO<br>\n\t\t\t\t\tDIRECCIÓN GENERAL DE FISCALIZACIÓN<br>\n\t\t\t\t\tSISTEMA DE FISCALIZACIÓN\n\t\t\t\t</div>\n\t\t\t</div><p style='text-align:justify;text-indent:10px;padding:16px;'>\n\t\t\tEstimados directores de línea, se asigna las siguientes quejas:\n\t\t\t</p>";
    $registros .= "<table style='width:100%;'>\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='7' style='background:#3B5998;color:white;padding:12px;font-size:1.3em;text-align:center;'>Quejas y/o Reclamos Asignadas</td>\n\t\t\t\t</tr>\n\n\t\t\t</thead><tbody></div>";
    foreach ($resultado as $key => $quejas) {
        foreach ($quejas as $key2 => $queja) {
            $registros .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t<th class='colorth'>N° Quejas/Reclamos</th>\n\t\t\t\t\t<th class='colorth'>Denunciante</th>\n\t\t\t\t\t<th class='colorth'>Motivos</th>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>" . $queja['ID_DENUNCIA'] . "</td>\n\t\t\t\t\t<td>" . $queja['ID_EMPRESA'] . "</td>\n\t\t\t\t\t<td style='text-align:justify !important;'>" . dameMotivosQuejaCadena($queja['ID_DENUNCIA']) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<th >Dirección Empresa</th>\n\t\t\t\t\t<th >Punto de Referencia</th>\n\t\t\t\t\t<th colspan='2' >Descripción</th>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td >" . $queja['DIRECCION_EMPRESA'] . "</td>\n\t\t\t\t\t<td >" . $queja['PUNTO_REF_FISC_EMPRESA'] . "</td>\n\t\t\t\t\t<td colspan='2'>" . $queja['DESCRIPCION'] . "</td>\n\t\t\t\t</tr>";
        }
    }
    $registros .= "</tbody></table>";
    /*****************************Fin tabla datos denuncia****************************************************/
    $texto = '<html>
		<head>
			<meta charset="UTF-8">
			<title>fiscalización-Denuncias</title>
			<style>
				html,body{
					margin:0px;
					padding:0px;
				}
				table{
					background:rgba(255,255,255,0.9);
				}
				table tr:hover{
					background:#ddd;
				}
				table td,table th{
					padding:5px;
					text-align:center;
					font-size:0.8em;
				}
				.colorth{					
					background:#d9edf7;
				}
				table th{ background:#f1f1f1; }
			</style>
		</head>
		<body style="background:linear-gradient(to right, #AFA19E, #E7E7FF, #E7E7E7, #8E8E8E) no-repeat scroll 0% 0% #8E8E8E;height:auto;font-size:0.8em;">
			' . $registros . '
			<br>
			<b>Descripción de Asignación:</b> <br>
			' . $descripcion . '
		</body>
		</html>';
    $correo->Body = utf8_decode($texto);
    foreach ($emails as $key => $value) {
        $correo->AddAddress($value);
    }
    //$correo->AddCC("*****@*****.**","Edwin AGM");
    //copia oculta
    $correo->AddBCC("*****@*****.**", "Edwin AGM");
    $correo->AddBCC("*****@*****.**", "Edwin AGM");
    //$correo->AddBCC("@ivss.gob.ve","Edwin AGM");
    if (!$correo->Send()) {
        return FALSE;
    } else {
        return TRUE;
    }
}
Exemplo n.º 2
0
            $status = "PROCEDENTE";
        } elseif ($key["ESTATUS_DENUNCIA"] == 1) {
            $status = "NO PROCEDENTE";
        } else {
            $status = "CERRADO";
        }
        ?>

                    <td> <?php 
        echo $status;
        ?>
 </td>

                    <td class="td_espacio_mas4">
                        <?php 
        echo dameMotivosQuejaCadena($key["ID_DENUNCIA"]);
        ?>
                    </td>

                </tr>
                <?php 
    }
}
?>
            </tbody>

            <tfoot style="display:none">
                <tr>
                    <th>Queja y/o Reclamos</th>
                    <th>N° Patronal</th>
                    <th>Nombre Del Representante</th>