3 function add_work_centre($name, $description)
5 $sql = "INSERT INTO ".TB_PREF."workcentres (name, description)
6 VALUES (".db_quote($name).",".db_quote($description).")";
8 db_query($sql, "could not add work centre");
11 function update_work_centre($type_id, $name, $description)
13 $sql = "UPDATE ".TB_PREF."workcentres SET name=".db_quote($name).", description=".db_quote($description)."
16 db_query($sql, "could not update work centre");
19 function get_all_work_centres()
21 $sql = "SELECT * FROM ".TB_PREF."workcentres";
23 return db_query($sql, "could not get all work centres");
26 function get_work_centre($type_id)
28 $sql = "SELECT * FROM ".TB_PREF."workcentres WHERE id=$type_id";
30 $result = db_query($sql, "could not get work centre");
32 return db_fetch($result);
35 function delete_work_centre($type_id)
37 $sql="DELETE FROM ".TB_PREF."workcentres WHERE id=$type_id";
39 db_query($sql, "could not delete work centre");