<?php
session_start();
if ($_SESSION['hash_5cd']){
    require_once 'class/Cadastros.php';
    $c = new Cadastros();
    $c->Monta_Cadastro();
}

require_once 'class/Site.php';
$site = new Site();
?>
<!-- HEADER DESKTOP-->
<header class="header-desktop3 d-none d-lg-block">
    <div class="section__content section__content--p35">
        <div class="header3-wrap">
            <div class="header__logo">
                <a href="/4fretes">
                    <img src="/app/images/logo-4fretes.png" alt="4 Fretes" />
                </a>
            </div>
            <div class="header__navbar">
                <ul class="list-unstyled">
                    
                    <li>
                        <a href="/app/">
                           <span class="bot-line"></span><i class="fas fa-check-circle"></i> Solicitar Orçamento</a>
                    </li>
                        
                    <li>
                        <a href="/app/como-funciona">
                            
                            <span class="bot-line"></span><i class="fas fa-question-circle"></i> Como funciona</a>
                    </li>                

                   <li>
                        <a href="/app/cadastro">
                           <span class="bot-line"></span><i class="fas fa-truck"></i> Cadastro de Profissional</a>
                    </li>

                </ul>
            </div>
            
            
            <div class="header__tool">

                <?php
                if (!empty($_SESSION['hash_5cd'])) {
                    ?>

                    

                    <div class="account-wrap">
                        <div class="account-item account-item--style2 clearfix js-item-menu">
                            <div class="image">
                                <img src="<?php if(empty($c->getFoto())){ echo '/app/images/icon/avatar-01.jpg'; }else{ 
                            echo '/app/fotos/'.$c->getFoto(); } ?>" alt="Usuário" />
                            </div>
                            
                            <div class="content">
                                <a class="js-acc-btn" href="#"><?php echo $c->getPnome() ?></a>
                            </div>
                            <div class="account-dropdown js-dropdown">
                                <div class="info clearfix">
                                    <div class="image">
                                        <a href="#">
                                            <img src="<?php if(empty($c->getFoto())){ echo '/app/images/icon/avatar-01.jpg'; }else{ 
                            echo '/app/fotos/'.$c->getFoto(); } ?>" alt="<?php echo $c->getPnome() ?>" />
                                        </a>
                                    </div>
                                    <div class="content">
                                        <h5 class="name">
                                            <a href="#"><?php echo $c->getPnome() ?></a>
                                        </h5>
                                        <span class="email"><?php echo $c->getEmail() ?></span>
                                    </div>
                                </div>
                                <div class="account-dropdown__body">
                                    <div class="account-dropdown__item">
                                         <a href="/app/user/">
                                            <i class="fas fa-tachometer-alt" style="font-size: 14px; width: 10px; margin-right:20px;"></i>Início</a>
                                    </div>
                                    <div class="account-dropdown__item">
                                        <a href="/app/user/meus-orcamentos">
                                            <i class="fas fa-file-alt" style="font-size: 14px; width: 10px; margin-right:20px;"></i>Meus orçamentos</a>
                                    </div>
                                    <div class="account-dropdown__item">
                                        <a href="/app/user/minha-conta">
                                            <i class="fas fa-user" style="font-size: 14px; width: 10px; margin-right:20px;"></i>Minha conta</a>
                                    </div>
                                    
                                    <div class="account-dropdown__item">
                                         <a href="/app/user/meu-plano">
                                            <i class="fas fa-dollar" style="font-size: 14px; width: 10px; margin-right:20px;"></i>Meu plano</a>
                                    </div>

                                </div>
                                <div class="account-dropdown__footer">
                                    <a href="/app/logout">
                                        <i class="zmdi zmdi-power"></i>Sair</a>
                                </div>
                            </div>
                        </div>
                    </div>

                    <?php
                } else {
                    ?>
                    <div class="account-wrap">
                        <div class="account-item account-item--style2 clearfix js-item-menu">

                            <div class="content">
                                <span class="fas fa-user-circle fa-2x" style="margin-right: 10px; float: left; color: #999;"></span>
                                <a class="js-acc-btn" href="#"> Entrar</a>
                            </div>
                            <div class="account-dropdown js-dropdown">
                                <div class="info clearfix">

                                    
                                    <form action="javascript:func()" method="post" name="inclogin" id="inclogin">
                                            <div class="form-group">

                                                <input class="au-input au-input--full" type="email" name="emaillog" id="emaillog" placeholder="Email">
                                            </div>
                                            <div class="form-group">

                                                <input class="au-input au-input--full" type="password" name="senhalog" id="senhalog" placeholder="Senha">
                                            </div>
                                        
                                        <div id="carrega" name="carrega" style="display:none;"></div>
                                        <div id="statuslogin" name="statuslogin" style="display:none;"></div>

                                            <button id="btnentrar" class="au-btn au-btn--block au-btn--green m-b-20 loginform" type="submit">ENTRAR</button>

                                        </form>
                                    
                                </div>
                                <div class="account-dropdown__body">
                                    <div class="account-dropdown__item">
                                        <a href="/app/lembrar-senha">
                                            <i class="fas fa-unlock-alt"></i>Esqueci a senha</a>
                                    </div>
                                    <div class="account-dropdown__item">
                                        <a href="/app/cadastro">
                                            <i class="fas fa-user-plus"></i>Cadastro de Profissional</a>
                                    </div>

                                </div>

                            </div>
                        </div>
                    </div>

                    <?php
                    }
                ?>


            </div>
        </div>
    </div>
