mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
This commit is contained in:
+326
-326
@@ -1,327 +1,327 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../include/news.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$sql_conn = pg_pconnect(CONN_STRING))
|
||||
die("Fehler beim öffnen der Datenbankverbindung");
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung($sql_conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(check_lektor($user,$sql_conn))
|
||||
$is_lector=true;
|
||||
|
||||
if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('assistenz') || $rechte->isBerechtigt('lehre') || $rechte->isBerechtigt('news'))
|
||||
$berechtigt=true;
|
||||
else
|
||||
$berechtigt=false;
|
||||
|
||||
if(isset($_GET['news_id']))
|
||||
$news_id=$_GET['news_id'];
|
||||
if(isset($_GET['message_sent']))
|
||||
$message_sent=$_GET['message_sent'];
|
||||
if(isset($_POST['message_sent']))
|
||||
$message_sent=$_POST['message_sent'];
|
||||
|
||||
if(isset($_GET['changed']))
|
||||
$changed=$_GET['changed'];
|
||||
if(isset($_POST['news_id']))
|
||||
$news_id=$_POST['news_id'];
|
||||
if(isset($_POST['news_submit']))
|
||||
$news_submit=$_POST['news_submit'];
|
||||
if(isset($_POST['txtNewsMessage']))
|
||||
$txtNewsMessage=$_POST['txtNewsMessage'];
|
||||
if(isset($_POST['txtAuthor']))
|
||||
$txtAuthor=$_POST['txtAuthor'];
|
||||
if(isset($_POST['datum']))
|
||||
$datum=$_POST['datum'];
|
||||
if(isset($_POST['datum_bis']))
|
||||
$datum_bis=$_POST['datum_bis'];
|
||||
if(isset($_POST['txtTitle']))
|
||||
$txtTitle=$_POST['txtTitle'];
|
||||
if(isset($_POST['btnSend']))
|
||||
$btnSend=$_POST['btnSend'];
|
||||
if(isset($_POST['news_submit']))
|
||||
$news_submit=$_POST['news_submit'];
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<?php
|
||||
//var_dump($_POST);
|
||||
//echo '<BR>';
|
||||
//var_dump($_GET);
|
||||
if($berechtigt && isset($btnSend) && (!isset($message_sent) || $message_sent == "no"))
|
||||
{
|
||||
$author = chop($txtAuthor);
|
||||
$title = chop($txtTitle);
|
||||
$news_message = chop($txtNewsMessage);
|
||||
if($author != "" && $title != "" && $news_message != "")
|
||||
{
|
||||
$news_message = mb_eregi_replace("\r\n", "<br>", $news_message);
|
||||
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
$news = new news();
|
||||
|
||||
$news->news_id = $news_id;
|
||||
$news->betreff = $title;
|
||||
$news->verfasser = $author;
|
||||
$news->text = $news_message;
|
||||
$news->studiengang_kz = '0';
|
||||
$news->semester = null;
|
||||
if(isset($chksenat))
|
||||
$news->fachbereich_kurzbz = 'Senat';
|
||||
else
|
||||
$news->fachbereich_kurzbz = '';
|
||||
$news->datum = $datum;
|
||||
$news->datum_bis = $datum_bis;
|
||||
$news->uid=$user;
|
||||
$news->updatevon=$user;
|
||||
$news->updateamum=date('Y-m-d H:i:s');
|
||||
$news->new=false;
|
||||
|
||||
if($news->save())
|
||||
{
|
||||
echo '<script language="JavaScript" type="text/javascript">';
|
||||
echo " document.location.href = 'news_entry.php?message_sent=yes&changed=yes';";
|
||||
echo "</script>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo $news->errormsg;
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php?message_sent=no';";
|
||||
echo "</script>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$news = new news();
|
||||
|
||||
$news->betreff = $title;
|
||||
$news->verfasser = $author;
|
||||
$news->text = $news_message;
|
||||
$news->studiengang_kz = '0';
|
||||
$news->updatevon=$user;
|
||||
$news->semester = null;
|
||||
if(isset($chksenat))
|
||||
$news->fachbereich_kurzbz = 'Senat';
|
||||
else
|
||||
$news->fachbereich_kurzbz = '';
|
||||
$news->uid = $user;
|
||||
$news->updateamum=date('Y-m-d H:i:s');
|
||||
$news->datum=$datum;
|
||||
$news->datum_bis=$datum_bis;
|
||||
$news->new=true;
|
||||
|
||||
if($news->save())
|
||||
{
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php' + \"?message_sent=yes&changed=no\";";
|
||||
echo "</script>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "test:".$news->errormsg;
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php' + \"?message_sent=no\";";
|
||||
echo "</script>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php' + \"?message_sent=no\";";
|
||||
echo "</script>";
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
function focusFirstElement()
|
||||
{
|
||||
if(document.NewsEntry.txtAuthor != null)
|
||||
{
|
||||
document.NewsEntry.txtAuthor.focus();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="focusFirstElement();">
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td>
|
||||
<form action="" method="POST" name="NewsEntry">
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td class="ContentHeader"><font class="ContentHeader"> Verwaltungstools - Newsverwaltung</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$berechtigt)
|
||||
{
|
||||
die("<td>Sie haben keine Berechtigung für diese Seite.</td>");
|
||||
}
|
||||
|
||||
if(isset($message_sent) && $message_sent == "yes")
|
||||
{
|
||||
if(isset($changed) && $changed == "yes")
|
||||
{
|
||||
echo " <td>";
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " parent.news_window.location.href = 'news_show.php'";
|
||||
echo "</script>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo " <td> </td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo " <td><h3>Die Nachricht wurde erfolgreich geändert!<h3></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <td>";
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " parent.news_window.location.href = 'news_show.php'";
|
||||
echo "</script>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo " <td> </td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo " <td><h3>Die Neuigkeit wurde erfolgreich eingetragen!</h3></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
#exit;
|
||||
}
|
||||
else if(isset($message_sent) && $message_sent == "no")
|
||||
{
|
||||
echo "<td> </td>";
|
||||
echo "</tr>";
|
||||
echo " <td><h3>Die Neuigkeit wurde NICHT eingetragen!</h3>";
|
||||
echo "<h3>Bitte versuchen Sie es erneut</h3></td>";
|
||||
echo "</tr>";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
echo '<td class="ContentHeader2"> ';
|
||||
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
$news = new news($news_id);
|
||||
echo 'Eintrag ändern';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Neuen Eintrag erstellen';
|
||||
}
|
||||
|
||||
echo '</td>';
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td width="65">Verfasser:</td>
|
||||
<td><input type="text" class="TextBox" name="txtAuthor" size="30"<?php if(isset($news_id) && $news_id != "") echo ' value="'.$news->verfasser.'"'; ?>></td>
|
||||
<td>Sichtbar ab:</td>
|
||||
<td><input type="text" class="TextBox" name="datum" size="10" value="<?php if(isset($news_id) && $news_id != "") echo date('d.m.Y',strtotime(strftime($news->datum))); else echo date('d.m.Y'); ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Titel:</td>
|
||||
<td><input type="text" class="TextBox" name="txtTitle" size="30"<?php if(isset($news_id) && $news_id != "") echo ' value="'.$news->betreff.'"'; ?>></td>
|
||||
<td>Sichtbar bis (optional):</td>
|
||||
<td><input type="text" class="TextBox" name="datum_bis" size="10" value="<?php if(isset($news_id) && $news_id != "" && $news->datum_bis!='') echo date('d.m.Y',strtotime(strftime($news->datum_bis))); else echo ''; ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>Bitte geben Sie hier Ihre Nachricht ein:</td>
|
||||
|
||||
<?php
|
||||
if($rechte->isBerechtigt('admin',0) || $rechte->isBerechtigt('assistenz',0))
|
||||
{
|
||||
?>
|
||||
<td>Senat:</td>
|
||||
<td><input type="checkbox" name="chksenat"<?php if(isset($news_id) && $news_id!="" && $news->fachbereich_kurzbz=='Senat') echo ' checked'?>></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td> </td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td><!--Bitte geben Sie hier Ihre Nachricht ein:<br>-->
|
||||
<textarea class="TextBox" style="width: 99%; heigth: 166px" name="txtNewsMessage" rows="10" cols="70" maxlength="2000"><?php if(isset($news_id) && $news_id != "") echo mb_eregi_replace("<br>", "\r\n", $news->text); ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap>
|
||||
<input type="hidden" name="message_sent" value="no">
|
||||
<input type="hidden" name="news_submit" value="true">
|
||||
<input type="submit" name="btnSend" value="Abschicken">
|
||||
<?php
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
echo "<input type='hidden' name='news_id' value='$news_id'>
|
||||
<input type=\"reset\" name=\"btnCancel\" value=\"Abbrechen\" onClick=\"document.location.href='news_entry.php';\"></td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input type="reset" name="btnCancel" value="Zurücksetzen" onClick="document.NewsEntry.txtAuthor.focus();"></td>';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</form></td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../include/news.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$sql_conn = pg_pconnect(CONN_STRING))
|
||||
die("Fehler beim öffnen der Datenbankverbindung");
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(check_lektor($user,$sql_conn))
|
||||
$is_lector=true;
|
||||
|
||||
if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('assistenz') || $rechte->isBerechtigt('lehre') || $rechte->isBerechtigt('news'))
|
||||
$berechtigt=true;
|
||||
else
|
||||
$berechtigt=false;
|
||||
|
||||
if(isset($_GET['news_id']))
|
||||
$news_id=$_GET['news_id'];
|
||||
if(isset($_GET['message_sent']))
|
||||
$message_sent=$_GET['message_sent'];
|
||||
if(isset($_POST['message_sent']))
|
||||
$message_sent=$_POST['message_sent'];
|
||||
|
||||
if(isset($_GET['changed']))
|
||||
$changed=$_GET['changed'];
|
||||
if(isset($_POST['news_id']))
|
||||
$news_id=$_POST['news_id'];
|
||||
if(isset($_POST['news_submit']))
|
||||
$news_submit=$_POST['news_submit'];
|
||||
if(isset($_POST['txtNewsMessage']))
|
||||
$txtNewsMessage=$_POST['txtNewsMessage'];
|
||||
if(isset($_POST['txtAuthor']))
|
||||
$txtAuthor=$_POST['txtAuthor'];
|
||||
if(isset($_POST['datum']))
|
||||
$datum=$_POST['datum'];
|
||||
if(isset($_POST['datum_bis']))
|
||||
$datum_bis=$_POST['datum_bis'];
|
||||
if(isset($_POST['txtTitle']))
|
||||
$txtTitle=$_POST['txtTitle'];
|
||||
if(isset($_POST['btnSend']))
|
||||
$btnSend=$_POST['btnSend'];
|
||||
if(isset($_POST['news_submit']))
|
||||
$news_submit=$_POST['news_submit'];
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<?php
|
||||
//var_dump($_POST);
|
||||
//echo '<BR>';
|
||||
//var_dump($_GET);
|
||||
if($berechtigt && isset($btnSend) && (!isset($message_sent) || $message_sent == "no"))
|
||||
{
|
||||
$author = chop($txtAuthor);
|
||||
$title = chop($txtTitle);
|
||||
$news_message = chop($txtNewsMessage);
|
||||
if($author != "" && $title != "" && $news_message != "")
|
||||
{
|
||||
$news_message = mb_eregi_replace("\r\n", "<br>", $news_message);
|
||||
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
$news = new news();
|
||||
|
||||
$news->news_id = $news_id;
|
||||
$news->betreff = $title;
|
||||
$news->verfasser = $author;
|
||||
$news->text = $news_message;
|
||||
$news->studiengang_kz = '0';
|
||||
$news->semester = null;
|
||||
if(isset($chksenat))
|
||||
$news->fachbereich_kurzbz = 'Senat';
|
||||
else
|
||||
$news->fachbereich_kurzbz = '';
|
||||
$news->datum = $datum;
|
||||
$news->datum_bis = $datum_bis;
|
||||
$news->uid=$user;
|
||||
$news->updatevon=$user;
|
||||
$news->updateamum=date('Y-m-d H:i:s');
|
||||
$news->new=false;
|
||||
|
||||
if($news->save())
|
||||
{
|
||||
echo '<script language="JavaScript" type="text/javascript">';
|
||||
echo " document.location.href = 'news_entry.php?message_sent=yes&changed=yes';";
|
||||
echo "</script>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo $news->errormsg;
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php?message_sent=no';";
|
||||
echo "</script>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$news = new news();
|
||||
|
||||
$news->betreff = $title;
|
||||
$news->verfasser = $author;
|
||||
$news->text = $news_message;
|
||||
$news->studiengang_kz = '0';
|
||||
$news->updatevon=$user;
|
||||
$news->semester = null;
|
||||
if(isset($chksenat))
|
||||
$news->fachbereich_kurzbz = 'Senat';
|
||||
else
|
||||
$news->fachbereich_kurzbz = '';
|
||||
$news->uid = $user;
|
||||
$news->updateamum=date('Y-m-d H:i:s');
|
||||
$news->datum=$datum;
|
||||
$news->datum_bis=$datum_bis;
|
||||
$news->new=true;
|
||||
|
||||
if($news->save())
|
||||
{
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php' + \"?message_sent=yes&changed=no\";";
|
||||
echo "</script>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "test:".$news->errormsg;
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php' + \"?message_sent=no\";";
|
||||
echo "</script>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " document.location.href = 'news_entry.php' + \"?message_sent=no\";";
|
||||
echo "</script>";
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
function focusFirstElement()
|
||||
{
|
||||
if(document.NewsEntry.txtAuthor != null)
|
||||
{
|
||||
document.NewsEntry.txtAuthor.focus();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="focusFirstElement();">
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td>
|
||||
<form action="" method="POST" name="NewsEntry">
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td class="ContentHeader"><font class="ContentHeader"> Verwaltungstools - Newsverwaltung</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$berechtigt)
|
||||
{
|
||||
die("<td>Sie haben keine Berechtigung für diese Seite.</td>");
|
||||
}
|
||||
|
||||
if(isset($message_sent) && $message_sent == "yes")
|
||||
{
|
||||
if(isset($changed) && $changed == "yes")
|
||||
{
|
||||
echo " <td>";
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " parent.news_window.location.href = 'news_show.php'";
|
||||
echo "</script>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo " <td> </td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo " <td><h3>Die Nachricht wurde erfolgreich geändert!<h3></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <td>";
|
||||
echo "<script language=\"JavaScript\">";
|
||||
echo " parent.news_window.location.href = 'news_show.php'";
|
||||
echo "</script>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo " <td> </td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo " <td><h3>Die Neuigkeit wurde erfolgreich eingetragen!</h3></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
#exit;
|
||||
}
|
||||
else if(isset($message_sent) && $message_sent == "no")
|
||||
{
|
||||
echo "<td> </td>";
|
||||
echo "</tr>";
|
||||
echo " <td><h3>Die Neuigkeit wurde NICHT eingetragen!</h3>";
|
||||
echo "<h3>Bitte versuchen Sie es erneut</h3></td>";
|
||||
echo "</tr>";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
echo '<td class="ContentHeader2"> ';
|
||||
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
$news = new news($news_id);
|
||||
echo 'Eintrag ändern';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Neuen Eintrag erstellen';
|
||||
}
|
||||
|
||||
echo '</td>';
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td width="65">Verfasser:</td>
|
||||
<td><input type="text" class="TextBox" name="txtAuthor" size="30"<?php if(isset($news_id) && $news_id != "") echo ' value="'.$news->verfasser.'"'; ?>></td>
|
||||
<td>Sichtbar ab:</td>
|
||||
<td><input type="text" class="TextBox" name="datum" size="10" value="<?php if(isset($news_id) && $news_id != "") echo date('d.m.Y',strtotime(strftime($news->datum))); else echo date('d.m.Y'); ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Titel:</td>
|
||||
<td><input type="text" class="TextBox" name="txtTitle" size="30"<?php if(isset($news_id) && $news_id != "") echo ' value="'.$news->betreff.'"'; ?>></td>
|
||||
<td>Sichtbar bis (optional):</td>
|
||||
<td><input type="text" class="TextBox" name="datum_bis" size="10" value="<?php if(isset($news_id) && $news_id != "" && $news->datum_bis!='') echo date('d.m.Y',strtotime(strftime($news->datum_bis))); else echo ''; ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>Bitte geben Sie hier Ihre Nachricht ein:</td>
|
||||
|
||||
<?php
|
||||
if($rechte->isBerechtigt('admin',0) || $rechte->isBerechtigt('assistenz',0))
|
||||
{
|
||||
?>
|
||||
<td>Senat:</td>
|
||||
<td><input type="checkbox" name="chksenat"<?php if(isset($news_id) && $news_id!="" && $news->fachbereich_kurzbz=='Senat') echo ' checked'?>></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td> </td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td><!--Bitte geben Sie hier Ihre Nachricht ein:<br>-->
|
||||
<textarea class="TextBox" style="width: 99%; heigth: 166px" name="txtNewsMessage" rows="10" cols="70" maxlength="2000"><?php if(isset($news_id) && $news_id != "") echo mb_eregi_replace("<br>", "\r\n", $news->text); ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap>
|
||||
<input type="hidden" name="message_sent" value="no">
|
||||
<input type="hidden" name="news_submit" value="true">
|
||||
<input type="submit" name="btnSend" value="Abschicken">
|
||||
<?php
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
echo "<input type='hidden' name='news_id' value='$news_id'>
|
||||
<input type=\"reset\" name=\"btnCancel\" value=\"Abbrechen\" onClick=\"document.location.href='news_entry.php';\"></td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input type="reset" name="btnCancel" value="Zurücksetzen" onClick="document.NewsEntry.txtAuthor.focus();"></td>';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</form></td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
+172
-172
@@ -1,172 +1,172 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
function deleteEntry(id)
|
||||
{
|
||||
if(confirm("Soll dieser Eintrag wirklich gelöscht werden?") == true)
|
||||
{
|
||||
document.location.href = 'news_show.php?remove_id=' + id;
|
||||
}
|
||||
}
|
||||
|
||||
function editEntry(id)
|
||||
{
|
||||
parent.news_entry.location.href = 'news_entry.php?news_id=' + id;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../include/news.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$sql_conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim öffnen der Datenbankverbindung');
|
||||
|
||||
$user = get_uid();
|
||||
// POST/GET Parameter uebernehmen
|
||||
if (isset($_GET))
|
||||
{
|
||||
while (list ($tmp_key, $tmp_val) = each($_GET))
|
||||
{
|
||||
$$tmp_key=$tmp_val;
|
||||
}
|
||||
}
|
||||
if (isset($_POST))
|
||||
{
|
||||
while (list ($tmp_key, $tmp_val) = each($_POST))
|
||||
{
|
||||
$$tmp_key=$tmp_val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$rechte = new benutzerberechtigung($sql_conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(check_lektor($user,$sql_conn))
|
||||
$is_lector=true;
|
||||
|
||||
if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('assistenz') || $rechte->isBerechtigt('news') || $rechte->isBerechtigt('lehre'))
|
||||
$berechtigt=true;
|
||||
else
|
||||
$berechtigt=false;
|
||||
|
||||
if($berechtigt)
|
||||
{
|
||||
if(isset($remove_id) && $remove_id != "")
|
||||
{
|
||||
$news = new news();
|
||||
if($news->delete($remove_id))
|
||||
{
|
||||
writeCISlog('DELETE NEWS','');
|
||||
echo '<script language="JavaScript" type="text/javascript">';
|
||||
echo ' document.location.href = "news_show.php"';
|
||||
echo '</script>';
|
||||
exit;
|
||||
}
|
||||
else
|
||||
echo 'Fehler beim Löschen des Eintrages';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td><table class="tabcontent">
|
||||
<tr>
|
||||
<?php
|
||||
if(!$berechtigt)
|
||||
exit;
|
||||
?>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<?php
|
||||
|
||||
$news = new news();
|
||||
$news->getnews(0,0,null, true, '*', 0);
|
||||
|
||||
$zaehler=0;
|
||||
$i=0;
|
||||
foreach($news->result as $row)
|
||||
{
|
||||
$i++;
|
||||
$zaehler++;
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
if($i % 2 != 0)
|
||||
{
|
||||
echo '<td class="MarkLine">';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<td>';
|
||||
}
|
||||
|
||||
echo ' <table class="tabcontent">';
|
||||
echo ' <tr>';
|
||||
echo ' <td nowarp>';
|
||||
echo $datum.' '.$row->verfasser;
|
||||
echo ' </td>';
|
||||
echo ' <td align="right" nowrap>';
|
||||
echo ' <a onClick="editEntry('.$row->news_id.');">Editieren</a>, <a onClick="deleteEntry('.$row->news_id.');">Löschen</a>';
|
||||
echo ' </td>';
|
||||
echo ' </tr>';
|
||||
echo ' <tr>';
|
||||
echo ' <td> </td>';
|
||||
echo ' </tr>';
|
||||
echo ' </table>';
|
||||
echo ' <strong>'.$row->betreff.'</strong><br>'.$row->text.'</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td> </td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td> </td>';
|
||||
echo '</tr>';
|
||||
|
||||
}
|
||||
if($zaehler==0)
|
||||
echo 'Zur Zeit gibt es keine aktuellen News!';
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
function deleteEntry(id)
|
||||
{
|
||||
if(confirm("Soll dieser Eintrag wirklich gelöscht werden?") == true)
|
||||
{
|
||||
document.location.href = 'news_show.php?remove_id=' + id;
|
||||
}
|
||||
}
|
||||
|
||||
function editEntry(id)
|
||||
{
|
||||
parent.news_entry.location.href = 'news_entry.php?news_id=' + id;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../include/news.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$sql_conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim öffnen der Datenbankverbindung');
|
||||
|
||||
$user = get_uid();
|
||||
// POST/GET Parameter uebernehmen
|
||||
if (isset($_GET))
|
||||
{
|
||||
while (list ($tmp_key, $tmp_val) = each($_GET))
|
||||
{
|
||||
$$tmp_key=$tmp_val;
|
||||
}
|
||||
}
|
||||
if (isset($_POST))
|
||||
{
|
||||
while (list ($tmp_key, $tmp_val) = each($_POST))
|
||||
{
|
||||
$$tmp_key=$tmp_val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(check_lektor($user,$sql_conn))
|
||||
$is_lector=true;
|
||||
|
||||
if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('assistenz') || $rechte->isBerechtigt('news') || $rechte->isBerechtigt('lehre'))
|
||||
$berechtigt=true;
|
||||
else
|
||||
$berechtigt=false;
|
||||
|
||||
if($berechtigt)
|
||||
{
|
||||
if(isset($remove_id) && $remove_id != "")
|
||||
{
|
||||
$news = new news();
|
||||
if($news->delete($remove_id))
|
||||
{
|
||||
writeCISlog('DELETE NEWS','');
|
||||
echo '<script language="JavaScript" type="text/javascript">';
|
||||
echo ' document.location.href = "news_show.php"';
|
||||
echo '</script>';
|
||||
exit;
|
||||
}
|
||||
else
|
||||
echo 'Fehler beim Löschen des Eintrages';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td><table class="tabcontent">
|
||||
<tr>
|
||||
<?php
|
||||
if(!$berechtigt)
|
||||
exit;
|
||||
?>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<?php
|
||||
|
||||
$news = new news();
|
||||
$news->getnews(0,0,null, true, '*', 0);
|
||||
|
||||
$zaehler=0;
|
||||
$i=0;
|
||||
foreach($news->result as $row)
|
||||
{
|
||||
$i++;
|
||||
$zaehler++;
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
if($i % 2 != 0)
|
||||
{
|
||||
echo '<td class="MarkLine">';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<td>';
|
||||
}
|
||||
|
||||
echo ' <table class="tabcontent">';
|
||||
echo ' <tr>';
|
||||
echo ' <td nowarp>';
|
||||
echo $datum.' '.$row->verfasser;
|
||||
echo ' </td>';
|
||||
echo ' <td align="right" nowrap>';
|
||||
echo ' <a onClick="editEntry('.$row->news_id.');">Editieren</a>, <a onClick="deleteEntry('.$row->news_id.');">Löschen</a>';
|
||||
echo ' </td>';
|
||||
echo ' </tr>';
|
||||
echo ' <tr>';
|
||||
echo ' <td> </td>';
|
||||
echo ' </tr>';
|
||||
echo ' </table>';
|
||||
echo ' <strong>'.$row->betreff.'</strong><br>'.$row->text.'</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td> </td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td> </td>';
|
||||
echo '</tr>';
|
||||
|
||||
}
|
||||
if($zaehler==0)
|
||||
echo 'Zur Zeit gibt es keine aktuellen News!';
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,390 +1,390 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/person.class.php');
|
||||
require_once('../../../include/benutzer.class.php');
|
||||
require_once('../../../include/studiengang.class.php');
|
||||
require_once('../../../include/fachbereich.class.php');
|
||||
require_once('../../../include/zeitaufzeichnung.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Zeitaufzeichnung</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="../../../include/js/tablesort/table.css" type="text/css">
|
||||
<script src="../../../include/js/tablesort/table.js" type="text/javascript"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function setbisdatum()
|
||||
{
|
||||
var now = new Date();
|
||||
var ret = "";
|
||||
var monat = now.getMonth();
|
||||
monat++;
|
||||
ret = foo(now.getDate());
|
||||
ret = ret + "." + foo(monat);
|
||||
ret = ret + "." + now.getFullYear();
|
||||
ret = ret + " " + foo(now.getHours());
|
||||
ret = ret + ":" + foo(now.getMinutes());
|
||||
//ret = ret + ":" + foo(now.getSeconds());
|
||||
|
||||
document.getElementById("bis").value=ret;
|
||||
}
|
||||
|
||||
function foo(val)
|
||||
{
|
||||
if(val<10)
|
||||
return "0"+val;
|
||||
else
|
||||
return val;
|
||||
}
|
||||
|
||||
function confdel()
|
||||
{
|
||||
return confirm("Wollen Sie diesen Datensatz wirklich loeschen?");
|
||||
}
|
||||
|
||||
function loaduebersicht()
|
||||
{
|
||||
projekt = document.getElementById("projekt").value;
|
||||
|
||||
document.location.href="'.$_SERVER['PHP_SELF'].'?filter="+projekt;
|
||||
}
|
||||
|
||||
function uebernehmen()
|
||||
{
|
||||
document.getElementById("bis").value=document.getElementById("von").value;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
';
|
||||
|
||||
echo '<table class="tabcontent">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td class="ContentHeader"><font class="ContentHeader">Zeitaufzeichnung</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>';
|
||||
|
||||
//Variablen initialisieren
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Datenbankverbindung fehlgeschlagen');
|
||||
|
||||
$user = get_uid();
|
||||
$datum = new datum();
|
||||
$studiengang = new studiengang($conn);
|
||||
$studiengang->getAll('typ, kurzbz', false);
|
||||
$stg_arr = array();
|
||||
|
||||
foreach ($studiengang->result as $stg)
|
||||
{
|
||||
$stg_arr[$stg->studiengang_kz]=$stg->kuerzel;
|
||||
}
|
||||
|
||||
$zeitaufzeichnung_id = (isset($_GET['zeitaufzeichnung_id'])?$_GET['zeitaufzeichnung_id']:'');
|
||||
$projekt_kurzbz = (isset($_POST['projekt'])?$_POST['projekt']:'');
|
||||
$studiengang_kz = (isset($_POST['studiengang'])?$_POST['studiengang']:'');
|
||||
$fachbereich_kurzbz = (isset($_POST['fachbereich'])?$_POST['fachbereich']:'');
|
||||
$aktivitaet_kurzbz = (isset($_POST['aktivitaet'])?$_POST['aktivitaet']:'');
|
||||
$von = (isset($_POST['von'])?$_POST['von']:date('d.m.Y H:i'));
|
||||
$bis = (isset($_POST['bis'])?$_POST['bis']:date('d.m.Y H:i', mktime(date('H'), date('i')+10, 0, date('m'),date('d'),date('Y'))));
|
||||
$beschreibung = (isset($_POST['beschreibung'])?$_POST['beschreibung']:'');
|
||||
|
||||
//Speichern der Daten
|
||||
if(isset($_POST['save']) || isset($_POST['edit']))
|
||||
{
|
||||
$zeit = new zeitaufzeichnung($conn);
|
||||
|
||||
if(isset($_POST['edit']))
|
||||
{
|
||||
if(!$zeit->load($zeitaufzeichnung_id))
|
||||
die('Fehler beim Laden des Datensatzes');
|
||||
|
||||
$zeit->new = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$zeit->new = true;
|
||||
$zeit->insertamum = date('Y-m-d H:i:s');
|
||||
$zeit->insertvon = $user;
|
||||
}
|
||||
|
||||
$zeit->uid = $user;
|
||||
$zeit->aktivitaet_kurzbz = $aktivitaet_kurzbz;
|
||||
$zeit->start = $von;
|
||||
$zeit->ende = $bis;
|
||||
$zeit->beschreibung = $beschreibung;
|
||||
$zeit->studiengang_kz = $studiengang_kz;
|
||||
$zeit->fachbereich_kurzbz = $fachbereich_kurzbz;
|
||||
$zeit->updateamum = date('Y-m-d H:i:s');
|
||||
$zeit->updatevon = $user;
|
||||
$zeit->projekt_kurzbz = $projekt_kurzbz;
|
||||
|
||||
if(!$zeit->save())
|
||||
{
|
||||
echo '<b>Fehler beim Speichern der Daten:'.$zeit->errormsg.'</b><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b>Daten wurden gespeichert</b><br>';
|
||||
$zeitaufzeichnung_id = $zeit->zeitaufzeichnung_id;
|
||||
}
|
||||
}
|
||||
|
||||
//Datensatz loeschen
|
||||
if(isset($_GET['type']) && $_GET['type']=='delete')
|
||||
{
|
||||
$zeit = new zeitaufzeichnung($conn);
|
||||
|
||||
if($zeit->load($zeitaufzeichnung_id))
|
||||
{
|
||||
if($zeit->uid==$user)
|
||||
{
|
||||
if($zeit->delete($zeitaufzeichnung_id))
|
||||
echo '<b>Eintrag wurde geloescht</b><br>';
|
||||
else
|
||||
echo '<b>Fehler beim Loeschen des Eintrages</b><br>';
|
||||
}
|
||||
else
|
||||
echo '<b>Keine Berechtigung!</b><br>';
|
||||
}
|
||||
else
|
||||
echo '<b>Datensatz wurde nicht gefunden</b><br>';
|
||||
}
|
||||
|
||||
//Laden der Daten zum aendern
|
||||
if(isset($_GET['type']) && $_GET['type']=='edit')
|
||||
{
|
||||
$zeit = new zeitaufzeichnung($conn);
|
||||
|
||||
if($zeit->load($zeitaufzeichnung_id))
|
||||
{
|
||||
if($zeit->uid==$user)
|
||||
{
|
||||
$uid = $zeit->uid;
|
||||
$aktivitaet_kurzbz = $zeit->aktivitaet_kurzbz;
|
||||
$von = date('d.m.Y H:i', $datum->mktime_fromtimestamp($zeit->start));
|
||||
$bis = date('d.m.Y H:i', $datum->mktime_fromtimestamp($zeit->ende));
|
||||
$beschreibung = $zeit->beschreibung;
|
||||
$studiengang_kz = $zeit->studiengang_kz;
|
||||
$fachbereich_kurzbz = $zeit->fachbereich_kurzbz;
|
||||
$projekt_kurzbz = $zeit->projekt_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<b> Keine Berechtigung zum Aendern des Datensatzes</b>";
|
||||
$zeitaufzeichnung_id='';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Projekte holen fuer zu denen der Benutzer zugeteilt ist
|
||||
$qry_projekt = "SELECT distinct tbl_projekt.* FROM fue.tbl_projektbenutzer JOIN fue.tbl_projekt USING(projekt_kurzbz) WHERE beginn<=now() AND (ende>=now() OR ende is null) AND uid='$user'";
|
||||
|
||||
if($result_projekt = pg_query($conn, $qry_projekt))
|
||||
{
|
||||
if(pg_num_rows($result_projekt)>0)
|
||||
{
|
||||
$bn = new benutzer($conn);
|
||||
if(!$bn->load($user))
|
||||
die("Benutzer $user wurde nicht gefunden");
|
||||
|
||||
echo "<table width='100%'><tr><td>Zeitaufzeichnung von <b>$bn->vorname $bn->nachname</b></td>
|
||||
<td align='right'><a href='".$_SERVER['PHP_SELF']."' class='Item'>NEU</a></td></tr></table>";
|
||||
|
||||
//Formular
|
||||
echo '<br><br><form action="'.$_SERVER['PHP_SELF'].'?zeitaufzeichnung_id='.$zeitaufzeichnung_id.'" method="POST">';
|
||||
|
||||
echo '<table>';
|
||||
//Projekt
|
||||
echo '<tr><td>Projekt</td><td><SELECT name="projekt" id="projekt">';
|
||||
while($row_projekt = pg_fetch_object($result_projekt))
|
||||
{
|
||||
if($projekt_kurzbz == $row_projekt->projekt_kurzbz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$row_projekt->projekt_kurzbz' $selected>$row_projekt->titel</option>";
|
||||
}
|
||||
echo '</SELECT><input type="button" value="Uebersicht" onclick="loaduebersicht();"></td>';
|
||||
|
||||
//Studiengang
|
||||
echo '<td>Studiengang</td><td><SELECT name="studiengang">';
|
||||
$stg_obj = new studiengang($conn);
|
||||
$stg_obj->getAll('typ, kurzbz',false);
|
||||
|
||||
echo "<option value=''>-- keine Auswahl --</option>";
|
||||
|
||||
foreach ($stg_obj->result as $stg)
|
||||
{
|
||||
if($stg->studiengang_kz == $studiengang_kz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$stg->studiengang_kz' $selected>$stg->kuerzel ($stg->kurzbzlang)</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
//Aktivitaet
|
||||
echo '<tr>';
|
||||
echo '<td>Aktivität</td><td>';
|
||||
|
||||
$qry = "SELECT * FROM fue.tbl_aktivitaet ORDER by beschreibung";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
echo '<SELECT name="aktivitaet">';
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($aktivitaet_kurzbz == $row->aktivitaet_kurzbz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$row->aktivitaet_kurzbz' $selected>$row->beschreibung</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
}
|
||||
//Fachbereich
|
||||
echo '</td><td>Fachbereich</td><td><SELECT name="fachbereich">';
|
||||
echo '<option value="">-- keine Auswahl --</option>';
|
||||
|
||||
$fb_obj = new fachbereich($conn);
|
||||
$fb_obj->getAll();
|
||||
|
||||
foreach ($fb_obj->result as $fb)
|
||||
{
|
||||
if($fachbereich_kurzbz == $fb->fachbereich_kurzbz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$fb->fachbereich_kurzbz' $selected>$fb->bezeichnung</option>";
|
||||
}
|
||||
echo '</SELECT></td></tr>';
|
||||
echo '<tr><td> </td><td> </td></tr>';
|
||||
//Start/Ende
|
||||
echo '
|
||||
<tr>
|
||||
<td>Von</td><td><input type="text" id="von" name="von" value="'.$von.'"><input type="button" value="->" onclick="uebernehmen()"></td>
|
||||
<td>Bis</td><td><input type="text" id="bis" name="bis" value="'.$bis.'"> <img src="../../../skin/images/refresh.png" onclick="setbisdatum()"></td>
|
||||
<tr>';
|
||||
//Beschreibung
|
||||
echo '<tr><td>Beschreibung</td><td colspan="3"><textarea name="beschreibung" cols="60">'.$beschreibung.'</textarea></td></tr>';
|
||||
echo '<tr><td></td><td></td><td></td><td align="right">';
|
||||
//SpeichernButton
|
||||
if($zeitaufzeichnung_id=='')
|
||||
echo '<input type="submit" value="Speichern" name="save"></td></tr>';
|
||||
else
|
||||
echo '<input type="submit" value="Ändern" name="edit"></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
|
||||
echo '<br><hr>';
|
||||
|
||||
//Uebersichtstabelle
|
||||
echo "<table id='t1' class='liste table-autosort:4 table-stripeclass:alternate table-autostripe'>\n";
|
||||
echo " <thead><tr class='liste'>\n";
|
||||
echo " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Projekt</th>";
|
||||
echo "<th class='table-sortable:default'>Aktivitaet</th><th class='table-sortable:default'>User</th>";
|
||||
echo "<th class='table-sortable:default'>Start</th>";
|
||||
echo "<th class='table-sortable:default'>Ende</th>";
|
||||
echo "<th class='table-sortable:default'>Dauer</th>";
|
||||
echo "<th class='table-sortable:default'>Beschreibung</th><th class='table-sortable:default'>Stg</th>";
|
||||
echo "<th class='table-sortable:default'>FB</th><th colspan='2'>Aktion</th>";
|
||||
echo " </tr></thead><tbody>\n";
|
||||
|
||||
if(isset($_GET['filter']))
|
||||
$where = "projekt_kurzbz='".addslashes($_GET['filter'])."'";
|
||||
else
|
||||
$where = "uid='$user' AND ende>(now() - INTERVAL '40 days')";
|
||||
//(SELECT to_char(sum(ende-start),'HH:MI:SS')
|
||||
$qry = "SELECT
|
||||
*, to_char ((ende-start),'HH24:MI') as diff,
|
||||
(SELECT (to_char(sum(ende-start),'DD')::integer)*24+to_char(sum(ende-start),'HH24')::integer || ':' || to_char(sum(ende-start),'MI')
|
||||
FROM campus.tbl_zeitaufzeichnung
|
||||
WHERE $where ) as summe
|
||||
FROM campus.tbl_zeitaufzeichnung WHERE $where
|
||||
ORDER BY start DESC";
|
||||
//AND ende>(now() - INTERVAL '40 days')
|
||||
//echo $qry;
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
$i = 0;
|
||||
$summe=0;
|
||||
while($row=pg_fetch_object($result))
|
||||
{
|
||||
$summe = $row->summe;
|
||||
echo " <tr>\n";
|
||||
echo " <td>".$row->zeitaufzeichnung_id."</td>\n";
|
||||
echo " <td>".$row->projekt_kurzbz."</td>\n";
|
||||
echo " <td>$row->aktivitaet_kurzbz</td>\n";
|
||||
echo " <td>$row->uid</td>\n";
|
||||
echo " <td nowrap><div style='display: none;'>$row->start</div>".date('d.m.Y H:i', $datum->mktime_fromtimestamp($row->start))."</td>\n";
|
||||
echo " <td nowrap><div style='display: none;'>$row->ende</div>".date('d.m.Y H:i', $datum->mktime_fromtimestamp($row->ende))."</td>\n";
|
||||
echo " <td align='right'>".$row->diff."</td>\n";
|
||||
echo " <td title='".mb_eregi_replace("\r\n",' ',$row->beschreibung)."'>".$row->beschreibung."</td>\n";
|
||||
echo " <td>".(isset($stg_arr[$row->studiengang_kz])?$stg_arr[$row->studiengang_kz]:$row->studiengang_kz)."</td>\n";
|
||||
echo " <td>$row->fachbereich_kurzbz</td>\n";
|
||||
echo " <td>";
|
||||
if(!isset($_GET['filter']) || $row->uid==$user)
|
||||
echo "<a href='".$_SERVER['PHP_SELF']."?type=edit&zeitaufzeichnung_id=$row->zeitaufzeichnung_id' class='Item'>edit</a>";
|
||||
echo "</td>\n";
|
||||
echo " <td>";
|
||||
if(!isset($_GET['filter']) || $row->uid==$user)
|
||||
echo "<a href='".$_SERVER['PHP_SELF']."?type=delete&zeitaufzeichnung_id=$row->zeitaufzeichnung_id' class='Item' onclick='return confdel()'>delete</a>";
|
||||
echo "</td>\n";
|
||||
echo " </tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
echo "</tbody></table>\n";
|
||||
echo "Gesamtdauer: $summe";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Sie sind derzeit keinen Projekten zugeordnet';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler beim Ermitteln der Projekte';
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/person.class.php');
|
||||
require_once('../../../include/benutzer.class.php');
|
||||
require_once('../../../include/studiengang.class.php');
|
||||
require_once('../../../include/fachbereich.class.php');
|
||||
require_once('../../../include/zeitaufzeichnung.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Zeitaufzeichnung</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="../../../include/js/tablesort/table.css" type="text/css">
|
||||
<script src="../../../include/js/tablesort/table.js" type="text/javascript"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function setbisdatum()
|
||||
{
|
||||
var now = new Date();
|
||||
var ret = "";
|
||||
var monat = now.getMonth();
|
||||
monat++;
|
||||
ret = foo(now.getDate());
|
||||
ret = ret + "." + foo(monat);
|
||||
ret = ret + "." + now.getFullYear();
|
||||
ret = ret + " " + foo(now.getHours());
|
||||
ret = ret + ":" + foo(now.getMinutes());
|
||||
//ret = ret + ":" + foo(now.getSeconds());
|
||||
|
||||
document.getElementById("bis").value=ret;
|
||||
}
|
||||
|
||||
function foo(val)
|
||||
{
|
||||
if(val<10)
|
||||
return "0"+val;
|
||||
else
|
||||
return val;
|
||||
}
|
||||
|
||||
function confdel()
|
||||
{
|
||||
return confirm("Wollen Sie diesen Datensatz wirklich loeschen?");
|
||||
}
|
||||
|
||||
function loaduebersicht()
|
||||
{
|
||||
projekt = document.getElementById("projekt").value;
|
||||
|
||||
document.location.href="'.$_SERVER['PHP_SELF'].'?filter="+projekt;
|
||||
}
|
||||
|
||||
function uebernehmen()
|
||||
{
|
||||
document.getElementById("bis").value=document.getElementById("von").value;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
';
|
||||
|
||||
echo '<table class="tabcontent">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td class="ContentHeader"><font class="ContentHeader">Zeitaufzeichnung</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>';
|
||||
|
||||
//Variablen initialisieren
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Datenbankverbindung fehlgeschlagen');
|
||||
|
||||
$user = get_uid();
|
||||
$datum = new datum();
|
||||
$studiengang = new studiengang($conn);
|
||||
$studiengang->getAll('typ, kurzbz', false);
|
||||
$stg_arr = array();
|
||||
|
||||
foreach ($studiengang->result as $stg)
|
||||
{
|
||||
$stg_arr[$stg->studiengang_kz]=$stg->kuerzel;
|
||||
}
|
||||
|
||||
$zeitaufzeichnung_id = (isset($_GET['zeitaufzeichnung_id'])?$_GET['zeitaufzeichnung_id']:'');
|
||||
$projekt_kurzbz = (isset($_POST['projekt'])?$_POST['projekt']:'');
|
||||
$studiengang_kz = (isset($_POST['studiengang'])?$_POST['studiengang']:'');
|
||||
$fachbereich_kurzbz = (isset($_POST['fachbereich'])?$_POST['fachbereich']:'');
|
||||
$aktivitaet_kurzbz = (isset($_POST['aktivitaet'])?$_POST['aktivitaet']:'');
|
||||
$von = (isset($_POST['von'])?$_POST['von']:date('d.m.Y H:i'));
|
||||
$bis = (isset($_POST['bis'])?$_POST['bis']:date('d.m.Y H:i', mktime(date('H'), date('i')+10, 0, date('m'),date('d'),date('Y'))));
|
||||
$beschreibung = (isset($_POST['beschreibung'])?$_POST['beschreibung']:'');
|
||||
|
||||
//Speichern der Daten
|
||||
if(isset($_POST['save']) || isset($_POST['edit']))
|
||||
{
|
||||
$zeit = new zeitaufzeichnung($conn);
|
||||
|
||||
if(isset($_POST['edit']))
|
||||
{
|
||||
if(!$zeit->load($zeitaufzeichnung_id))
|
||||
die('Fehler beim Laden des Datensatzes');
|
||||
|
||||
$zeit->new = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$zeit->new = true;
|
||||
$zeit->insertamum = date('Y-m-d H:i:s');
|
||||
$zeit->insertvon = $user;
|
||||
}
|
||||
|
||||
$zeit->uid = $user;
|
||||
$zeit->aktivitaet_kurzbz = $aktivitaet_kurzbz;
|
||||
$zeit->start = $von;
|
||||
$zeit->ende = $bis;
|
||||
$zeit->beschreibung = $beschreibung;
|
||||
$zeit->studiengang_kz = $studiengang_kz;
|
||||
$zeit->fachbereich_kurzbz = $fachbereich_kurzbz;
|
||||
$zeit->updateamum = date('Y-m-d H:i:s');
|
||||
$zeit->updatevon = $user;
|
||||
$zeit->projekt_kurzbz = $projekt_kurzbz;
|
||||
|
||||
if(!$zeit->save())
|
||||
{
|
||||
echo '<b>Fehler beim Speichern der Daten:'.$zeit->errormsg.'</b><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b>Daten wurden gespeichert</b><br>';
|
||||
$zeitaufzeichnung_id = $zeit->zeitaufzeichnung_id;
|
||||
}
|
||||
}
|
||||
|
||||
//Datensatz loeschen
|
||||
if(isset($_GET['type']) && $_GET['type']=='delete')
|
||||
{
|
||||
$zeit = new zeitaufzeichnung($conn);
|
||||
|
||||
if($zeit->load($zeitaufzeichnung_id))
|
||||
{
|
||||
if($zeit->uid==$user)
|
||||
{
|
||||
if($zeit->delete($zeitaufzeichnung_id))
|
||||
echo '<b>Eintrag wurde geloescht</b><br>';
|
||||
else
|
||||
echo '<b>Fehler beim Loeschen des Eintrages</b><br>';
|
||||
}
|
||||
else
|
||||
echo '<b>Keine Berechtigung!</b><br>';
|
||||
}
|
||||
else
|
||||
echo '<b>Datensatz wurde nicht gefunden</b><br>';
|
||||
}
|
||||
|
||||
//Laden der Daten zum aendern
|
||||
if(isset($_GET['type']) && $_GET['type']=='edit')
|
||||
{
|
||||
$zeit = new zeitaufzeichnung($conn);
|
||||
|
||||
if($zeit->load($zeitaufzeichnung_id))
|
||||
{
|
||||
if($zeit->uid==$user)
|
||||
{
|
||||
$uid = $zeit->uid;
|
||||
$aktivitaet_kurzbz = $zeit->aktivitaet_kurzbz;
|
||||
$von = date('d.m.Y H:i', $datum->mktime_fromtimestamp($zeit->start));
|
||||
$bis = date('d.m.Y H:i', $datum->mktime_fromtimestamp($zeit->ende));
|
||||
$beschreibung = $zeit->beschreibung;
|
||||
$studiengang_kz = $zeit->studiengang_kz;
|
||||
$fachbereich_kurzbz = $zeit->fachbereich_kurzbz;
|
||||
$projekt_kurzbz = $zeit->projekt_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<b> Keine Berechtigung zum Aendern des Datensatzes</b>";
|
||||
$zeitaufzeichnung_id='';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Projekte holen fuer zu denen der Benutzer zugeteilt ist
|
||||
$qry_projekt = "SELECT distinct tbl_projekt.* FROM fue.tbl_projektbenutzer JOIN fue.tbl_projekt USING(projekt_kurzbz) WHERE beginn<=now() AND (ende>=now() OR ende is null) AND uid='$user'";
|
||||
|
||||
if($result_projekt = pg_query($conn, $qry_projekt))
|
||||
{
|
||||
if(pg_num_rows($result_projekt)>0)
|
||||
{
|
||||
$bn = new benutzer();
|
||||
if(!$bn->load($user))
|
||||
die("Benutzer $user wurde nicht gefunden");
|
||||
|
||||
echo "<table width='100%'><tr><td>Zeitaufzeichnung von <b>$bn->vorname $bn->nachname</b></td>
|
||||
<td align='right'><a href='".$_SERVER['PHP_SELF']."' class='Item'>NEU</a></td></tr></table>";
|
||||
|
||||
//Formular
|
||||
echo '<br><br><form action="'.$_SERVER['PHP_SELF'].'?zeitaufzeichnung_id='.$zeitaufzeichnung_id.'" method="POST">';
|
||||
|
||||
echo '<table>';
|
||||
//Projekt
|
||||
echo '<tr><td>Projekt</td><td><SELECT name="projekt" id="projekt">';
|
||||
while($row_projekt = pg_fetch_object($result_projekt))
|
||||
{
|
||||
if($projekt_kurzbz == $row_projekt->projekt_kurzbz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$row_projekt->projekt_kurzbz' $selected>$row_projekt->titel</option>";
|
||||
}
|
||||
echo '</SELECT><input type="button" value="Uebersicht" onclick="loaduebersicht();"></td>';
|
||||
|
||||
//Studiengang
|
||||
echo '<td>Studiengang</td><td><SELECT name="studiengang">';
|
||||
$stg_obj = new studiengang($conn);
|
||||
$stg_obj->getAll('typ, kurzbz',false);
|
||||
|
||||
echo "<option value=''>-- keine Auswahl --</option>";
|
||||
|
||||
foreach ($stg_obj->result as $stg)
|
||||
{
|
||||
if($stg->studiengang_kz == $studiengang_kz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$stg->studiengang_kz' $selected>$stg->kuerzel ($stg->kurzbzlang)</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
//Aktivitaet
|
||||
echo '<tr>';
|
||||
echo '<td>Aktivität</td><td>';
|
||||
|
||||
$qry = "SELECT * FROM fue.tbl_aktivitaet ORDER by beschreibung";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
echo '<SELECT name="aktivitaet">';
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($aktivitaet_kurzbz == $row->aktivitaet_kurzbz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$row->aktivitaet_kurzbz' $selected>$row->beschreibung</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
}
|
||||
//Fachbereich
|
||||
echo '</td><td>Fachbereich</td><td><SELECT name="fachbereich">';
|
||||
echo '<option value="">-- keine Auswahl --</option>';
|
||||
|
||||
$fb_obj = new fachbereich($conn);
|
||||
$fb_obj->getAll();
|
||||
|
||||
foreach ($fb_obj->result as $fb)
|
||||
{
|
||||
if($fachbereich_kurzbz == $fb->fachbereich_kurzbz)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$fb->fachbereich_kurzbz' $selected>$fb->bezeichnung</option>";
|
||||
}
|
||||
echo '</SELECT></td></tr>';
|
||||
echo '<tr><td> </td><td> </td></tr>';
|
||||
//Start/Ende
|
||||
echo '
|
||||
<tr>
|
||||
<td>Von</td><td><input type="text" id="von" name="von" value="'.$von.'"><input type="button" value="->" onclick="uebernehmen()"></td>
|
||||
<td>Bis</td><td><input type="text" id="bis" name="bis" value="'.$bis.'"> <img src="../../../skin/images/refresh.png" onclick="setbisdatum()"></td>
|
||||
<tr>';
|
||||
//Beschreibung
|
||||
echo '<tr><td>Beschreibung</td><td colspan="3"><textarea name="beschreibung" cols="60">'.$beschreibung.'</textarea></td></tr>';
|
||||
echo '<tr><td></td><td></td><td></td><td align="right">';
|
||||
//SpeichernButton
|
||||
if($zeitaufzeichnung_id=='')
|
||||
echo '<input type="submit" value="Speichern" name="save"></td></tr>';
|
||||
else
|
||||
echo '<input type="submit" value="Ändern" name="edit"></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
|
||||
echo '<br><hr>';
|
||||
|
||||
//Uebersichtstabelle
|
||||
echo "<table id='t1' class='liste table-autosort:4 table-stripeclass:alternate table-autostripe'>\n";
|
||||
echo " <thead><tr class='liste'>\n";
|
||||
echo " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Projekt</th>";
|
||||
echo "<th class='table-sortable:default'>Aktivitaet</th><th class='table-sortable:default'>User</th>";
|
||||
echo "<th class='table-sortable:default'>Start</th>";
|
||||
echo "<th class='table-sortable:default'>Ende</th>";
|
||||
echo "<th class='table-sortable:default'>Dauer</th>";
|
||||
echo "<th class='table-sortable:default'>Beschreibung</th><th class='table-sortable:default'>Stg</th>";
|
||||
echo "<th class='table-sortable:default'>FB</th><th colspan='2'>Aktion</th>";
|
||||
echo " </tr></thead><tbody>\n";
|
||||
|
||||
if(isset($_GET['filter']))
|
||||
$where = "projekt_kurzbz='".addslashes($_GET['filter'])."'";
|
||||
else
|
||||
$where = "uid='$user' AND ende>(now() - INTERVAL '40 days')";
|
||||
//(SELECT to_char(sum(ende-start),'HH:MI:SS')
|
||||
$qry = "SELECT
|
||||
*, to_char ((ende-start),'HH24:MI') as diff,
|
||||
(SELECT (to_char(sum(ende-start),'DD')::integer)*24+to_char(sum(ende-start),'HH24')::integer || ':' || to_char(sum(ende-start),'MI')
|
||||
FROM campus.tbl_zeitaufzeichnung
|
||||
WHERE $where ) as summe
|
||||
FROM campus.tbl_zeitaufzeichnung WHERE $where
|
||||
ORDER BY start DESC";
|
||||
//AND ende>(now() - INTERVAL '40 days')
|
||||
//echo $qry;
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
$i = 0;
|
||||
$summe=0;
|
||||
while($row=pg_fetch_object($result))
|
||||
{
|
||||
$summe = $row->summe;
|
||||
echo " <tr>\n";
|
||||
echo " <td>".$row->zeitaufzeichnung_id."</td>\n";
|
||||
echo " <td>".$row->projekt_kurzbz."</td>\n";
|
||||
echo " <td>$row->aktivitaet_kurzbz</td>\n";
|
||||
echo " <td>$row->uid</td>\n";
|
||||
echo " <td nowrap><div style='display: none;'>$row->start</div>".date('d.m.Y H:i', $datum->mktime_fromtimestamp($row->start))."</td>\n";
|
||||
echo " <td nowrap><div style='display: none;'>$row->ende</div>".date('d.m.Y H:i', $datum->mktime_fromtimestamp($row->ende))."</td>\n";
|
||||
echo " <td align='right'>".$row->diff."</td>\n";
|
||||
echo " <td title='".mb_eregi_replace("\r\n",' ',$row->beschreibung)."'>".$row->beschreibung."</td>\n";
|
||||
echo " <td>".(isset($stg_arr[$row->studiengang_kz])?$stg_arr[$row->studiengang_kz]:$row->studiengang_kz)."</td>\n";
|
||||
echo " <td>$row->fachbereich_kurzbz</td>\n";
|
||||
echo " <td>";
|
||||
if(!isset($_GET['filter']) || $row->uid==$user)
|
||||
echo "<a href='".$_SERVER['PHP_SELF']."?type=edit&zeitaufzeichnung_id=$row->zeitaufzeichnung_id' class='Item'>edit</a>";
|
||||
echo "</td>\n";
|
||||
echo " <td>";
|
||||
if(!isset($_GET['filter']) || $row->uid==$user)
|
||||
echo "<a href='".$_SERVER['PHP_SELF']."?type=delete&zeitaufzeichnung_id=$row->zeitaufzeichnung_id' class='Item' onclick='return confdel()'>delete</a>";
|
||||
echo "</td>\n";
|
||||
echo " </tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
echo "</tbody></table>\n";
|
||||
echo "Gesamtdauer: $summe";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Sie sind derzeit keinen Projekten zugeordnet';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler beim Ermitteln der Projekte';
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user