<?php

# HA NINCS ID, AKKOR BÉRLETTÍPUS LISTA

if ($this->is_id()) {
    # BÉRLETTÍPUS SZERKESZTÉSE

    $lease = new lease();
    $lease->set_l_data_by_id($this->get_id());

    $training_type_query = "SELECT * FROM training_type WHERE trt_deleted = 0 ORDER BY trt_name ASC;";
    $training_type_assoc_array = $sql->assoc_array($training_type_query);

    $smarty->assign("training_type_assoc_array", $training_type_assoc_array);
    $smarty->assign('lease',$lease);

    $smarty->display('lease_data_edit.tpl');
}
else {

    # BÉRLETTÍPUS LISTA

    $l_query = "SELECT * FROM lease WHERE l_deleted = 0 ORDER BY l_name ASC";
    $l_assoc_array = $sql->assoc_array($l_query);

    $smarty->assign('l_assoc_array',$l_assoc_array);
    $smarty->display('lease_list.tpl');
}
?>
