<? include ("clases/aviso.class.php");
$cod=$_REQUEST['iddc'];
$obja=new aviso();
//if($obja->BuscarPorDocente($cod)){ 
 ///  $iddocente=$obja->getIddoc();   
 //  }  
   
   
?>
<html>
	<head><title>MIS AVISOS</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>

<script src="editor/ckeditor/ckeditor.js" type=text/javascript></script>

	</head>
	
	<script language="javascript">
	function consultar(f){
	f.action = 'mancurso.php';
	f.submit();return true;
	}
	
	function grabar(f)
	{
	   if(f.aviso.value=="")
	   {  alert("Debe ingresar un Aviso");
	      f.aviso.focus();
		  return false;
	   }	   
	   f.action = 'controladores/procesaaviso.php';
	   f.submit();
	   return true;
	}
	
	</script>
	
	<script>
function confirmar()
{
	if(confirm('Estas seguro de Eliminar el Registro?'))
		return true;
	else
		return false;
}
</script>
	<body >
	<div class="panel-heading">
    <h4>      REGISTRAR AVISOS :  
	             
    </a><a href="datoscargalectiva.php?dc=<?=$cod;?>" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-share" aria-hidden="true"></span></a></h4>
</div>  
	
<form name="f" action="" method="post">
<div class="container">
			<input type="hidden" name="text" value="R">
                <input type="hidden" name="iddoc" value="<?=$cod;?>" class="inputbox">
				<div class="form-group">                
				<textarea name="aviso" id="aviso"  class="form-control" placeholder="Ingrese su Aviso" >               
            </textarea><script>
                CKEDITOR.replace( 'aviso' );
            </script>
				</div>
				<div class="form-group">
                <input type="button" name="b" value="Registrar" class="btn btn-success btn-lg" onClick="grabar(this.form);">
             </div>
              <table class="table table-responsive">    
                  <? 
				   echo "<strong>Descripcion de Avisos</strong> ";	
			  $obj = new aviso();		  
			 
			  $lista = $obj->ListarPorDoccurso($cod);
			  
			  for($i = 0; $i<count($lista); $i++)
			  {
			     echo "<div class='form-group'>";
			  ?>
			    <tr>
				  <td valign="top"><span class="glyphicon glyphicon-ok"></span></td>
				  <td valign="top"><?=$lista[$i]["aviso"];?></td>
				  <td valign="top"><a href="controladores/procesaaviso.php?id=<?=$lista[$i]["idaviso"];?>&text=e&coddc=<?=$lista[$i]["iddoc_curso"];?>" onClick="return confirmar();"><span class="glyphicon glyphicon-trash"></span></a></td>
				</tr>
                  <?  echo "</div>";
			  }
			  ?>
             </table>  
  </div>
    </form>
</center>
	</body>	
</html>