Menu Items - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Menu Items

munky344munky344 Posts: 12Member
Hi there

I have this very simple menu item , but I am not sure how to connect a from to my menu items , i.e. I need my search.php form to open once the user clicks on the search menu item. Please can someone take a look.

Thanking you in advance. Regards.

[b]index.php[/b]

<?php require_once("menuHandler.php"); ?>



MicroMetaSpider - Check website META information




Medex Information System



This is a Medex Index Page!



2008 - Medex Information Systems





[b]menuStruct.php[/b]

<?php
// Main menu items
$mainMenu['Help'] = 'link-1';
$mainMenu['Admin Functions'] = 'link-2';
$mainMenu['Modules'] = 'link-3';
$mainMenu['Support'] = 'link-4';
$mainMenu['Others'] = 'link-5';

// Sub menu items
$subMenu['Modules']['Patient Demographics'] = 'sub-link-1';
$subMenu['Modules']['Search'] = 'sub-link-2';
$subMenu['Modules']['Visits'] = 'sub-link-3';
$subMenu['Modules']['Reports'] = 'sub-link-4';

$subMenu['Others']['SubMenu-1'] = 'sub-link-11';
$subMenu['Others']['SubMenu-2'] = 'sub-link-12';
$subMenu['Others']['SubMenu-3'] = 'sub-link-13';
?>

[b]menuHandler.php[/b]

<?php
function createMenu($actLink){
include_once('menuStruct.php');

echo '<table class="menutable">';

// Get actual Main menu
$actMenu='';
foreach ($mainMenu as $menu => $link) {
if ($link == $actLink) $actMenu = $menu;
if (isset($subMenu[$menu])){
foreach ($subMenu[$menu] as $menuSub => $linkSub) {
if ($linkSub == $actLink) $actMenu = $menu;
}
}
}


foreach ($mainMenu as $menu => $link) {
echo ''.$menu.'';
if ( ($actMenu == $menu) && (isset($subMenu[$menu])) ){
foreach ($subMenu[$menu] as $menuSub => $linkSub) {
echo ''.$menuSub.'';
}
}
}

echo "";
}
?>
Sign In or Register to comment.