Esempio n. 1
0
 public function zmenitHeslo($id_u, $nove)
 {
     $db = new Databaze();
     //GENEROVÁNÍ NOVÉHO SALTU
     $nove_options = ['cost' => 10, 'salt' => uniqid(mt_rand(), true)];
     $id = $db->pripravaProInput($id_u);
     $n_heslo = $db->pripravaProInput(password_hash($nove, PASSWORD_BCRYPT, $nove_options));
     $salt = $nove_options["salt"];
     $sql = "UPDATE uzivatele SET heslo = '{$n_heslo}', salt = '{$salt}'\n                WHERE id_uzivatel = {$id}";
     return $db->zpracovani($sql);
 }
Esempio n. 2
0
 public function vymazat($id)
 {
     $db = new Databaze();
     $sql = "DELETE FROM typy\n                WHERE id_typ = {$id}";
     return $db->zpracovani($sql);
 }
Esempio n. 3
0
 public function vymazat($id)
 {
     $db = new Databaze();
     $sql = "DELETE FROM objednavky\n                WHERE id_objednavka = {$id}";
     return $db->zpracovani($sql);
 }