<?php
   # Incluindo a classe
   require('googleTranslateTool.class.php');
   
   		$tempo_sessao =  120*300*120*50;
   		if (session_status() !== PHP_SESSION_ACTIVE) {//Verificar se a sessão não já está aberta.
   			ini_set('session.gc_maxlifetime', $tempo_sessao);
   			ini_set('session.cookie_lifetime', $tempo_sessao);
   			ini_set("session.cookie_secure", $tempo_sessao);
   			ini_set("session.sess_expiration", 0);
   			ini_set("session.sess_expire_on_close", TRUE);
   			ini_set('session.save_path',realpath(dirname(__FILE__).'/sessao'));
   			ini_set('session.gc_probability', 1);
   			session_start();
   		}
   		
   		//Obtendo o id da sessão iniciada: 
   		$idSession = session_id();
   		
   
   
   if(isset($_POST['pt_br'])){
   	
   	$_SESSION['language'] = 'pt-br';
   	$_SESSION['source'] = 'en';
   	$_SESSION['target'] = 'pt-br';
   	
   }elseif(isset($_POST['en'])){
   	
   	$_SESSION['language'] = 'en';
   	$_SESSION['source'] = 'pt-br';
   	$_SESSION['target'] = 'en';
   	
   }elseif(!isset($_POST['pt_br']) AND !isset($_POST['en'])){
   	
   	if(isset($_SESSION['language']) AND isset($_SESSION['source']) AND isset($_SESSION['target'])){
   
   		$_SESSION['language'] = $_SESSION['language'];
   		$_SESSION['source'] = $_SESSION['source'] ;
   		$_SESSION['target'] = $_SESSION['target'];
   
   	}else{
   		
   		$_SESSION['language'] = 'pt-br';
   		$_SESSION['source'] = 'en';
   		$_SESSION['target'] = 'pt-br';
   		
   	}
   	
   }
   		
   
 include_once('admin/conexao.php');
 include_once('admin/DAO/DAOnoticias.php');
 $DaoNoticias  = new DaoNoticias();      
   
   
   ?>
