<?php

require_once('config.php');

$garsonKodu = intval($_POST['garsonKodu']);


$result = odbc_exec($db,"SELECT * FROM Q_Userkontrol WHERE pwd='$garsonKodu' AND bolum='Garson'");

$user = odbc_fetch_array($result);

if($user['bolum'] == 'Garson'){
  $waiter = array(
    'name' => $user['username'],
    'code' => $user['pwd']
  );

  $response = array('successful' => true, 'waiter' => $waiter);
} else
  $response = array('successful' => false);


utf8_print($response);

?>
