<?php

require_once('config.php');

$_hall = $_POST['hall'];
$_table = $_POST['table'];

$query = odbc_exec($db,"SELECT * FROM Q_Mars WHERE hall_name='$_hall' AND Masa='$_table'");

$items = array();
while($item = odbc_fetch_array($query) ) {

  $items[] = array(
    "id" => $item['MDY_ID'],
    "name" => $item['MADI'],
    "quantity" => $item['adet']
  );

}

$response = array("successful" => true, "items" => $items);

utf8_print($response);

?>
