Ejemplo n.º 1
0
 public function cargarCupo($celular)
 {
     //$flag = Noprepago::model()->exists('numero =:numero and compania =:compania',array(':numero'=>$celular, ':compania'=>$compania));
     $model_cupo = Cupo::model()->findByAttributes(array('numero' => $celular));
     if (!$model_cupo && empty($model_cupo)) {
         return new Cupo();
     }
     //$model_cupo = Cupo::model()->findByAttributes( array('numero'=>$numero), 'numero=:numero', array(':numero'=>$celular));
     return $model_cupo;
 }
Ejemplo n.º 2
0
 public function AumentarCupo($celular)
 {
     $model_cupo = null;
     $model_cupo = new Cupo();
     $model_cupo = Cupo::model()->findByAttributes(array('numero' => $celular));
     if ($model_cupo && !empty($model_cupo)) {
         $model_cupo->cupo = $model_cupo->cupo - 1;
         $model_cupo->save(false);
     } else {
         $model_cupo = null;
         $model_cupo = new Cupo();
         $model_cupo->numero = $celular;
         $model_cupo->cupo = 1;
         $model_cupo->estado = 'DISPONIBLE';
         $model_cupo->save(false);
     }
 }
Ejemplo n.º 3
0
	<div class="row">
		<?php 
echo $form->label($model, 'id');
?>
		<?php 
echo $form->textField($model, 'id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'cupo_id');
?>
		<?php 
echo $form->dropDownList($model, 'cupo_id', GxHtml::listDataEx(Cupo::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All')));
?>
	</div>

	<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');
Ejemplo n.º 4
0
<?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 (&lt;, &lt;=, &gt;, &gt;=, &lt;&gt; 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')))));
Ejemplo n.º 5
0
 <span class="required">*</span> <?php 
echo Yii::t('app', 'are required');
?>
.
	</p>

	<?php 
echo $form->errorSummary($model);
?>

		<div class="row">
		<?php 
echo $form->labelEx($model, 'cupo_id');
?>
		<?php 
echo $form->dropDownList($model, 'cupo_id', GxHtml::listDataEx(Cupo::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'cupo_id');
?>
		</div><!-- row -->
		<div class="row">
		<?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');
?>
Ejemplo n.º 6
0
 public function actionEliminarTodos()
 {
     $model = new Cupo();
     Cupo::model()->deleteAll();
     $this->redirect(array('admin'));
 }