<!-- Vertical Nav Bar -->
<link rel="stylesheet" href="css/nav-bar/menu.min.css">
<link rel="stylesheet" href="css/nav-bar/menu.css">
<style>
.sidebar {
	max-height: unset;
	min-height: unset;
}
#login-form input{
	margin-bottom: 0 !important;
}
.help-block {
    color: #d32f2f;
    font-size: 12px;
}
</style>
<div class="row">
  <div class="col-lg-12" style="padding-right: 0px;">
    <?php include 'common/sidebar-nav.php'; ?>
  </div>
</div>
<br>
<div class="row">
  <div class="col-lg-12">
    <div class="tab-widget"> 
      <!-- Nav tabs -->
      <ul class="nav nav-tabs" id="myTab" role="tablist">
        <li class="nav-item"> <a class="nav-link active" data-toggle="tab" href="#rel_links" role="tab"><?php if($lang == 1) { ?> RELATED LINKS <?php } if($lang == 2) { ?> සබැඳි වෙබ් අඩවි <?php } if($lang == 3) { ?> தொடர்புடைய இணைப்புகள் <?php } ?></a> </li>
        <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="#pub" role="tab"><?php if($lang == 1) { ?> PUBLICATIONS <?php } if($lang == 2) { ?> ප්‍රකාශන <?php } if($lang == 3) { ?> வெளியீடுகள் <?php } ?></a> </li>
      </ul>
      <!-- Tab panes -->
      <div class="tab-content">
        <div class="tab-pane fade show active" id="rel_links" role="tabpanel">
		  <?php $sql_link = mysqli_query($conn, "SELECT title, url, logo FROM related_links WHERE lang='$lang' AND del=0 ORDER BY id ASC, group_id ASC");
          while($row_link = mysqli_fetch_array($sql_link)) { ?>
          <div class="m-view-content">
            <?php if(!empty($row_link['logo'])) { ?>
            <div class="m-view-img"> <a href="#"><img src="backend/upload/related_links/<?php echo $row_link['logo']; ?>" alt="" class="img-fluid"></a> </div>
            <?php } ?>
            <div class="img-content">
              <p><a href="<?php echo $row_link['url']; ?>" target="_blank"><?php echo $row_link['title']; ?></a></p>
            </div>
          </div>
          <?php } ?>        
        </div>
        <div class="tab-pane fade" id="pub" role="tabpanel">
          <div class="catagory-content">
            <div class="row">
              <div class="col-md-12">
                <ul class="list-unstyled">
              	  <?php $sql_pub = mysqli_query($conn, "SELECT title FROM publications WHERE lang='$lang' AND del=0 ORDER BY id ASC, group_id ASC");
				  while($row_pub = mysqli_fetch_array($sql_pub)) { ?>
                  <li><a href="#"><i class="fa fa-angle-right"></i> &nbsp;<?php echo $row_pub['title']; ?></a></li>
                  <?php } ?>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="login-widget">
      <h4><?php if($lang == 1) { ?> LOG IN <?php } if($lang == 2) { ?>ලොග් වන්න<?php } if($lang == 3) { ?> உள்நுழை <?php } ?></h4>
	  <form method="post" id="login-form">
		<div id="errorDiv"></div>	
		<div class="form-group">
		<input type="text" name="user" placeholder="<?php if($lang == 1) { ?> User Name <?php } if($lang == 2) { ?> පරිශීලක නාමය <?php } if($lang == 3) { ?> பயனப்பெயர் <?php } ?>">
		 <span class="help-block" id="error"></span></div>
       
		<div class="form-group">
		<input type="password" name="password" placeholder="<?php if($lang == 1) { ?> Password <?php } if($lang == 2) { ?> මුරපදය <?php } if($lang == 3) { ?> கடவூச்சொல் <?php } ?>">
		 <span class="help-block" id="error"></span></div>
        <button type=""  id="btn-login"><?php if($lang == 1) { ?> LOGIN <?php } if($lang == 2) { ?> ඇතුල් වන්න <?php } if($lang == 3) { ?> உள்நுழை <?php } ?></button>
      </form> 
    </div>
    <div class="news-details">
      <div class="relate-news">
        <h4><?php if($lang == 1) { ?> LATEST NEWS <?php } if($lang == 2) { ?> නවතම ප්‍රවෘත්ති <?php } if($lang == 3) { ?> புதிய செய்தி <?php } ?></h4>
        <div class="owl-carousel relate-slider">
          <?php $sql_latest = mysqli_query($conn, "SELECT title, img, group_id FROM news WHERE lang='$lang' AND del=0 ORDER BY id DESC, group_id ASC LIMIT 3");
		  while($row_latest = mysqli_fetch_array($sql_latest)) { ?>
          <div class="slider-content"> <img src="backend/upload/news/<?php echo $row_latest['img']; ?>" alt="" class="img-fluid">
            <div class="slider-layer">
              <p><a href="news-details.php?gid=<?php echo $row_latest['group_id']; ?>"><?php $t = $row_latest['title']; if (strlen($t) > 60) $t = substr($t, 0, strrpos(substr($t, 0, 60), ' ')) . '...'; echo $t; ?></a></p>
            </div>
          </div>
          <?php } ?>
        </div>
      </div>
    </div>
  </div>
</div>
