ACC SHELL

Path : /www/hosting/oltv.cz/_/_class/
File Upload :
Current File : /www/hosting/oltv.cz/_/_class/uzivatele.php

<?php
/**
* @author Filip Štencl
* @since 28. 04. 2015
*/

class uzivatele extends base {
   const TABLE_NAME = 'uzivatele';

   private $id = null;
   private $caszalozeni = null;
   private $caszmeny = null;
   private $jmeno = null;
   private $prijmeni = null;
   private $login = null;
   private $heslo = null;
   private $email = null;
   private $email_kod = null;
   private $idkanaly = null;
   private $idkategorie = null;
   private $auto_schvalovat = null;
   private $potvrzen = null;
   private $povolen = null;
   private $chyba = null;

   public function __construct($id = null) {
      if (!is_null($id) && intval($id) != 0) { // Pokud již položka existuje, zpřístupní její vlastnosti
         $result = dibi::query('SELECT * FROM ['.self::TABLE_NAME.'] WHERE id=%i',intval($id));
         if($result->count() > 0) {
            $row = $result->fetch();
            $this->id = $row->id;
            $this->caszalozeni = $row->caszalozeni;
            $this->caszmeny = $row->caszmeny;
            $this->jmeno = $row->jmeno;
            $this->prijmeni = $row->prijmeni;
            $this->login = $row->login;
            $this->heslo = $row->heslo;
            $this->email = $row->email;
            $this->email_kod = $row->email_kod;
            $this->idkanaly = $row->idkanaly;
            $this->idkategorie = $row->idkategorie;
            $this->auto_schvalovat = $row->auto_schvalovat;
            $this->potvrzen = $row->potvrzen;
            $this->povolen = $row->povolen;
         } else { notification::infoBox_error("Požadovaná položka nebyla nalezena"); set404(); }
      }
   }

   public function getId() { return $this->id; }
   public function getCaszalozeni() { return $this->caszalozeni; }
   public function getCaszmeny() { return $this->caszmeny; }
   public function getJmeno() { return $this->jmeno; }
   public function getPrijmeni() { return $this->prijmeni; }
   public function getLogin() { return $this->login; }
   public function getHeslo() { return $this->heslo; }
   public function getEmail() { return $this->email; }
   public function getEmail_kod() { return $this->email_kod; }
   public function getIdkanaly() { return $this->idkanaly; }
   public function getIdkategorie() { return $this->idkategorie; }
   public function getAuto_schvalovat() { return $this->auto_schvalovat; }
   public function getPotvrzen() { return $this->potvrzen; }
   public function getPovolen() { return $this->povolen; }

   public function setId($id) { $this->id = $id; }
   protected function getChyba() { return $this->chyba; }
   protected function checkData($data) {
      if(array_key_exists("id",$data)) {if(intval($data['id']) > 0) { $this->id = intval($data['id']); } else { $this->chyba .= "ID je v nesprávném formátu<br />"; return false; }}
      return true;
   }
}

ACC SHELL 2018