<?
session_start();
if(!isset($_SESSION['usuario']))
{
 	echo "<script languaje='JavaScript'>";       
	echo "parent.location.href='index.php'; ";
	echo "</script>";
}
include ("clases/alumno.class.php");
include ("clases/autor.class.php"); $objau = new autor();
include ("clases/curso.class.php"); $objcur = new curso();
include ("clases/matricula.class.php");
include ("clases/blog.class.php"); 
include ("clases/carrera.class.php"); $objcar = new carrera();
include ("clases/doc_curso.class.php"); $objdc = new doc_curso();
$objd = new alumno();
$id = $_REQUEST["id"];
if($objd->BuscarPorCodigo($id))
	{
	  $nombre = $objd->getNombres();
	  $apellido = $objd->getApellidos();
	  $email = $objd->getEmail();
	  $foto = $objd->getFoto();
	  $dir = $objd->getDireccion();
	  $tel = $objd->getTelefono();
	  $f = $objd->getFechanaci();
	  $es = $objd->getEspecialidad();
	  if($objcar->BuscarPorCodigo($es))
	   {
	      $carrera = $objcar->getNombre();
	   }
	  $idalu = $objd->getIdalu();
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Perfil Alumno</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="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 language="javascript">
function envia2(id)
	{ 
	  window.open("modificaalu.php?id="+id,"","fullscreen=no, height=470,width=620,left=150,top=100,resizable = yes,scrollbars=yes,toolbar = no,status = no");						
	}
	function envia(id)
	{ 
	  window.open("manclase.php?id="+id,"","fullscreen=no, height=270,width=620,left=100,top=200,resizable = yes,scrollbars=yes,toolbar = no,status = no");						
	}
	function envia3(id)
	{ 
	  window.open("manaviso.php?id="+id,"","fullscreen=no, height=220,width=620,left=100,top=200,resizable = yes,scrollbars=yes,toolbar = no,status = no");						
	}
	
</script>

<style>
.text_docentes{ font-size:12px; font-family:Arial, Helvetica, sans-serif;}
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<div class="col-md-12">    
	  <div class="panel-heading">
	     <h4><p class="bg-info"><a href="#" target="trabajos" data-title="foto" data-toggle="modal" data-target="#foto">
		       <img src="fotosa/<? if($foto==""){echo "student.png";}else{echo $foto;}?>" width="95" height="95" class="img-thumbnail img-circle">
			 </a>
			 
			 <?=$nombre;?> <?=$apellido;?>  <span class="text-muted"> <? //$email;?> / 
		     <a href="listaentradas.php" class="close" data-dismiss="modal" aria-hidden="true">
			   <span class="glyphicon glyphicon-share" aria-hidden="true"></span>			 </a>
		 Estudiante de:<?=$carrera;?>
	      
	      <? //$f;?></span>	 </p>   </h4>
	  </div>			
  </div>
  <div class="col-md-4">  
    <div class="panel panel-primary">
              <div class="panel-heading">CURSOS INSCRITOS 
                <input type="hidden" name="text" value="R" />
                  <input type="hidden" name="iddoc" value="<?=$cod;?>" class="inputbox" />
			  </div>
     <table class="table">
            <? 
			  
			  $objm = new matricula();			  
			  $lista=$objm->ListarPorAlumno($idalu);
			 
			  for($i = 0; $i<count($lista); $i++)
			  {
			    if($objdc->BuscarPorCodigo($lista[$i]["iddoc_curso"])){
				      $lista[$i]["iddoc"]=$objdc->getIddoc(); 
					  if($objau->BuscarPorCodigo($lista[$i]["iddoc"]))
					   {
					     $lista[$i]["nombres"]=$objau->getNombres();
						 $lista[$i]["apellidos"]=$objau->getApellidos();
					   }
					  $lista[$i]["idcurso"]=$objdc->getIdcurso(); 
					  if($objcur->BuscarPorCodigo($lista[$i]["idcurso"]))
					   {
					     $lista[$i]["curso"]=$objcur->getCurso();
					   }
				 }	 
			  ?>
            <tr onmouseover="this.style.backgroundColor='#f5f5f5'" onmouseout="this.style.backgroundColor='#FFFFFF'" class="Estilo1">
              <td width="65%"><?= $lista[$i]["curso"];?></td>
              <td width="35%" align="center"><a href="listatrabajos.php?id=<?=$lista[$i]["idmatricula"];?>" target="trabajos"> </a></td>
            </tr>
            <?
			  }
			  ?>
          </table>
	  </div>
  </div>
  
  <div class="col-md-7">
    <div class="panel panel-danger">
       <div class="panel-heading">
		            <center>
		                <input type="hidden" name="iddoc2" value="<?=$cod;?>" class="inputbox" />
		                <input type="hidden" name="text2" value="R" />
	                  ULTIMAS PUBLICACIONES EN BLOG:
		            </center>
      </div>
	  <table class="table">
      			 <? 
			  $obj = new blog();		  
			 
			  $lista = $obj->ListaUltimos($id);
			  
			  for($i = 0; $i<count($lista); $i++)
			  {
			     echo "<div class='form-group'>";
			  ?>
			  <tr onmouseover="this.style.backgroundColor='#f5f5f5'" onmouseout="this.style.backgroundColor='#FFFFFF'">
			  <td width="65%"><span class="glyphicon glyphicon-ok"></span> <?=$lista[$i]["titulo"];?>  <?="(Pub:".$lista[$i]["fechareg"].")";?> <a href="frmblogver.php?idblog=<?= $lista[$i]["idblog"];?>&idpersona=<?php echo $id;?>"> <span class="glyphicon glyphicon-search"></span></a></td>
			  </tr>
				  <?
				  echo "</div>";
				  }
				  ?>
				  </table>
  </div>
 </div>
 </div>
  <table width="100%" class="table-responsive" >
    
    <tr>
      <td width="36%" height="16" colspan="2"><table width="100%" border="0" class="v2-collapse-shadow">
        
        <tr>
          <td width="100%" colspan="2" >&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2" valign="top"><iframe name="trabajos" width="100%" height="300" id="clases" frameborder="0"></iframe></td>
          </tr>
      </table></td>
    </tr>
  </table>
</form>


<div class="modal fade" id="foto" 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">Gracias por visitarme</h4>
			  </div>
			  <div class="modal-body">
				<div class="form-group">
					<img src="fotosa/<?=$foto;?>" class="img-thumbnail" />
				</div>
			  </div>
			  <div class="modal-footer ">
				   <?=$nombre;?> <?=$apellido;?>		
			  </div>
        </div>
    <!-- /.modal-content --> 
       </div>
      <!-- /.modal-dialog --> 
  </div>
  
</body>

</html>
