Jump to content

Different Menu displaying on two different pages


mikebrowntsbod
Go to solution Solved by mikebrowntsbod,

Recommended Posts

So when I am going from index.php and /applications/add.php they show two different menus. 

 

/index.php

 

 <body>
    <?php include "includes/menu.php"; ?>
  <!--<a class="navbar-brand" href="#"><strong>Home</strong></a>-->
  <p class="navbar-brand"><strong>Home</strong></p>
  <?php include "includes/lowermenu.php"; ?>
 
  <?php include "includes/rolecheck.php"; ?>
  
  
 
  <?php
  echo '<div id="accordion">
  <h3>Administrative News</h3>

/includes/lowermenu.php

<?php
	include_once ('/includes/rolecheck.php');
echo ' </div>';
            /*Collect the nav links, forms, and other content for toggling */
            echo '<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a href="/index.php">Home</a></li>';
		    	if (in_array(11,$userRoles))
			{
				echo '<li class="dropdown">
					<a href="#" data-toggle="dropdown" class="dropdown-toggle">Election<b class="caret"></b></a>
					<ul class="dropdown-menu">
					    <li><a href="/election/vote.php">Vote</a></li>
					    <li><a href="/election/results.php">Results</a></li>
					</ul>
				    </li>';
			}
		    if (in_array(2,$userRoles))
		    {
			echo'  <li class="dropdown">
				<a href="#" data-toggle="dropdown" class="dropdown-toggle">Architecture<b class="caret"></b></a>
				<ul class="dropdown-menu">
				    <li><a href="/applications/add.php">Add Application</a></li>
				    <li><a href="/applications/view.php">View Applications</a></li>
				    <li><a href="/applications/vote.php">Vote</a></li>
				    <li><a href="/applications/modify.php">Modify Application</a></li>
				    <li><a href="/applications/remove.php">Remove Application</a></li>
				    <li class="divider"></li>
				    <li><a href="/applications/addfinal.php">Add Final Pictures</a></li>
				</ul>
			    </li>';
		    }
		if (in_array(11,$userRoles) || in_array(3,$userRoles) || in_array(4,$userRoles))
		{
			echo'	<li class="dropdown">
				<a href="#" data-toggle="dropdown" class="dropdown-toggle">Violations<b class="caret"></b></a>
				<ul class="dropdown-menu">
				    <li><a href="/violations/add.php">Report Violation</a></li>
				    <li><a href="/violations/boardHearings/request.php">Request a Board Hearing</a></li>';
				    if (in_array(3,$userRoles) || in_array(4,$userRoles))
				    {
				    	echo'<li><a href="/violations/boardHearings/results.php">Board Hearing Results</a></li>
				    	<li><a href="/violations/boardHearings/schedule.php">Schedule Hearing</a></li>';
				    }
				echo '</ul>
			    </li>';
		}
			
			
                     echo '<li><a href="/user/messages.php" class="nav-link disabled">Messages</a></li>';
		    if (in_array(11,$userRoles) || in_array(4,$userRoles))
		    {
		        echo '<li class="dropdown">
                        <a href="#" data-toggle="dropdown" class="dropdown-toggle">Parking<b class="caret"></b></a>
                        <ul class="dropdown-menu">';
			    
			    if (in_array(4,$userRoles) || in_array(3,$userRoles))
			    {
                            	echo '<li><a href="/parking/towing/addVehicle.php">Add Vehicle (Towing)</a></li>
                            	<li><a href="/parking/towing/updateVehicle.php">Update Vehicle (Towing)</a></li>';
			    }
			    
			    if (in_array(11,$userRoles))
			    {
			    	echo '<li><a href="/parking/violation.php">Report Violation</a></li>
			    	<li><a href="/parking/requestLongTermParking.php">Long Term Parking Request</a></li>';
			    }
                        echo '</ul>
                    </li>';
		    }
		    
		if (in_array(3,$userRoles))
		{
		     echo '<li class="dropdown">
                        <a href="#" data-toggle="dropdown" class="dropdown-toggle">Board <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="/board/addMotion.php">Add Motion</a></li>
                            <li><a href="/board/removeMotion.php">Remove Motion</a></li>
                            <li><a href="/board/amendMotion.php">Amend Motion</a></li>
			    <li><a href="/board/revokeMotion.php">Revoke Motion</a></li>
                            <li><a href="/board/voteMotion.php">Vote</a></li>
			    <li><a href="/board/boardHearingVote.php">Board Hearing Vote</a></li>
			    <li><a href="/board/submitHearingNotes.php">Hearing Notes</a></li>
                        </ul>
                    </li>';
		}

		    	if (in_array(11,$userRoles) || in_array(4,$userRoles) || in_array(14,$userRoles))
			{
				echo '<li><a href="/reports.php">Reports</a></li>';
			}
			echo '<li><a href="/user/profile.php">Profile</a></li>
			<li><a href="/login/logout.php">Logout</a></li>
                    
                </ul>';
		
                	echo '<ul class="nav navbar-nav navbar-right">';
				if (in_array(1, $userRoles)) 
				{
                    			echo '<li class="dropdown">
						<a href="#" data-toggle="dropdown" class="dropdown-toggle">Admin <b class="caret"></b></a>
						<ul class="dropdown-menu">
						    <li><a href="/admin/addusers.php">Add User</a></li>
						    <li><a href="/admin/removeusers.php">Remove Users</a></li>
						    <li><a href="/admin/modifyusers.php">Modify Users</a></li>
						    <li class="divider"></li>
						    <li><a href="/admin/systemsettings.php">Settings</a></li>
						</ul>
					    </li>';
				}
               echo' </ul>';
		
echo '
            </div>
        </div>
</nav>';
?>
/includes/rolecheck.php

<?php
	include_once ('dbconnect.php');
		$userRoleSearch=$db_con->prepare("SELECT * FROM members m 
			INNER JOIN userRoleGroups urg ON urg.userid = m.userid 
			INNER JOIN userGroups ug ON ug.userGroupID = urg.userGroup_id WHERE m.username=:username");
        		
        	$userRoleSearch->bindParam(':username', $_SESSION['username']);
        	$userRoleSearch->execute();
	  	
	  	$userRoles=array();
		foreach ($userRoleSearch as $row)
		{
			//print $row["userGroupID"] . "-" . $row["userGroupName"] . "<br />";
			$userRoles[] = $row["userGroupID"];
		}
?>
/applications/add.php

<body>
       <?php include "../includes/menu.php"; ?>
	  <!--<a class="navbar-brand" href="#"><strong>Home</strong></a>-->
	  <p class="navbar-brand"><strong>Add App</strong></p>
	  <?php include "../includes/lowermenu.php"; ?>

	  <?php include "../includes/rolecheck.php"; ?>
	  <!--Added Here-->
	  <div class="container">
Edited by mikebrowntsbod
Link to comment
Share on other sites

I am seeing the following in the apache2 error log

 

[sun Oct 08 16:58:25.450123 2017] [:error] [pid 22895] [client 73.200.12.32:51826] PHP Warning: include(/includes/rolecheck.php): failed to open stream: No such file or directory in /var/www/html/arch1/applications/add.php on line 151, referer: https://portal.tanyardspringshoa.com/index.php

[sun Oct 08 16:58:25.450193 2017] [:error] [pid 22895] [client 73.200.12.32:51826] PHP Warning: include(): Failed opening '/includes/rolecheck.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/arch1/applications/add.php on line 151, referer: https://portal.tanyardspringshoa.com/index.php

[

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.