diff --git a/index.php b/index.php index 5f2ba24..e2f983f 100644 --- a/index.php +++ b/index.php @@ -57,8 +57,8 @@ if ($type == "validate") { } else if ($type == "conn" || $type == "connection" || $type == "connections") { if ((isset($_GET["from"]) && isset($_GET["to"])) || (isset($_POST["from"]) && isset($_POST["to"]))) { prepare(); - $from = (isset($_GET["from"]) && isset($_GET["to"]) ? $_GET["from"] : $_POST["from"]); - $to = (isset($_GET["from"]) && isset($_GET["to"]) ? $_GET["to"] : $_POST["to"]); + $from = (isset($_GET["from"]) && isset($_GET["to"]) ? $api->validate($_GET["from"])[0]["id"] : $api->validate($_POST["from"])[0]["id"]); + $to = (isset($_GET["from"]) && isset($_GET["to"]) ? $api->validate($_GET["to"])[0]["id"] : $api->validate($_POST["to"])[0]["id"]); $count = (isset($_GET["count"]) ? $_GET["count"] : (isset($_POST["count"]) ? $_POST["count"] : 3)); $date = (isset($_GET["date"]) ? $_GET["date"] : (isset($_POST["date"]) ? $_POST["date"] : null)); $time = (isset($_GET["time"]) ? $_GET["time"] : (isset($_POST["time"]) ? $_POST["time"] : null));