<?php
		$ubs_data = Session::getSession('UBS_DATA');
?>
<div class="row">
	<form id="searchDb">
		<div class="col-xs-2">
			<div class="panel panel-default">
				<div class="panel-heading">
					<i class="pe-7s-search pe-lg"></i> Search
				</div>
				<div class="panel-body">
					<div class="row">
						<div class="form-group col-xs-12">
							<input type="search" name="dbName" class="form-control" placeholder="SEARCH DB"/>
						</div>
						<div class="form-group col-xs-12">
							<select name="ub" placeholder="type" class="form-control">
								<option value="%%">DATABASES</option>
							<?php
								foreach($ubs_data as $each){
							?>
								<option value="<?= $each[0] ?>"><?= $each[1] ?></option>
							<?php
								}
							?>
							</select>
						</div>
						<div class="form-group col-xs-12">
							<select name="status" class="form-control">
								<option value="%%">Status</option>
								<option value="available">Available</option>
								<option value="used">Used</option>
								<option value="queue">Queue</option>
							</select>
						</div>
						<div class="form-group col-xs-12">
							<button class="btn btn-success-standard form-control" type="submit">
								<i class="pe-7s-search pe-lg"></i>
							</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="col-xs-10">
			<div class="panel panel-default">
				<div class=" panel-heading">
					<i class="pe-7s-monitor pe-va pe-lg"></i> Report
				</div>
				<div class="panel-body">
					<div class="listsContainer">
						<input type="hidden" name="counts" class="toRemove" value="20"/>
						<input type="hidden" name="page" value="1"/>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
<script>
$(function(){
	$('#searchDb').submit(function(){
		form_values = $('#searchDb').serialize();
		// $('.listsContainer').html('Searching. . .');
		$('.cssload-holder').css('opacity','1');
		$.post('<?= URL ?>report/searchDb',form_values)
			.done(function(returnData){
				
				$('.cssload-holder').css('opacity','0');
				$('.listsContainer').html(returnData);
			});
		return false;
	});
})
</script>