mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
36 lines
801 B
PHP
36 lines
801 B
PHP
<?php
|
|
class Zeitaufzeichnung_model extends DB_Model
|
|
{
|
|
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$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);
|
|
}
|
|
|
|
public function zeitaufzeichnungExistsForLastWeekList()
|
|
{
|
|
$qry = "SELECT
|
|
DISTINCT uid
|
|
FROM campus.tbl_zeitaufzeichnung
|
|
WHERE date_trunc('day',ende) >= (date_trunc('day', current_date-interval '7' day));";
|
|
|
|
return $this->execQuery($qry);
|
|
|
|
}
|
|
}
|