Urlaubstool

This commit is contained in:
Andreas Österreicher
2008-06-02 15:46:28 +00:00
parent f1c44435ea
commit fb5575f96b
12 changed files with 847 additions and 55 deletions
+86
View File
@@ -221,6 +221,92 @@
</tr>
<?php
//URLAUBE
//Untergebene holen
$qry = "SELECT * FROM public.tbl_benutzerfunktion WHERE (funktion_kurzbz='fbl' OR funktion_kurzbz='stgl') AND uid='".addslashes($user)."'";
if($result = pg_query($db_conn, $qry))
{
$institut='';
$stge='';
while($row = pg_fetch_object($result))
{
if($row->funktion_kurzbz=='fbl')
{
if($institut!='')
$institut.=',';
$institut.="'".addslashes($row->fachbereich_kurzbz)."'";
}
elseif($row->funktion_kurzbz=='stgl')
{
if($stge!='')
$stge.=',';
$stge.="'".$row->studiengang_kz."'";
}
}
}
$qry = "SELECT distinct uid FROM public.tbl_benutzerfunktion WHERE funktion_kurzbz='Institut' AND (false ";
if($institut!='')
$qry.=" OR fachbereich_kurzbz in($institut)";
if($stge!='')
$qry.=" OR studiengang_kz in($stge)";
$qry.=")";
$untergebene='';
if($result = pg_query($db_conn, $qry))
{
while($row = pg_fetch_object($result))
{
if($untergebene!='')
$untergebene.=',';
$untergebene.="'".addslashes($row->uid)."'";
}
}
if($untergebene!='')
{
$qry = "SELECT * FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid in($untergebene) ORDER BY nachname, vorname";
if($result = pg_query($db_conn, $qry))
{
echo '
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap">
<a href="profile/urlaubsfreigabe.php" target="content" class="MenuItem" onClick="js_toggle_container(\'urlaub\');">
<img src="../../skin/images/menu_item.gif" width="7" height="9">&nbsp;Urlaube
</a>
</td>
</tr>
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td nowrap>
<table class="tabcontent" id="urlaub" style="display: none;">
<tr>
<td class="tdwrap">
<ul style="margin-top: 0px; margin-bottom: 0px;">';
echo '<li><a class="Item2" href="profile/urlaubsfreigabe.php" target="content">Alle</a></li>';
while($row = pg_fetch_object($result))
{
echo '<li><a class="Item2" href="profile/urlaubsfreigabe.php?uid='.$row->uid.'" target="content">'."$row->nachname $row->vorname $row->titelpre $row->titelpost".'</a></li>';
}
echo '</ul>
</td>
</tr>
</table>
</td>
</tr>';
}
}
}
?>
</table>
+19 -4
View File
@@ -42,6 +42,8 @@ class zeitsperre
var $updatevon; // string
var $insertamum; // timestamp
var $insertvon; // string
var $freigabeamum;
var $freigabevon;
/**
@@ -70,9 +72,14 @@ class zeitsperre
WHERE mitarbeiter_uid='".addslashes($uid)."'";
if($bisgrenze)
$qry.=" AND bisdatum>=now()::date";
$qry.=" AND (
(date_part('month',vondatum)>=9 AND date_part('year', vondatum)>='".(date('Y')-1)."')
OR
(date_part('month',vondatum)<9 AND date_part('year', vondatum)>='".(date('Y'))."')
)";
//$qry.=" AND bisdatum>=now()::date";
$qry.= " ORDER BY vondatum";
$qry.= " ORDER BY vondatum DESC";
//echo $qry;
if($result = pg_query($this->conn, $qry))
{
@@ -100,6 +107,8 @@ class zeitsperre
$obj->updatevon = $row->updatevon;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->freigabeamum = $row->freigabeamum;
$obj->freigabevon = $row->freigabevon;
$this->result[] = $obj;
@@ -151,6 +160,8 @@ class zeitsperre
$this->updatevon = $row->updatevon;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->freigabeamum = $row->freigabeamum;
$this->freigabevon = $row->freigabevon;
}
else
{
@@ -237,7 +248,7 @@ class zeitsperre
$qry = 'INSERT INTO campus.tbl_zeitsperre (zeitsperretyp_kurzbz, mitarbeiter_uid, bezeichnung,'.
' vondatum ,vonstunde, bisdatum, bisstunde, erreichbarkeit_kurzbz, vertretung_uid, insertamum,'.
' insertvon, updateamum, updatevon) VALUES ('.
' insertvon, updateamum, updatevon, freigabeamum, freigabevon) VALUES ('.
$this->addslashes($this->zeitsperretyp_kurzbz).', '.
$this->addslashes($this->mitarbeiter_uid).', '.
$this->addslashes($this->bezeichnung).', '.
@@ -250,7 +261,9 @@ class zeitsperre
$this->addslashes($this->insertamum).', '.
$this->addslashes($this->insertvon).', '.
$this->addslashes($this->updateamum).', '.
$this->addslashes($this->updatevon).'); ';
$this->addslashes($this->updatevon).','.
$this->addslashes($this->freigabeamum).','.
$this->addslashes($this->freigabevon).'); ';
}
else
{
@@ -275,6 +288,8 @@ class zeitsperre
'vertretung_uid='.$this->addslashes($this->vertretung_uid).', '.
'insertamum='.$this->addslashes($this->insertamum).', '.
'insertvon='.$this->addslashes($this->insertvon).', '.
'freigabeamum='.$this->addslashes($this->freigabeamum).', '.
'freigabevon='.$this->addslashes($this->freigabevon).', '.
'updateamum='.$this->addslashes($this->updateamum).', '.
'updatevon='.$this->addslashes($this->updatevon).' '.
'WHERE zeitsperre_id = '.$this->addslashes($this->zeitsperre_id).';';