<?php
/* @var $this AsociadoCuentaBancoController */
/* @var $model AsociadoCuentaBanco */

$this->breadcrumbs=array(
	'Asociado Cuenta Bancos'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List AsociadoCuentaBanco', 'url'=>array('index')),
	array('label'=>'Create AsociadoCuentaBanco', 'url'=>array('create')),
	array('label'=>'Update AsociadoCuentaBanco', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete AsociadoCuentaBanco', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage AsociadoCuentaBanco', 'url'=>array('admin')),
);
?>

<h3 style="text-align: center">Cuentas de banco registradas</h3>
<?php
$this->widget('bootstrap.widgets.TbAlert', array(
    'block' => true, // display a larger alert block?
    'fade' => true, // use transitions?
    'closeText' => '×', // close link text - if set to false, no close link is displayed
    'alerts' => array(// configurations per alert type
        'success' => array('block' => true, 'fade' => true, 'closeText' => '×'), // success, info, warning, error or danger
        'error' => array('block' => true, 'fade' => true, 'closeText' => '×'), // success, info, warning, error or danger
    ),
));
?>
<?php  
// if (Yii::app()->user->checkAccess('reportes_cuenta_banco_admin')) {
    $this->widget('bootstrap.widgets.TbButtonGroup', array(
        'type' => 'action', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
        'buttons' => array(
            array('label' => 'Reportes', 'type' => 'danger', 'icon' => 'icon-file icon-white', 'items' => array(
                    array('label' => 'Reporte General', 'icon' => 'icon-print', 'target' => '_blank', 'url' => array('reporte')),
                    //array('label' => 'Crear Txt', 'icon' => 'icon-print', 'target' => '_blank', 'url' => array('credito/txt')),
                )),
        ),
    ));
// }
?>


<?php $this->widget('bootstrap.widgets.TbGridView', array(
	'id'=>'asociado-cuenta-banco-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		[
			'name'=>'cedula',
			'value'=>'$data->idAsociado->cedula',
			// 'filter'=>'id_banco',

		],[
			'name'=>'nombres',
			'value'=>'$data->idAsociado->nombre',
			// 'filter'=>'id_banco',

		],[
			'name'=>'apellidos',
			'value'=>'$data->idAsociado->apellidos',
			// 'filter'=>'id_banco',

		],
		[
		      'header'=>'Empresa',
		      'name'=>'oficina',
		      'value' => '($data->idAsociado->lugartrabajo0)?$data->idAsociado->lugartrabajo0->descripcion:""',
		      'filter' => CHtml::listData(LugarTrabajo::model()->findAll(array('order'=>'descripcion asc')), 'idlugartrabajo', 'descripcion'),
		],
    [
      'header'=>'Unidad',
      'name'=>'unidad',
      'value' => '($data->idAsociado->unidad)?$data->idAsociado->unidad->descripcion:""',
      'filter'=>CHtml::listData(Unidad::model()->findAllByAttributes(array(),"idlugartrabajo = :empresa",array(':empresa'=>(int)$model->oficina)),
      'idunidad','descripcion')
    ],

    [
			'name'=>'id_banco',
			'value'=>'$data->idBanco->descripcion',
			 'filter' => CHtml::listData(Banco::model()->findAll(array('order'=>'descripcion asc')), 'idbanco', 'descripcion'),

		],
		[
			'name'=>'cuenta_corriente',
			'value'=>'($data->cuenta_corriente)?"Cuenta Corriente":"Cuenta de Ahorro"',
			// 'filter'=>'id_banco',

		],
		[
			'name'=>'cuenta_principal',
			'value'=>'($data->cuenta_principal)?"Si":"No"',
			'filter'=>['1'=>'Si','0'=>'No'],

		],
		'cuenta_bancaria',
		array(
			 'header'=>'Acciones',
		      'class'=>'bootstrap.widgets.TbButtonColumn',
		      'htmlOptions'=>array('width'=>'80'),
		        /*{ecuenta}*/
		      'template' => '{update}{delete}',
		),
	),
)); ?>
