load($stundensatz_id); } public function getStundensatzDatum($uid, $beginn, $ende = null, $typ = null) { $qry = "SELECT * FROM hr.tbl_stundensatz WHERE uid = ". $this->db_add_param($uid) ." AND (gueltig_bis >= ". $this->db_add_param($beginn) ." OR gueltig_bis is null)"; if (!is_null($ende)) { $qry .= " AND (gueltig_von <= ". $this->db_add_param($ende) .")"; } if (!is_null($typ)) { $qry .= " AND stundensatztyp = ". $this->db_add_param($typ); } $qry .= " ORDER BY gueltig_bis DESC NULLS FIRST, gueltig_von DESC NULLS LAST LIMIT 1;"; if ($this->db_query($qry)) { if ($row = $this->db_fetch_object()) { $this->stundensatz_id = $row->stundensatz_id; $this->uid = $row->uid; $this->stundensatztyp = $row->stundensatztyp; $this->stundensatz = $row->stundensatz; $this->oe_kurzbz = $row->oe_kurzbz; $this->gueltig_von = $row->gueltig_von; $this->gueltig_bis = $row->gueltig_bis; $this->insertamum = $row->insertamum; $this->insertvon = $row->insertvon; $this->updateamum = $row->updateamum; $this->updatevon = $row->updatevon; } return true; } else { $this->errormsg = 'Fehler beim Laden der Daten'; return false; } } } ?>