<!DOCTYPE html>
<html lang="pt-nr">
   <head>
      <meta charset="utf-8" />
      <?php include "titulo.php" ?>
      <meta content="width=device-width, initial-scale=1.0" name="viewport" />
      <meta content="" name="keywords" />
      <meta content="" name="description" />
      <!-- Favicon -->
      <link href="img/favicon.ico" rel="icon" />
      <!-- Google Web Fonts -->
      <link rel="preconnect" href="https://fonts.googleapis.com" />
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
      <link
         href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&family=Poppins:wght@600;700&display=swap"
         rel="stylesheet"
         />
      <!-- Icon Font Stylesheet -->
      <link
         href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css"
         rel="stylesheet"
         />
      <link
         href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css"
         rel="stylesheet"
         />
      <!-- Libraries Stylesheet -->
      <link href="lib/animate/animate.min.css" rel="stylesheet" />
      <link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet" />
      <!-- Customized Bootstrap Stylesheet -->
      <link href="css/bootstrap.min.css" rel="stylesheet" />
      <!-- Template Stylesheet -->
      <link href="css/style.css" rel="stylesheet" />
   </head>
   <style>
      .text-light {
      color: #052F59 !important;
      }
      /*
      //dispositivos móveis
      @media screen and (max-width: 480px) {
      .w-100-carrossel {
      width: 100% !important;
      height: 400px !important;
      }
      }　
      //iPads, tablets
      @media screen and (min-width: 481px) and (max-width: 768px) {
      .w-100-carrossel {
      width: 100% !important;
      height: 450px !important;
      }
      }　
      //telas pequenas, laptops
      @media screen and (min-width: 769px) and (max-width: 1024px) {
      .w-100-carrossel {
      width: 100% !important;
      height: 798px !important;
      }
      }　
      //desktops, telas grandes
      @media screen and (min-width: 1025px) and (max-width: 1200px) {
      .w-100-carrossel {
      width: 100% !important;
      height: 798px !important;
      }
      }　
      //telas muito grandes, TVs
      @media screen and (min-width: 1201px) {
      .w-100-carrossel {
      width: 100% !important;
      height: 798px !important;
      }
      }　
      */
      /*TELA CELULAR*/
      @media screen and (max-width: 600px) {
      .w-100-carrossel {
      width: 100% !important;
      height: 450px !important;
      }
      }
      /*TELA DESKTOP*/
      @media screen and (min-width: 900px) {
      .w-100-carrossel {
      width: 100% !important;
      height: 798px !important;
      }
      }
      .position-absolute {
      position: static !important;
      }
   </style>
   <body>
      <!-- Spinner Start -->
      <div
         id="spinner"
         class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center"
         >
         <div class="spinner-grow text-primary" role="status"></div>
      </div>
      <!-- Spinner End -->
      <!-- Topbar Start -->
      <!-- Topbar End -->
      <!-- Navbar Start -->
      <?php include "menu.php" ?>
      <!-- Navbar End -->
      <!-- Page Header Start -->
      <div class="container-fluid page-header py-5 mb-5 wow fadeIn" data-wow-delay="0.1s">
         <div class="container text-center py-5">
            <h1 class="display-4 text-white animated slideInDown mb-4"><?php if($_SESSION['target'] == 'pt-br'){echo 'Notícias';}else{echo GoogleTranslate::translate($_SESSION['source'], $_SESSION['target'],'Notícias');} ?></h1>
            <nav aria-label="breadcrumb animated slideInDown">
               <ol class="breadcrumb justify-content-center mb-0">
                  <li class="breadcrumb-item">
                     <a class="text-white" href="index.php">Home</a>
                     <a class="text-white" href="noticias.php">/<?php if($_SESSION['target'] == 'pt-br'){echo 'Notícias';}else{echo GoogleTranslate::translate($_SESSION['source'], $_SESSION['target'],'Notícias');} ?></a>
                  </li>
               </ol>
            </nav>
         </div>
      </div>
      <!-- Page Header End -->
      <!-- A empresa -->
      <div class="container">
         <div class="row">
            <div class="col-lg-12 wow fadeInUp shadow mb-60" data-wow-delay="0.5s">            
				<div class="row">
					<div class="col-lg-4 wow fadeInUp" data-wow-delay="0.8s">
						<img class="card-img-top" src="img/service-1.jpg" alt="Card image" style="width:90%;margin: 1.6rem 1.5rem 1.6rem 1rem !important;">
					</div>
					<?php 
			
					$result =  $DaoNoticias->PesquisarNoticias($_GET['nti_id']);
					foreach($result as $row){
						
						$nti_titulo = $row['nti_titulo'];
						$nti_descricao = $row['nti_descricao'];
						$nti_dt_cadastro = date("d/m/Y H:i", strtotime($row["nti_dt_cadastro"]));
						
					}

					?>
			
					<div class="col-lg-8 wow fadeInUp" data-wow-delay="0.12s">					    
					    <h1 class="display-8 mb-0" style="text-align: center;color: rgb(36,62,99);font-weight: 10;margin-top: 1rem !important;font-size: 1.5rem !important;"><?php if($_SESSION['target'] == 'pt-br'){echo $nti_titulo;}else{echo GoogleTranslate::translate($_SESSION['source'], $_SESSION['target'],$nti_titulo);} ?></h1><br>
						<p style="color: black;font-size: 1.1rem;text-align: justify;margin: 0.5rem 3rem 3rem 3rem !important;">					   
						<?php if($_SESSION['target'] == 'pt-br'){echo $nti_descricao;}else{echo GoogleTranslate::translate($_SESSION['source'], $_SESSION['target'],$nti_descricao);} ?><br></p>
						

					</div>	
                     
					 <div class="col-lg-12 wow fadeInUp" data-wow-delay="0.18s" style="visibility: visible; animation-delay: 0.18s; animation-name: fadeInUp;text-align: right;">	
					 <button class="btn"><i class="fa fa-calendar" style="color: #363636;line-height: 1.7;font-weight: 400;font-size: 15px;"> <?php echo $nti_dt_cadastro; ?></i></button>
					 </div>



					
				</div>					
            </div>       
         </div>
      </div>
      </div>
      <!-- About End -->
      <!-- Team Start -->
      <!-- Team End -->
      <!-- Footer Start -->
      <?php include "rodape.php" ?>
      <!-- Footer End -->
      <!-- Back to Top -->
      <a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"
         ><i class="bi bi-arrow-up"></i
         ></a>
      <!-- JavaScript Libraries -->
      <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
      <script src="lib/wow/wow.min.js"></script>
      <script src="lib/easing/easing.min.js"></script>
      <script src="lib/waypoints/waypoints.min.js"></script>
      <script src="lib/owlcarousel/owl.carousel.min.js"></script>
      <!-- Template Javascript -->
      <script src="js/main.js"></script>
   </body>
</html>
