function insert() { // write $this to the database as a new entry global $DBc, $_USER; $this->setOrder($this->parent->getNextOrder()); $DBc->sqlQuery("INSERT INTO ach_category (ac_parent,ac_order,ac_image,ac_dev) VALUES (" . mkn($this->getParentID()) . ",'" . $this->getOrder() . "'," . mkn($this->getImage()) . ",'1')"); $id = $DBc->insertID(); $this->setID($id); #MISSING: insert lang entry $DBc->sqlQuery("INSERT INTO ach_category_lang (acl_category,acl_lang,acl_name) VALUES ('" . $this->getID() . "','" . $_USER->getLang() . "','" . $DBc->sqlEscape($this->getName()) . "')"); }
function insert() { global $DBc; $this->dev = 1; $DBc->sqlQuery("INSERT INTO ach_task (at_achievement,at_parent,at_value,at_condition,at_condition_value,at_dev,at_torder,at_inherit) VALUES ('" . $this->getAchievement() . "'," . mkn($this->getParentID()) . ",'" . $DBc->sqlEscape($this->getValue()) . "','" . $DBc->sqlEscape($this->getCondition()) . "'," . mkn($this->getConditionValue()) . ",'1','" . $this->torder . "','" . $this->inherit_obj . "')"); $id = $DBc->insertID(); $this->setID($id); $DBc->sqlQuery("INSERT INTO ach_task_lang (atl_task,atl_lang,atl_name,atl_template) VALUES ('" . $this->getID() . "','en','" . $DBc->sqlEscape($this->getName()) . "'," . mkn($this->getTemplate()) . ")"); foreach ($this->tie_race as $elem) { $DBc->sqlQuery("INSERT INTO ach_task_tie_race (attr_task,attr_race) VALUES ('" . $this->getID() . "','" . $DBc->sqlEscape($elem) . "')"); } foreach ($this->tie_align as $elem) { $DBc->sqlQuery("INSERT INTO ach_task_tie_align (atta_task,atta_alignment) VALUES ('" . $this->getID() . "','" . $DBc->sqlEscape($elem) . "')"); } }
function insert() { global $DBc; $this->dev = 1; $DBc->sqlQuery("INSERT INTO ach_achievement (aa_category,aa_parent,aa_image,aa_dev,aa_sticky) VALUES ('" . $this->getCategory() . "'," . mkn($this->getParentID()) . ",'" . $DBc->sqlEscape($this->getImage()) . "','1','" . $DBc->sqlEscape($this->getSticky()) . "')"); $id = $DBc->insertID(); $this->setID($id); $DBc->sqlQuery("INSERT INTO ach_achievement_lang (aal_achievement,aal_lang,aal_name,aal_template) VALUES ('" . $this->getID() . "','en','" . $DBc->sqlEscape($this->getName()) . "'," . mkn($this->getTemplate()) . ")"); }
function insert() { global $DBc; $DBc->sqlQuery("INSERT INTO ach_objective (ao_task,ao_condition,ao_value,ao_display,ao_metalink) VALUES ('" . $this->getTask() . "','" . $DBc->sqlEscape($this->getCondition()) . "'," . mkn($this->getValue()) . ",'" . $DBc->sqlEscape($this->getDisplay()) . "'," . mkn($this->getMetalink()) . ")"); $id = $DBc->insertID(); $this->setID($id); $DBc->sqlQuery("INSERT INTO ach_objective_lang (aol_objective,aol_lang,aol_name) VALUES ('" . $this->getID() . "','en','" . $DBc->sqlEscape($this->getName()) . "')"); }