Esempio n. 1
0
<?php

session_start();
include 'funkcie.php';
include 'pouzivatelia.php';
include 'preteky.php';
$po = new POUZIVATELIA();
$po = POUZIVATELIA::vrat_pouzivatela($_GET["id"]);
if (isset($_POST['posli3'])) {
    vymaz_obrazok($_GET['id']);
    pridaj_obrazok($_GET['id']);
}
if (isset($_POST['vymaz'])) {
    vymaz_obrazok($_GET['id']);
}
$zobraz_form = true;
if (isset($_POST['posli2'])) {
    $po->vymaz_pouzivatela($_GET['id']);
    echo '<meta http-equiv="refresh" content="0; URL=index.php">';
    //unset($po);
    ?>
  
  <?php 
    echo '<p class="chyba">Vymazane!</p>';
    $zobraz_form = false;
}
if (isset($_POST['posli']) && over($_POST['meno']) && over($_POST['priezvisko'])) {
    $po->uprav_pouzivatela($_POST['meno'], $_POST['priezvisko'], $_POST['oddiel'], $_POST['oscislo'], $_POST['cip'], $_POST['poznamka'], $_POST['uspech']);
    unset($po);
    $po = new POUZIVATELIA();
    $po = POUZIVATELIA::vrat_pouzivatela($_GET["id"]);
Esempio n. 2
0
    static function vymaz_pouzivatela($ID)
    {
        $db = napoj_db();
        $sql = <<<EOF
       DELETE FROM POUZIVATELIA WHERE ID = {$ID};
       DELETE FROM PRIHLASENY WHERE ID_POUZ = {$ID};
       DELETE FROM PLATBY WHERE ID_POUZ = {$ID};
EOF;
        $ret = $db->exec($sql);
        if (!$ret) {
            echo $db->lastErrorMsg();
        } else {
            vymaz_obrazok($ID);
            //echo "Records removed successfully\n";
        }
        $db->close();
    }