<div id="searchModal" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
     
      <div class="modal-body">
      <div class="row">
 
 <div class="col-md-12">
 <form action="search_results.php" method="post">
    <div class="input-group">
    <div class="input-group-btn">
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-gear fa-fw"></i></button>
        <ul class="dropdown-menu dropdown-menu-left">
          <li> <input type="checkbox" name="property" value="property" id="property" style='margin-left:5px;margin-right:5px'><label for="property">Property</label>
          </li>
          <?php          if($user_type == 'admin'){     ?>
          <li> <input type="checkbox" name="users" value="users" id="users" style='margin-left:5px;margin-right:5px'><label for="users">Users</label></li>
          <?php          }     ?>
          <li> <input type="checkbox" name="jobs" value="jobs" id="jobs" style='margin-left:5px;margin-right:5px'><label for="jobs">Jobs</label></li>
          <li> <input type="checkbox" name="orders" value="orders" id="orders" style='margin-left:5px;margin-right:5px'><label for="orders">Orders</label></li>
          <li> <input type="checkbox" name="payments" value="payments" id="payments" style='margin-left:5px;margin-right:5px'><label for="payments">Payments</label></li>
          <li> <input type="checkbox" name="invoices" id="invoices" value="invoices" style='margin-left:5px;margin-right:5px' checked><label for="invoices">Invoices</label></li>
          <li> <input type="checkbox" name="all" value="all" id="all" style='margin-left:5px;margin-right:5px'><label for="all">All</label>
          </li>
        </ul>
      </div><!-- /btn-group -->
      <input type="text" class="form-control" name="search_text" id="search_text" required minlength='2' placeholder='Search'>
      <span class="input-group-btn">
        <button class="btn btn-info" type="submit"><i class="fa fa-search fa-fw"></i>Search</button>
      </span>
    </div><!-- /input-group -->
</form>
    </div>

</div><!-- /.row -->
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger btn-xs" data-dismiss="modal"><i class="fa fa-times-circle" aria-hidden="true"></i> Close</button>
      </div>
    </div>
  </div>
</div>

<script>
$("#app_search").on("click",function(){
  if(!($(this)).hasClass("disabled")) {
	$('#searchModal').modal('show');

  }
});
$(".dropdown-menu li").click((event) => {
         event.stopPropagation()
         let url = event.target.href
         
    })

    $('#searchModal').on('shown.bs.modal', function () {
  
  $('#search_text').focus()
})
</script>
<script>
            $('#all').click(function() {
    if ($(this).is(':checked')) {
        $('div input').attr('checked', true);
    } else {
        $('div input').attr('checked', false);
    }
});
            </script>