db_start . "_user set "; if (isset($variable_array['id'])) $sql .= " id = '" . $variable_array['id'] . "', "; if (isset($variable_array['password'])) $sql .= " password = '" . md5($variable_array['password']) . "', "; if (isset($variable_array['company'])) $sql .= " company = '" . $variable_array['company'] . "', "; if (isset($variable_array['name'])) $sql .= " name = '" . $variable_array['name'] . "', "; if (isset($variable_array['user_class'])) $sql .= " user_class = '" . $variable_array['user_class'] . "', "; if (isset($variable_array['customer'])) $sql .= " customer = '" . $variable_array['customer'] . "', "; if (isset($variable_array['language'])) $sql .= " language = '" . $variable_array['language'] . "', "; if (isset($variable_array['info'])) $sql .= " info = '" . $variable_array['info'] . "', "; $sql .= " created = NOW(), "; $sql .= " created_by = '" . $_SESSION["username"] . "',"; $sql .= " modified = NOW(), "; $sql .= " modified_by = '" . $_SESSION["username"] . "'"; $result = @mysql_query($sql); $this->id = $variable_array['id']; $this->load($this->id);*/ } function modify($variable_array) {/* $sql = "update " . $GLOBALS["conf"]->db_start . "_user set "; if (isset($variable_array['password']) && $variable_array['password'] != "") $sql .= " password = '" . md5($variable_array['password']) . "', "; if (isset($variable_array['company'])) $sql .= " company = '" . $variable_array['company'] . "', "; if (isset($variable_array['name'])) $sql .= " name = '" . $variable_array['name'] . "', "; if (isset($variable_array['user_class'])) $sql .= " user_class = '" . $variable_array['user_class'] . "', "; if (isset($variable_array['customer'])) $sql .= " customer = '" . $variable_array['customer'] . "', "; if (isset($variable_array['language'])) $sql .= " language = '" . $variable_array['language'] . "', "; if (isset($variable_array['info'])) $sql .= " info = '" . $variable_array['info'] . "', "; $sql .= " modified = NOW(), "; $sql .= " modified_by = '" . $_SESSION["username"] . "'"; $sql .= " where id = '" . $this->id . "'"; $result = @mysql_query($sql); $this->load($this->id);*/ } function remove() { if ($this->id == '') return false; /* $result = @mysql_query("delete from " . $GLOBALS["conf"]->db_start . "_user where id='" . $this->id . "'"); $this->id = ""; $this->name = ""; $this->company = ""; $this->langage = ""; $this->customer = ""; $this->created = ""; $this->info = ""; $this->password = ""; $this->user_class = ""; $this->created_by = ""; $this->modified_by = ""; $this->modified = "";*/ } function load($id) { $this->id = $id; $file = @fopen($GLOBALS['conf']->path . "/notes/" . $_SESSION['username'] . "/" . $id, "r"); $this->title = fgets($file); $this->text = ""; while (!@feof($file)) $this->text .= fgets($file); @fclose($file); unlink($GLOBALS['conf']->path . "/notes/" . $_SESSION['username'] . "/" . $id); } function getSetup($action = '') { } function getContent($action = '') { } function getTitle($action = '') { global $str; if (isset($this->id) && $this->id != '') return $this->name; else return $str['note']; } function getTopMenu() { } function getSubMenu() { } function getManagerTopMenu() { } function getManagerSubMenu() { } function setToManager(&$template) { $template->set("page_title", $this->getTitle()); if (isset($this->id) && $this->id != '') $module = new Template("note_view"); else $module = new Template("note"); $this->setToPage($module); $module->setToManager($template); } function setToPage(&$template) { $template->set("id", $this->id); $template->set("notes_title", $this->title); $template->set("notes_text", $this->text); } } ?>