<?
include ("clases/foro.class.php"); $obja = new foro();
include ("clases/doc_curso.class.php"); $objdc = new doc_curso();
 //$idpersona=$_REQUEST['idpersona'];
 $iddoc_curso = $_REQUEST['iddc'];
 if($objdc->BuscarPorCodigo($iddoc_curso)){
   $idpersona = $objdc->getIddoc();
}
 
 $idforo = $_REQUEST['idf'];
if($obja->BuscarPorCodigo($idforo))
{
  $concepto = $obja->getConcepto();
  $detalle = $obja->getDetalle();
  $visible = $obja->getVisible();
  ///////////////
  $idpersona = $obja->getUsuario();
  $iddoc_curso = $obja->getIddoc_curso();
  //////////////////////////////
  $valor = "M";
  $boton = "Modificar";
}else{$valor = "R";
		$boton = "Guardar";
     }
?>
<html>
<head>
<title>Documento sin t&iacute;tulo</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>

<script>
function guardar(f)
{
   if(f.concepto.value==""){
      alert("Debe ingresar un titulo");
	  f.concepto.focus();
	  return false;
   }
   /*if(f.detalle.value==""){
      alert("No ha ingresado ninguna especificacion");
	  f.detalle.focus();
	  return false;
   }*/
 if(f.visible.value==""){
      alert("Seleccione Visibilidad");
	  f.visible.focus();
	  return false;
   }
   f.action="controladores/procesaforo.php";
   f.submit();
   return true;
}
</script>
</head>

<body>
<div class="container">
<form name="form1" method="post" action="">
 <div class="panel-heading">
    <h4>      Registrar Foro:  <input type="hidden" name="text" value="<?=$valor;?>">
    <input type="hidden" name="iddoc" value="<?=$idpersona;?>" >
    <input type="hidden" name="iddoc_curso" value="<?=$iddoc_curso;?>">
    <a href="manforo.php?id=<?php echo $idpersona;?>" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-share" aria-hidden="true"></span></a></h4>
  </div> 
  
  <div class="form-group">
   Concepto:  </div>
  <div class="form-group">
  <input name="concepto" type="text"  size="70" value="<?php echo $concepto;?>" class="form-control" placeholder="Concepto o Titulo">
  </div>
  <div class="form-group">
  Detalle:
  </div>
  <div class="form-group">
   <textarea name="detalle" id="detalle" class="form-control" placeholder="Especificacion"><?php echo $detalle;?></textarea><script>
                CKEDITOR.replace( 'detalle' );
            </script>
  </div>
  <div class="form-group">
  Visibilidad:
  </div>
  <div class="form-group">
   <select name="visible" class="form-control-static">
		        <option value="<?php if($visible!=""){echo $visible;}else{echo "";}?>"><?php if($visible!=""){echo $visible;}else{echo "Seleccione";}?></option>
				<option value="SI">SI</option>
				<option value="NO">NO</option>
    </select>
	</div>
  <div class="form-group">
   <table width="100%" border="0">
  <tr>
    <td scope="col" align="right"><input type="hidden" name="idforo" value="<?php echo $idforo;?>">
    <input name="" type="button" value="<?=$boton;?>" class="btn btn-success" onClick="guardar(this.form);"></td>
  </tr>
</table>
  
  </div>
   
</form>
</div>
</body>
</html>
