Example #1
0
 public static function listaralertasdashboard($model)
 {
     // Obtener ids de contactos
     $contactos_ids = array();
     //        foreach ($model->contactos as $contacto)
     //            $contactos_ids[] = $contacto->id;
     /**
      * Obtener las actividades
      */
     $alertas = array();
     $query = Yii::app()->db->createCommand()->select()->from('alerta')->where(array('and', 'entidad_tipo = :cuenta', 'entidad_id = :entidad_id'), array(':cuenta' => $model->tableName(), ':entidad_id' => $model->id))->orWhere(array('and', 'entidad_tipo = :contacto', array('in', 'entidad_id', $contactos_ids)), array(':contacto' => Contacto::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :tarea', array('in', 'entidad_id', $tareas_ids)), array(':tarea' => Tarea::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :oportunidad', array('in', 'entidad_id', $oportunidades_ids)), array(':oportunidad' => Oportunidad::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :cobranza', array('in', 'entidad_id', $cobranzas_ids)), array(':cobranza' => Cobranza::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :evento', array('in', 'entidad_id', $eventos_ids)), array(':evento' => Evento::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :nota', array('in', 'entidad_id', $notas_ids)), array(':nota' => Nota::model()->tableName()))->order('fecha DESC');
     $alertas = $query->queryAll();
     return $alertas;
 }
Example #2
0
    $this->breadcrumbs = array('Grupocontactos' => array(Yii::t('app', 'index')), Yii::t('app', 'Manage'));
}
if (!isset($this->menu) || $this->menu === array()) {
    $this->menu = array(array('label' => Yii::t('app', 'List') . ' Grupocontacto', 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' Grupocontacto', 'url' => array('create')));
}
Yii::app()->clientScript->registerScript('search', "\n\t\t\t\$('.search-button').click(function(){\n\t\t\t\t\$('.search-form').toggle();\n\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\$('.search-form form').submit(function(){\n\t\t\t\t\$.fn.yiiGridView.update('grupocontacto-grid', {\ndata: \$(this).serialize()\n});\n\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t");
?>

<h1> <?php 
echo Yii::t('app', 'Manage');
?>
 Grupocontactos</h1>

<?php 
echo "<ul>";
foreach ($model->relations() as $key => $relation) {
    echo "<li>" . substr(str_replace("Relation", "", $relation[0]), 1) . " " . CHtml::link(Yii::t("app", $relation[1]), array($this->resolveRelationController($relation) . "/admin")) . " (" . $relation[2] . ")" . " </li>";
}
echo "</ul>";
echo CHtml::link(Yii::t('app', 'Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div>

<?php 
$locale = CLocale::getInstance(Yii::app()->language);
$this->widget('zii.widgets.grid.CGridView', array('id' => 'grupocontacto-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', array('name' => 'contactoid', 'value' => 'CHtml::value($data,\'contacto.recordTitle\')', 'filter' => CHtml::listData(Contacto::model()->findAll(), 'contactoid', 'recordTitle')), array('name' => 'grupoid', 'value' => 'CHtml::value($data,\'grupo.nombre\')', 'filter' => CHtml::listData(Grupo::model()->findAll(), 'grupoid', 'nombre')), array('class' => 'CButtonColumn'))));
Example #3
0
        <div class="row">
                <?php 
echo $form->label($model, 'id');
?>
                <?php 
echo $form->textField($model, 'id', array('size' => 20, 'maxlength' => 20));
?>
        </div>
    
        <div class="row">
                <?php 
echo $form->label($model, 'contactoid');
?>
                <?php 
echo $form->dropDownList($model, 'contactoid', CHtml::listData(Contacto::model()->findAll(), 'contactoid', 'recordTitle'), array('prompt' => Yii::t('app', 'All')));
?>
        </div>
    
        <div class="row">
                <?php 
echo $form->label($model, 'grupoid');
?>
                <?php 
echo $form->dropDownList($model, 'grupoid', CHtml::listData(Grupo::model()->findAll(), 'grupoid', 'nombre'), array('prompt' => Yii::t('app', 'All')));
?>
        </div>
    
        <div class="row buttons">
                <?php 
echo CHtml::submitButton(Yii::t('app', 'Search'));
Example #4
0
 public function actionAutocompletesearch()
 {
     $q = "%" . $_GET['term'] . "%";
     $result = array();
     if (!empty($q)) {
         $criteria = new CDbCriteria();
         $criteria->select = array('id', "CONCAT_WS(' ',nombre) as nombre");
         $criteria->condition = "lower(CONCAT_WS(' ',nombre)) like lower(:nombre) ";
         $criteria->params = array(':nombre' => $q);
         $criteria->limit = '10';
         $cursor = Contacto::model()->findAll($criteria);
         foreach ($cursor as $valor) {
             $result[] = array('label' => $valor->nombre, 'value' => $valor->nombre, 'id' => $valor->id);
         }
     }
     echo json_encode($result);
     Yii::app()->end();
 }
 public function actionStorecontact()
 {
     $models = Contacto::model()->findAll();
     print_r(CJSON::encode($models));
 }
Example #6
0
"></script>

  </head>

  <body class="">

      <header id="header">
			<div id="logo-group">
	        <!-- PLACE YOUR LOGO HERE -->
	        <span id="logo"><img alt="Logo" src="<?php 
echo Yii::app()->theme->baseUrl . '/img/logo.png';
?>
">Portal Web Admin</span> 
	        <!-- END LOGO PLACEHOLDER -->        
	 				<?php 
$mensajes = Contacto::model()->findAll("estatus_did = 1");
?>
	        <span class="activity-dropdown" id="activity"> <b class="badge"><?php 
echo count($mensajes);
?>
</b></span> 
	        <!-- AJAX-DROPDOWN : control this dropdown height, look and feel from the LESS variable file -->
	        <div class="ajax-dropdown">
            Mensajes Pendientes
            <div class="ajax-notifications custom-scroll">
               
               <table class="table table-bordered table-hover table-condensed">
               		<thead>
               			<tr>
               				<th class="text-center">Asunto</th>
               				<th class="text-center">Acciones</th>
 public function loadModel()
 {
     // modificacion,dialog
     if ($this->_model === null) {
         if (isset($_GET['id'])) {
             $this->_model = Contacto::model()->findByPk((int) $_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));
         }
     }
     return $this->_model;
 }