mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
CIS Anpassung an neue DB
- Lesson - Pinboard - News - Upload - Zip-Download - Anpassung Sync Scripte
This commit is contained in:
@@ -39,7 +39,7 @@ $anzahl_fehler=0;
|
||||
// ***********************************
|
||||
|
||||
//Mitarbeiter
|
||||
$qry = 'Select * FROM tbl_userberechtigung left join tbl_fachbereich using(fachbereich_id)';
|
||||
$qry = 'Select art, kurzbz, tbl_userberechtigung.studiengang_kz, berechtigung_kurzbz, uid, studiensemester_kurzbz, start, ende FROM tbl_userberechtigung left join tbl_fachbereich using(fachbereich_id)';
|
||||
|
||||
if($result = pg_query($conn_vilesci, $qry))
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ if($result = pg_query($conn_vilesci, $qry))
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_log .= 'Fehler beim auslesen der Lehrveranstaltung_nr\n';
|
||||
$error_log .= "Fehler beim Auslesen der Lehrveranstaltung_nr\n.$qry\n";
|
||||
$anzahl_fehler++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ if($result = pg_query($conn_vilesci, $qry))
|
||||
$lehrveranstaltung->ects =$row->ects;
|
||||
$lehrveranstaltung->semesterstunden =0;
|
||||
$lehrveranstaltung->anmerkung ='';
|
||||
$lehrveranstaltung->lehre =($row->aktiv=='t'?true:false);
|
||||
$lehrveranstaltung->lehre =($row->lehre=='t'?true:false);
|
||||
$lehrveranstaltung->lehreverzeichnis =$row->lehrevz;
|
||||
$lehrveranstaltung->aktiv =($row->aktiv=='t'?true:false);
|
||||
$lehrveranstaltung->planfaktor ='1.0';
|
||||
|
||||
@@ -67,9 +67,10 @@ if($result = pg_query($conn_vilesci, $qry))
|
||||
$news->studiengang_kz =$row->studiengang_kz;
|
||||
$news->verfasser =$row->verfasser;
|
||||
//$news->insertamum ='';
|
||||
$news->insertvon ='SYNC';
|
||||
$news->insertvon =$row->uid;
|
||||
$news->datum = $row->updateamum;
|
||||
$news->updateamum =$row->updateamum;
|
||||
//$news->updatevon =$row->updatevon;
|
||||
$news->updatevon =$row->uid;
|
||||
|
||||
$qry = "SELECT news_id FROM campus.tbl_news WHERE news_id='$row->news_id'";
|
||||
if($result1 = pg_query($conn, $qry))
|
||||
|
||||
@@ -139,7 +139,18 @@ if($result = pg_query($conn_vilesci, $qry))
|
||||
$qry.="'".$row->stundenplandev_id."'";
|
||||
else
|
||||
$qry.="'".$row->stundenplan_id."'";
|
||||
|
||||
//fix fuer fehlerhafte Lehrverbaende
|
||||
|
||||
if(trim($row->semester)!='')
|
||||
$verb=$row->verband;
|
||||
else
|
||||
$verb=' ';
|
||||
if(trim($verb)!='')
|
||||
$gruppe=$row->gruppe;
|
||||
else
|
||||
$gruppe=' ';
|
||||
|
||||
$qry.=",".myaddslashes($row->unr).",".
|
||||
myaddslashes($row->uid).",".
|
||||
myaddslashes($row->datum).",".
|
||||
@@ -154,8 +165,8 @@ if($result = pg_query($conn_vilesci, $qry))
|
||||
myaddslashes($lehreinheit_id).",".
|
||||
myaddslashes($row->studiengang_kz).",".
|
||||
myaddslashes($row->semester).",'".
|
||||
($row->verband!=''?addslashes($row->verband):' ')."','".
|
||||
(($row->gruppe!='' && $row->gruppe!=0)?addslashes($row->gruppe):' ')."');";
|
||||
($verb!=''?addslashes($verb):' ')."','".
|
||||
(($gruppe!='' && $gruppe!=0)?addslashes($gruppe):' ')."');";
|
||||
if(pg_query($conn,$qry))
|
||||
{
|
||||
$anzahl_eingefuegt++;
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<?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');
|
||||
@@ -87,7 +107,7 @@
|
||||
<td valign="top"> </td>
|
||||
<td>';
|
||||
|
||||
$qry = "SELECT vorname, nachname, tbl_benutzer.uid as uid FROM lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter, tbl_benutzer, tbl_person WHERE tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid=tbl_benutzer.uid AND tbl_person.person_id=tbl_benutzer.person_id AND lehrveranstaltung_id='$lvid' AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid NOT like '_Dummy%' AND tbl_person.aktiv=true ORDER BY nachname, vorname";
|
||||
$qry = "SELECT distinct vorname, nachname, tbl_benutzer.uid as uid FROM lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter, tbl_benutzer, tbl_person WHERE tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid=tbl_benutzer.uid AND tbl_person.person_id=tbl_benutzer.person_id AND lehrveranstaltung_id='$lvid' AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid NOT like '_Dummy%' AND tbl_person.aktiv=true AND studiensemester_kurzbz='$angezeigtes_stsem' ORDER BY nachname, vorname";
|
||||
|
||||
$result = pg_exec($sql_conn, $qry);
|
||||
$num_rows_result = pg_num_rows($result);
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
<?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>.
|
||||
*/
|
||||
/**
|
||||
* Pinboard
|
||||
* Zeigt alle Pinboardeintraege an. Am rechten Rand werden
|
||||
@@ -48,8 +68,8 @@
|
||||
foreach ($news_obj->result as $row)
|
||||
{
|
||||
$zaehler++;
|
||||
if($row->updateamum!='')
|
||||
$datum = date('d.m.Y - h:i',strtotime(strftime($row->updateamum)));
|
||||
if($row->datum!='')
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
else
|
||||
$datum='';
|
||||
|
||||
@@ -323,7 +343,7 @@
|
||||
{
|
||||
while($row_stdv = pg_fetch_object($result_course_stdv))
|
||||
{
|
||||
echo "<a href='mailto:".$row_stdv->uid."@technikum-wien.at'>$row_stdv->titelpre $row_stdv->vorname $row_stdv->nachname $row->titelpost</a><br>";
|
||||
echo "<a href='mailto:".$row_stdv->uid."@technikum-wien.at'>$row_stdv->titelpre $row_stdv->vorname $row_stdv->nachname $row_stdv->titelpost</a><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,11 +1,31 @@
|
||||
<?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/news.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die("Fehler beim oeffnen der Datenbankverbindung");
|
||||
die('Fehler beim oeffnen der Datenbankverbindung');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
@@ -70,7 +90,7 @@
|
||||
<?php
|
||||
|
||||
$news_obj = new news($conn);
|
||||
$news_obj->getnews(MAXNEWSALTER,$course_id, $term_id);
|
||||
$news_obj->getnews(MAXNEWSALTER,$course_id, $term_id, true);
|
||||
|
||||
$i=0;
|
||||
foreach($news_obj->result as $row)
|
||||
@@ -83,8 +103,8 @@
|
||||
else
|
||||
echo '<td>';
|
||||
|
||||
if($row->updateamum!='')
|
||||
$datum = date('d.m.Y - h:i',strtotime(strftime($row->updateamum)));
|
||||
if($row->datum!='')
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
else
|
||||
$datum='';
|
||||
|
||||
@@ -120,4 +140,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,85 @@
|
||||
<?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>.
|
||||
*/
|
||||
/**
|
||||
* Erstellt ein Zip Archiv des Download-Bereichs und leitet dann zum Download weiter
|
||||
* @create 20-03-2006
|
||||
* Aufruf: zipdownload.php?stg=255&sem=1$short=eng
|
||||
*/
|
||||
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/studiengang.class.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
|
||||
//Connection zur DB herstellen
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
{
|
||||
writeCISlog('STOP');
|
||||
die("Fehler beim herstellen der DB Verbindung");
|
||||
}
|
||||
|
||||
//Gueltigkeit der Parameter pruefen
|
||||
if(!isset($_GET['stg']) || !is_numeric($_GET['stg']))
|
||||
{
|
||||
writeCISlog('STOP');
|
||||
die("Fehler bei der Parameteruebergabe");
|
||||
}
|
||||
|
||||
if(!isset($_GET['sem']) || !is_numeric($_GET['sem']))
|
||||
{
|
||||
writeCISlog('STOP');
|
||||
die("Fehler bei der Parameteruebergabe");
|
||||
}
|
||||
|
||||
if(!isset($_GET['short']) || strstr("..",$_GET['short']))
|
||||
{
|
||||
writeCISlog('STOP');
|
||||
die("Fehler bei der Parameteruebergabe");
|
||||
}
|
||||
|
||||
$stg = $_GET['stg'];
|
||||
$sem = $_GET['sem'];
|
||||
$short = $_GET['short'];
|
||||
|
||||
//Studiengangskuerzel holen
|
||||
$stg_obj = new studiengang($conn);
|
||||
$stg_obj->load($stg);
|
||||
|
||||
$kurzbz = strtolower($stg_obj->kurzbz);
|
||||
|
||||
//Pfade bauen
|
||||
$pfad = '../../../documents/'.$kurzbz.'/'.$sem.'/'.$short.'/download/';
|
||||
$filename = $kurzbz.'_'.$sem.'_'.$short.'_download.zip';
|
||||
$pfad2 = '../../../documents/'.$kurzbz.'/'.$sem.'/'.$short.'/';
|
||||
|
||||
//Pfad wechseln
|
||||
chdir($pfad);
|
||||
|
||||
//File loeschen falls es existiert
|
||||
if(file_exists($filename))
|
||||
exec("rm $filename");
|
||||
|
||||
//Zip File erstellen
|
||||
exec("zip -r ../".$filename." ./*");
|
||||
|
||||
//Auf Zip File Verweisen
|
||||
header("Location: $pfad2$filename");
|
||||
?>
|
||||
@@ -1,8 +1,28 @@
|
||||
<?php
|
||||
include("../../config.inc.php");
|
||||
include("../../../include/functions.inc.php");
|
||||
include("../../../include/benutzerberechtigung.class.php");
|
||||
include("../../../include/news.class.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))
|
||||
@@ -52,8 +72,10 @@
|
||||
$news->text = $news_message;
|
||||
$news->studiengang_kz = '0';
|
||||
$news->semester = null;
|
||||
$news->datum = $datum;
|
||||
$news->uid=$user;
|
||||
$news->updatevon=$user;
|
||||
$news->updateamum=date('Y-m-d');
|
||||
$news->new=false;
|
||||
|
||||
if($news->save())
|
||||
@@ -80,6 +102,8 @@
|
||||
$news->updatevon=$user;
|
||||
$news->semester = null;
|
||||
$news->uid = $user;
|
||||
$news->updateamum=date('Y-m-d');
|
||||
$news->datum=$datum;
|
||||
$news->new=true;
|
||||
|
||||
if($news->save())
|
||||
@@ -211,6 +235,7 @@
|
||||
<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: <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>
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
<?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>
|
||||
@@ -26,7 +48,7 @@
|
||||
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');
|
||||
@@ -78,9 +100,9 @@
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<?php
|
||||
|
||||
|
||||
$news = new news($sql_conn);
|
||||
$news->getnews(MAXNEWSALTER,0,null);
|
||||
$news->getnews(MAXNEWSALTER,0,null, true);
|
||||
|
||||
$zaehler=0;
|
||||
$i=0;
|
||||
@@ -88,7 +110,7 @@
|
||||
{
|
||||
$i++;
|
||||
$zaehler++;
|
||||
$datum = date('d.m.Y - h:i',strtotime(strftime($row->updateamum)));
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
@@ -104,7 +126,7 @@
|
||||
echo ' <table width="100%" border="0" cellspacing="0" cellpadding="0">';
|
||||
echo ' <tr>';
|
||||
echo ' <td nowarp>';
|
||||
echo $datum.' '.$row->verfasser;
|
||||
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>';
|
||||
@@ -115,7 +137,7 @@
|
||||
echo ' </tr>';
|
||||
echo ' </table>';
|
||||
echo ' <strong>'.$row->betreff.'</strong><br>'.$row->text.'</td>';
|
||||
echo "</tr>";
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td> </td>';
|
||||
echo '</tr>';
|
||||
|
||||
+21
-1
@@ -1,4 +1,24 @@
|
||||
<?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/news.class.php');
|
||||
|
||||
@@ -37,7 +57,7 @@
|
||||
{
|
||||
$zaehler++;
|
||||
//no comment
|
||||
$datum = date('d.m.Y - h:i',strtotime(strftime($row->updateamum)));
|
||||
$datum = date('d.m.Y',strtotime(strftime($row->datum)));
|
||||
|
||||
echo $datum.' '.$row->verfasser.'<br><br><strong>'.$row->betreff.'</strong><br>'.$row->text.'<br><br><br>
|
||||
';
|
||||
|
||||
@@ -179,7 +179,7 @@ class benutzerberechtigung
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern des Feedbacks:'.$qry;
|
||||
$this->errormsg = 'Fehler beim Speichern der Benutzerberechtigung:'.$qry;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+21
-10
@@ -35,6 +35,7 @@ class news
|
||||
var $uid; // @var varchar(16)
|
||||
var $studiengang_kz; // @var integer
|
||||
var $verfasser; // @var varchar(64)
|
||||
var $datum; // @date
|
||||
var $updateamum; // @var timestamp
|
||||
var $updatevon=0; // @var string
|
||||
var $insertamum; // @var timestamp
|
||||
@@ -77,6 +78,7 @@ class news
|
||||
$news_obj->uid = $row->uid;
|
||||
$news_obj->studiengang_kz=$row->studiengang_kz;
|
||||
$news_obj->verfasser = $row->verfasser;
|
||||
$news_obj->datum = $row->datum;
|
||||
$news_obj->insertamum=$row->insertamum;
|
||||
$news_obj->insertvon=$row->insertvon;
|
||||
$news_obj->updateamum=$row->updateamum;
|
||||
@@ -92,7 +94,7 @@ class news
|
||||
// * als $maxalter Tage sind
|
||||
// * @param $maxalter
|
||||
// **********************************
|
||||
function getnews($maxalter, $studiengang_kz, $semester)
|
||||
function getnews($maxalter, $studiengang_kz, $semester, $all=false)
|
||||
{
|
||||
if(!is_numeric($maxalter) || !is_numeric($studiengang_kz) || ($semester!='' && !is_numeric($semester)))
|
||||
{
|
||||
@@ -102,16 +104,21 @@ class news
|
||||
|
||||
if($maxalter!=0)
|
||||
{
|
||||
$interval = "(now()-updateamum)<interval '$maxalter days' AND";
|
||||
$interval = "(now()-datum)<interval '$maxalter days' AND";
|
||||
}
|
||||
else
|
||||
$interval = '';
|
||||
|
||||
if($all)
|
||||
$datum = '';
|
||||
else
|
||||
$datum = 'AND datum<=now()';
|
||||
|
||||
if($studiengang_kz==0)
|
||||
$qry = "SELECT * FROM campus.tbl_news WHERE $interval studiengang_kz=".$studiengang_kz." AND semester".($semester!=''?"='$semester'":' is null')." order by updateamum DESC;";
|
||||
$qry = "SELECT * FROM campus.tbl_news WHERE $interval studiengang_kz=".$studiengang_kz." AND semester".($semester!=''?"='$semester'":' is null')." $datum ORDER BY datum DESC, updateamum DESC;";
|
||||
else
|
||||
$qry = "SELECT * FROM campus.tbl_news WHERE $interval ((studiengang_kz=$studiengang_kz AND semester=$semester) OR (studiengang_kz=$studiengang_kz AND semester=0) OR (studiengang_kz=0 AND semester=$semester) OR (studiengang_kz=0 and semester is null)) ORDER BY updateamum DESC";
|
||||
|
||||
$qry = "SELECT * FROM campus.tbl_news WHERE $interval ((studiengang_kz=$studiengang_kz AND semester=$semester) OR (studiengang_kz=$studiengang_kz AND semester=0) OR (studiengang_kz=0 AND semester=$semester) OR (studiengang_kz=0 and semester is null)) $datum ORDER BY datum DESC, updateamum DESC";
|
||||
|
||||
if($result = pg_query($this->conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
@@ -124,6 +131,7 @@ class news
|
||||
$newsobj->betreff = $row->betreff;
|
||||
$newsobj->text = $row->text;
|
||||
$newsobj->verfasser = $row->verfasser;
|
||||
$newsobj->datum = $row->datum;
|
||||
$newsobj->updateamum = $row->updateamum;
|
||||
$newsobj->updatevon = $row->updateamum;
|
||||
$newsobj->insertamum = $row->insertamum;
|
||||
@@ -171,6 +179,7 @@ class news
|
||||
$this->uid = $row->uid;
|
||||
$this->studiengang_kz = $row->studiengang_kz;
|
||||
$this->verfasser = $row->verfasser;
|
||||
$this->datum = $row->datum;
|
||||
$this->insertamum = $row->insertamum;
|
||||
$this->insertvon = $row->insertvon;
|
||||
$this->updateamum = $row->updateamum;
|
||||
@@ -254,7 +263,7 @@ class news
|
||||
{
|
||||
//Neuen Datensatz anlegen
|
||||
|
||||
$qry = 'INSERT INTO campus.tbl_news (betreff, text, semester, uid, studiengang_kz, verfasser, insertamum, insertvon,
|
||||
$qry = 'INSERT INTO campus.tbl_news (betreff, text, semester, uid, studiengang_kz, verfasser,datum, insertamum, insertvon,
|
||||
updateamum, updatevon) VALUES ('.
|
||||
$this->addslashes($this->betreff).', '.
|
||||
$this->addslashes($this->text).', '.
|
||||
@@ -262,9 +271,10 @@ class news
|
||||
$this->addslashes($this->uid).', '.
|
||||
$this->addslashes($this->studiengang_kz).', '.
|
||||
$this->addslashes($this->verfasser).', '.
|
||||
$this->addslashes($this->datum).', '.
|
||||
$this->addslashes($this->insertamum).', '.
|
||||
$this->addslashes($this->insertvon).', now(),'.
|
||||
//$this->addslashes($this->updateamum).', '.
|
||||
$this->addslashes($this->insertvon).', '.
|
||||
$this->addslashes($this->updateamum).', '.
|
||||
$this->addslashes($this->updatevon).'); ';
|
||||
|
||||
}
|
||||
@@ -286,13 +296,14 @@ class news
|
||||
'uid='.$this->addslashes($this->uid).', '.
|
||||
'studiengang_kz='.$this->addslashes($this->studiengang_kz).', '.
|
||||
'verfasser='.$this->addslashes($this->verfasser).', '.
|
||||
'datum='.$this->addslashes($this->datum).', '.
|
||||
'insertamum='.$this->addslashes($this->insertamum).', '.
|
||||
'insertvon='.$this->addslashes($this->insertvon).', '.
|
||||
'updateamum=now(),'. //'.$this->addslashes($this->updateamum).', '.
|
||||
'updateamum='.$this->addslashes($this->updateamum).', '.
|
||||
'updatevon='.$this->addslashes($this->updatevon).' '.
|
||||
'WHERE news_id = '.$this->addslashes($this->news_id).';';
|
||||
}
|
||||
echo $qry;
|
||||
|
||||
if(pg_query($this->conn, $qry))
|
||||
{
|
||||
/*//Log schreiben
|
||||
|
||||
Reference in New Issue
Block a user