<?php

$gender =$_POST['gender'];
$campus = $_POST['selectedValue'];
//$student_id = $_POST['student_id'];

include('../../db_connect/db.php');

echo '<div class="form-group">
      <label for="title" class="col-sm-2 control-label" style="margin-top:10px;">Select Block </label>
      <div class="col-sm-10">
    <input type="hidden" id="site_id" value="'.$campus.'">
       <div class="input-group" style="margin-top:10px;">
        <select class="form-control" id="category" onchange="allocate();">
          <option></option>';

                $sql_get_state=mysqli_query($conn_1, "SELECT CONCAT_WS(' ', title, description) as name, id FROM hostel_blocks WHERE campus_id='$campus' AND gender='$gender'") or die(mysqli_error($conn_1));
                if($sql_get_state){
                  $sql_get_state_row=mysqli_num_rows($sql_get_state);
                  if($sql_get_state_row > 0){
                    while($row=mysqli_fetch_array($sql_get_state)){

                      $id = $row['id'];
                      //echo'<input type="text" name="id" value="'.$id.'"/>';
                      echo '1';
                      echo '<option name="title" value="'.$row['id'].'">'.$row['name'].'</option>';
                    }
                  }
                }



        echo '</select>
        <div class="input-group-addon"> <span class="ast">*</span></div>
        </div>

      </div>
   </div>

   ';

   ?>
