<?php
    include ("clases/clases.class.php");
include ("clases/doc_curso.class.php");
include ("clases/curso.class.php");
include ("clases/autor.class.php");
include ("clases/curso_info.class.php");$objci = new curso_info();
include ("clases/matricula.class.php"); $objmat = new matricula();
$objdc = new doc_curso(); $objc = new curso(); $objd = new autor();
$cod=$_REQUEST['dc'];
if($objdc->BuscarPorCodigo($cod)){
     $idcurso =  $objdc->getIdcurso();
	 if($objc->BuscarPorCodigo($idcurso))
	    {$nombrecurso = $objc->getCurso();
		 $bv = $objc->getBienvenida();
		 $ic = $objc->getCursoinfo();
		}
	 $iddoc =  $objdc->getIddoc();
	 if($objd->BuscarPorCodigo($iddoc))
	    {$nom = $objd->getNombres()." ".$objd->getApellidos();
		 $foto = $objd->getFoto();
		}
   }
  
/*  if($objmat->BuscarPorDocCur($cod))
  {
    $idmatricula = $objmat->getIdmatricula();
  }*/
?>
<!DOCTYPE html>
<html>
<head>
<title>EL CURSO</title>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="Shortcut Icon" type="image/x-icon" href="assets/icons/book.ico" />
	<script src="editor/ckeditor/ckeditor.js" type=text/javascript></script>
    <script src="js/sweet-alert.min.js"></script>
    <link rel="stylesheet" href="css/sweet-alert.css">
    <link rel="stylesheet" href="css/material-design-iconic-font.min.css">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/jquery.mCustomScrollbar.css">
    <link rel="stylesheet" href="css/timeline.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/jquery-1.11.2.min.js"><\/script>')</script>
    <script src="js/modernizr.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script src="js/main.js"></script>
	
	
	
	<script>
	function editar(f)
	{    		
	   f.action='controladores/procesacurso.php';
	   f.submit();
	   return true;			
	}
	
	
	function guardar(f)
	{
	  if(f.recurso.value=="")
	    {f.recurso.focus();return false;}
	   if(f.file.value=="")
	    {f.file.focus();return false;}
		
		f.action='controladores/procesarecurso.php';
	   f.submit();
	   return true;
	}
	</script>

</head>

<body>

<form name="form1" method="post" action="">
<div class="panel-heading">
    <h1>     Curso de: <?=$nombrecurso;?>  
        <a href="listaentradas.php" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-share" aria-hidden="true"></span></a>
	</h1>	
</div>
<table width="100%" border="0" style="margin:10px 5px">
  <tr>
    <td colspan="2" valign="top" scope="col">
	<section class="full-reset text-center" style="padding: 10px 0;"> 
	       <article class="tile"><a href="matriculados.php?id=<?=$cod;?>">
                <div class="tile-icon full-reset"><i class="zmdi zmdi-male-female"></i></div>
                <div class="tile-name all-tittles" style="width: 90%;">Alumnos Inscritos</div>
                <div class="tile-num full-reset">01</div></a>            </article>            
            <article class="tile"><a href="manclase.php?id=<?=$cod;?>">
                <div class="tile-icon full-reset"><i class="zmdi zmdi-book"></i></div>
                <div class="tile-name all-tittles">Clases</div>
                <div class="tile-num full-reset">02</div></a>            </article>
            
            <article class="tile"><a href="salon.php?id=<?=$cod;?>">
                <div class="tile-icon full-reset"><i class="zmdi zmdi-assignment-account"></i></div>
                <div class="tile-name all-tittles">Sal&oacute;n</div>
                <div class="tile-num full-reset">03</div></a>            </article>
			<article class="tile"><a href="listareunion.php?id=<?=$cod;?>">
                <div class="tile-icon full-reset"><i class="zmdi zmdi-timer"></i></div>
                <div class="tile-name all-tittles">Reuniones</div>
                <div class="tile-num full-reset">04</div></a>            </article>
			<article class="tile"><a href="manaviso.php?iddc=<?=$cod;?>">
                <div class="tile-icon full-reset"><i class="zmdi zmdi-assignment"></i></div>
                <div class="tile-name all-tittles">Avisos</div>
                <div class="tile-num full-reset">05</div></a>            </article>
			<article class="tile"><a href="manforo.php?iddc=<?=$cod;?>">
                <div class="tile-icon full-reset"><i class="zmdi zmdi-comment" ></i></div>
                <div class="tile-name all-tittles">Foros</div>
                <div class="tile-num full-reset">06</div></a>            </article>
	      </section>	</td>
    </tr>
  <tr>
    <th colspan="2" valign="top" scope="col"><hr></th>
    </tr>
  <tr>
    <th width="103" rowspan="2" valign="top" scope="col"><img src="fotos/<? if($foto==""){echo "student.png";}else{echo $foto;}?>" width="95" height="95" class="img-thumbnail img-circle"></th>
    <td scope="col" valign="top"><strong>PRESENTACIÓN</strong> <a href="editcurso.php?cur=<?=$idcurso;?>&dc=<?=$cod;?>" data-dismiss="modal" aria-hidden="true" data-title="Edit" ><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a></td>
  </tr>
  <tr>
    <td width="1761" valign="top"><table width="75%" border="0">
  <tr>
    <td scope="col"><div align="justify">
      <?=$bv;?>
    </div></td>
  </tr>
