Duplication of page content (HTML / PHP)

1

I have a duplication problem on my page. The content that should be organized within the main index duplicates in the header on the page as in the image below.

-Myindex.php

<?phprequire'./lib/autoload.php';$smarty=newTemplate();Rotas::get_pagina();//valoresparaotemplate$smarty->assign('NOME','JulioCesardeCamargo');$smarty->assign('GET_TEMA',Rotas::get_SiteTEMA());$smarty->assign('GET_HOME',Rotas::get_SiteHOME());$smarty->assign('PAG_CARRINHO',Rotas::pag_Carrinho());$smarty->assign('PAG_CONTATO',Rotas::pag_Contato());$smarty->assign('PAG_MINHACONTA',Rotas::pag_MinhaConta());$smarty->assign('TITULO_SITE',Config::SITE_NOME);$smarty->display('index.tpl');?>

-Myindex.tpl

<!DOCTYPEhtml><html><head><title>{$TITULO_SITE}</title><metacharset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link href="{$GET_TEMA}/tema/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <link href="{$GET_TEMA}/tema/contatos/contatos.css" rel="stylesheet" type="text/css"/>
        <script src="{$GET_TEMA}/tema/js/jquery-2.2.1.min.js" type="text/javascript"></script>
        <script src="{$GET_TEMA}/tema/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="{$GET_TEMA}/tema/contatos/contatos.js" type="text/javascript"></script>
        <!-- meu aquivo pessoal de CSS-->
        <link href="{$GET_TEMA}/tema/css/tema.css" rel="stylesheet" type="text/css"/>
     <!-- HTML5 shim e Respond.js para suporte no IE8 de elementos HTML5 e media queries -->
    <!-- ALERTA: Respond.js não funciona se você visualizar uma página file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script><scriptsrc="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    </head>
    <body>

        <!-- começa  o container geral -->
        <div class="container-fluid">

            <!-- começa a div topo -->
            <div class="row" id="topo">


                <div class="container">
                <img src="#" alt=""> 

                </div>    

            </div><!-- fim da div topo -->

            <!-- começa a barra MENU-->
            <div class="row" id="barra-menu">

                <!--começa navBAR-->
                <nav class="navbar navbar-inverse">

                    <!-- container navBAr-->
                    <div class="container">
                        <!-- header da navbar-->
                        <div class="navbar-header">
                           <!-- botao que mostra e esconde a navbar--> 
                           <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                               <span class="sr-only">Toggle navigation</span>
                               <span class="icon-bar"></span>
                               <span class="icon-bar"></span>
                               <span class="icon-bar"></span>
                           </button>

                        </div><!--fim header navbar-->  

                        <div class="collapse navbar-collapse" id="navbar">
                            <ul class="nav navbar-nav">
                                <li><a href="{$GET_HOME}"><i class="glyphicon glyphicon-home"></i> Home </a> </li>

                                <li><a href="{$PAG_MINHACONTA}"><i class="glyphicon glyphicon-user"></i> Minha Conta </a> </li>
                                <li><a href="{$PAG_CARRINHO}"><i class="glyphicon glyphicon-shopping-cart"></i> Carrinho </a> </li>
                                <li><a href="{$PAG_CONTATO}" ><i class="glyphicon glyphicon-envelope"></i> Contato </a> </li>

                            </ul>


                            <form class="navbar-form navbar-right" role="search">
                                <div class="form-group">
                                    <input type="text" class="form-control" placeholder="Digite para buscar" required>
                                </div>
                                <button type="submit" class="btn btn-primary">Buscar</button>
                            </form>

                         </div><!-- fim navbar collapse-->   


                    </div> <!--fim container navBar-->

                </nav><!-- fim da navBar-->   





            </div> <!-- fim barra menu--> 

            <!-- começa DIV conteudo-->
            <div class="row" id="conteudo">

            <div class="container"> 

                <!-- coluna da esquerda -->
                <div class="col-md-2" id="lateral">

                <div class="list-group">
                    <span class="list-group-item active"> Categorias</span>

                    <a href="#" class="list-group-item"><span class="glyphicon glyphicon-menu-right"></span> Presentes</a> 
                    <a href="#" class="list-group-item"><i class="glyphicon glyphicon-menu-right"></i> Brinquedos</a> 

                    <a href="#" class="list-group-item"><span class="glyphicon glyphicon-menu-right"></span> Presentes</a> 
                    <a href="#" class="list-group-item"><i class="glyphicon glyphicon-menu-right"></i> Brinquedos</a> 

                    <a href="#" class="list-group-item"><span class="glyphicon glyphicon-menu-right"></span> Presentes</a> 
                    <a href="#" class="list-group-item"><i class="glyphicon glyphicon-menu-right"></i> Brinquedos</a> 


                </div><!--fim da list group-->              

                </div> <!-- finm coluna esquerda -->  

                <!-- coluna direita CONYEUDO CENTRAL -->
                <div class="col-md-10">


                    <ul class="breadcrumb">
                        <li><a href="#"><i class="glyphicon glyphicon-home"></i> Home </a></li>
                        <li><a href="#"> Produtos </a></li>
                        <li><a href="#"> Info </a></li>
                    </ul>   
                    <!-- fim do menu breadcrumb--> 

                    {php}

                    Rotas::get_Pagina();    


                    {/php}            



                </div>  <!--fim coluna direita-->  

            </div>   






            </div><!-- fim DIV conteudo-->

            <!-- começa div rodape -->
            <div class="row" id="rodape">
                <center><h4>{$TITULO_SITE}</h4>
                <p> Todos os diretos reservados</p>

                </center>


            </div><!-- fim div rodape-->



           </div> <!-- fim do container geral -->




    </body>
