} } </SCRIPT> <?php $dateflg = 1; $divar = array(); $divar = array("Settings", "Members", "MemberPayment", "Users", "Vendors", "Transporters", "Contents", "Charecteristics", "Mail", "Dealers", "Feedbacks", "Reports", "SalesReps", "Marketing"); if ((isset($_SESSION["sess_adminname"]) and $_SESSION["sess_adminname"] != "") || (isset($_SESSION["sess_adminlogin"]) and $_SESSION["sess_adminlogin"] != "") and $_SESSION['sess_useradmin'] == "") { if ($_GET['displayDiv']) { $_SESSION['divVar'] = $_GET['displayDiv']; // Get the value of displayDiv from Query String } $menus = getAdminMenus(0); // Get the value of displayDiv from Query String ?> <div align="left" class="links_container"> <?php $m = 0; for ($i = 0; $i < sizeof($menus); $i++) { if ($menus[$i]['menu_id'] != 0) { if ($menus[$i]['subpage'] != "") { if (isset($_GET['rghtMenu'])) { $divVar = $_SESSION['divVar']; } $div = $menus[$i]['divname']; if ($div == $divVar) { $styles[$i] = "style='display:block'"; } else {
function getAdminMenus($parentid) { global $tableprefix; $arr1 = array(); $qry = "select b.* from " . $tableprefix . "admin_menu b where "; $qry .= " b.parent_id=" . $parentid . " and b.status ='ACTIVE' ORDER BY b.display_order"; $res = mysql_query($qry) or die(mysql_error()); if (mysql_num_rows($res) != 0) { $i = 0; while ($rws = mysql_fetch_assoc($res)) { $arr1[$i]["menu_id"] = $rws["menu_id"]; $arr1[$i]["page_name"] = $rws["page_name"]; $arr1[$i]["link"] = SITE_URL . "/admin/" . $rws["link"]; $arr1[$i]["divname"] = $rws["divname"]; $ChildNodeExists = whetherAdminChildNodeExist($rws["menu_id"]); if ($ChildNodeExists === TRUE) { $arr1[$i]['subpage'] = getAdminMenus($rws["menu_id"]); $i++; } else { $i++; } } } return $arr1; }