<?
require("../clases/m_chat.class.php");
$obj = new m_chat();
$t = $_REQUEST["text"];
if($t=="R"){
		
		$name=$_POST['name'];
    	$msg=$_POST['msg'];
		$iddoc = $_POST['iddoc'];
		/////////////////////////////////////////////////////////////////	
		if($obj->Crear($name,$msg,$iddoc)){ 
					echo "<script languaje=javascript>\n"; 
	 				echo "location.href ='../chatpage.php?id=$iddoc';";					
	 				echo "</script>"; 
							
		}else{
		       echo "no pasa nada";
		     }
}

/*if($t=="e"){
 $iddoccur = $_REQUEST["iddoccur"];
 $cod = $_REQUEST["id"];
	if($obj->BuscarPorCodigo($cod))
	 {   
		 $archivo = $obj->getArchivo();
		 $ruta = "../temas/".$archivo;
		 unlink($ruta); 
		 
		 if($obj->Eliminar($cod)){
		   
			   echo "<script languaje=javascript>\n"; 
				echo "location.href ='../manclase.php?id=$iddoccur';";					
				echo "</script>";		
		   }
		   else
		   {
			echo "no pasa nada";
		   }
	   }
}*/

////////////////////////
	

?>