</html>

- My route class

<?php 

Class Rotas{

    public static $pag;
    private static $pasta_controller = 'controller';
    private static $pasta_view = 'view';    



    static function get_SiteHOME(){
        return Config::SITE_URL . '/' .Config::SITE_PASTA;
    }

    static function get_SiteRAIZ(){
        return $_SERVER['DOCUMENT_ROOT'] . '/' .Config::SITE_PASTA;
    }

    static function get_SiteTEMA(){
        return self::get_SiteHOME(). '/' .self::$pasta_view;
    }

    static function pag_Carrinho(){
        return self::get_SiteHOME(). '/carrinho';
    }

    static function pag_Contato(){
        return self::get_SiteHOME(). '/contato';
    }

    static function pag_MinhaConta(){
        return self::get_SiteHOME(). '/minhaconta';
    }


    static function get_Pagina(){
        if(isset($_GET['pag'])){

            $pagina = $_GET['pag'];

            self::$pag = explode('/', $pagina);

            $pagina = 'controller/' .$_GET['pag'] . '.php';
            if(file_exists($pagina)){
                include $pagina;

            }else{
            include 'erro.php';
        }
        }
    }
}


 ?>

Please help me, I need to resolve this.

    
asked by anonymous 09.11.2017 / 20:01

1 answer

0

Hello, Julius!

<body>    
<!--começa navBAR-->
<nav class="navbar navbar-inverse">

  <!-- container navBAr-->
  <div class="container">
    <!-- header da navbar-->
    <div class="navbar-header">
      <!-- botao que mostra e esconde a navbar--> 
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>

    </div><!--fim header navbar-->  

    <div class="collapse navbar-collapse" id="navbar">
      <ul class="nav navbar-nav">
        <li><a href="{$GET_HOME}"><i class="glyphicon glyphicon-home"></i> Home </a> </li>

        <li><a href="{$PAG_MINHACONTA}"><i class="glyphicon glyphicon-user"></i> Minha Conta </a> </li>
        <li><a href="{$PAG_CARRINHO}"><i class="glyphicon glyphicon-shopping-cart"></i> Carrinho </a> </li>
        <li><a href="{$PAG_CONTATO}" ><i class="glyphicon glyphicon-envelope"></i> Contato </a> </li>

      </ul>


      <form class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Digite para buscar" required>
        </div>
        <button type="submit" class="btn btn-primary">Buscar</button>
      </form>

    </div><!-- fim navbar collapse-->   


  </div> <!--fim container navBar-->

</nav><!-- fim da navBar--> 

<div class="container-fluid">

  <div class="row">
    <div class="col-md-2" style="background-color:red;">

      <div class="list-group">
          <span class="list-group-item active"> Categorias</span>

                <a href="#" class="list-group-item"><span class="glyphicon glyphicon-menu-right"></span> Presentes</a> 
                <a href="#" class="list-group-item"><i class="glyphicon glyphicon-menu-right"></i> Brinquedos</a> 

                <a href="#" class="list-group-item"><span class="glyphicon glyphicon-menu-right"></span> Presentes</a> 
                <a href="#" class="list-group-item"><i class="glyphicon glyphicon-menu-right"></i> Brinquedos</a> 

                <a href="#" class="list-group-item"><span class="glyphicon glyphicon-menu-right"></span> Presentes</a> 
                <a href="#" class="list-group-item"><i class="glyphicon glyphicon-menu-right"></i> Brinquedos</a> 


            </div><!--fim da list group-->              

    </div>
    <div class="col-md-10"style="background-color:green;">

      <ul class="breadcrumb">
                    <li><a href="#"><i class="glyphicon glyphicon-home"></i> Home </a></li>
                    <li><a href="#"> Produtos </a></li>
                    <li><a href="#"> Info </a></li>
                </ul>   
                <!-- fim do menu breadcrumb--> 

                {php}

                Rotas::get_Pagina();    


                {/php}            

    </div><!-- fim col 10 -->

  </div><!-- fim linha -->

  <div class="row">
    <div class="col-md-12 text-center">
      <h4>{$TITULO_SITE}</h4>
      <p> Todos os diretos reservados</p>
    </div>
  </div>

</div><!-- cls container -->

I hope I have helped you!

    
11.05.2018 / 22:51