<?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 recursos descargables del video <?php echo $Video->titulo; ?> </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> Recurso </th>
								<th class="col-md-2"> Mantenimiento </th>
							</tr>
						</thead>
						<tbody>
							<?php $__empty_1 = true; foreach($RecursosDescargables as $Recurso): $__empty_1 = false; ?>
							<tr>
								<td> <?php echo $Recurso->titulo; ?> </td>
								<td>
									<?php
										$ext = pathinfo($Recurso->ruta, PATHINFO_EXTENSION);
									?>
									<?php if($ext == 'xlsx'): ?>
									<img class="img-thumbnail" src="https://s3-us-west-2.amazonaws.com/biblioteca-img-clientes/6141-GZPHOgVWHJFRZYUipKmcxOmmljqBLf.png" style="width: 200px;">
									<?php elseif($ext == 'docx'): ?>
									<img class="img-thumbnail" src="https://s3-us-west-2.amazonaws.com/biblioteca-img-clientes/6141-1xq6V2Yp9JuybsnunL9tq4gln8uWvK.png" style="width: 200px;">
									<?php elseif($ext == 'pdf'): ?>
									<div class="embed-responsive embed-responsive-4by3">
										<iframe class="embed-responsive-item" src="<?php echo asset('SysWeb/VideoTutoriales/RecursosDescargables/'.$Recurso->ruta); ?>"> </iframe>
									</div>
									<?php else: ?>
									<img class="img-thumbnail" src="https://s3-us-west-2.amazonaws.com/biblioteca-img-clientes/6141-ig7OdRu3xjzgtXHgm2epiJGnUh88rn.png" style="width: 200px;">
									<?php endif; ?>
								</td>
								<td>
									<?php echo Form::button('Eliminar', array('class' => 'btn btn-danger', 'onclick' => 'Eliminar('.$Recurso->id.')')); ?>

								</td>
							</tr>
							<?php endforeach; if ($__empty_1): ?>
							<tr class="danger"> <td colspan="3"> No existe ningún recurso descargable agregado </td> </tr>
							<?php endif; ?>
						</tbody>
					</table>
				</div>
			</div>
			<div class="bottom">
				<?php echo HTML::linkRoute('SysWebVTutorialesModulosVideosRecursosAgregar', 'Agregar', array($Modulo->id, $Video->id), 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){
		if(confirm("Estas seguro de que deseas eliminar este archivo")){
			var id = id;
			$.post(
				"<?php echo URL::route('SysWebVTutorialesModulosVideosRecursosEliminar', array($Modulo->id, $Video->id)); ?>",
				{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('SysWebVTutorialesModulosVideosRecursos', array($Modulo->id, $Video->id)); ?>"; }, 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(); ?>