<?
session_start();
if(!isset($_SESSION['usuario']))
{
 	echo "<script languaje='JavaScript'>";       
	echo "parent.location.href='index.html'; ";
	echo "</script>";
}
include ("clases/autor.class.php"); $objd = new autor();
include ("clases/curso.class.php");  $objcur = new curso();
include ("clases/doc_curso.class.php"); $objdc = new doc_curso();
//include ("clases/alumno.class.php"); $objalu = new alumno();
//include ("clases/matricula.class.php"); $objmat = new matricula();

$cod = $_REQUEST["id"];
//////////////primero traemos los datos de los docentes y el curso//////////////////
if($objdc->BuscarPorCodigo($cod))
 {
   $idcurso = $objdc->getIdcurso();
    ///////ahora traemos al curso///
	if($objcur->BuscarPorCodigo($idcurso))
	   {
	     $curso = $objcur->getCurso();
	    }
	////////////////////////////////
   $iddoc = $objdc->getIddoc();
   ///////////ahora traemos los datos del docente//////////
   if($objd->BuscarPorCodigo($iddoc))
    {	  
	  $foto = $objd->getFoto();
	  $nom = $objd->getNombres()." ".$objd->getApellidos();
	}
	
	
 }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
	
    <!-- This file has been downloaded from Bootsnipp.com. Enjoy! -->
    <title>CHAT</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/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 src="js/jquery-1.2.1.pack.js"></script>

<style>
.text_docentes{ font-size:12px; font-family:Arial, Helvetica, sans-serif;}
</style>
    <style type="text/css">
        @import url(https://fonts.googleapis.com/css?family=Quicksand:400,300);
body{
    font-family: 'Quicksand', sans-serif;
}
.team{
    padding:5px 0;
}
h6.description{
	font-weight: bold;
	letter-spacing: 2px;
	color: #999;
	border-bottom: 1px solid rgba(0, 0, 0,0.1);
	padding-bottom: 5px;
}
.profile{
	margin-top: 25px;
}
.profile h1{
	font-weight: normal;
	font-size: 20px;
	margin:10px 0 0 0;
}
.profile h2{
	font-size: 12px;
	font-weight: lighter;
	margin-top: 0px;
}
.profile .img-box{
	opacity: 1;
	display: block;
	position: relative;
}
.profile .img-box:after{
	content:"";
	opacity: 0;
	background-color: rgba(0, 0, 0, 0.75);
	position: absolute;
	right: 0;
	left: 0;
	top: 0;
	bottom: 0;
}
.img-box ul{
	position: absolute;
	z-index: 2;
	bottom: 50px;
	text-align: center;
	width: 100%;
	padding-left: 0px;
	height: 0px;
	margin:0px;
	opacity: 0;
}
.profile .img-box:after, .img-box ul, .img-box ul li{
	-webkit-transition: all 0.5s ease-in-out 0s;
    -moz-transition: all 0.5s ease-in-out 0s;
    transition: all 0.5s ease-in-out 0s;
}
.img-box ul i{
	font-size: 20px;
	letter-spacing: 10px;
}
.img-box ul li{
	width: 30px;
    height: 30px;
    text-align: center;
    border: 1px solid #88C425;
    margin: 2px;
    padding: 5px;
	display: inline-block;
}
.img-box a{
	color:#fff;
}
.img-box:hover:after{
	opacity: 1;
}
.img-box:hover ul{
	opacity: 1;
}
.img-box ul a{
	-webkit-transition: all 0.3s ease-in-out 0s;
	-moz-transition: all 0.3s ease-in-out 0s;
	transition: all 0.3s ease-in-out 0s;
}
.img-box a:hover li{
	border-color: #fff;
	color: #88C425;
}
a{
    color:#88C425;
}
a:hover{
    text-decoration:none;
    color:#519548;
}
i.red{
    color:#BC0213;
}
    </style>
	<style>
  h2{
color:#006699;
  }
  label{
color:006699;
  }
  span{
	  color:#673ab7;
	  font-weight:bold;
  }
  
  .btn-primary {
    background-color: #673AB7;
	}
	.display-chat{
		height:480px;
		background-color:#FFFFFF;
		margin-bottom:4%;
		overflow:auto;
		padding:15px;
	}
	.messaje{
		background-color:#ffffff;
		color:#404040;
		border-radius: 5px; border:#999999;
		padding: 5px;
		margin-bottom: 2%;
	}
  </style>
	
	<script>
function guardar(f)
{   if(f.txtnumero.value==""){
		 f.txtnumero.focus();
		 return false;
	}else{
		   f.action='controladores/MesaController.php';
		   f.submit();
		   return true;
		 }
}

function cambiamesa(f){
	   f.action='controladores/PedidoController.php';
	   f.submit();
	   return true;
	}

function editar(f)
{   if(f.txtnumeromod.value==""){
		 f.txtnumeromod.focus();
		 return false;
	}else{
		   f.action='controladores/MesaController.php';
		   f.submit();
		   return true;
		 }
}

function eliminar(f)
{   
		   f.action='controladores/MesaController.php';
		   f.submit();
		   return true;
		 
}
function rellenar(n){
  document.form3.nm.value=n;
}


</script>
 <script>
		  function seleccionar(c){		   
			 document.form2.action='listaproductos.php?idmesa='+c;
			 document.form2.submit();
			 return true;
			 }

</script>

<script>

 /*     $(document).ready(function(){
        // Set trigger and container variables
        var trigger = $('.container .display-chat '),
            container = $('#content');
        
        // Fire on click
        trigger.on('click', function(){
          // Set $this for re-use. Set target from data attribute
          var $this = $(this),
            target = $this.data('target');       
          
          // Load target page into container
          container.load(target + '.php');
          
          // Stop normal link behavior
          return false;
        });
      });*/
    </script>
</head>
<body>


  <div class="container">
    <div class="row"><a href="listaentradas.php" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-share" aria-hidden="true"></span></a>
				<p class="bg-success"><img src="fotos/<?=$foto;?>" width="85" height="85" class="img-thumbnail img-circle" /> 
	                 Docente Encargado: <?=$nom;?>  | <a href="pagdocente.php?id=<?=$iddoc;?>" target="trabajos">Mi pagina</a>			   </p>
                <table width="100%" >
    
    <tr>
      <td><table class="table table-responsive">
        
        <tr>
          <td colspan="2" class="titulo-mantenimiento">SALON DEL CURSO DE <?php echo $curso;?>  <a href="chatpage.php?id=<?=$cod;?>" class="close" data-dismiss="modal" aria-hidden="true" target="chat"><span class="glyphicon glyphicon-send" aria-hidden="true"></span> Chat Grupal</a> </td>
		  <td width="18%">
		  <a href="reuniones_activas.php?id=<?=$cod;?>" class="close" aria-hidden="true" target="chat"><span class="glyphicon glyphicon-facetime-video" aria-hidden="true"></span>Reuniones</a>		  </td>
        </tr>
        <tr>
          <td width="44%" valign="top">
		   
	<div class="display-chat" id = "display-chat">
	 <div id="messaje"></div>
		  </div>		  </td>
          <td colspan="2"><iframe name="chat" width="100%" height="500" id="clases" frameborder="0" src="reuniones_activas.php?id=<?=$cod;?>"></iframe></td>
		  </tr>
      </table></td>
    </tr>
  </table>
    </div>
  </div>


</body>
</html>
<script>
$(document).ready(function(){   
   setInterval(function()
  {
      $('#messaje').load('salon_detalle.php?id=<?php echo $cod;?>');
  },1000);
});
</script>