public function actionPago()
 {
     $model = new PagosCxp();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['pago'])) {
         //$model->attributes=$_POST['ProductoCompras'];
         $model->producto_compra_id = $_GET['idCompra'];
         $model->pago = $_POST['pago'];
         $model->comentario = $_POST['comentario'];
         $model->fecha = date("Y-m-d H:i:s");
         $model->personal_id = Yii::app()->user->usuarioId;
         if ($model->save()) {
             $laCompra = ProductoCompras::model()->findByPk($model->producto_compra_id);
         }
         //$laCompra->saldo = $_POST['resto'];
         $laCompra->saveAttributes(array('saldo' => $_POST['resto']));
         $laCompra->save();
         //los estados???
         $this->redirect(array('view', 'id' => $model->producto_compra_id));
     }
     $this->redirect(array('view', 'id' => $_GET['idCompra']));
 }
示例#2
0
</div>

<div id="historial" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel2">Historial de Abonos a Cuenta </h3>
    <div class="span12">
    	<table class="table table-striped">
			<tr>
				<th>Pago</th>
				<th>Comentario</th>
				<th>Ingresado por</th>
				<th>Fecha</th>
			</tr>
		<?php 
$losPagos = PagosCxp::model()->findAll("producto_compra_id = {$model->id}");
?>
		<?php 
foreach ($losPagos as $los_pagos) {
    ?>
				<tr>
					<td><?php 
    echo $los_pagos->pago;
    ?>
</td>
					<td><?php 
    echo $los_pagos->comentario;
    ?>
</td>
					<td><?php 
    echo $los_pagos->personal->nombreCompleto;