Ejemplo n.º 1
0
 /**
  * Creates a new MedioPago model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new MedioPago();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Ejemplo n.º 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = MedioPago::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'info', $this->info]);
     return $dataProvider;
 }
Ejemplo n.º 3
0
        </div>

    </div>

    <div class="center">
        <h4>Detalles de pago</h4>
        <div class="row">
            <div class="col-lg-6"><?php 
echo $form->field($model, 'fecha_pago')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE]);
?>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-6"><?php 
echo $form->field($model, 'medio')->dropDownList(ArrayHelper::map(MedioPago::find()->all(), 'id', 'nombre'));
?>
</div>
        </div>

        <div class="row">
            <div class="col-lg-6"><?php 
echo $form->field($model, 'valor')->widget(MaskMoney::className(), ['pluginOptions' => ['prefix' => '$ ', 'suffix' => '', 'thousands' => '.', 'decimal' => ',', 'allowNegative' => false]]);
?>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-6"><?php 
echo $form->field($model, 'comprobante')->textInput(['maxlength' => true]);
?>
Ejemplo n.º 4
0
/* @var $this yii\web\View */
/* @var $model app\models\Pago */
$this->title = Yii::t('app', 'Registrar Pago');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Pagos'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pago-create">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_form', ['model' => $model, 'model_detalle_academia' => $model_detalle_academia, 'valor_a_pagar' => $valor_a_pagar, 'periodo_a_pagar' => $periodo_a_pagar, 'meses_a_pagar' => $meses_a_pagar]);
?>

    <h1><?php 
echo Html::encode("Historial de Pagos");
?>
</h1>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'fecha_pago:date', ['attribute' => 'medio', 'value' => function ($d) {
    return MedioPago::findOne(['id' => $d->medio])->nombre;
}], 'valor:currency', 'comprobante', 'info:ntext', ['class' => 'yii\\grid\\ActionColumn']]]);
?>


</div>
 public function getAll()
 {
     return \Response::json(array('datos' => MedioPago::all()));
 }