Ejemplo n.º 1
0
                                        </div>
                                    </td>
                                    <td width="85%"><div style="left: 300px; background-color: white"><?php 
    echo $content;
    ?>
</div></td>
                                </tr>
                            </tr>
                        </table>
                    </td>
                    <td width="10%" >
                        <div style="position: absolute; top: 182px;">
                            <?php 
    for ($i = 0; $i < 5; $i++) {
        $numero_aleatorio = rand(1, 500);
        $publicidades = Publicidades::model()->findAll("`idPublicidad` = {$numero_aleatorio}");
        if ($publicidades == Null) {
            $i--;
        } else {
            foreach ($publicidades as $data) {
                if ($i == 2) {
                    ?>
                                        <div style="position: static; margin-top: 5px; background-color: white">
                                            <p>
                                            <?php 
                    $encuesta = Encuestas::model()->findAll(array('order' => 'idEncuesta DESC', 'limit' => 1));
                    foreach ($encuesta as $dataE) {
                        echo $dataE->pregunta;
                        $_SESSION['idEncuesta'] = $dataE->idEncuesta;
                        $opciones = Opciones::model()->findAll(array('order' => 'idOpcion DESC', 'condition' => "`encuestas_idEncuesta` = {$dataE->idEncuesta}"));
                        ?>
Ejemplo n.º 2
0
<?php

/* @var $this SiteController */
$this->pageTitle = Yii::app()->name;
?>
                                                        <!--DIV PARA SLIDER-->
                                                        <div id="slides">
                                                                <div class="slides_container">
                                                                <?php 
$publicidadesSlider = Publicidades::model()->findAll(array('order' => 'idPublicidad DESC', 'limit' => 4));
foreach ($publicidadesSlider as $publi) {
    ?>
                                                                    <a><img src=<?php 
    echo Yii::app()->request->baseUrl . '/images/' . $publi->url;
    ?>
></a>
                                                                <?php 
}
?>
                                                                </div>
                                                                <a href="#" class="prev"><img src="images/arrow-prev.png" width="24" height="43" alt="Arrow Prev"/></a>
                                                                <a href="#" class="next"><img src="images/arrow-next.png" width="24" height="43" alt="Arrow Next"/></a>
                                                         </div>
<?php 
if ($noticias) {
    ?>
    <?php 
    foreach ($noticias as $data) {
        ?>
        <div>
            <br /><h1><?php 
 /**
  * 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 = Publicidades::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'La página solicitada no existe.');
     }
     return $model;
 }