add functions to delete entries

This commit is contained in:
Nikolaus Krondraf
2020-06-30 15:40:30 +02:00
parent 507be8c673
commit 21703cfc00
2 changed files with 19 additions and 0 deletions
@@ -11,4 +11,14 @@ class Zeitaufzeichnung_model extends DB_Model
$this->dbTable = 'campus.tbl_zeitaufzeichnung';
$this->pk = 'zeitaufzeichnung_id';
}
public function deleteEntriesForCurrentDay()
{
$today = date('Y-m-d');
$qry = "DELETE FROM " . $this->dbTable . "
WHERE start >= '" . $today . " 00:00:00'
AND start <= '" . $today . " 23:59:59';";
return $this->execQuery($qry);
}
}
@@ -11,4 +11,13 @@ class Zeitsperre_model extends DB_Model
$this->dbTable = 'campus.tbl_zeitsperre';
$this->pk = 'zeitsperre_id';
}
public function deleteEntriesForCurrentDay()
{
$today = date('Y-m-d');
$qry = "DELETE FROM " . $this->dbTable . "
WHERE vondatum = '" . $today . "';";
return $this->execQuery($qry);
}
}