User to log in has 2 types of menus and before that the system must understand if it is logged in or not to display another menu [closed]

0

Personal in my code above, I'm trying to display 2 types of menu for the user, when logged in, not logged in, in case when logged in he still assembles another menu comparing which type of user is logged in, if it is a user simple or advanced user ... only that my echo is with problem I can not make display one or the other in the condition ... could anyone help me?

Detail Drawn below:

LOGIN | REGISTRATION

WHEN FACE CLICK ON ONE OF THESE THERE IS A FLOATING ABA BELOW ..

IF CASE LOGAR, LOGIN and REGISTRATION DISAPPEAR | and DISPLAY NAME OF THE USER REGISTERED IN THE SYSTEM; STAYING SO

USER and below the menu links for that user.

, but at login, the system will identify which user will have access to which menu ... because in the system below I need to be shown the correct menu for the user the condition already works perfectly, the problem is that I need to do an if else, to display only the login and not logged in menus already pus within each echo .. .

 <div class="auth auth--header">
          <ul class="auth__nav">
           <?php
session_start();
if(!isset($_SESSION['usertype']))
{
echo '<li class="dropdown auth__nav-item">
              <div class="dropdown__menu auth__dropdown--restore">
                <!-- BEGIN AUTH RESTORE-->
                <h5 class="auth__title">Resetar Senha</h5>
                <form action="#" class="auth__form js-restore-form js-parsley">
                  <div class="auth__row form-group">
                    <label for="restore-email-dropdown" class="auth__label control-label">Digite usuario ou email</label>
                    <input type="email" name="email" id="restore-email-dropdown" required class="auth__in auth__in--text form-control">
                  </div>
                  <div class="auth__row">
                    <button type="submit" class="auth__in auth__in--submit">Resetar senha</button>
                  </div>
                  <div class="auth__row"><span class="auth__links">Back para
                      <button type="button" class="js-user-login">Logar em</button>ou
                      <button type="button" class="js-user-register">Registrar</button></span>
                    <!-- end of block .auth__links-->
                  </div>
                </form>
                <!-- end of block .auth__form-->
                <!-- END AUTH RESTORE-->
              </div>
            </li>
            <li class="dropdown auth__nav-item">
              <button data-toggle="dropdown" type="button" class="dropdown-toggle js-auth-nav-btn auth__nav-btn">
                <svg class="auth__icon-user">
                  <use xlink:href="#icon-user"></use>
                </svg><span class="header__span"> Entrar /</span>
              </button>
              <div class="dropdown__menu auth__dropdown--login">
                <!-- BEGIN AUTH LOGIN-->
                <h5 class="auth__title">Entre com sua conta</h5>
                <form action="#" class="auth__form js-login-form js-parsley">
                  <div class="auth__row form-group">
                    <label for="login-username-dropdown" class="auth__label control-label">Usuario</label>
                    <input type="text" name="username" id="login-username-dropdown" required data-parsley-trigger="keyup" data-parsley-minlength="6" data-parsley-validation-threshold="5" data-parsley-minlength-message="Login should be at least 6 chars" class="auth__in auth__in--text form-control">
                  </div>
                  <div class="auth__row auth__row--password form-group">
                    <label for="login-password-dropdown" class="auth__label control-label">Senha</label>
                    <input type="password" name="password" id="login-password-dropdown" required class="auth__in auth__in--text form-control">
                  </div>
                  <div class="auth__row">
                    <button type="button" class="auth__forgot js-user-restore">Perdeu a senha ?</button>
                    <button type="submit" class="auth__in auth__in--submit">Entrar?</button><span class="auth__remember">
                      <input type="checkbox" id="remember-in-dropdown" class="in-checkbox">
                      <label for="remember-in-dropdown" class="in-label">Lembre-me</label></span>
                  </div>
                  <div class="auth__row"><span class="auth__links">Não e usuário?
                      <button type="button" class="js-user-register">Pegue uma conta</button></span></div>
                </form>
                <!-- end of block .auth__form-->
                <!-- END AUTH LOGIN-->
              </div>
            </li>
            <li class="dropdown auth__nav-item">
              <button data-toggle="dropdown" type="button" class="dropdown-toggle auth__nav-btn"><span class="header__span">Cadastrar</span></button>
              <div class="dropdown__menu auth__dropdown--register">
                <!-- BEGIN AUTH REGISTER-->
                <h5 class="auth__title">Registre uma nova conta</h5>
                <form action="#" class="auth__form js-register-form js-parsley">
                  <div class="auth__coll form-group">
                    <label for="register-name-dropdown" class="auth__label control-label">Nome</label>
                    <input type="text" name="username" id="register-name-dropdown" required class="auth__in auth__in--text form-control">
                  </div>
                  <div class="auth__coll auth__coll--right form-group">
                    <label for="register-lastname-dropdown" class="auth__label control-label">Sobre Nome</label>
                    <input type="text" name="name" id="register-lastname-dropdown" required class="auth__in auth__in--text form-control">
                  </div>
                  <div class="auth__coll auth__coll--email form-group">
                    <label for="register-email-dropdown" class="auth__label control-label">E-mail</label>
                    <input type="email" name="email" id="register-email-dropdown" required class="auth__in auth__in--text form-control">
                  </div>
                  <div class="auth__coll auth__coll--right form-group">
                    <label for="register-password-dropdown" class="auth__label control-label">Senha</label>
                    <input type="password" name="password" id="register-password-dropdown" required class="auth__in auth__in--text form-control">
                  </div>
                  <div class="auth__row"><span class="auth__links">Back para
                      <button type="button" class="js-user-login">Entrar</button></span>
                    <button type="submit" class="auth__in auth__in--submit">Entrar</button>
                  </div>
                </form>
                </div>
             </li>    ';
}
else
{
echo '  <li class="dropdown auth__nav-item">
              <button data-toggle="dropdown" type="button" class="dropdown-toggle js-auth-nav-btn auth__nav-btn">
                <svg class="auth__icon-user">
                  <use xlink:href="#icon-user"></use>
                </svg><span class="header__span"> <?php if (isset($username)){echo $username;} ?><?php if (isset($model)){echo $model;} ?></span>
              </button>
        <div class="dropdown__menu auth__dropdown--login">
           <nav class="worker__nav">
 <li class="topmenu"><a href="#" style="height:10px;line-height:10px;"><span></span></a>
    <div class="submenu" style="width:92px;">
      <?php if($username) {

    echo '<li><a href="cp/chatusers/index.php">Minha Conta</a></li>

    <li><a href="cp/chatusers/favorites.php">Favoritos</a></li>

    <li><a href="cp/chatusers/updateprofile.php">Meu Perfil</a></li>

    <li><a href="cp/chatusers/viewsessions.php">Hist&oacute;rico</a></li>

    <li><a href="cp/chatusers/buyminutes.php">Dinheiro</a></li>

    <li><a href="logout.php">Logout</a></li>';} ?>
    <?php if($model) {

    echo '<li><a href="index.php">Minha Conta</a></li>

    <li><a href="cp/chatmodels/broadcast.php">Transmiss&aatilde;o</a></li>

    <li><a href="cp/chatmodels/updateprofile.php">Meu Perfil</a></li>

    <li><a href="cp/chatmodels/showslist.php">Hist&oacute;rico</a></li>

    <li><a href="cp/chatmodels/uploadpicture.php">Minhas Fotos</a></li>

    <li><a href="cp/chatmodels/paymentop.php">Dinheiro</a></li>

    <li><a href="logout.php">Logout</a></li>';} ?>


    </div>   
</li>
</nav>';
}
?>


            </ul>
          <!-- end of block .auth header-->
        </div>
    
asked by anonymous 16.11.2016 / 19:50

1 answer

0

Man, you will have to present the menu according to the permissions that the user has through if Type

<?php if($_SESSION[ 'permissao']=="Nivel1" ]){ ?>
  <li>Mostrar Tag do menu ADM</li>
<?php }else if($_SESSION[ 'permissao']=="Nivel2" ){ ?>
  <li>Mostrar tag do menu referente a esta permissao</li>
<?php} ?>
    
16.11.2016 / 20:28