<?php

# HA NINCS ID, AKKOR SEMMI
# HA VAN ID, AKKOR BEFIZETÉS / USER

if ($this->is_id()) {
    # USERHEZ TARTOZÓ BEFIZETÉSEK
    $user_mod_query = "SELECT * FROM money_deposit JOIN money_income ON mi_id = mod_money_income_mi_id WHERE mod_user_kid_uk_id = " . $this->get_id() . " and mod_deleted = 0 ORDER BY mi_date DESC;";
    $umod_assoc_array = $sql->assoc_array($user_mod_query);

    $mods = array();
    foreach ($umod_assoc_array as $key => $value) {
        $new_mod = new money_deposit();
        $new_mod->set_mod_data_by_id($value['mod_id']);
        $mods[] = $new_mod;
    }

    $smarty->assign("mod_array", $mods);
    $smarty->assign("balance", $sql->single_variable('SELECT uk_balance FROM user_kid WHERE uk_id = ' . $this->get_id()));
    $smarty->assign("mod_user_kid_id", $this->get_id());
    $smarty->display("view_deposit.tpl");

}
else {
    # EMPTY

}

?>
