JSON table and SQL Server via PHP

0

I need a simple filter of values of the column received by JSON and only show the lines that contain this value, json is generated by a php that does a query in SQL.

$(document).ready(function () {

 $('#retrieve-resources').click(function () {
 var displayResources = $('#display-resources');

 displayResources.text('Carregando Dados...');

 $.ajax({
 type: "GET",
 url: "consulta.php",
 success: function(result)
 {
 console.log(result);
 var output="<table><thead><tr><th>Data</th><th>Usuario</th><th>Relatos</th><th>Observacoes</th></thead><tbody>";
 for (var i in result)
 {
 output+="<tr><td>" + result[i].data.date + "</td><td>" + result[i].usuario + "</td><td>" + result[i].relato + "</td><td>" + result[i].observacao + "</td></tr>";
 }
 output+="</tbody></table>";

 displayResources.html(output);
 $("table").addClass("table");
 }
 });

 });
});
	<script src="js/json.js"></script>
  <select id="area" name="area" class="form-control">
					<option value="AF01">Al 1</option>
					<option value="AF02">Al 2</option>
				</select><br>
				<label class="col-md-4 control-label" for="celula">Celula</label>
				<select id="celula" name="celula" class="form-control">
					<option value="cl1">Celula 1</option>
					<option value="cl2">Celula 2</option>
				</select><br>
				<label class="col-md-4 control-label" for="subarea">Subarea</label>
				<select id="subarea" name="subarea" class="form-control">
		     
		      <option value="gna">s1/option>
		      <option value="lgs">s2</option>
		      <option value="trt">s3</option>
		      <option value="car">s4</option>
		      <option value="pci">s5</option>
		      <option value="reg">s6</option>
		      <option value="ger">s7</option>
		      <option value="dsp">s8</option>
		    </select>
		
			<div class="col-sm-8 text-left">
				<div id="display-resources">
				</div>
				<br><br>
				<center><a href="#" class="btn btn-primary" id="retrieve-resources">Atualizar</a></center>
				
    
asked by anonymous 01.02.2018 / 19:23

0 answers