function enviarMail(Preguntas $p) { $to = $p->getEmail(); $subject = "Recepcion pregunta Portal Inmobiliario NotNull"; $message = "\r\n <html>\r\n <head>\r\n <title>Recepción pregunta</title>\r\n </head>\r\n <body>\r\n <p>\r\n <FONT color=#000080 size=2\r\n face='Century Gothic'>\r\n Estimado " . $p->getNombreCliente() . "," . "\r\n </FONT> \r\n </p>\r\n <br>\r\n <DIV><SPAN class=648433414-04082015><FONT color=#000080 size=2\r\n face='Century Gothic'>Nuestros ejecutivos se pondrán en contacto\r\n contigo</FONT></SPAN></DIV>\r\n <DIV><SPAN class=648433414-04082015><FONT color=#000080 size=2\r\n face='Century Gothic'>lo antes posible.</FONT></SPAN></DIV>\r\n <DIV><SPAN class=648433414-04082015><FONT color=#000080 size=2\r\n face='Century Gothic'></FONT></SPAN> </DIV>\r\n <DIV><SPAN class=648433414-04082015><FONT color=#000080 size=2\r\n face='Century Gothic'><a href = http://portalinmobiliarionotnull.site40.net/index.php >Sigue visitando nuestro\r\n portal</a></FONT></SPAN></DIV>\r\n <DIV><SPAN class=648433414-04082015><FONT color=#000080 size=2\r\n face='Century Gothic'></FONT></SPAN> </DIV>\r\n <DIV><SPAN class=648433414-04082015><FONT color=#000080 size=2\r\n face='Century Gothic'>Saludos,</FONT></SPAN></DIV>\r\n <DIV class=Section1>\r\n <DIV>\r\n <P style='mso-margin-top-alt: auto; mso-margin-bottom-alt: auto' class=MsoNormal\r\n align=left><SPAN\r\n style='FONT-FAMILY: Verdana; COLOR: navy; FONT-SIZE: 10pt'><SPAN\r\n class=648433414-04082015></SPAN><STRONG><FONT face='Century Gothic'>I<SPAN\r\n class=648433414-04082015>nformaciones Not\r\n Null</SPAN></FONT></STRONG><BR></SPAN><SPAN\r\n style='FONT-FAMILY: Verdana; COLOR: navy; FONT-SIZE: 7.5pt'><SPAN\r\n class=648433414-04082015></SPAN><FONT face='Century Gothic'><FONT size=2>P<SPAN\r\n class=648433414-04082015>ortal Inmobiliario\r\n !Null</SPAN></FONT></FONT><BR></SPAN><SPAN class=SpellE><SPAN\r\n style='FONT-FAMILY: 'Century Gothic'; COLOR: #666666; FONT-SIZE:\r\n 7.5pt'>Tel</SPAN></SPAN><SPAN\r\n style='FONT-FAMILY: 'Century Gothic'; COLOR: #666666; FONT-SIZE: 7.5pt'>. \r\n (562) <SPAN class=648433414-04082015>1111 1111</SPAN><BR>Fax \r\n (562) <SPAN class=648433414-04082015>1111 1111</SPAN><BR><SPAN\r\n class=648433414-04082015>Calle !notNull</SPAN>, Santiago Centro –\r\n Chile<BR></SPAN><SPAN\r\n style='FONT-FAMILY: 'Century Gothic'; COLOR: blue; FONT-SIZE: 7.5pt'><A\r\n href='mailto:informaciones@portalinmobiliarionotnull.site40.net'>informaciones</A></SPAN></P>\r\n <P style='mso-margin-top-alt: auto; mso-margin-bottom-alt: auto'\r\n class=MsoNormal><B><SPAN\r\n style='FONT-FAMILY: Webdings; COLOR: green; FONT-SIZE: 18pt;\r\n mso-bidi-font-family: Arial; mso-ansi-language: CA'\r\n lang=CA>P</SPAN></B><B><U><SPAN\r\n style='COLOR: green; FONT-SIZE: 8pt; mso-ansi-language: CA' lang=CA>\r\n </SPAN></U></B><SPAN style='COLOR: green; FONT-SIZE: 10pt'>Antes de imprimir\r\n este correo</SPAN><SPAN\r\n style='COLOR: green; FONT-SIZE: 10pt; mso-ansi-language: CA' lang=CA>, piense si\r\n es necesario hacerlo. </SPAN></P>\r\n <P style='mso-margin-top-alt: auto; mso-margin-bottom-alt: auto'\r\n class=MsoNormal><B><SPAN\r\n style='COLOR: green; FONT-SIZE: 10pt; mso-ansi-language: CA' lang=CA>Cuidar el\r\n medio ambiente es tarea de todos.</SPAN></B></P></DIV></DIV>\r\n <DIV> </DIV></BODY></HTML>\r\n "; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= 'Content-type:text/html;charset=UTF-8' . "\r\n"; // More headers $headers .= 'From: <*****@*****.**>' . "\r\n"; mail($to, $subject, $message, $headers); }
/** * Carga interfaz para edición de encuesta * * @param int $id */ public function editEncuesta($id) { global $uid; $e = $this->getEncuesta($id); $tpl = new Elfic_Smarty(); $tpl->assign('uid', $uid); $tpl->assign('eid', $id); $tpl->assign('titulo', $e->titulo); $tpl->assign('observaciones', $e->observaciones); $tpl->assign('publicado', array('n' => 'No', 's' => 'Si')); $tpl->assign('sel_pub', $e->publicado); $tpl->assign('data', Preguntas::getPreguntasEscuesta($id)); $tpl->display('encuestas/encuestasEdit.tpl'); }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param Preguntas $value A Preguntas object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(Preguntas $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Preguntas::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, Yii::t('The requested page does not exist.')); } return $model; }
<?php if (isset($_GET['id_pregunta'])) { $_SESSION["pregunta"] = $_GET['id_pregunta']; } $this->breadcrumbs = array('Respuestas' => array('admin'), Yii::t('App', 'Manage')); $this->menu = array(array('label' => 'Listado de Respuestas', 'url' => array('admin')), array('label' => 'Nueva Respuesta', 'url' => array('create'))); Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('respuestas-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1>Respuestas de la pregunta:</h1> <br /> <h2> <?php $condicion = "id=" . $_SESSION["pregunta"]; $pregunta = Preguntas::model()->find($condicion, 'pregunta'); echo $pregunta->pregunta; ?> <span style="font-size:12px">(<?php echo CHtml::link("Regresar", "../preguntas", array("class" => "openNewWindow")); ?> )</span> </h2> <?php echo CHtml::link('Busqueda Avanzada', '#', array('class' => 'search-button')); ?> <div class="search-form" style="display:none"> <?php
<!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php try { //Inicializamos la conexion a la DB $preguntaDal = new PreguntaDal(); $preguntas = new Preguntas(); //Capturamos los valores de la pagina $preguntas->setNombreCliente($_POST['txt_nombre']); $preguntas->setEmail($_POST['txt_email']); $preguntas->setTelefonoContacto($_POST['txt_phone']); $preguntas->setPregunta($_POST['txt_pregunta']); //Nos Conectamos a la BD if ($preguntaDal->insertPregunta($preguntas)) { //Redirige a la pagina $preguntaDal->enviarMail($preguntas); header('Location: ../mensaje_enviado.php'); } else { //Redirige pagina error echo '("Error")'; } } catch (Exception $exc) {
/** * Declares an association between this object and a Preguntas object. * * @param Preguntas $v * @return Resultadosparciales The current object (for fluent API support) * @throws PropelException */ public function setPreguntas(Preguntas $v = null) { if ($v === null) { $this->setPreguntasId(NULL); } else { $this->setPreguntasId($v->getId()); } $this->aPreguntas = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Preguntas object, it will not be re-added. if ($v !== null) { $v->addResultadosparciales($this); } return $this; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // if (Preguntas::destroy($id)) { $respuesta["registros"] = []; $respuesta["mensaje"] = "Registro eliminado exitosamente"; $respuesta["resultado"] = true; return $respuesta; } else { $respuesta["registros"] = []; $respuesta["mensaje"] = "El registro no existe"; $respuesta["resultado"] = false; return $respuesta; } }
/** * Arreglo de preguntas * @return array */ public function getPreguntas() { $pr = new Preguntas(); $p = $pr->getPreguntas(); $data = array(); $db = new DB(); $i = 0; while ($line = $db->fetchNextObject($p)) { $data[$i]['id'] = $line->id; $data[$i]['pregunta'] = $line->pregunta; $i++; } return $data; }
if (!$uperms['encuestas_w']) { Elfic::cosRedirect('index2.php', MSG_NOPERM_COM); } else { $p = new Preguntas(); $pid = $p->setPregunta($_eid); $r = new Respuestas(); $r->setRespuestas($pid); Elfic::cosRedirect('index2.php?com=encuestas&do=edit&eid=' . $_eid); } break; case 'deletepregunta': if (!$uperms['encuestas_w']) { Elfic::cosRedirect('index2.php', MSG_NOPERM_COM); } else { if ($_pid) { $p = new Preguntas(); $p->deletePregunta($_pid); } Elfic::cosRedirect('index2.php?com=encuestas&do=edit&eid=' . $_eid); } break; case 'resultados': $smarty->assign('eid', $_eid); $smarty->display('encuestas' . DS . 'encuestas_resultados_menubar.tpl'); $smarty->display('end_menubar.tpl'); if (!$uperms['encuestas_w']) { Elfic::cosRedirect('index2.php', MSG_NOPERM_COM); } else { if ($_eid) { $r = new Resultados($_eid); $r->getInforme($_eid);
?> <?php echo $form->textField($model, 'id_pregunta', array('size' => 11, 'maxlength' => 11, 'value' => $_SESSION["pregunta"])); ?> <?php echo $form->error($model, 'id_pregunta'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'sig_preg'); ?> <?php $condicion = "id_encuesta=" . $_SESSION["encuesta"]; echo $form->dropDownList($model, 'sig_preg', array('--Seleccione una Pregunta--', 'Preguntas' => CHtml::listData(Preguntas::model()->findAll($condicion), 'id', 'pregunta'))); ?> <?php echo $form->error($model, 'sig_preg'); ?> </div> <div class="row buttons"> <?php echo CHtml::link($model->isNewRecord ? 'Guardar y Agregar otra Respuesta' : 'Actualizar', 'javascript:;', array('submit' => '', 'class' => 'positive')); ?> <?php echo CHtml::link(Yii::t('App', 'Cancel'), array('admin'), array('class' => 'negative')); ?>