</table>

	</td>
  </tr>
  <tr>
    <th colspan="2" valign="top" scope="col"><hr></th>
    </tr>
  <tr>
    <td colspan="2" valign="top" scope="col">
	<div class="form-group">
		  <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
		  <div class="panel panel-default">
              <div class="panel-heading" role="tab" id="headingTwo">
			  		<h4 class="panel-title">
        			<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
			 		 	<span class="glyphicon glyphicon-search"></span> Informacion del Curso </a> 
						<a href="#" target="trabajos" data-id="<?=$idalu;?>" data-title="Editar" data-toggle="modal" data-target="#recurso" class="btn btn-default"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
						</h4>
			  </div>
			  <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
					  <table border="0">			    
					<tr>
					  <td>
						<table border="0"  class="table table-responsive">
						  
						  <? 
				  
				  $lista=$objci->ListarPorDoccur($cod);			  
				  for($i = 0; $i<count($lista); $i++)
				  {
				  ?>
						  <tr>
							<td><span class="glyphicon glyphicon-ok"></span></td>
							<td><?= $lista[$i]["recurso"];?></td>							
							<td><a href="recursos/<?= $lista[$i]["archivo"];?>" data-toggle="tooltip" title="Descargar Clase"><span class="glyphicon glyphicon-download-alt"></span></a></td >							
							<td><a href="controladores/procesarecurso.php?id=<?=$lista[$i]['idci'];?>&text=e&iddoccur=<?=$lista[$i]['iddoc_curso'];?>" onClick="return confirmar();" data-toggle="tooltip" title="Eliminar"><span class="glyphicon glyphicon-trash"></span></a></td >
						  </tr>
                      
                      <?
			  }
			  ?>
                    </table></td>
      			</tr>
		      </table>
		     </div>
	 </div>
  </div>	</td>
    </tr>
	<tr>
	   <td colspan="2">	         </td>
	</tr>
</table>

</form>

<form name="form2" action="" method="post" enctype="multipart/form-data">
        <input type="hidden" name="iddoc_curso" value="<?=$cod;?>">
		<input type="hidden" name="text" value="R">
<div class="modal fade" id="recurso" tabindex="-1" role="dialog" aria-labelledby="nuevo" aria-hidden="true">
      <div class="modal-dialog">
    <div class="modal-content">
          <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
        <h4 class="modal-title custom_align" id="Heading">Registrar Informacion / Recurso</h4>
      </div>
          <div class="modal-body">
          <div class="form-group">Especificacion:
         <input name="recurso" type="text" value="" size="35" class="form-control" >
		</div>
		<div class="form-group">Archivo:
		<input type="file" name="file" class="form-control">
		<input type="hidden" name="MAX_FILE_SIZE" value="4000000">	
		</div>			
       
      </div>
          <div class="modal-footer ">
        <button type="button" class="btn btn-success btn-lg" style="width: 100%;" onClick="guardar(this.form);"><span class="glyphicon glyphicon-ok-sign"></span>Guardar</button>
		
      </div>
        </div>
    <!-- /.modal-content --> 
  </div>
      <!-- /.modal-dialog --> 
  </div>
</form>   

</body>
</html>
