public function cargarPendientesOperador() { $id_user = $this->cargarUser(); $criteria = new CDbCriteria(array('condition' => 't.estado =:estado or (t.estado =:estado2 AND atencion.user_id = :user)', 'order' => 't.id DESC', 'limit' => 500, 'with' => array('atencion'), 'params' => array(':estado' => 'PENDIENTE', ':estado2' => 'PROCESANDO', ':user' => $id_user))); $hoy = new CDbExpression("CURDATE()"); $criteria->addCondition('t.fecha >= ' . $hoy); $model = Recarga::model()->findAll($criteria); $dataProvider = new CActiveDataProvider('Recarga', array('criteria' => $criteria, 'pagination' => array('pageSize' => 100))); return $dataProvider; }
<div class="row"> <?php echo $form->label($model, 'user_id'); ?> <?php echo $form->dropDownList($model, 'user_id', GxHtml::listDataEx(User::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'recarga_id'); ?> <?php echo $form->dropDownList($model, 'recarga_id', GxHtml::listDataEx(Recarga::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'fecha'); ?> <?php echo $form->textField($model, 'fecha'); ?> </div> <div class="row"> <?php echo $form->label($model, 'comentario');
public function actionRecargasIngresadas() { $model = new Recarga('search'); $model->unsetAttributes(); $criteria = new CDbCriteria(array('condition' => 'usuario_id =:usuario_id', 'order' => 'id DESC', 'limit' => 500, 'params' => array(':usuario_id' => 1))); $model = Recarga::model()->findAll($criteria); $dataProvider = new CActiveDataProvider('Recarga', array('criteria' => $criteria)); $dataProvider->setPagination(false); //FIN CONSULTA $this->render('recargas_ingresadas', array('dataProvider' => $dataProvider, 'model' => $model)); }
<?php $this->breadcrumbs = array($model->label(2) => array('index'), Yii::t('app', 'Manage')); $this->menu = array(array('label' => Yii::t('app', 'List') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create'))); Yii::app()->clientScript->registerScript('search', "\r\n\$('.search-button').click(function(){\r\n\t\$('.search-form').toggle();\r\n\treturn false;\r\n});\r\n\$('.search-form form').submit(function(){\r\n\t\$.fn.yiiGridView.update('atencion-grid', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n"); ?> <h1><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?> </h1> <p> You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done. </p> <?php echo GxHtml::link(Yii::t('app', 'Advanced Search'), '#', array('class' => 'search-button')); ?> <div class="search-form"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'atencion-grid', 'dataProvider' => $model->search(), 'type' => 'striped bordered condensed', 'filter' => $model, 'template' => "{items}", 'columns' => array('id', array('name' => 'cupo_id', 'value' => 'GxHtml::valueEx($data->cupo)', 'filter' => GxHtml::listDataEx(Cupo::model()->findAllAttributes(null, true))), array('name' => 'user_id', 'value' => 'GxHtml::valueEx($data->user)', 'filter' => GxHtml::listDataEx(User::model()->findAllAttributes(null, true))), array('name' => 'recarga_id', 'value' => 'GxHtml::valueEx($data->recarga)', 'filter' => GxHtml::listDataEx(Recarga::model()->findAllAttributes(null, true))), 'fecha', array('class' => 'bootstrap.widgets.TbButtonColumn', 'htmlOptions' => array('style' => 'width: 50px')))));
<?php echo $form->labelEx($model, 'user_id'); ?> <?php echo $form->dropDownList($model, 'user_id', GxHtml::listDataEx(User::model()->findAllAttributes(null, true))); ?> <?php echo $form->error($model, 'user_id'); ?> </div><!-- row --> <div class="row"> <?php echo $form->labelEx($model, 'recarga_id'); ?> <?php echo $form->dropDownList($model, 'recarga_id', GxHtml::listDataEx(Recarga::model()->findAllAttributes(null, true))); ?> <?php echo $form->error($model, 'recarga_id'); ?> </div><!-- row --> <div class="row"> <?php echo $form->labelEx($model, 'fecha'); ?> <?php echo $form->textField($model, 'fecha'); ?> <?php echo $form->error($model, 'fecha'); ?>