mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
This commit is contained in:
@@ -1,111 +1,111 @@
|
||||
<?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 >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*
|
||||
*/
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/news.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$sql_conn = pg_pconnect(CONN_STRING))
|
||||
die("Fehler beim oeffnen der Datenbankverbindung");
|
||||
|
||||
|
||||
function print_news($sql_conn)
|
||||
{
|
||||
$news_obj = new news($sql_conn);
|
||||
$news_obj->getnews(MAXNEWSALTER,'0','0', false, null, MAXNEWS);
|
||||
$open=true;
|
||||
$zaehler=0;
|
||||
echo "<div id='news'>";
|
||||
foreach ($news_obj->result as $row)
|
||||
{
|
||||
$zaehler++;
|
||||
if($row->datum!='')
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
else
|
||||
$datum='';
|
||||
|
||||
echo '<div class="news">';
|
||||
//if($row->semester == '')
|
||||
//{
|
||||
echo '
|
||||
<div class="titel">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="60%" align="left">'.$row->betreff.'</td>
|
||||
<!--<td width="30%" align="center"></td>-->
|
||||
<td width="30%" align="right" style="display: '.($open?'none':'block').'" id="'.$zaehler.'Mehr" ><a href="#" class="Item" onclick="return show(\''.$zaehler.'\')">mehr >></a></td>
|
||||
<td width="30%" align="right" style="display: '.($open?'block':'none').'" id="'.$zaehler.'Verfasser">'.$row->verfasser.' <span style="font-weight: normal">( '.$datum.' )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="text" style="display: '.($open?'block':'none').';" id="'.$zaehler.'Text">
|
||||
'.mb_ereg_replace("../../skin","../../../skin","$row->text").'
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
';
|
||||
/*if($row->semester == 0)
|
||||
{
|
||||
echo '<tr><td class="ContentHeader2"><p><small>'.$datum.' - '.$row->verfasser.' - [Allgemein]</small><br><b>'.$row->betreff.'</b><br></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<tr><td class="ContentHeader2"><p><small>'.$datum.' - '.$row->verfasser.' - </small><br><b>'.$row->betreff.'</b><br></td></tr>';
|
||||
}
|
||||
|
||||
echo "<tr><td class='MarkLine'>".mb_ereg_replace("../../skin","../../../skin","$row->text")."</p></td></tr>";*/
|
||||
}
|
||||
echo "</div>";
|
||||
if($zaehler==0)
|
||||
echo '<p>Zur Zeit gibt es keine aktuellen News!</p>';
|
||||
}
|
||||
?>
|
||||
<!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">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td><table class="tabcontent">
|
||||
<tr>
|
||||
<td class="ContentHeader" width="70%"><font class="ContentHeader"> Pinboard</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><?php print_news($sql_conn); ?></td>
|
||||
</tr>
|
||||
</table></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 >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*
|
||||
*/
|
||||
|
||||
// ---------------- CIS Include Dateien einbinden
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/news.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
|
||||
function print_news()
|
||||
{
|
||||
$news_obj = new news();
|
||||
$news_obj->getnews(MAXNEWSALTER,'0','0', false, null, MAXNEWS);
|
||||
$open=true;
|
||||
$zaehler=0;
|
||||
echo "<div id='news'>";
|
||||
foreach ($news_obj->result as $row)
|
||||
{
|
||||
$zaehler++;
|
||||
if($row->datum!='')
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
else
|
||||
$datum='';
|
||||
|
||||
echo '<div class="news">';
|
||||
//if($row->semester == '')
|
||||
//{
|
||||
echo '
|
||||
<div class="titel">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="60%" align="left">'.$row->betreff.'</td>
|
||||
<!--<td width="30%" align="center"></td>-->
|
||||
<td width="30%" align="right" style="display: '.($open?'none':'block').'" id="'.$zaehler.'Mehr" ><a href="#" class="Item" onclick="return show(\''.$zaehler.'\')">mehr >></a></td>
|
||||
<td width="30%" align="right" style="display: '.($open?'block':'none').'" id="'.$zaehler.'Verfasser">'.$row->verfasser.' <span style="font-weight: normal">( '.$datum.' )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="text" style="display: '.($open?'block':'none').';" id="'.$zaehler.'Text">
|
||||
'.mb_ereg_replace("../../skin","../../../skin","$row->text").'
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
';
|
||||
/*if($row->semester == 0)
|
||||
{
|
||||
echo '<tr><td class="ContentHeader2"><p><small>'.$datum.' - '.$row->verfasser.' - [Allgemein]</small><br><b>'.$row->betreff.'</b><br></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<tr><td class="ContentHeader2"><p><small>'.$datum.' - '.$row->verfasser.' - </small><br><b>'.$row->betreff.'</b><br></td></tr>';
|
||||
}
|
||||
|
||||
echo "<tr><td class='MarkLine'>".mb_ereg_replace("../../skin","../../../skin","$row->text")."</p></td></tr>";*/
|
||||
}
|
||||
echo "</div>";
|
||||
if($zaehler==0)
|
||||
echo '<p>Zur Zeit gibt es keine aktuellen News!</p>';
|
||||
}
|
||||
?>
|
||||
<!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">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td><table class="tabcontent">
|
||||
<tr>
|
||||
<td class="ContentHeader" width="70%"><font class="ContentHeader"> Pinboard</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><?php print_news(); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,74 +1,393 @@
|
||||
<?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 >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*
|
||||
*/
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$sql_conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim oeffnen der Datenbankverbindung');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$is_lector=false;
|
||||
if(check_lektor($user,$sql_conn))
|
||||
$is_lector=true;
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.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">
|
||||
</head>
|
||||
|
||||
<frameset rows="375,*" cols="*" framespacing="0"" frameborder="NO" border="0">
|
||||
<frame src="pinboard_entry.php" name="news_entry">
|
||||
<frame src="pinboard_show.php" name="news_window">
|
||||
</frameset>
|
||||
<noframes><body>
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td><table class="tabcontent">
|
||||
<tr>
|
||||
<td class="ContentHeader"><font class="ContentHeader"> Lektorenbereich - Pinboardverwaltung</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
if(!$is_lector)
|
||||
{
|
||||
die('Sie haben leider keine Berechtigung für diese Seite.');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></noframes>
|
||||
</html>
|
||||
<?php
|
||||
/* Copyright (C) 2008 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 >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
// ---------------- CIS Include Dateien einbinden
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
|
||||
// ---------------- Diverse Funktionen und UID des Benutzers ermitteln
|
||||
require_once('../../../include/functions.inc.php');
|
||||
if (!$user=get_uid())
|
||||
die('Sie sind nicht angemeldet. Es wurde keine Benutzer UID gefunden ! <a href="javascript:history.back()">Zurück</a>');
|
||||
|
||||
// ---------------- Classen Datenbankabfragen und Funktionen
|
||||
include_once('../../../include/person.class.php');
|
||||
include_once('../../../include/benutzer.class.php');
|
||||
include_once('../../../include/benutzerberechtigung.class.php');
|
||||
// ---------------- News Classe und Allg.Funktionen
|
||||
require_once('../../../include/news.class.php');
|
||||
|
||||
// Init
|
||||
$error='';
|
||||
|
||||
$fachbereich_kurzbz=(isset($_REQUEST['fachbereich_kurzbz']) && !empty($_REQUEST['fachbereich_kurzbz'])?$_REQUEST['fachbereich_kurzbz']:null);
|
||||
$studiengang_kz=(isset($_REQUEST['course_id'])?$_REQUEST['course_id']:(isset($_REQUEST['studiengang_kz'])?$_REQUEST['studiengang_kz']:null));
|
||||
$semester=(isset($_REQUEST['term_id'])?$_REQUEST['term_id']:(isset($_REQUEST['semester'])?$_REQUEST['semester']:null));
|
||||
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(check_lektor($user))
|
||||
$is_lector=true;
|
||||
else
|
||||
die('Sie haben leider keine Berechtigung für diese Seite. <a href="javascript:history.back()">Zurück</a>');
|
||||
|
||||
|
||||
/* Im Freifach nicht notwendig
|
||||
if($rechte->isBerechtigt('admin')
|
||||
|| $rechte->isBerechtigt('assistenz')
|
||||
|| $rechte->isBerechtigt('lehre')
|
||||
|| $rechte->isBerechtigt('news'))
|
||||
$berechtigt=true;
|
||||
else
|
||||
$berechtigt=false;
|
||||
if(!$berechtigt)
|
||||
die('Sie haben keine Berechtigung für diese Seite. ! <a href="javascript:history.back()">Zurück</a>');
|
||||
*/
|
||||
|
||||
// Init
|
||||
$error='';
|
||||
// Open der NEWs-Classe
|
||||
$news = new news();
|
||||
|
||||
#var_dump($news);
|
||||
# var_dump($_REQUEST);
|
||||
|
||||
// Parameter einlesen
|
||||
$news_id=trim((isset($_REQUEST['news_id']) ? $_REQUEST['news_id']:''));
|
||||
$btnSend=trim((isset($_REQUEST['btnSend']) ? $_REQUEST['btnSend']:''));
|
||||
$btnDel=trim((isset($_REQUEST['btnDel']) ? $_REQUEST['btnDel']:''));
|
||||
$btnRead=trim((isset($_REQUEST['btnRead']) ? $_REQUEST['btnRead']:''));
|
||||
|
||||
// Verarbeiten der Daten
|
||||
if (!empty($btnSend))
|
||||
{
|
||||
if(isset($news_id) && $news_id != "")
|
||||
$news->new=false;
|
||||
else
|
||||
$news->new=true;
|
||||
|
||||
$news->news_id = $news_id;
|
||||
$news->betreff = trim((isset($_REQUEST['betreff']) ? $_REQUEST['betreff']:''));
|
||||
$news->verfasser =trim((isset($_REQUEST['verfasser']) ? $_REQUEST['verfasser']:''));
|
||||
$news->text = trim((isset($_REQUEST['text']) ? $_REQUEST['text']:''));
|
||||
|
||||
$news->studiengang_kz=0;
|
||||
$news->semester=0;
|
||||
$news->fachbereich_kurzbz=null;
|
||||
|
||||
$news->datum = trim((isset($_REQUEST['datum']) ? $_REQUEST['datum']:date('d.m.Y')));
|
||||
$news->datum_bis = trim((isset($_REQUEST['datum_bis']) ? $_REQUEST['datum_bis']:null));
|
||||
$news->uid=$user;
|
||||
$news->updatevon=$user;
|
||||
$news->updateamum=date('Y-m-d H:i:s');
|
||||
|
||||
# var_dump($news);
|
||||
if($news->save())
|
||||
{
|
||||
if(isset($news_id) && $news_id != "")
|
||||
$error.=(!empty($error)?'<br>':'').'Die Nachricht wurde erfolgreich geändert!';
|
||||
else
|
||||
$error.=(!empty($error)?'<br>':'').'Die Nachricht wurde erfolgreich eingetragen!';
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.=(!empty($error)?'<br>':'').$news->errormsg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Verarbeiten der Daten
|
||||
if (!empty($btnDel))
|
||||
{
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
if($news->delete($news_id))
|
||||
{
|
||||
writeCISlog('DELETE NEWS','');
|
||||
$error.=(!empty($error)?'<br>':'').'Die Nachricht wurde erfolgreich gelöscht!';
|
||||
$news_id='';
|
||||
}
|
||||
else
|
||||
$error.=(!empty($error)?'<br>':'').'Fehler beim löschen des Eintrages! '.$news->errormsg;
|
||||
}
|
||||
|
||||
}
|
||||
// Einlesen News
|
||||
if(isset($news_id) && $news_id != "")
|
||||
{
|
||||
if (!$news->load($news_id))
|
||||
$error.=(!empty($error)?'<br>':'').$news->errormsg;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.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 focusFirstElement()
|
||||
{
|
||||
if(document.NewsEntry.verfasser != null)
|
||||
{
|
||||
document.NewsEntry.verfasser.focus();
|
||||
}
|
||||
}
|
||||
|
||||
function plausibElement()
|
||||
{
|
||||
document.getElementById('error').innerHTML='';
|
||||
if(document.NewsEntry.verfasser.value == '')
|
||||
{
|
||||
document.NewsEntry.verfasser.focus();
|
||||
document.getElementById('error').innerHTML='Eingabe Verfasser fehlt!';
|
||||
return false;
|
||||
}
|
||||
var checkDate=''
|
||||
if(document.NewsEntry.datum.value == '')
|
||||
{
|
||||
document.NewsEntry.datum.focus();
|
||||
document.getElementById('error').innerHTML='Eingabe Sichtbar ab fehlt!';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(document.NewsEntry.datum.value != '')
|
||||
{
|
||||
checkDate=checkdatum(document.NewsEntry.datum);
|
||||
if (checkDate)
|
||||
{
|
||||
document.NewsEntry.datum.focus();
|
||||
document.getElementById('error').innerHTML=checkDate;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (document.NewsEntry.datum_bis.value != '')
|
||||
{
|
||||
checkDate=checkdatum(document.NewsEntry.datum_bis);
|
||||
if (checkDate)
|
||||
{
|
||||
document.NewsEntry.datum_bis.focus();
|
||||
document.getElementById('error').innerHTML=checkDate;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(document.NewsEntry.betreff.value == '')
|
||||
{
|
||||
document.NewsEntry.betreff.focus();
|
||||
document.getElementById('error').innerHTML='Eingabe Titel fehlt!';
|
||||
return false;
|
||||
}
|
||||
if(document.NewsEntry.text.value == '')
|
||||
{
|
||||
document.NewsEntry.text.focus();
|
||||
document.getElementById('error').innerHTML='Eingabe der Nachricht fehlt!';
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkdatum(datum)
|
||||
{
|
||||
var Datum=datum;
|
||||
if(Datum.value.length<10)
|
||||
{
|
||||
return 'Datum ' + Datum.value + ' ist ungültig. Bitte beachten Sie das führende nullen angegeben werden müssen (Beispiel: <?php echo date('d.m.Y');?>)';
|
||||
}
|
||||
var Tag, Monat,Jahr,Date;
|
||||
Date=Datum.value;
|
||||
Tag=Date.substring(0,2);
|
||||
Monat=Date.substring(3,5);
|
||||
Jahr=Date.substring(6,10);
|
||||
|
||||
if (parseInt(Tag,10)<1 || parseInt(Tag,10)>31)
|
||||
{
|
||||
return ' Tag '+ Tag + ' ist nicht richtig im Datum '+ Datum.value;
|
||||
}
|
||||
if (parseInt(Monat,10)<1 || parseInt(Monat,10)>12)
|
||||
{
|
||||
return ' Monat '+ Monat + ' ist nicht richtig im Datum '+ Datum.value;
|
||||
}
|
||||
if (parseInt(Jahr,10)<2000 || parseInt(Jahr,10)>3000)
|
||||
{
|
||||
return ' Jahr '+ Jahr + ' ist nicht richtig im Datum '+ Datum.value;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function deleteEntry(id)
|
||||
{
|
||||
if(confirm("Soll dieser Eintrag wirklich gelöscht werden?") == true)
|
||||
{
|
||||
document.location.href = '<?php echo $_SERVER['PHP_SELF'];?>?btnDel=y&news_id=' + id;
|
||||
}
|
||||
}
|
||||
|
||||
function editEntry(id)
|
||||
{
|
||||
document.location.href = '<?php echo $_SERVER['PHP_SELF'];?>?btnRead=y&news_id=' + id;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="focusFirstElement();">
|
||||
<form onsubmit="if (!plausibElement()) return false;" name="NewsEntry" target="_self" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> <a name="top" > </a></td>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
|
||||
<tr><td class="ContentHeader"><font class="ContentHeader"> Verwaltungstools - Newsverwaltung</font></td></tr>
|
||||
<tr><td class="ContentHeader2"> <?php echo (isset($news_id) && $news_id != ''?'Eintrag ändern':'Neuen Eintrag erstellen'); ?></td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td width="65">Verfasser:</td>
|
||||
<td><input class="TextBox" style="color:black;background-color:#FFFCF2;border : 1px solid Black;" type="text" name="verfasser" size="30"<?php if(isset($news_id) && $news_id != "") echo ' value="'.$news->verfasser.'"'; ?>></td>
|
||||
<td>Sichtbar ab:</td>
|
||||
<td><input class="TextBox" style="color:black;background-color:#FFFCF2;border : 1px solid Black;" type="text" 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 class="TextBox" style="color:black;background-color:#FFFCF2;border : 1px solid Black;" type="text" name="betreff" 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>
|
||||
<td colspan='2'><strong><font class="error">Hinweis:</font></strong>Bitte beachten Sie, dass im Titel auch das jeweilige Freifach genannt wird.
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><textarea class="TextBox" style="color:black;background-color:#FFFCF2;border : 1px solid Black;width: 99%; heigth: 166px;" name="text" rows="10" cols="100" maxlength="1999"><?php if(isset($news_id) && $news_id != "") echo mb_eregi_replace("<br>", "\r\n", $news->text); ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="error" class="error"> <?php echo $error; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="submit" name="btnSend" value="Abschicken">
|
||||
<input type="reset" name="btnCancel" value="<?php echo (isset($news_id) && $news_id !=''?'Abbrechen':'Zurücksetzen'); ?>" onClick="document.location.href='<?php echo $_SERVER['PHP_SELF']; ?>';">
|
||||
<input type="hidden" name="news_id" value="<?php echo $news_id;?>">
|
||||
</td>
|
||||
<td style="color:black;background-color:#FFFCF2;border : 1px solid Black;"> </td><td>Pflichtfelder</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
// Einlesen News
|
||||
$all=true;
|
||||
|
||||
$maxnews=(defined('MAXNEWS')?MAXNEWS:5);
|
||||
$maxalter=(defined('MAXNEWSALTER')?MAXNEWSALTER:30);
|
||||
|
||||
$maxalter=0;
|
||||
|
||||
$fachbereich_kurzbz=null;
|
||||
$studiengang_kz=0;
|
||||
$semester=0;
|
||||
#$news_obj->getnews(MAXNEWSALTER,'0','0',true, null, MAXNEWS);
|
||||
if (!$news->getnews($maxalter, $studiengang_kz, $semester, $all, $fachbereich_kurzbz, $maxnews))
|
||||
die($news->errormsg);
|
||||
|
||||
// Datenlesen OK - in Tabellenform anzeigen
|
||||
if(count($news->result)<1)
|
||||
exit('Zur Zeit gibt es keine aktuellen News!');
|
||||
?>
|
||||
|
||||
<table class="tabcontent" id="inhalt">
|
||||
<tr>
|
||||
<td class="tdwidth10"> </td>
|
||||
<td><table class="tabcontent">
|
||||
<tr>
|
||||
<td>
|
||||
<table class="tabcontent">
|
||||
<?php
|
||||
$i=0;
|
||||
foreach($news->result as $row)
|
||||
{
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
|
||||
echo '<tr>';
|
||||
|
||||
$i++; // Zeilenwechsel - Counter
|
||||
if($i % 2 != 0)
|
||||
echo '<td class="MarkLine">';
|
||||
else
|
||||
echo '<td>';
|
||||
echo ' <table class="tabcontent">';
|
||||
echo ' <tr>';
|
||||
echo ' <td nowarp title="Studiengang_kz:'.$row->studiengang_kz ,', Semester:'. $row->semester .', Fachbereich_kurzbz:'.$row->fachbereich_kurzbz.'">';
|
||||
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>, <a href="#top" >Top</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>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td class="tdwidth30"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<a href="#top" > Top</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user