angepasste oberflaeche fuer gesamtorganisation

csv import
This commit is contained in:
Gerald Raab
2015-08-31 11:03:06 +02:00
parent 8e0f80e007
commit f58e272858
3 changed files with 156 additions and 14 deletions
Regular → Executable
+22
View File
@@ -942,4 +942,26 @@ function generateActivationKey()
return md5(encryptData(uniqid(mt_rand(), true),$key));
}
function check_infrastruktur($uid)
{
$db = new basis_db();
// checken, ob der user eine oezuordnung der infrastruktur hat
$sql_query="SELECT 1 FROM public.tbl_benutzerfunktion WHERE funktion_kurzbz = 'oezuordnung' and oe_kurzbz in ('Infrastruktur', 'Systementwicklung', 'ServiceDesk', 'Empfang', 'Haustechnik', 'ITService', 'LVPlanung') and (datum_bis > now() or datum_bis is NULL) and uid=".$db->db_add_param($uid);
//echo $sql_query;
if($db->db_query($sql_query))
{
$num_rows=$db->db_num_rows();
// Wenn kein ergebnis return 0 sonst 1
if ($num_rows>0)
{
return 1;
}
else
return 0;
}
else
return 0;
}
?>
+21
View File
@@ -418,6 +418,27 @@ class zeitaufzeichnung extends basis_db
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Löscht sämtliche Einträge eines Users für einen Tag
* @param string $user
* @param string $tag Y-m-d
*/
public function deleteEntriesForUser($user, $tag)
{
$where = "uid=".$this->db_add_param($user);
$qry = "delete from campus.tbl_zeitaufzeichnung where $where and date_trunc('day', start) = '$tag'";
if($result = $this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
?>