<!-- Mobile Menu -->
<section class="mobile-menu-area">
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <div class="mobile-menu">
          <nav id="dropdown"> <a href="home"><img src="images/mobile-logo.png" alt="" class="img-fluid"></a>
            <ul>
			  <?php $sql_cat = mysqli_query($conn, "SELECT group_id, url, cat FROM menu_category WHERE lang='$lang' AND del=0 ORDER BY order_id ASC");
              while($row_cat = mysqli_fetch_array($sql_cat)) {
                  $cat_id = $row_cat['group_id'];
                  $sql_sub = mysqli_query($conn, "SELECT url, sub_cat, group_id FROM menu_subcat WHERE lang='$lang' AND del=0 AND cat_id='$cat_id' ORDER BY order_id ASC");
                  if(mysqli_num_rows($sql_sub) == 0) {
              ?>
              <li class="list-inline-item"> <a href="<?php if(empty($row_cat['url'])) { echo '#'; } else { echo $row_cat['url']; } ?>"><?php echo $row_cat['cat']; ?></a></li>
              <?php } else { ?>
              <li class="list-inline-item"> <a href="#"><?php echo $row_cat['cat']; ?><span class="fa arrow"></span></a>
                <ul class="list-unstyled">
                  <?php while($row_sub = mysqli_fetch_array($sql_sub)) { ?>
                  <li><a href="<?php if(empty($row_sub['url'])) { 
					/*if($row_sub['group_id'] == 1) { // BSR
						$sql_bsr = mysqli_fetch_assoc(mysqli_query($conn, "SELECT pdf FROM procurements WHERE type=3 AND lang=1"));
						if(empty($sql_bsr['pdf'])) {
							echo '#';
						} else {
							echo 'backend/upload/PDF/procurements/'.$sql_bsr['pdf'];
						}
						
					} else if($row_sub['group_id'] == 3) { // Awaraded
						$sql_awd = mysqli_fetch_assoc(mysqli_query($conn, "SELECT pdf FROM procurements WHERE type=1 AND lang=1"));
						if(empty($sql_awd['pdf'])) {
							echo '#';
						} else {
							echo 'backend/upload/PDF/procurements/'.$sql_awd['pdf'];
						}
						
					} else if($row_sub['group_id'] == 4) { // Con Reg
						$sql_reg = mysqli_fetch_assoc(mysqli_query($conn, "SELECT pdf FROM procurements WHERE type=2 AND lang=1"));
						if(empty($sql_reg['pdf'])) {
							echo '#';
						} else {
							echo 'backend/upload/PDF/procurements/'.$sql_reg['pdf'];
						}
						
					} else {*/
						echo '#'; 
					//} 
				  } else { echo $row_sub['url']; } ?>" target="<?php //if(empty($row_sub['url'])) { echo '_blank'; } ?>"><?php echo $row_sub['sub_cat']; ?></a></li>
                  <?php } ?>
                </ul>
              </li>
              <?php } } ?>
            </ul>
          </nav>
        </div>
      </div>
    </div>
  </div>
</section>
<!-- End Mobile Menu --> 