<!doctype html>
<html class="no-js" lang="zxx">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>NWP ENGINEERING DEPARTMENT - SRI LANKA</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<!-- Google Fonts -->
<link href="css/fonts.css" rel="stylesheet">
<!-- Bootstrap-->
<link rel="stylesheet" href="css/assets/bootstrap.min.css">
<!-- Fontawesome Icon -->
<link rel="stylesheet" href="css/assets/font-awesome.min.css">
<!-- Animate CSS -->
<link rel="stylesheet" href="css/assets/animate.css">
<!-- Mean Menu -->
<link rel="stylesheet" href="css/assets/meanmenu.min.css">
<!-- Owl Carousel -->
<link rel="stylesheet" href="css/assets/owl.carousel.min.css">
<!-- Magnific Popup -->
<link rel="stylesheet" href="css/assets/magnific-popup.css">
<!-- Custom Style -->
<link rel="stylesheet" href="css/assets/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/assets/responsive.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-69018766-3"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-69018766-3');
</script>
</head>
<body>
<!-- Pre-Loader -->
<div id="page-preloader"><span class="spinner"></span></div>
<!-- End Pre-Loader --> 

<!-- Top Bar -->
<?php 
include 'common/top-bar.php';
include 'common/mobile-menu.php';
?>
<!-- End Top Bar --> 

<!-- Page Heading -->
<section class="p-heading text-center">
  <div class="container">
    <div class="page-bg">
      <div class="row">
        <div class="col-md-12">
          <div class="p-content">
            <h4><?php if($lang == 1) { ?> NEWS AND EVENTS <?php } if($lang == 2) { ?> පුවත් සහ සිදුවීම් <?php } if($lang == 3) { ?>  செய்திகளும் நிகழ்வூகளும்  <?php } ?></h4>
            <ul class="list-unstyled list-inline">
              <li class="list-inline-item"><a href="home"><?php if($lang == 1) { ?> Home <?php } if($lang == 2) { ?> මුල් පිටුව <?php } if($lang == 3) { ?> முகப்பு <?php } ?></a></li>
              <li class="list-inline-item"><i class="fa fa-long-arrow-right" aria-hidden="true"></i><a href="news-and-events"><?php if($lang == 1) { ?> News <?php } if($lang == 2) { ?> පුවත් <?php } if($lang == 3) { ?> செய்திகள் <?php } ?></a></li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
<!-- End Page Heading -->

<section class="news-details catagory">
  <div class="container">
    <div class="row">
      <div class="col-lg-3 col-sm-4 hidden-xs">
        <?php include 'common/common-sidebar.php'; ?>
      </div>
      <div class="col-lg-9 col-sm-8">
        <?php
		$gid = htmlspecialchars(strip_tags(trim($_GET['gid'])), ENT_QUOTES, 'UTF-8');
		if(empty($gid)) {
			header("Location: news-and-events");
		
		} else {
			$sql = mysqli_fetch_assoc(mysqli_query($conn, "SELECT title, description, DATE_FORMAT(date, '%M %d %Y') AS date, img FROM news WHERE lang='$lang' AND del=0 AND group_id='$gid'"));
			$sql_img = mysqli_query($conn, "SELECT img FROM news_img WHERE del=0 AND news_id='$gid'");
		}
		?>
        <div class="row">
          <div class="col-md-12">
            <div class="news-heading">
              <h4><?php echo $sql['title']; ?></h4>
              <ul class="list-unstyled list-inline">
                <li class="list-inline-item"><i class="fa fa-calendar"></i><?php echo $sql['date']; ?></li>
              </ul>
              <img src="backend/upload/news/<?php echo $sql['img']; ?>" alt="" class="img-fluid" style="width:450px">
              <p align="justify"><?php echo $sql['description']; ?></p>
            </div>
          </div>
        </div><hr>
        <div class="row">
          <div class="col-lg-12">
            <div class="popup-gallery">
              <?php while($row_img = mysqli_fetch_array($sql_img)) { ?>
              <a href="backend/upload/news_img/<?php echo $gid; ?>/<?php echo $row_img['img']; ?>" title=""><img src="backend/upload/news_img/<?php echo $gid; ?>/<?php echo $row_img['img']; ?>" width="200" height="auto" style="padding:3px;"></a>
              <?php } ?>
            </div>
          </div>
        </div>
        <br>
      </div>
    </div>
  </div>
  </div>
</section>

<!-- Footer -->
<?php include 'common/footer.php'; ?>
<!-- End Footer --> 

<!-- =========================================
JavaScript Files
========================================== --> 

<!-- jQuery JS --> 
<script src="js/assets/vendor/jquery-1.12.4.min.js"></script> 
<!-- Poppers Js --> 
<script src="js/assets/popper.js"></script> 
<!-- Bootstrap --> 
<script src="js/assets/bootstrap.min.js"></script> 
<!-- Sticky Js --> 
<script src="js/assets/jquery.sticky.js"></script> 
<!-- WOW JS --> 
<script src="js/assets/wow.min.js"></script> 
<!-- Smooth Scroll --> 
<script src="js/assets/smooth-scroll.js"></script> 
<!-- Mean Menu --> 
<script src="js/assets/jquery.meanmenu.min.js"></script> 
<!-- News Ticker --> 
<script src="js/assets/jquery.newsticker.min.js"></script> 
<!-- Owl Carousel --> 
<script src="js/assets/owl.carousel.min.js"></script> 
<!-- Magnific Popup --> 
<script src="js/assets/jquery.magnific-popup.min.js"></script> 
<!-- Syotimer --> 
<script src="js/assets/jquery.syotimer.min.js"></script> 
<!-- Custom JS --> 
<script src="js/plugins.js"></script> 
<script src="js/custom.js"></script> 
<!-- Vertical Nav Bar --> 
<script src="js/nav-bar/menu.min.js"></script> 

<!-- JavaScript Validation For Login Page -->
<script src="js/assets/jquery.validate.min.js"></script>
<script src="js/form_validate.js"></script>

<script>
$(document).ready(function() {
	$('.popup-gallery').magnificPopup({
		delegate: 'a',
		type: 'image',
		tLoading: 'Loading image #%curr%...',
		mainClass: 'mfp-img-mobile',
		gallery: {
			enabled: true,
			navigateByImgClick: true,
			preload: [0,1] // Will preload 0 - before current, and 1 after the current image
		},
		image: {
			tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
			titleSrc: function(item) {
				return item.el.attr('title') + '<small><?php echo $sql['date']; ?></small>';
			}
		}
	});
});

$(function() {
  $('#auto-collapse-menu-demo').metisMenu();
});
</script>

</body>
</html>