<?php $__env->startSection('CSS'); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('Contenido'); ?>
<div class="row">
	<div class="col-md-12">
		<h2><i class="fa fa-video-camera"></i> Video Tutoriales </h2>
	</div><!--/col-md-12-->
</div><!--/row-->

<div class="row">
	<div class="col-md-12">
		<div class="block-web">
			<div class="header"> <h3 class="content-header"> Listado de módulos de video tutoriales </h3> </div>
			<div class="porlets-content">
				<div class="table-responsive">
					<table class="table table-hover">
						<thead>
							<tr>
								<th class="col-md-2"> Título </th>
								<th> Descripción </th>
								<th class="col-md-3"> Mantenimiento </th>
							</tr>
						</thead>
						<tbody>
							<?php $__empty_1 = true; foreach($Modulos as $Modulo): $__empty_1 = false; ?>
							<tr>
								<td> <?php echo $Modulo->titulo; ?> </td>
								<td> <?php echo $Modulo->descripcion; ?> </td>
								<td>
									<?php echo HTML::linkRoute('SysWebVTutorialesModulosEditar', 'Editar', array($Modulo->id), array('class' => 'btn btn-warning')); ?>

									<?php echo Form::button('Eliminar', array('class' => 'btn btn-danger', 'onclick' => 'Eliminar('.$Modulo->id.')')); ?>

									<?php echo HTML::linkRoute('SysWebVTutorialesModulosVideos', 'Videos', array($Modulo->id), array('class' => 'btn btn-success')); ?>

								</td>
							</tr>
							<?php endforeach; if ($__empty_1): ?>
							<tr class="danger"> <td colspan="3"> No existe ningún módulo agregado </td> </tr>
							<?php endif; ?>
						</tbody>
					</table>
				</div>
			</div>
			<div class="bottom">
				<?php echo HTML::linkRoute('SysWebVTutorialesModulosAgregar', 'Agregar', array(), array('class' => 'btn btn-primary')); ?>

			</div>
		</div>
	</div>
</div><!--/row end-->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('JS'); ?>
<script type="text/javascript">
	function Eliminar(id){
		var id = id;
		$.post(
			"<?php echo URL::route('SysWebVTutorialesModulosEliminar'); ?>",
			{id:id},
			function(data){
				if(data.success){
					new PNotify({ title: "Realizado", text: data.mensaje, type: "success" });
					setInterval(function(){ window.location.href = "<?php echo URL::route('SysWebVTutorialesModulos'); ?>"; }, 1000);
				}
				else{
					if(data.mensaje != ""){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
				}
			},
			"json"
		);
	}
</script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('JSOr'); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('BaseSistemaWeb', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>