<? include ("clases/clases.class.php");
include ("clases/doc_curso.class.php");
include ("clases/curso.class.php");
include ("clases/autor.class.php");
include ("clases/tarea.class.php"); $objtarea = new tarea();
$objdc = new doc_curso(); $objc = new curso(); $objd = new autor();
$cod=$_REQUEST['id'];
if($objdc->BuscarPorCodigo($cod)){
     $idcurso =  $objdc->getIdcurso();
	 if($objc->BuscarPorCodigo($idcurso)){$curso = $objc->getCurso();}
	 $iddoc =  $objdc->getIddoc();
	 if($objd->BuscarPorCodigo($iddoc)){$nom = $objd->getNombres()." ".$objd->getApellidos();}
   }
///////////////////////////////   
$obja=new clases();    
?>
<html>
	<head><title>mi web</title>
	<meta charset="UTF-8">
    <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="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>
		</head>
	
	<script language="javascript">
	function consultar(f){
	f.action = 'mandocente.php';
	f.submit();return true;
	}
	
	</script>
	<body>
	<form action="controladores/procesaclases.php" method="post" enctype="multipart/form-data" name="f">
	<div class="container">
	  <input type="hidden" name="iddoc_curso" value="<?=$cod;?>">
	  
		          <div class="panel-heading">
		            <h3>
		              Clases/Temas/Recursos del curso de: <?=$curso;?>
		              <a href="datoscurso.php?curso=<?=$cod;?>" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-share" aria-hidden="true"></span></a>
					</h3>
		          </div>
				  <table class="table table-responsive">				    
				    <? 			  
				  $lista=$obja->ListarVisibles($cod);			  
				  for($i = 0; $i<count($lista); $i++)
				  {
				   echo "<div class='form-group'>";
				  ?>
				   <tr>
				     <td>
				  <span class="glyphicon glyphicon-ok"></span> <a href="temas/<?=$lista[$i]["archivo"];?>"><?=$lista[$i]["clase"];?></a>  
				    </td>
				   </tr>
				   <tr>
				        <td>
						    <strong>ACTIVIDAD(ES):</strong><br>
							<?php
							    $tareas = $objtarea->ListarPorClase($lista[$i]["idclases"]);
								for($j=0;$j<count($tareas);$j++){
								  // if($tareas[$j]["fechalimite"]>=date("Y-m-d")){
								     echo "-".$tareas[$j]["titulo"].", Fecha Limite de entrega: ".date("d-m-Y", strtotime($tareas[$j]["fechalimite"]))." <a href='mantrabajo.php?idtarea=".$tareas[$j]['idtarea']."'><span class='glyphicon glyphicon-cloud-upload'></span></a><br>";
								  // }else{echo "";}
								}	
							?>
						</td>
				   </tr>
				  <?
				  echo "</div>";
				  }
				  ?>
				  </center>
	</form>

	</body>	
</html>