<?php
/* @var $this OrdenPagoController */
/* @var $model OrdenPago */
Yii::import('application.modules.contable.models.ParametrosBancos');

$this->breadcrumbs=array(
	'Orden Pagos'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List OrdenPago', 'url'=>array('index')),
	array('label'=>'Create OrdenPago', 'url'=>array('create')),
	array('label'=>'Update OrdenPago', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete OrdenPago', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage OrdenPago', 'url'=>array('admin')),
);
?>
<h3 style="text-align: center">Aprobar orden de pago masivo</h3>
<hr>
<div class="form">
		<table class="table table-bordered table-striped table-hover items table table-striped table-bordered table-condensed" >
            <tr class="info" >
              <td style="text-align: center"><b><?= $model->getAttributeLabel('nombre_archivo')?></b></td>
              <td style="text-align: center"><b><?= $model->getAttributeLabel('cant_pago')?></b></td>
              <td style="text-align: center"><b><?= $model->getAttributeLabel('fecha_pago')?></b></td>
              <td style="text-align: center"><b><?= $model->getAttributeLabel('total_pago')?></b></td>
              <td style="text-align: center"><b><?= $model->getAttributeLabel('descripcion')?></b></td>
            </tr>
            <tr>
              <td style="text-align: center"><?= $model->nombre_archivo?></td>
              <td style="text-align: center"><?= $model->cant_pago?></td>
              <td style="text-align: center"><?= date('d-m-Y',strtotime($model->fecha_pago))?></td>
              <td style="text-align: center"><?= number_format($model->total_pago,2,',','.')?></td>
              <td style="text-align: center"><?= $model->descripcion?></td>
            </tr>
          </table>	<hr>

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'orden-pago-aprobar-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="help-block text-center">Campos con <span class="required">*</span> son requerido.</p>

	    <div class="alert alert-info">
           	<div class="row">
           		<div class="span3"><h3>Datos bancarios</h3></div>
           		<div class="span6">
	           		<div class="row">
				        <?= $form->dropDownListRow($modelProcesoPago,'id_banco',  CHtml::listData(ParametrosBancos::model()->findAll(array('condition'=>'estatus=true and blnborrado=false')),'id','descripcion'),
	                                                                    ['style'=>"width:100%",'prompt'=>'-- SELECCIONE EL BANCO--']); ?>
	           		</div>
	                <div class="row">
	                    <?php echo CHtml::label('<strong>Fecha del pagado:</strong>',''); ?>
	                    <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
	                              'model' => $modelProcesoPago,
	                              'attribute' => 'fecha_pago',
	                              'value' => $modelProcesoPago->fecha_pago,
	                              'language' => 'es',
	                              'htmlOptions' => array('readonly' => "readonly", 'class' => 'input-xlarge'),
	                              //additional javascript options for the date picker plugin
	                              'options' => array(
	                                  'autoSize' => true,
	                                  'defaultDate'=>'03-03-2011',
	                                  //'dateFormat'=>'yy-m-d',
	                                  'dateFormat' => 'dd-mm-yy',
	                                  'buttonImage' => Yii::app()->baseUrl . '/images/calendar.png',
	                                  'buttonImageOnly' => true,
	                                  'buttonText' => 'Fecha',
	                                  'selectOtherMonths' => true,
	                                  'showAnim' => 'slide',
	                                  'showButtonPanel' => true,
	                                  'showOn' => 'button',
	                                  'changeMonth' => 'true',
	                                  'changeYear' => 'true',
	                                  'maxDate'=> "+0D",
	                              ),
	                        'htmlOptions'=>array('value'=>date('d-m-Y'))
	                          ));
	                    ?>
	                    <?php echo $form->error($modelProcesoPago,'fecha_pago') ;?>
	                </div>
	               <div class="row">
	                   <?php echo $form->textFieldRow($modelProcesoPago,'referencia', array('style'=>'width: 100%;')); ?>
	               </div>
	               <div class="row">
	                   <?php echo $form->textareaRow($modelProcesoPago,'observacion', array('style'=>'width: 100%;')); ?>
	               </div>
           			
           		</div>
           </div>        
    </div>
    <hr>
	<div class="row buttons text-right">
		<?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'type' => 'success',
            'buttonType' => 'submit',
            'id' => 'btn_registrar',
            'icon' => 'icon-ok',
            'label' => 'Pagar nómina',
//                        'htmlOptions'=>array('onclick'=>'aprobarla()'),
        ));?>
        &nbsp;
        <?php $this->widget('bootstrap.widgets.TbButton', array(
            'type' => 'info',
            'id' => 'btn_registrar',
            'label' => 'Regresar',
            'icon' => 'icon-circle-arrow-left',
            'url' => Yii::app()->createUrl('pagos/datosNominaOrdenPago/admin'),
        ));
        ?>       
	</div>

<?php $this->endWidget(); ?>
