<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');

if (empty($_GET['template_id'])) {
    echo json_encode(null);
}
else {


    $template_query = "SELECT * FROM training_template WHERE tt_id = " . $_GET['template_id'];

    $template_assoc_array = $sql->assoc_array($template_query);

    if (isset($template_assoc_array[0])) {
        echo json_encode($template_assoc_array[0]);
    }
    else {
        echo json_encode(null);
    }
}

?>
