id = $param; $this->reload(); } } else { $this->id = $param[0]; $this->tema = $param[1]; $this->url = $param[2]; $this->autor = $param[3]; $this->comentario = $param[4]; $this->ranking = $param[5]; $this->fecha = $param[6]; $this->texto = ''; } } function reload() { if (is_file($this->infoCSVConst)) { $record_info = fsearchcsv($this->infoCSVConst, $this->id); if ($record_info) { $this->id = $record_info[0]; $this->tema = $record_info[1]; $this->url = $record_info[2]; $this->autor = $record_info[3]; $this->comentario = $record_info[4]; $this->ranking = $record_info[5]; $this->fecha = $record_info[6]; $this->texto = ''; } } } function ingresar( $pId, $pTema, $pURL, $pAutor, $pComentario ) { $this->id = $pId; $this->tema = $pTema; $this->url = $pURL; $this->autor = $pAutor; $this->comentario = $pComentario; $this->ranking = 0; $this->fecha = time(); $this->texto = ''; $resultado = ""; if (!fappendcsv($this->infoCSVConst, array($this->id, $this->tema, $this->url, $this->autor, $this->comentario, $this->ranking, $this->fecha))) { $resultado = "ERROR al agregar la informacion. Revise que los parametros sean los adecuados"; } return $resultado; } function toHTML() { ?>