<?php  
 require 'db_config/config.php';
 if(isset($_POST["from_date"], $_POST["to_date"]))  
 {  
      $output = '';  
      $query = "  
           SELECT * FROM asset_info  
           WHERE date BETWEEN '".$_POST["from_date"]."' AND '".$_POST["to_date"]."'  
      ";  
      $result = mysqli_query($connect, $query);  
      $output .= '  
           <table class="table table-bordered">  
                <tr>  
                        
		<th>ID</th>
		<th>USER</th>
		<th>USER STATUS</th>
		<th>DESIGNATION</th>
		<th>DEVICE</th>
		<th>BRAND</th>
		<th>MODEL NUMBER</th>
		<th>LOCATION</th>
		<th>ASSET TAGGING</th>
		<th>ASSET TAG </th>
		<th>DATE</th>
		</tr>
      ';  
      if(mysqli_num_rows($result) > 0)  
      {  
           while($row = mysqli_fetch_array($result))  
           {  
                $output .= '  
                     <tr>  
                          <td>'. $row["id"] .'</td>  
                          <td>'. $row["user"] .'</td>  
                          <td>'. $row["user_status"] .'</td>  
                          <td>'. $row["designation"] .'</td>  
                          <td>'. $row["device"] .'</td>  
                          <td>'. $row["brand"] .'</td>  
                          <td>'. $row["model_num"] .'</td>  
                          <td>'. $row["location"] .'</td>  
                          <td>'. $row["asset_tagging"] .'</td>  
                          <td>'. $row["asset_tag"] .'</td>  
                          <td>'. $row["date"] .'</td>    
                     </tr>  
                ';  
           }  
      }  
      else  
      {  
           $output .= '  
                <tr>  
                     <td colspan="5">No Order Found</td>  
                </tr>  
           ';  
      }  
      $output .= '</table>';  
      echo $output;  
 }  
 ?>