<div class="row">
	<div class="col-md-11">
		<h2><?php echo $proveedor->nombre_proveedor;?></h2>
		<span class=""><?php echo $proveedor->razonsocial_proveedor;?></span>
		<p>
			<small><?php echo $proveedor->giro_proveedor;?></small>
		</p>
	</div>
	<div class="col-md-1">
		<div class="input-group">
			<button class="btn btn-link dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v fa-2x"></i></button>
			<ul class="dropdown-menu">
				<li><a href="javascript:void(0)" <?php if($permiso_eliminarctaxpagar):?>onclick="deudas.eliminar(<?php echo $proveedor->id_proveedor;?>,'<?php echo $proveedor->nombre_proveedor;?>','<?php echo $saldo;?>')"<?php else:?>onclick="error_noacces()"<?php endif;?>><i class="fa fa-times"></i> Eliminar record</a></li>
				<li class="divider"></li>
				<li><a <?php if($permiso_exportarxpagar):?>href="<?php echo base_url("reportes/reporte_deudas_proveedor");?>?idproveedor=<?php echo $proveedor->id_proveedor;?>" target="_blank"<?php else:?>onclick="error_noacces()"<?php endif;?>><i class="fa fa-file-pdf-o"></i> Exportar creditos</a></li>
			</ul>
		</div>
	</div>
</div>
<div class="hr-line-dashed"></div>
<div class="row">
	<div class="col-sm-12">
		<label class="control-label">Saldo Total:</label>
		<span class="">$ <?php echo $saldo;?></span>
	</div>
</div>
<div class="hr-line-dashed"></div><?php echo $permiso_eliminarctaxpagar;?>
<!--tabla-->
<h3>Cr&eacute;ditos activos</h3>
<div id="cxp-creditos-tabla">
	<?php if(count($deudas)>0):?>
	<div class="table-responsive">
		 <table id="table-cxp-creditos" class="table table-striped table-hover">
			<thead>
				<tr>
					<th>ID</th>
					<th>Monto</th>
					<th>Saldo</th>
					<th>Final</th>
					<th>Estado</th>
					<th>Acciones</th>
				</tr>
			</thead>
			<tbody>
				<?php foreach($deudas as $deuda):?>
				<tr>
					<td><?php echo $deuda->id_deuda;?></td>
					<td><?php echo $deuda->monto_deuda;?></td>
					<td><?php echo $deuda->saldo_deuda;?></td>
					<td><?php echo $deuda->finalizacion_deuda;?></td>
					<td>
						<?php switch($deuda->estado_deuda):
						case 0:?>
						<span class="label label-info">Activo</span>
						<?php break; case 1:?>
						<span class="label">Liquidado</span>
						<?php break; endswitch;?>
					</td>
					<td>
						<button class="btn btn-primary btn-xs modal-trigger" data-target="<?php echo base_url("proveedores/deudasdetalles");?>?id=<?php echo $deuda->id_deuda;?>">Ver</button>
					</td>
				</tr>
				<?php endforeach;?>
			</tbody>
		</table>
	</div>
	<?php else:?>
	<span>No hay creditos para este cliente</span>
	<?php endif;?>
</div>