mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
- Infoscreen Seiten werden jetzt fortlaufend angezeigt anstatt zufällig
- Übersichtsseite mit allen Infoscreens - Refreshzeit kann pro Seite unterschiedlich konfiguriert werden
This commit is contained in:
@@ -27,12 +27,71 @@ require_once('../../include/infoscreen.class.php');
|
||||
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
|
||||
if(isset($_GET['ipadresse']))
|
||||
$ip = $_GET['ipadresse'];
|
||||
else
|
||||
$ip = $_SERVER["REMOTE_ADDR"];
|
||||
$infoscreen = new infoscreen();
|
||||
$i=0;
|
||||
$refreshzeit = 60; // Default Refreshzeit
|
||||
|
||||
$refreshzeiten[0]=$refreshzeit; //Refreshzeit fuer News
|
||||
$infoscreen_content[0]=-1;
|
||||
$aktuellerContentIdx=0;
|
||||
|
||||
//Cookie erhaelt zusaetzlich die IP im Namen damit bei der Preview keine Konflikte entstehen
|
||||
$cookie = 'infoscreenContent'.str_replace('-','',str_replace('.','',$ip));
|
||||
|
||||
//zuletzt angezeigte Seite des Terminals ermitteln
|
||||
if(isset($_COOKIE[$cookie]))
|
||||
{
|
||||
$lastinfoscreencontent = $_COOKIE[$cookie];
|
||||
}
|
||||
else
|
||||
{
|
||||
$lastinfoscreencontent = -1;
|
||||
$aktuellerContentIdx = 0;
|
||||
}
|
||||
|
||||
if($infoscreen->getInfoscreen($ip))
|
||||
{
|
||||
$infoscreen_id = $infoscreen->infoscreen_id;
|
||||
$infoscreen->getScreenContent($infoscreen_id);
|
||||
foreach($infoscreen->result as $row)
|
||||
{
|
||||
$i++;
|
||||
$content[$i] = $row->content_id;
|
||||
$infoscreen_content[$i] = $row->infoscreen_content_id;
|
||||
$refreshzeiten[$i] = $row->refreshzeit;
|
||||
if($row->infoscreen_content_id==$lastinfoscreencontent)
|
||||
{
|
||||
$aktuellerContentIdx=$i+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($aktuellerContentIdx==0 && $i>0)
|
||||
$aktuellerContentIdx=1;
|
||||
if($aktuellerContentIdx>$i)
|
||||
$aktuellerContentIdx=0;
|
||||
|
||||
if(isset($refreshzeiten[$aktuellerContentIdx]) && $refreshzeiten[$aktuellerContentIdx]!='')
|
||||
$refreshzeit = $refreshzeiten[$aktuellerContentIdx];
|
||||
|
||||
//echo "ScreenID: $infoscreen->infoscreen_id";
|
||||
//echo "last: $lastinfoscreencontent\n";
|
||||
//echo "current: $infoscreen_content[$aktuellerContentIdx]\n";
|
||||
//echo "current index: $aktuellerContentIdx\n";
|
||||
//echo "refreshzeit: $refreshzeit\n";
|
||||
|
||||
// Cookie enthaelt die zuletzt angezeigte Seite
|
||||
setcookie($cookie,$infoscreen_content[$aktuellerContentIdx],time()+3600*24);
|
||||
|
||||
echo '
|
||||
<!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">
|
||||
<meta http-equiv="refresh" content="60">
|
||||
<meta http-equiv="refresh" content="',$refreshzeit,'">
|
||||
<link href="../../skin/infoscreen.css" rel="stylesheet" type="text/css">
|
||||
<title>Infoscreen</title>
|
||||
<style type="text/css">
|
||||
@@ -53,29 +112,10 @@ echo '
|
||||
|
||||
<body>';
|
||||
|
||||
$ip = $_SERVER["REMOTE_ADDR"];
|
||||
$infoscreen = new infoscreen();
|
||||
$i=0;
|
||||
if($infoscreen->getInfoscreen($ip))
|
||||
if($aktuellerContentIdx!=0)
|
||||
{
|
||||
$infoscreen_id = $infoscreen->infoscreen_id;
|
||||
$infoscreen->getScreenContent($infoscreen_id);
|
||||
foreach($infoscreen->result as $row)
|
||||
{
|
||||
$i++;
|
||||
$content[$i] = $row->content_id;
|
||||
}
|
||||
//echo "screen: $infoscreen_id";
|
||||
//echo "ip: ".$ip;
|
||||
}
|
||||
|
||||
$zuf = rand(0,$i);
|
||||
//echo 'zuf:'.$zuf.' i:'.$i.'<br>';
|
||||
//var_dump($content);
|
||||
//echo 'show content:'.$content[$zuf].' - '.$zuf;
|
||||
if($zuf!=0)
|
||||
{
|
||||
echo '<center style="height: 100%"><iframe src="../../cms/content.php?content_id='.$content[$zuf].'"></center>';
|
||||
|
||||
echo '<center style="height: 100%"><iframe src="../../cms/content.php?content_id='.$content[$aktuellerContentIdx].'"></center>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ class infoscreen extends basis_db
|
||||
public $content_id;
|
||||
public $gueltigvon;
|
||||
public $gueltigbis;
|
||||
public $refreshzeit;
|
||||
public $insertamum;
|
||||
public $insertvon;
|
||||
public $updateamum;
|
||||
@@ -115,6 +116,7 @@ class infoscreen extends basis_db
|
||||
$this->content_id = $row->content_id;
|
||||
$this->gueltigvon = $row->gueltigvon;
|
||||
$this->gueltigbis = $row->gueltigbis;
|
||||
$this->refreshzeit = $row->refreshzeit;
|
||||
$this->insertamum = $row->insertamum;
|
||||
$this->insertvon = $row->insertvon;
|
||||
$this->updateamum = $row->updateamum;
|
||||
@@ -140,7 +142,7 @@ class infoscreen extends basis_db
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$qry = "SELECT * FROM campus.tbl_infoscreen";
|
||||
$qry = "SELECT * FROM campus.tbl_infoscreen ORDER BY bezeichnung";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
@@ -240,11 +242,12 @@ class infoscreen extends basis_db
|
||||
if($new)
|
||||
{
|
||||
$qry = "BEGIN;INSERT INTO campus.tbl_infoscreen_content(infoscreen_id, content_id,
|
||||
gueltigvon, gueltigbis, insertamum, insertvon, updateamum, updatevon) VALUES(".
|
||||
gueltigvon, gueltigbis, refreshzeit, insertamum, insertvon, updateamum, updatevon) VALUES(".
|
||||
$this->addslashes($this->infoscreen_id).','.
|
||||
$this->addslashes($this->content_id).','.
|
||||
$this->addslashes($this->gueltigvon).','.
|
||||
$this->addslashes($this->gueltigbis).','.
|
||||
$this->addslashes($this->refreshzeit).','.
|
||||
$this->addslashes($this->insertamum).','.
|
||||
$this->addslashes($this->insertvon).','.
|
||||
$this->addslashes($this->updateamum).','.
|
||||
@@ -257,6 +260,7 @@ class infoscreen extends basis_db
|
||||
' content_id='.$this->addslashes($this->content_id).','.
|
||||
' gueltigvon='.$this->addslashes($this->gueltigvon).','.
|
||||
' gueltigbis='.$this->addslashes($this->gueltigbis).','.
|
||||
' refreshzeit='.$this->addslashes($this->refreshzeit).','.
|
||||
' updateamum='.$this->addslashes($this->updateamum).','.
|
||||
' updatevon='.$this->addslashes($this->updatevon).' '.
|
||||
' WHERE infoscreen_content_id='.$this->addslashes($this->infoscreen_content_id).';';
|
||||
@@ -352,6 +356,7 @@ class infoscreen extends basis_db
|
||||
$qry.="
|
||||
AND (gueltigvon<=now() OR gueltigvon is null)
|
||||
AND (gueltigbis>=now() OR gueltigbis is null)";
|
||||
$qry.=" ORDER BY infoscreen_content_id";
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
@@ -363,6 +368,7 @@ class infoscreen extends basis_db
|
||||
$obj->content_id = $row->content_id;
|
||||
$obj->gueltigvon = $row->gueltigvon;
|
||||
$obj->gueltigbis = $row->gueltigbis;
|
||||
$obj->refreshzeit = $row->refreshzeit;
|
||||
$obj->insertamum = $row->insertamum;
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
|
||||
+50
-9
@@ -36525,7 +36525,7 @@
|
||||
<Left>5198</Left>
|
||||
<z>0</z>
|
||||
<Width>901</Width>
|
||||
<Height>395</Height>
|
||||
<Height>434</Height>
|
||||
<dz>0</dz>
|
||||
<RecalculateSizes>1</RecalculateSizes>
|
||||
<UseWorkSpaceRecalculateSizes>1</UseWorkSpaceRecalculateSizes>
|
||||
@@ -37920,7 +37920,7 @@
|
||||
<Id>{9592E5CD-A497-41B0-A32F-BEFD756A0A6A}</Id>
|
||||
</WorkSpaceShape2>
|
||||
<NamePositionX>6021</NamePositionX>
|
||||
<NamePositionY>1479</NamePositionY>
|
||||
<NamePositionY>1488</NamePositionY>
|
||||
<Points>
|
||||
<Point>
|
||||
<x>6291</x>
|
||||
@@ -37932,11 +37932,11 @@
|
||||
</Point>
|
||||
<Point>
|
||||
<x>6130</x>
|
||||
<y>1964</y>
|
||||
<y>1983</y>
|
||||
</Point>
|
||||
<Point>
|
||||
<x>6099</x>
|
||||
<y>1964</y>
|
||||
<y>1983</y>
|
||||
</Point>
|
||||
</Points>
|
||||
</WorkSpaceLinePERRelationPG83>
|
||||
@@ -46649,7 +46649,7 @@
|
||||
<Company>Technikum Wien</Company>
|
||||
<Version>2.0</Version>
|
||||
<CreatedDate>2009-04-17T10:15:21.000+01:00</CreatedDate>
|
||||
<ModifiedDate>2012-01-13T14:09:46.461+01:00</ModifiedDate>
|
||||
<ModifiedDate>2012-01-19T11:37:20.793+01:00</ModifiedDate>
|
||||
<Project>FH-Complete 2.0</Project>
|
||||
<Description><?xml-stylesheet type="text/xsl" href="FHCompleteTDM3PG83.xsl"?>
|
||||
</Description>
|
||||
@@ -143781,10 +143781,51 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
|
||||
<ArrDims></ArrDims>
|
||||
<IsArray>0</IsArray>
|
||||
</PERAttributePG83>
|
||||
<PERAttributePG83 ObjectType="2003" CSAOName="PERAttributePG83">
|
||||
<Id>{2A5231DE-FF6A-4B91-8F04-1542F0F91CEC}</Id>
|
||||
<Name>refreshzeit</Name>
|
||||
<Ordinal>6</Ordinal>
|
||||
<HistoryID>{974E44FA-CF43-4E8E-A759-7B0F6149FA38}</HistoryID>
|
||||
<GlobalOrder>0</GlobalOrder>
|
||||
<RNOffset>0</RNOffset>
|
||||
<RNLength>0</RNLength>
|
||||
<IgnoreNC>0</IgnoreNC>
|
||||
<GenerateCode>1</GenerateCode>
|
||||
<BeforeScript></BeforeScript>
|
||||
<AfterScript></AfterScript>
|
||||
<Notes></Notes>
|
||||
<Comments></Comments>
|
||||
<DataTypeParam1></DataTypeParam1>
|
||||
<DataTypeParam2></DataTypeParam2>
|
||||
<KeepForeignKey>0</KeepForeignKey>
|
||||
<DefaultValue></DefaultValue>
|
||||
<NotNull>0</NotNull>
|
||||
<Migrated>0</Migrated>
|
||||
<Caption>refreshzeit</Caption>
|
||||
<Unique>0</Unique>
|
||||
<OriginalName></OriginalName>
|
||||
<CheckConstraint></CheckConstraint>
|
||||
<CheckConstraintName></CheckConstraintName>
|
||||
<KeyConstraintItems/>
|
||||
<PKForeignKeys/>
|
||||
<FKForeignKeys/>
|
||||
<DictType/>
|
||||
<Domain/>
|
||||
<DataType>
|
||||
<Id>{3AA5E900-D254-4FBD-AD67-AD230407284C}</Id>
|
||||
</DataType>
|
||||
<UserDataType/>
|
||||
<IndexItems/>
|
||||
<Default/>
|
||||
<CheckConstraints/>
|
||||
<KeyConstraint/>
|
||||
<ArrDims></ArrDims>
|
||||
<IsArray>0</IsArray>
|
||||
</PERAttributePG83>
|
||||
<PERAttributePG83 ObjectType="2003" CSAOName="PERAttributePG83">
|
||||
<Id>{9D05FA00-0B6F-4934-9978-1A70903E8CC9}</Id>
|
||||
<Name>insertamum</Name>
|
||||
<Ordinal>6</Ordinal>
|
||||
<Ordinal>7</Ordinal>
|
||||
<HistoryID>{02E12191-E5F5-4391-98E1-25DEEB840F69}</HistoryID>
|
||||
<GlobalOrder>0</GlobalOrder>
|
||||
<RNOffset>0</RNOffset>
|
||||
@@ -143825,7 +143866,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
|
||||
<PERAttributePG83 ObjectType="2003" CSAOName="PERAttributePG83">
|
||||
<Id>{E5A2A9F3-0EB0-412F-AD0F-EF43A20B2922}</Id>
|
||||
<Name>insertvon</Name>
|
||||
<Ordinal>7</Ordinal>
|
||||
<Ordinal>8</Ordinal>
|
||||
<HistoryID>{EB99DD58-5BCB-4772-BDCF-2178E98BADC0}</HistoryID>
|
||||
<GlobalOrder>0</GlobalOrder>
|
||||
<RNOffset>0</RNOffset>
|
||||
@@ -143866,7 +143907,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
|
||||
<PERAttributePG83 ObjectType="2003" CSAOName="PERAttributePG83">
|
||||
<Id>{2BCD0141-C8B1-4CEA-8664-8EF32369ED5A}</Id>
|
||||
<Name>updateamum</Name>
|
||||
<Ordinal>8</Ordinal>
|
||||
<Ordinal>9</Ordinal>
|
||||
<HistoryID>{ED162FF1-222C-4A6E-9DE2-E62A596798A6}</HistoryID>
|
||||
<GlobalOrder>0</GlobalOrder>
|
||||
<RNOffset>0</RNOffset>
|
||||
@@ -143907,7 +143948,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
|
||||
<PERAttributePG83 ObjectType="2003" CSAOName="PERAttributePG83">
|
||||
<Id>{17DA2759-3466-4741-BFD3-35697B6C0A38}</Id>
|
||||
<Name>updatevon</Name>
|
||||
<Ordinal>9</Ordinal>
|
||||
<Ordinal>10</Ordinal>
|
||||
<HistoryID>{78A7EC8D-106D-4540-B712-4391DF1A377A}</HistoryID>
|
||||
<GlobalOrder>0</GlobalOrder>
|
||||
<RNOffset>0</RNOffset>
|
||||
|
||||
@@ -3134,6 +3134,7 @@ if(!@$db->db_query("SELECT 1 FROM campus.tbl_infoscreen LIMIT 1"))
|
||||
content_id integer NOT NULL,
|
||||
gueltigvon timestamp,
|
||||
gueltigbis timestamp,
|
||||
refreshzeit smallint,
|
||||
insertamum timestamp,
|
||||
insertvon varchar(32),
|
||||
updateamum timestamp,
|
||||
|
||||
@@ -88,6 +88,7 @@ $datum_obj = new datum();
|
||||
$content_id = $_POST['content_id'];
|
||||
$gueltigvon = $_POST['gueltigvon'];
|
||||
$gueltigbis = $_POST['gueltigbis'];
|
||||
$refreshzeit = $_POST['refreshzeit'];
|
||||
|
||||
$infoscreen = new infoscreen();
|
||||
if($infoscreen_content_id!='')
|
||||
@@ -106,6 +107,7 @@ $datum_obj = new datum();
|
||||
$infoscreen->content_id = $content_id;
|
||||
$infoscreen->gueltigvon = $datum_obj->formatDatum($gueltigvon,'Y-m-d H:i:s');
|
||||
$infoscreen->gueltigbis = $datum_obj->formatDatum($gueltigbis,'Y-m-d H:i:s');
|
||||
$infoscreen->refreshzeit = $refreshzeit;
|
||||
$infoscreen->updateamum = date('Y-m-d H:i:s');
|
||||
$infoscreen->updatevon = $user;
|
||||
|
||||
@@ -158,6 +160,10 @@ $datum_obj = new datum();
|
||||
<td>Gültig bis</td>
|
||||
<td><input type="text" size="18" name="gueltigbis" value="',$db->convert_html_chars($datum_obj->formatDatum($infoscreen->gueltigbis,'d.m.Y H:i:s')),'" /> ( Format: ',date('d.m.Y H:i:s'),' )</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Refreshzeit</td>
|
||||
<td><input type="text" size="18" name="refreshzeit" value="',$db->convert_html_chars($infoscreen->refreshzeit),'" /> Zeit wie lange die Seite angezeigt wird (in Sekunden)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="Speichern" /></td>
|
||||
@@ -176,6 +182,7 @@ $datum_obj = new datum();
|
||||
<th>ContentID</th>
|
||||
<th>Gültig von</th>
|
||||
<th>Gültig bis</th>
|
||||
<th>Refreshzeit</th>
|
||||
<th colspan="2">Aktion</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -189,6 +196,7 @@ $datum_obj = new datum();
|
||||
echo '<td>',$db->convert_html_chars($row->content_id),'</td>';
|
||||
echo '<td>',$db->convert_html_chars($datum_obj->formatDatum($row->gueltigvon,'d.m.Y H:i:s')),'</td>';
|
||||
echo '<td>',$db->convert_html_chars($datum_obj->formatDatum($row->gueltigbis,'d.m.Y H:i:s')),'</td>';
|
||||
echo '<td>',$db->convert_html_chars($row->refreshzeit),'</td>';
|
||||
echo '<td><a href="infoscreen_details.php?action=update&infoscreen_id=',$db->convert_html_chars($infoscreen_id),'&infoscreen_content_id=',$db->convert_html_chars($row->infoscreen_content_id),'">bearbeiten</a>';
|
||||
echo '<td><a href="infoscreen_details.php?action=delete&infoscreen_id=',$db->convert_html_chars($infoscreen_id),'&infoscreen_content_id=',$db->convert_html_chars($row->infoscreen_content_id),'">entfernen</a>';
|
||||
echo '</tr>';
|
||||
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 FH 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: Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
|
||||
*/
|
||||
/**
|
||||
* Seite zur Wartung der Infoscreens
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/infoscreen.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/datum.class.php');
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/infoscreen'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$datum_obj = new datum();
|
||||
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Infoscreen - Preview</title>
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Infoscreen - Preview</h1>
|
||||
<?php
|
||||
$infoscreen = new infoscreen();
|
||||
$infoscreen->getAll();
|
||||
|
||||
foreach($infoscreen->result as $row)
|
||||
{
|
||||
echo '
|
||||
<div style="float: left">
|
||||
<h2><center>',$row->bezeichnung,'</center></h2>
|
||||
<iframe style="width:500px; height:400px" src="../../cis/infoterminal/infoscreen.php?ipadresse=',$row->ipadresse,'"></iframe>
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -61,6 +61,7 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<body>
|
||||
<h2>Infoscreen Übersicht</h2>
|
||||
<div style="text-align:right">
|
||||
<a href="infoscreen_preview.php" target="main">Übersicht anzeigen</a> |
|
||||
<a href="infoscreen_uebersicht.php?action=new" target="uebersicht_infoscreen">Neuen Infoscreen hinzufügen</a>
|
||||
</div>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user