<?php 
     session_start(); ?>

<html>

<head>
        <link rel="stylesheet" type="text/css" href="https://bma24.com/assets/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="assets/css/style.css?ver=<?php echo rand(000000000,999999999 ); ?>">
    	<script language="javascript" type="text/javascript" src="assets/js/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="assets/js/dados.js?ver=<?php echo rand(000000000,999999999 ); ?>" charset="UTF-8"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>

     <?php
     if(!isset($_SESSION['password']) or !isset($_SESSION['password']) or $_SESSION['passUser'] != 'ty73bhtgm352edr4') 
     { ?>
         <div class="header-bg"></div>
         <div class="container">
             <div class="row">
            <div class=" col-12 block-login">
                <div class="col-12 text-center"><h1><img src="assets/images/bliss_logo.jpg" alt =""Bliss Natura width="150" height="150"/></h1></div>
                <div class="col-12 text-center"><h3>Lead Manager</h3></div>
                    <div>
                        <form action="ValidaPassword.php" method="post" >
                            <div class="form-group">
                                <label for="user">Utilizador</label> 
                                <input type="text" name="user" class="form-control" value=""></div>
                            <div class="form-group">
                                <label for="pass">Password</label> 
                                <input type="password" name="pass" class="form-control" value=""> </div>

                            <input type="submit" name="submit" value="Aceder" class="btn btn-success">
                        </form>
                    </div>
                </div>
            </div>
         </div>
<?php
	 exit();
     }
     else
     {
          $per = explode(",", $_SESSION['password']);
          $idUser = $per[0];
          $nameUser = $per[1];
          $nivelUser=$per[3];
     }

?>

<div id="combo" style="display:none;">
    <div class="dialogPopup">
      <p>Insira o valor da venda (apenas números são aceites): </p>
      <input type="text" id="valorCombo"><br>
      <p id="CancCompra" style="cursor: pointer">Cancelar</p>
    </div>
   </div>
<div class="container-fluid">
<div class="row">
    <div class="header-bg"></div>
   <div id="head" class="navbar-header">
        <div id="head1">
           
        </div>

        <div id="head2">
            <div>Operador: <?php echo $nameUser ?> <a href="TerminaSessao.php" style="color:#9dd6ed; font-size:10px;">Log out</a></div>
            <h2>LEAD MANAGER</h2>
            <h3>Calcio Mais</h3>
        </div>
   </div>
   <table class="content-box table" id="conteudo" cellpadding="0">
   </table>

   <div id="detalhes" class="container-fluid">
        <div class="row">

       <div class="col-12 col-md-4">
            <div class="box-head">
               Anotações
           </div>
              <textarea type="text" id="Anotacoes" class="notes-textarea"></textarea>


       </div>

       <div class="col-12 col-md-4">
           <div class="box-head">
               Histórico
           </div>
           <div id="Historico" class="history-box">
            
           </div>
       </div>

       <div class="col-12 col-md-4">
           <table class="table sales-table">
               <thead>
                    <tr >
                        <td>Total</td>
                        <td>Contactadas</td>
                        <td>Vendas</td>
                        <td>€</td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>Hoje</td>
                        <td id="ContUserH"></td>
                        <td id="VendasUserH"></td>
                        <td id="VVendasUserH"></td>
                    </tr>
                    <tr>
                        <td>Mês</td>
                        <td id="ContUserM"></td>
                        <td id="VendasUserM"></td>
                        <td id="VVendasUserM"></td>
                    </tr>
                </tbody>
           </table>
       </div>
    <?php 
         if ($nivelUser==2)
         { ?>
         <div class="text-center col-12 mt-4 mb-4">
              <a href="javascript:void(0);" id="exportExcel" class="btn btn-primary">Export to Excel</a>
         </div>
        <?php }?>
   </div>
   </div>

</div>
</div>
<footer id="footer-bma" class="container-fluid">
    <div class="row">
        <div class="col-12 col-md-6">
            <p class="copyright">©<span id="year"></span> copyright. Powered by BlueMarketAgency</p>
         </div>
         <div class="col-12 col-md-6">
         <p class="disclaimer"></p>
         </div>
    </div>
         </footer>

         <script>
            document.getElementById("year").innerHTML = new Date().getFullYear();
        </script>
</body>

</html>