<?
require("../clases/curso.class.php");
$obj = new curso();
$t = $_REQUEST["text"];
if($t=="R"){
		
		 $c = strtoupper($_REQUEST["curso"]);
		 $bv = html_entity_decode($_REQUEST["bienvenida"]);
		$ic="";
		if($obj->Crear($c,$bv,$ic)){
		//echo "se a guardado<br>";
		//echo "<a href='mancurso.php'>Registrar nuevo</a>";

					echo "<script languaje=javascript>\n"; 
	 				echo "location.href ='../mancurso.php';";					
	 				echo "</script>"; 
							
		}else{
		       echo "no pasa nada";
		     }
}

if($t=="e"){

 $cod = $_REQUEST["id"];
   if($obj->Eliminar($cod)){
   
       echo "<script languaje=javascript>\n"; 
	 	echo "location.href ='../mancurso.php';";					
	 	echo "</script>";		
   }
   else
   {
    echo "no pasa nada";
	}

}

if($t=="M"){
		$cod = $_REQUEST["idcurso"];
		$c = strtoupper($_REQUEST["curso"]);
		$bv =  html_entity_decode($_REQUEST["bienvenida"]);
		$ic="";
		
		if($obj->Actualizar($cod,$c,$vb,$ic)){
		/*echo "se a guardado<br>";
		echo "<a href='mancurso.php'>Registrar nuevo</a>";*/

					echo "<script languaje=javascript>\n"; 
	 				echo "location.href ='../mancurso.php';";					
	 				echo "</script>"; 
							
		}else{
		       echo "no se actualizo";
		     }
}

if($t=="A"){
        $dc = $_REQUEST['dc'];
		$cod = $_REQUEST["idcurso"];
		$c = strtoupper($_REQUEST["curso"]);
		$bv =  html_entity_decode($_REQUEST["bienvenida"]);
		$ic="";
		
		if($obj->Actualizar($cod,$c,$bv,$ic)){
		/*echo "se a guardado<br>";
		echo "<a href='mancurso.php'>Registrar nuevo</a>";*/

					echo "<script languaje=javascript>\n"; 
	 				echo "location.href ='../datoscargalectiva.php?dc=$dc';";					
	 				echo "</script>"; 
							
		}else{
		       echo "no se actualizo";
		     }
}

?>

