<!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">
<link rel="stylesheet" href="backend/bootstrap/css/bootstrap.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="backend/plugins/datatables/dataTables.bootstrap.css">
<!-- Theme style -->
<link rel="stylesheet" href="backend/dist/css/AdminLTE.min.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>
<style>
@media screen and (max-width: 767px) {
.table-responsive {
	margin-bottom: 0;
	border: none;
}
.tbl {
	padding: 12px !important;
}
}
.tbl {
	padding: 25px;
	border: 1px solid #d9d9d9;
}
.reg_list {
	padding: 0px 0 20px;
}
</style>
</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) { ?>
              REGISTERED CONTRACTORS
              <?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>
                <?php if($lang == 1) { ?>
                Contractors
                <?php } if($lang == 2) { ?>
                කොන්ත්‍රාත්කරුවන්
                <?php } if($lang == 3) { ?>
                ஒப்பந்ததாரர்கள்
                <?php } ?>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
<!-- End Page Heading -->

<section class="reg_list">
  <div class="container">
    <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="tbl">
          <div class="row">
            <div class="col-lg-8 col-md-8">
              <h4>REGISTERED CONTRACTERS FOR BUILDING WORKS - 
			  <?php 
			  if(isset($_GET['year'])) {
				echo $year = htmlspecialchars(strip_tags(trim($_GET['year'])), ENT_QUOTES, 'UTF-8');
			  } else { echo $year = date('Y'); } ?></h4>
            </div>
            <div class="col-lg-4 col-md-4">
              <form class="form-horizontal" name="form" id="form">
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-4 control-label">Select Year:</label>
                  <div class="col-sm-8">
                    <select class="form-control" name="year" id="year" onChange="formHandler()">
                      <option value=""></option>
					  <?php $sql_r = mysqli_query($conn, "SELECT reg_year FROM contractor_reg WHERE del=0 AND reg_year!=0 GROUP BY reg_year"); 
					  while($row_r = mysqli_fetch_array($sql_r)) { ?>
                      <option value="registered-contractors?year=<?php echo $row_r['reg_year']; ?>"><?php echo $row_r['reg_year']; ?></option>
					  <?php } ?>
                    </select>
                  </div>
                </div>
              </form>
            </div>
          </div>
          <hr>
          <div class="table-responsive">
            <table id="tabl_reg" class="table table-bordered table-striped">
              <thead>
                <tr>
                  <th>#</th>
                  <th>Name</th>
                  <th>Address</th>
                  <th>Business Reg. No</th>
                  <th>Telephone (Home)</th>
                  <th>Telephone (Office)</th>
                  <th>Telephone (Mobile)</th>
                  <th>Fax No</th>
                  <th>Email</th>
                  <th>SIDA No</th>
                  <th>Expiry Date</th>
                  <th>Building Grade</th>
                </tr>
              </thead>
              <tbody>
                <?php		 
				$sql="SELECT * FROM contractor_reg WHERE del=0 AND reg_year='$year' ORDER BY id ASC";
				$result=mysqli_query($conn, $sql);
				$x = 0;
				while ($row = mysqli_fetch_array($result)){ $x++;
				?>
                <tr>
                  <td><?php echo $x; ?>.</td>
                  <td><?php echo $row['name']; ?></td>
                  <td><?php echo $row['address']; ?></td>
                  <td><?php echo $row['business_reg']; ?></td>
                  <td><?php echo $row['tel_home']; ?></td>
                  <td><?php echo $row['tel_office']; ?></td>
                  <td><?php echo $row['tel_mobile']; ?></td>
                  <td><?php echo $row['fax']; ?></td>
                  <td><?php echo $row['email']; ?></td>
                  <td><?php echo $row['SIDA_no']; ?></td>
                  <td><?php echo $row['exp_date']; ?></td>
                  <td><?php echo $row['bldg_grade']; ?></td>
                </tr>
                <?php  } ?>
              </tbody>
            </table>
          </div>
        </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> 

<!-- Bootstrap 3.3.5 --> 
<script src="backend/bootstrap/js/bootstrap.min.js"></script> 
<!-- DataTables --> 
<script src="backend/plugins/datatables/jquery.dataTables.min.js"></script> 
<script src="backend/plugins/datatables/dataTables.bootstrap.min.js"></script> 
<script src='js/pdf_export/dataTables.buttons.min.js'></script> 
<script src='js/pdf_export/buttons.html5.min.js'></script> 
<script src='js/pdf_export/buttons.bootstrap.min.js'></script> 
<script src='js/pdf_export/jszip.min.js'></script> 
<script src='js/pdf_export/pdfmake.min.js'></script> 
<script src='js/pdf_export/vfs_fonts.js'></script> 
<script src="js/pdf_export/pdf_export.js"></script> 

<script>
$(function () {
  $("#tabl_reg").DataTable();
});
  
function formHandler(){
  var URL = document.form.year.options[document.form.year.selectedIndex].value;
  window.location.href = URL;
}
</script>

</body>
</html>