</header>
<!-- END HEADER DESKTOP-->

<!-- HEADER MOBILE-->
<header class="header-mobile header-mobile-2 d-block d-lg-none">
    <div class="header-mobile__bar">
        <div class="container-fluid">
            <div class="header-mobile-inner">
                <button class="hamburger hamburger--slider" type="button">
                    <span class="hamburger-box">
                        <span class="hamburger-inner"></span>
                    </span>
                </button>
                <a  class="logomobile" href="/4fretes">
                    <img src="/app/images/logo-4fretes.png" alt="4Fretes" />
                </a>
                
                <div class="sub-header-mobile-2 d-block d-lg-none">
    <div class="header__tool">
 
        <?php
                if ($_SESSION['hash_5cd']) {
                    ?>

                    

                    <div class="account-wrap">
                        <div class="account-item account-item--style2 clearfix js-item-menu">
                            
                            <div class="content">
                                <a class="js-acc-btn" href="#"><?php $c->getPnome(); ?></a>
                            </div>
                            <div class="account-dropdown js-dropdown">
                                <div class="info clearfix">
                                    <div class="image">
                                        <a href="#">
                                            <img src="<?php if(empty($c->getFoto())){ echo '/app/images/icon/avatar-01.jpg'; }else{ 
                            echo '/app/fotos/'.$c->getFoto(); } ?>" alt="<?php echo $c->getPnome() ?>" />
                                        </a>
                                    </div>
                                    <div class="content">
                                        <h5 class="name">
                                            <a href="#"><?php echo $c->getPnome() ?></a>
                                        </h5>
                                        <span class="email"><?php echo $c->getEmail() ?></span>
                                    </div>
                                </div>
                                <div class="account-dropdown__body">
                                    <div class="account-dropdown__item">
                                        <a href="/app/user/">
                                            <i class="fas fa-tachometer-alt"></i>Início</a>
                                    </div>
                                    <div class="account-dropdown__item">
                                        <a href="/app/user/meus-orcamentos">
                                            <i class="fas fa-file-alt"></i>Meus Orçamentos</a>
                                    </div>
                                    <div class="account-dropdown__item">
                                        <a href="/app/user/minha-conta">
                                            <i class="fas fa-user"></i>Minha Conta</a>
                                    </div>
                                    <div class="account-dropdown__item">
                                        <a href="/app/user/meu-plano">
                                            <i class="fas fa-dollar"></i>Meu Plano</a>
                                    </div>

                                </div>
                                <div class="account-dropdown__footer">
                                    <a href="/app/logout">
                                        <i class="fas fa-power-off"></i>Sair</a>
                                </div>
                            </div>
                        </div>
                    </div>

                    <?php
                } else {
                    ?>
                    <div class="account-wrap">
                        <div class="account-item account-item--style2 clearfix js-item-menu">

                            <div class="content">
                                
                                <a class="js-acc-btn" href="#"> Entrar</a>
                            </div>
                            <div class="account-dropdown js-dropdown">
                                <div class="info clearfix">

                                    
                                    <form action="javascript:func()" method="post" name="moblogin" id="moblogin">
                                            <div class="form-group">

                                                <input class="au-input au-input--full" type="email" name="emaillog" id="emaillog" placeholder="Email">
                                            </div>
                                            <div class="form-group">

                                                <input class="au-input au-input--full" type="password" name="senhalog" id="senhalog" placeholder="Senha">
                                            </div>
                                        
                                        <div id="carrega" name="carrega" style="display:none;"></div>
                                        <div id="mobstatuslogin" name="mobstatuslogin" style="display:none;"></div>

                                            <button id="mobbtnsubmit" class="au-btn au-btn--block au-btn--green m-b-20 mobloginform" type="submit">ENTRAR</button>

                                        </form>
                                    
                                </div>
                                <div class="account-dropdown__body">
                                    <div class="account-dropdown__item">
                                        <a href="/app/lembrar-senha">
                                            <i class="fas fa-unlock-alt"></i>Esqueci a senha</a>
                                    </div>
                                    <div class="account-dropdown__item">
                                        <a href="/app/cadastro">
                                            <i class="fas fa-user-plus"></i>Cadastro de Profissional</a>
                                    </div>

                                </div>

                            </div>
                        </div>
                    </div>

                    <?php
                    }
                ?>
    </div>
</div>
                
            </div>
        </div>
    </div>
    <nav class="navbar-mobile">
        <div class="container-fluid">
            <ul class="navbar-mobile__list list-unstyled">
                <li>
                    <a href="/app/">
                        <i class="fas fa-check-circle"></i> Solicitar Orçamento</a>
                </li>
                <li>
                    <a href="/app/como-funciona">
                        <i class="fas fa-question-circle"></i> Como Funciona</a>
                </li>  
                 <li>
                    <a href="/app/cadastro">
                        <i class="fas fa-truck"></i> Cadastro de Profissional</a>
                </li>
                             
                
            </ul>
        </div>
    </nav>
</header>

<!-- END HEADER MOBILE -->