function menuList($id) { $sql = $this->db->query("SELECT id, id_cliente, id_pai, ordem, sec_nome, sec_url_nome, sec_tipo FROM " . tbl_usr . "secoes_paginas WHERE id_cliente = '" . $id . "' ORDER BY ordem"); if (!$sql->result()) { return 0; } else { return $sql->result_array(); } } function countParents($id_cliente,$id_pai) { return $this->db->count_all(tbl_usr . "secoes_paginas","WHERE id_cliente = '" . $id_cliente . "' and id_pai = '" . $id_pai . "'"); } function getFatherId($id_cliente,$id_menu) { $sql = $this->db->query("SELECT id_pai, sec_nome FROM " . tbl_usr . "secoes_paginas WHERE id = '" . $id_menu . "' AND" . " id_cliente = '" . $id_cliente . "'"); if (!$sql->result()) { return 0; } else { $array = $sql->row_array(); return $array['id_pai']; } }