Exemplo n.º 1
0
 function envia_datos_contacto($parametros)
 {
     $nombre = $parametros["jform"]["contact_name"];
     $telefono = $parametros["jform"]["contact_subject"];
     $email = $parametros["jform"]["contact_email"];
     $comentarios = $parametros["jform"]["contact_message"];
     $email_portal_contacts = Config::getPreferenceValue("email_portal_contacts");
     $email_subject = Config::getPreferenceValue("email_subject");
     $email_alt_body = Config::getPreferenceValue("email_alt_body");
     if ($email_portal_contacts && $email_subject) {
         //For some reason, the html below is not working... the next one is almost the same (at least in look and feel)
         //            $html = '<div class="entry" style="margin: 0px auto; width:100%;-webkit-border-radius: 100px;-moz-border-radius: 100px;border-radius: 100px; border-width:3px; border-style:solid; border-color:#9b0310;"><table width="80%" border="0" cellpadding="5" cellspacing="0" align="center"><tbody><tr><td colspan="3">&nbsp;</td></tr><tr><td rowspan="2" align="center" width="30%"><img src="http://www.uiest.edu.mx/images/logo_uiest_sin_bola.png" height="123" width="93"></td><td>&nbsp;</td><td width="30%">&nbsp;</td></tr><tr><td colspan="2" align="center" valign="baseline">Actitud emprendedora, formaci&oacute;n innovadora <span style="font-weight:bold;">UIEST</span></td></tr><tr> <td colspan="3" align="left"><p>La siguiente informaci&oacute;n fue proporcionada desde el Portal</p><table width="100%" border="1" cellpadding="5" cellspacing="0" ><tr><td width="10%">Nombre: </td> <td><strong>'.$nombre.'</strong></td></tr><tr><td>Tel&eacute;fono:</td><td><strong>'.$telefono.'</strong></td></tr><tr><td>email:</td><td><strong>'.$email.'</strong></td></tr><tr> <td colspan="2">Comentario:<p>'.nl2br($comentarios).'</p></td></tr> </table></td></tr><tr><td colspan="3" align="right"><p style="font-size:9px;">E-mail generado autom&aacute;ticamente</p></td></tr><tr><td colspan="3" align="right">&nbsp;</td></tr></tbody></table></div>';
         $html = "<div class='entry' style='margin: 0px auto; width: 100%; -webkit-border-radius: 100px; -moz-border-radius: 100px; border-radius: 100px; border-width: 3px; border-style: solid; border-color: #9b0310;'><table style='width: 80%;' border='0' align='center'><tbody><tr><td>&nbsp;<img src='http://www.uiest.edu.mx/images/logo_uiest_sin_bola.png' alt='' width='93' height='123' /></td><td style='text-align: center;'><span>Actitud emprendedora, formaci&oacute;n innovadora&nbsp;</span><strong>UIEST</strong></td></tr><tr><td colspan='3' align='center'>&nbsp;<br /><span>La siguiente informaci&oacute;n fue proporcionada desde el Portal</span><br />&nbsp;</td></tr><tr><td colspan='2'><table style='width: 100%;' border='1' cellspacing='0' cellpadding='5'><tbody><tr><td>&nbsp;<span>Nombre:</span></td><td>&nbsp;<strong>" . $nombre . "</strong></td></tr><tr><td>&nbsp;<span>Tel&eacute;fono:</span></td><td>&nbsp;<strong>" . $telefono . "</strong></td></tr><tr><td>&nbsp;<span>email:</span></td><td>" . $email . "</td></tr><tr><td colspan='2'><span>Comentario:</span><br /><p>" . nl2br($comentarios) . "</p></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td><td><p style='font-size: 9px; text-align: right;'>E-mail generado autom&aacute;ticamente</p></td></tr></tbody></table></div>";
         //            debug($html,"html");
         if ($this->enviarEmail($email_portal_contacts, $email_subject, $html, $email_alt_body)) {
             $contactanos = new Contactanos();
             //                $contactanos->set_debug_mode();
             $contactanos->set_campo("con_nombre", $nombre);
             $contactanos->set_campo("con_telefono", $telefono);
             $contactanos->set_campo("con_email", $email);
             $contactanos->set_campo("con_comentario", $comentarios);
             $contactanos->set_campo("con_enviado_a", $email_portal_contacts);
             $contactanos->agrega();
             $this->autorespuesta($email, $email_subject);
             return true;
         }
     }
     return false;
 }
Exemplo n.º 2
0
<?php

require_once "../includes/class.contactanos_info.php";
require_once "../includes/class.contactanos.php";
require_once "../includes/class.contactanos_xml.php";
if ($_REQUEST["cmd"] == "listado") {
    /*
    $galerias = new Galerias(new DB());
    $galerias->get_listado_xml_prt();
    */
    $contactanos = new Contactanos_XML($_REQUEST, new DB());
    //    $contactanos->set_debug_mode();
    $contactanos->get_listado_xml_prt();
    exit;
}
if ($_REQUEST[$_REQUEST["ids"] . "_!nativeeditor_status"] == "deleted") {
    $contactanos = new Contactanos(new DB());
    //    $galeria->set_debug_mode();debug($_REQUEST);
    if ($contactanos->elimina($_REQUEST["ids"])) {
        $contactanos->response_xml_prt();
    } else {
        $contactanos->response_xml("error", "error");
    }
    exit;
}
if ($_REQUEST["cmd"] == "info_json") {
    $contactanos = new Contactanos_info($_REQUEST["id_contacto"], new DB());
    $contactanos->get_campos_json_prt("con_nombre,con_telefono,con_email,con_comentario,con_enviado_a,con_fallo,con_fecha_creado");
    exit;
}