<?php

include './conn.php';

if (!empty($_POST["pickupdate"])) {

    $pickupdate = $_POST['pickupdate'];

    $hour = $_POST['hour'];

    $minute = $_POST['minute'];

    $richtung = $_POST['way'];

    $pickuptime = $hour . ':' . $minute . ':00';

    $pickupdate = date("Y-m-d", strtotime($pickupdate));



    if ($richtung == 'ZUM') {

	$table = 'stop_to';
    } else {

	$table = 'stop_from';
    }





    $sqlX = mysql_query("select * from $table where date='$pickupdate' AND day='1' ");

    if (mysql_num_rows($sqlX) == 0) {





	$sql = mysql_query("select * from $table where date='$pickupdate' AND `hour` = '$hour' ");



	if (mysql_num_rows($sql) == 0) {



	    $sql = mysql_query("select * from $table where date='$pickupdate' AND `time` = '$pickuptime' ");





	    if (mysql_num_rows($sql) == 0) {

	    } else {

		echo 'stop_time';
	    }
	} else {

	    echo 'stop_hour';
	}
    } else {

	echo 'stop_day';
    }
}



/*



  if (!empty($_POST["personen"]))

  {

  $personen=$_POST['personen'];

  if ($personen <='3'){$auto='limo';}

  if ($personen ==4){$auto='kombi';}

  if ($personen <=8 && $personen >=5 ){$auto='van';}







  if (!empty($plz)) {



  $sql=mysql_query("select $auto from plzliste where plz='$plz'");

  while($row=mysql_fetch_array($sql))

  {

  $price=$row['$auto'];

  echo $price;

  }

  }





  }

 */
?>