cn = $p_cn; } function sub_menu($resource, $p_id) { if (Database::num_row($resource) != 0) { $gDossier = dossier::id(); echo ''; } // end if } /** * Show a table with all the menu and the type * @param type $p_id profile.p_id */ function listing_profile($p_id) { $array = $this->cn->get_array(" SELECT pm_id, pm.me_code, me_code_dep, p_id, p_order, p_type_display, pm_default, pm_desc, me_menu, me_description FROM profile_menu as pm join profile_menu_type on (p_type_display=pm_type) join menu_ref as mr on (mr.me_code=pm.me_code) where p_id=$1 and p_type_display='M' order by p_order asc ", array($p_id)); if (count($array) == 0) { // if not module show only menu $ret = $this->cn->exec_sql(" SELECT pm_id, pm.me_code, me_code_dep, p_id, p_order, p_type_display, pm_default, pm_desc, me_menu, me_description FROM profile_menu as pm join profile_menu_type on (p_type_display=pm_type) join menu_ref as mr on (mr.me_code=pm.me_code) where p_id=$1 and p_type_display='E' order by p_order asc ", array($p_id)); echo ''; } else { $this->cn->prepare("menu", " SELECT pm_id, pm.me_code, me_code_dep, p_id, p_order, p_type_display, pm_default, pm_desc, me_menu, me_description FROM profile_menu as pm join profile_menu_type on (p_type_display=pm_type) join menu_ref as mr on (mr.me_code=pm.me_code) where p_id=$1 and me_code_dep=$2 and p_type_display in ('E','S') order by p_order asc "); echo ''; //******************************************* // show also menu without a module //******************************************* $ret = $this->cn->exec_sql(" SELECT pm_id, pm.me_code, me_code_dep, p_id, p_order, p_type_display, pm_default, pm_desc, me_menu, me_description FROM profile_menu as pm join profile_menu_type on (p_type_display=pm_type) join menu_ref as mr on (mr.me_code=pm.me_code) where p_id=$1 and p_type_display='E' and me_code_dep is null order by p_order asc ", array($p_id)); $this->sub_menu($ret, $p_id); } } function printing($p_id) { $ret = $this->cn->exec_sql(" SELECT pm_id, pm.me_code, me_code_dep, p_id, p_order, p_type_display, pm_default, pm_desc, me_menu, me_description FROM profile_menu as pm join profile_menu_type on (p_type_display=pm_type) join menu_ref as mr on (mr.me_code=pm.me_code) where p_id=$1 and me_type='PR' order by p_order asc ", array($p_id)); // Menu by module $gDossier = Dossier::id(); $this->sub_menu($ret, $p_id); } } //end class ?>