Erstversion Ampelsystem

This commit is contained in:
Andreas Österreicher
2011-11-29 08:50:02 +00:00
parent 12e6092178
commit a0bd89cbc8
13 changed files with 584 additions and 193 deletions
Executable
+52
View File
@@ -0,0 +1,52 @@
<?php
require_once('../config/cis.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/ampel.class.php');
require_once('../include/datum.class.php');
if(is_user_logged_in())
{
$user = get_uid();
$ampel = new ampel();
$ampel->loadUserAmpel($user);
$rot=0;
$gelb=0;
$datum = new datum();
foreach($ampel->result as $row)
{
$ts_deadline = $datum->mktime_fromdate($row->deadline);
$vlz = "-".$row->vorlaufzeit." day";
$ts_vorlaufzeit = strtotime($vlz, $ts_deadline);
$ts_now = $datum->mktime_fromdate(date('Y-m-d'));
if($ts_deadline < $ts_now)
{
$rot++;
}
else
{
if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline)
{
$gelb++;
}
}
}
if($rot>0 || $gelb>0)
{
echo '[';
if($rot>0)
echo '<a href="private/tools/ampelverwaltung.php" target="content" title="Red Alert"><img src="../skin/images/ampel_rot.png" style="vertical-align: bottom;"> '.$rot.'</a>';
if($rot>0 && $gelb>0)
echo ' | ';
if($gelb>0)
echo '<a href="private/tools/ampelverwaltung.php" target="content" title="Yellow Alert"><img src="../skin/images/ampel_gelb.png" style="vertical-align: bottom;"> '.$gelb.'</a>';
echo ' ]';
}
}
else
{
echo "<script>window.setTimeout('loadampel()',5000);</script>";
//echo microtime();
}
?>
+18 -2
View File
@@ -54,8 +54,10 @@ else
<head>
<title>CIS - <?php echo CAMPUS_NAME; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../skin/jquery.css" type="text/css">
<link href="../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<script src="../include/js/jquery.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
function changeSprache(sprache)
@@ -69,8 +71,21 @@ function changeSprache(sprache)
window.location.href="index.php?sprache="+sprache+"&content_id=<?php echo $id;?>&menu="+menu+"&content="+content;
}
function gettimestamp()
{
var now = new Date();
var ret = now.getHours()*60*60*60;
ret = ret + now.getMinutes()*60*60;
ret = ret + now.getSeconds()*60;
ret = ret + now.getMilliseconds();
return ret;
}
function loadampel()
{
$('#ampel').load('ampel.php?'+gettimestamp());
}
</script>
<body style="margin-top:0; padding-top:0">
<body style="margin-top:0; padding-top:0" onload="loadampel()">
<table class="tabcontent">
<tr>
<td></td>
@@ -90,7 +105,8 @@ function changeSprache(sprache)
</tr>
<tr>
<td></td>
<td align="right" nowrap colspan="2">
<td align="right" nowrap colspan="2">
<span id="ampel"></span>
<?php require_once('../include/'.EXT_FKT_PATH.'/cis_menu_global.inc.php'); ?>
</td>
+149
View File
@@ -0,0 +1,149 @@
<?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>
*/
require_once('../../../config/cis.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/ampel.class.php');
require_once('../../../include/datum.class.php');
require_once('../../../include/phrasen.class.php');
$user = get_uid();
$sprache = getSprache();
$p = new phrasen($sprache);
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../skin/fhcomplete.css" type="text/css"/>
<link rel="stylesheet" href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
<link rel="stylesheet" href="../../../skin/jquery.css" type="text/css"/>
<script type="text/javascript" src="../../../include/js/jquery.js"></script>
<title>',$p->t('tools/ampelsystem'),'</title>
<script type="text/javascript">
$(document).ready(function()
{
$("#myTable").tablesorter(
{
sortList: [[2,0]],
widgets: [\'zebra\']
});
});
</script>
</head>
<body>
<h1>',$p->t('tools/ampelsystem'),'</h1>
';
$datum_obj = new datum();
$type = isset($_GET['type'])?$_GET['type']:'';
$ampel_id = isset($_GET['ampel_id'])?$_GET['ampel_id']:'';
if($type=='bestaetigen' && is_numeric($ampel_id))
{
$ampel = new ampel();
if($ampel->load($ampel_id))
{
if($ampel->isZugeteilt($user, $ampel->benutzer_select))
{
if($ampel->bestaetigen($user, $ampel_id))
{
$message = '<span class="ok">OK</span>';
}
else
$message = '<span class="error">'.$ampel->errormsg.'</span>';
}
else
$message = '<span class="error">'.$p->t('tools/nichtZugeteilt').'</span>';
}
else
$message = '<span class="error">'.$p->t('tools/ampelNichtGefunden').'</span>';
}
$ampel = new ampel();
$ampel->loadUserAmpel($user, true);
echo '
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>'.$p->t('tools/ampelStatus').'</th>
<th>'.$p->t('tools/ampelBeschreibung').'</th>
<th>'.$p->t('tools/ampelDeadline').'</th>
<th>'.$p->t('tools/ampelAktion').'</th>
</tr>
</thead>
<tbody>
';
foreach($ampel->result as $row)
{
$ts_deadline = $datum_obj->mktime_fromdate($row->deadline);
$vlz = "-".$row->vorlaufzeit." day";
$ts_vorlaufzeit = strtotime($vlz, $ts_deadline);
$ts_now = $datum_obj->mktime_fromdate(date('Y-m-d'));
if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline)
$ampelstatus='gelb';
elseif($ts_now>$ts_deadline)
$ampelstatus='rot';
elseif($ts_now<$ts_deadline && $ts_vorlaufzeit>=$ts_now)
$ampelstatus='gruen';
echo '<tr>';
echo '<td align="center">';
switch($ampelstatus)
{
case 'rot':
echo '<img src="../../../skin/images/ampel_rot.png">';
break;
case 'gelb':
echo '<img src="../../../skin/images/ampel_gelb.png">';
break;
case 'gruen':
echo '<img src="../../../skin/images/ampel_gruen.png">';
break;
default:
break;
}
echo '</td>';
echo '<td>'.$row->beschreibung[$sprache].'</td>';
echo '<td>'.$datum_obj->formatDatum($row->deadline,'d.m.Y').'</td>';
if(!$ampel->isBestaetigt($user,$row->ampel_id))
echo '<td><a href="'.$_SERVER['PHP_SELF'].'?ampel_id='.$row->ampel_id.'&type=bestaetigen">bestätigen</a></td>';
else
echo '<td></td>';
// echo "<td>".date('d.m.Y',$ts_now)."</td>";
// echo "<td align=\"center\">".date('d.m.Y',$ts_vorlaufzeit)."</td>";
// echo "<td>".date('d.m.Y',$ts_deadline)."</td>";
echo '</tr>';
}
echo '</tbody></table>';
echo '</body>
</html>';
?>
+84 -19
View File
@@ -22,6 +22,7 @@
*
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/sprache.class.php');
class ampel extends basis_db
{
@@ -31,7 +32,7 @@ class ampel extends basis_db
//Tabellenspalten
public $ampel_id; // bigint
public $kurzbz; // varchar(64)
public $beschreibung; // text
public $beschreibung = array(); // text[]
public $benutzer_select;// text
public $deadline; // date
public $vorlaufzeit; // smallint
@@ -43,7 +44,7 @@ class ampel extends basis_db
public $ampel_benutzer_id; // bigint
public $uid; // varchar(32)
/**
* Konstruktor - Laedt optional eine Ampel
* @param $amepl_id
@@ -51,7 +52,7 @@ class ampel extends basis_db
public function __construct($ampel_id=null)
{
parent::__construct();
if(!is_null($ampel_id))
$this->load($ampel_id);
}
@@ -70,7 +71,10 @@ class ampel extends basis_db
return false;
}
$qry = "SELECT * FROM public.tbl_ampel WHERE ampel_id='".addslashes($ampel_id)."'";
$sprache = new sprache();
$beschreibung = $sprache->getSprachQuery('beschreibung');
$qry = "SELECT *,".$beschreibung." FROM public.tbl_ampel WHERE ampel_id='".addslashes($ampel_id)."'";
if($result = $this->db_query($qry))
{
@@ -78,7 +82,7 @@ class ampel extends basis_db
{
$this->ampel_id = $row->ampel_id;
$this->kurzbz = $row->kurzbz;
$this->beschreibung = $row->beschreibung;
$this->beschreibung = $sprache->parseSprachResult('beschreibung', $row);
$this->benutzer_select = $row->benutzer_select;
$this->deadline = $row->deadline;
$this->vorlaufzeit = $row->vorlaufzeit;
@@ -108,7 +112,10 @@ class ampel extends basis_db
*/
public function getAll()
{
$qry = "SELECT * FROM public.tbl_ampel ORDER BY deadline";
$sprache = new sprache();
$beschreibung = $sprache->getSprachQuery('beschreibung');
$qry = "SELECT *,".$beschreibung." FROM public.tbl_ampel ORDER BY deadline";
if($result = $this->db_query($qry))
{
@@ -118,7 +125,7 @@ class ampel extends basis_db
$obj->ampel_id = $row->ampel_id;
$obj->kurzbz = $row->kurzbz;
$obj->beschreibung = $row->beschreibung;
$obj->beschreibung = $sprache->parseSprachResult('beschreibung', $row);
$obj->benutzer_select = $row->benutzer_select;
$obj->deadline = $row->deadline;
$obj->vorlaufzeit = $row->vorlaufzeit;
@@ -169,7 +176,8 @@ class ampel extends basis_db
*/
public function isZugeteilt($user, $benutzer_select)
{
$qry = "SELECT CASE WHEN '".addslashes($user)."' IN (".$row->benutzer_select.") THEN true ELSE false END as zugeteilt";
$qry = "SELECT CASE WHEN '".addslashes($user)."' IN (".$benutzer_select.") THEN true ELSE false END as zugeteilt";
if($result_zugeteilt = $this->db_query($qry))
{
if($row_zugeteilt = $this->db_fetch_object($result_zugeteilt))
@@ -196,10 +204,24 @@ class ampel extends basis_db
* Laedt alle aktuellen Ampeln eines Users
* @param $user
*/
public function loadUserAmpel($user)
public function loadUserAmpel($user, $zukuenftige_anzeigen=false, $bestaetigt=false)
{
$qry = "SELECT * FROM public.tbl_ampel WHERE deadline+verfallszeit>now() AND deadline-vorlaufzeit<now()";
$sprache = new sprache();
$beschreibung = $sprache->getSprachQuery('beschreibung');
$qry = "SELECT *,".$beschreibung." FROM public.tbl_ampel WHERE deadline+verfallszeit>now()";
if(!$zukuenftige_anzeigen)
$qry.=" AND deadline-vorlaufzeit<now()";
if(!$bestaetigt)
{
$qry.=" AND NOT EXISTS
(SELECT ampel_id
FROM public.tbl_ampel_benutzer_bestaetigt
WHERE uid='".addslashes($user)."' AND ampel_id=tbl_ampel.ampel_id)";
}
if($result = $this->db_query($qry))
{
while($row = $this->db_fetch_object($result))
@@ -210,7 +232,7 @@ class ampel extends basis_db
$obj->ampel_id = $row->ampel_id;
$obj->kurzbz = $row->kurzbz;
$obj->beschreibung = $row->beschreibung;
$obj->beschreibung = $sprache->parseSprachResult('beschreibung', $row);
$obj->benutzer_select = $row->benutzer_select;
$obj->deadline = $row->deadline;
$obj->vorlaufzeit = $row->vorlaufzeit;
@@ -239,13 +261,27 @@ class ampel extends basis_db
if(is_null($new))
$new = $this->new;
$sprache = new sprache();
$sprache->loadIndexArray();
if($this->new)
{
$qry = "BEGIN;INSERT INTO public.tbl_ampel (kurzbz, beschreibung, benutzer_select, deadline,
$qry = "BEGIN;INSERT INTO public.tbl_ampel (kurzbz, ";
foreach($this->beschreibung as $key=>$value)
{
$idx = $sprache->index_arr[$key];
$qry.=" beschreibung[$idx],";
}
$qry.=" benutzer_select, deadline,
vorlaufzeit, verfallszeit, insertamum, insertvon , updateamum, updatevon) VALUES(".
$this->addslashes($this->kurzbz).','.
$this->addslashes($this->beschreibung).','.
$this->addslashes($this->benutzer_select).','.
$this->addslashes($this->kurzbz).',';
foreach($this->beschreibung as $key=>$value)
$this->addslashes($value).',';
$qry .= $this->addslashes($this->benutzer_select).','.
$this->addslashes($this->deadline).','.
$this->addslashes($this->vorlaufzeit).','.
$this->addslashes($this->verfallszeit).','.
@@ -257,9 +293,15 @@ class ampel extends basis_db
else
{
$qry = 'UPDATE public.tbl_ampel SET'.
' kurzbz = '.$this->addslashes($this->kurzbz).','.
' beschreibung = '.$this->addslashes($this->beschreibung).','.
' benutzer_select = '.$this->addslashes($this->benutzer_select).','.
' kurzbz = '.$this->addslashes($this->kurzbz).',';
foreach($this->beschreibung as $key=>$value)
{
$idx = $sprache->index_arr[$key];
$qry.=' beschreibung['.$idx.'] = '.$this->addslashes($value).',';
}
$qry.= ' benutzer_select = '.$this->addslashes($this->benutzer_select).','.
' deadline = '.$this->addslashes($this->deadline).','.
' vorlaufzeit = '.$this->addslashes($this->vorlaufzeit).','.
' verfallszeit = '.$this->addslashes($this->verfallszeit).','.
@@ -326,7 +368,30 @@ class ampel extends basis_db
$this->errormsg = 'Fehler beim Loeschen der Ampel';
return false;
}
}
}
/**
* Bestaetigt die Ampel eines Users
* @param $user
* @param $ampel_id
* @return boolean
*/
public function bestaetigen($user, $ampel_id)
{
$qry = 'INSERT INTO public.tbl_ampel_benutzer_bestaetigt(ampel_id, uid, insertamum, insertvon) VALUES('.
$this->addslashes($ampel_id).','.
$this->addslashes($user).','.
'now(),'.
$this->addslashes($user).');';
if($this->db_query($qry))
return true;
else
{
$this->errormsg = 'Fehler beim Speichern der Daten';
return false;
}
}
}
?>
+1 -1
View File
@@ -29,7 +29,7 @@ require_once ('../include/functions.inc.php');
$sprache = getSprache();
$p = new phrasen($sprache);
?>
<div id="GlobalMenu">
<div id="GlobalMenu" style="display: inline">
[ <a class='Item' href="index.html" target="_top"><?php echo $p->t('profil/home');?></a>
| <a class='Item' href="menu.php?content_id=173" target="menu"><?php echo $p->t('profil/meinCis');?></a>
| <a class='Item' href="menu.php?content_id=166" target="menu"><?php echo $p->t('lvaliste/lehrveranstaltungen');?></a>
+11 -1
View File
@@ -23,5 +23,15 @@ $this->phrasen['tools/betrag']='Betrag';
$this->phrasen['tools/zahlungsbestaetigung']='Zahlungsbestätigung';
$this->phrasen['tools/bestaetigungDrucken']='Bestaetigung drucken';
$this->phrasen['tools/offen']='offen';
$this->phrasen['tools/keineZahlungenVorhanden']='Derzeit sind keine Zahlungen vorhanden'
$this->phrasen['tools/keineZahlungenVorhanden']='Derzeit sind keine Zahlungen vorhanden';
//Ampeln
$this->phrasen['tools/ampelsystem']='Ampelsystem';
$this->phrasen['tools/nichtZugeteilt']='Sie sind nicht zu dieser Ampel zugeteilt';
$this->phrasen['tools/ampelNichtGefunden']='Die angegeben Ampel wurde nicht gefunden';
$this->phrasen['tools/ampelStatus']='Status';
$this->phrasen['tools/ampelBeschreibung']='Beschreibung';
$this->phrasen['tools/ampelDeadline']='Deadline';
$this->phrasen['tools/ampelAktion']='Aktion';
?>
+10 -1
View File
@@ -23,5 +23,14 @@ $this->phrasen['tools/betrag']='Amount';
$this->phrasen['tools/zahlungsbestaetigung']='Confirmation of payment ';
$this->phrasen['tools/bestaetigungDrucken']='Print Confirmation';
$this->phrasen['tools/offen']='outstanding';
$this->phrasen['tools/keineZahlungenVorhanden']='Currently there are no payments'
$this->phrasen['tools/keineZahlungenVorhanden']='Currently there are no payments';
//Ampeln
$this->phrasen['tools/ampelsystem']='Ampelsystem';
$this->phrasen['tools/nichtZugeteilt']='Sie sind nicht zu dieser Ampel zugeteilt';
$this->phrasen['tools/ampelNichtGefunden']='Die angegeben Ampel wurde nicht gefunden';
$this->phrasen['tools/ampelStatus']='Status';
$this->phrasen['tools/ampelBeschreibung']='Description';
$this->phrasen['tools/ampelDeadline']='Deadline';
$this->phrasen['tools/ampelAktion']='Action';
?>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

+205 -154
View File
@@ -25456,8 +25456,8 @@
<FontStyle>0</FontStyle>
<FormatLocked>0</FormatLocked>
<FontHeight>-28</FontHeight>
<Top>1773</Top>
<Left>8676</Left>
<Top>1615</Top>
<Left>8697</Left>
<z>0</z>
<Width>886</Width>
<Height>551</Height>
@@ -25612,8 +25612,8 @@
<FontStyle>0</FontStyle>
<FormatLocked>0</FormatLocked>
<FontHeight>-28</FontHeight>
<Top>2419</Top>
<Left>8830</Left>
<Top>2230</Top>
<Left>8790</Left>
<z>0</z>
<Width>764</Width>
<Height>200</Height>
@@ -26056,8 +26056,8 @@
<FontStyle>0</FontStyle>
<FormatLocked>0</FormatLocked>
<FontHeight>-28</FontHeight>
<Top>767</Top>
<Left>8552</Left>
<Top>717</Top>
<Left>8585</Left>
<z>0</z>
<Width>794</Width>
<Height>278</Height>
@@ -26747,8 +26747,8 @@
<FontStyle>0</FontStyle>
<FormatLocked>0</FormatLocked>
<FontHeight>-28</FontHeight>
<Top>1207</Top>
<Left>8758</Left>
<Top>1050</Top>
<Left>8751</Left>
<z>0</z>
<Width>899</Width>
<Height>473</Height>
@@ -27337,8 +27337,8 @@
<FontStyle>0</FontStyle>
<FormatLocked>0</FormatLocked>
<FontHeight>-28</FontHeight>
<Top>2797</Top>
<Left>8637</Left>
<Top>2579</Top>
<Left>8666</Left>
<z>0</z>
<Width>1092</Width>
<Height>1487</Height>
@@ -27416,8 +27416,8 @@
<FontStyle>0</FontStyle>
<FormatLocked>0</FormatLocked>
<FontHeight>-28</FontHeight>
<Top>2315</Top>
<Left>9924</Left>
<Top>2371</Top>
<Left>10020</Left>
<z>0</z>
<Width>801</Width>
<Height>473</Height>
@@ -27929,16 +27929,16 @@
<WorkSpaceShape2>
<Id>{4B8FF0F0-CE9E-4D02-B29F-73FEB38DB1AC}</Id>
</WorkSpaceShape2>
<NamePositionX>9723</NamePositionX>
<NamePositionY>2812</NamePositionY>
<NamePositionX>9703</NamePositionX>
<NamePositionY>2718</NamePositionY>
<Points>
<Point>
<x>9594</x>
<y>2519</y>
<x>9554</x>
<y>2330</y>
</Point>
<Point>
<x>9625</x>
<y>2519</y>
<x>9585</x>
<y>2330</y>
</Point>
<Point>
<x>9934</x>
@@ -28243,15 +28243,15 @@
<Id>{4C98A428-14DD-4587-B44B-5A31CAA42B19}</Id>
</WorkSpaceShape2>
<NamePositionX>4281</NamePositionX>
<NamePositionY>2195</NamePositionY>
<NamePositionY>2241</NamePositionY>
<Points>
<Point>
<x>7672</x>
<y>2907</y>
<y>2999</y>
</Point>
<Point>
<x>7641</x>
<y>2907</y>
<y>2999</y>
</Point>
<Point>
<x>2302</x>
@@ -28501,23 +28501,23 @@
<Id>{C2303976-8004-4530-A9DC-543D000F94C9}</Id>
</WorkSpaceShape2>
<NamePositionX>7449</NamePositionX>
<NamePositionY>2917</NamePositionY>
<NamePositionY>2732</NamePositionY>
<Points>
<Point>
<x>7672</x>
<y>2999</y>
<y>2907</y>
</Point>
<Point>
<x>7641</x>
<y>2999</y>
<y>2907</y>
</Point>
<Point>
<x>7417</x>
<y>2944</y>
<y>2667</y>
</Point>
<Point>
<x>7386</x>
<y>2944</y>
<y>2667</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -28587,15 +28587,15 @@
<Id>{003CB043-E645-44CB-A1E7-B2DAB7CD0513}</Id>
</WorkSpaceShape2>
<NamePositionX>8338</NamePositionX>
<NamePositionY>2001</NamePositionY>
<NamePositionY>1932</NamePositionY>
<Points>
<Point>
<x>7386</x>
<y>2621</y>
<y>2483</y>
</Point>
<Point>
<x>7417</x>
<y>2621</y>
<y>2483</y>
</Point>
<Point>
<x>9765</x>
@@ -28715,24 +28715,24 @@
<WorkSpaceShape2>
<Id>{CA4F7EAC-55C4-480E-B7C9-180DB66AC5B0}</Id>
</WorkSpaceShape2>
<NamePositionX>8086</NamePositionX>
<NamePositionY>1753</NamePositionY>
<NamePositionX>7827</NamePositionX>
<NamePositionY>1519</NamePositionY>
<Points>
<Point>
<x>7386</x>
<y>2460</y>
<x>6906</x>
<y>2298</y>
</Point>
<Point>
<x>7417</x>
<y>2460</y>
<x>6906</x>
<y>2267</y>
</Point>
<Point>
<x>8727</x>
<y>1562</y>
<x>8720</x>
<y>1286</y>
</Point>
<Point>
<x>8758</x>
<y>1562</y>
<x>8751</x>
<y>1286</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -28758,16 +28758,16 @@
<WorkSpaceShape2>
<Id>{0C663600-4D6D-4A2E-800A-153F59399066}</Id>
</WorkSpaceShape2>
<NamePositionX>8585</NamePositionX>
<NamePositionY>1387</NamePositionY>
<NamePositionX>8582</NamePositionX>
<NamePositionY>1367</NamePositionY>
<Points>
<Point>
<x>8758</x>
<y>1444</y>
<x>8751</x>
<y>1405</y>
</Point>
<Point>
<x>8727</x>
<y>1444</y>
<x>8720</x>
<y>1405</y>
</Point>
<Point>
<x>8507</x>
@@ -28887,15 +28887,15 @@
<WorkSpaceShape2>
<Id>{FFCA6168-3717-4994-BC3B-042505DD8EED}</Id>
</WorkSpaceShape2>
<NamePositionX>8029</NamePositionX>
<NamePositionX>8069</NamePositionX>
<NamePositionY>2037</NamePositionY>
<Points>
<Point>
<x>7066</x>
<x>7146</x>
<y>2298</y>
</Point>
<Point>
<x>7066</x>
<x>7146</x>
<y>2267</y>
</Point>
<Point>
@@ -28930,15 +28930,15 @@
<WorkSpaceShape2>
<Id>{C9AFAFC7-19FB-4784-A406-4B4CDEABCD21}</Id>
</WorkSpaceShape2>
<NamePositionX>7695</NamePositionX>
<NamePositionX>7654</NamePositionX>
<NamePositionY>1299</NamePositionY>
<Points>
<Point>
<x>6747</x>
<x>6667</x>
<y>2298</y>
</Point>
<Point>
<x>6747</x>
<x>6667</x>
<y>2267</y>
</Point>
<Point>
@@ -29145,8 +29145,8 @@
<WorkSpaceShape2>
<Id>{6AEE904A-17EB-47A0-B5FD-DEAC6C762AEA}</Id>
</WorkSpaceShape2>
<NamePositionX>8456</NamePositionX>
<NamePositionY>1012</NamePositionY>
<NamePositionX>8473</NamePositionX>
<NamePositionY>986</NamePositionY>
<Points>
<Point>
<x>8476</x>
@@ -29157,12 +29157,12 @@
<y>1239</y>
</Point>
<Point>
<x>8521</x>
<y>906</y>
<x>8554</x>
<y>856</y>
</Point>
<Point>
<x>8552</x>
<y>906</y>
<x>8585</x>
<y>856</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -29845,16 +29845,16 @@
<WorkSpaceShape2>
<Id>{3C978BA4-E261-44AB-A8AC-850BFC5A3C3B}</Id>
</WorkSpaceShape2>
<NamePositionX>9397</NamePositionX>
<NamePositionY>625</NamePositionY>
<NamePositionX>9394</NamePositionX>
<NamePositionY>546</NamePositionY>
<Points>
<Point>
<x>9357</x>
<y>1207</y>
<x>9350</x>
<y>1050</y>
</Point>
<Point>
<x>9357</x>
<y>1176</y>
<x>9350</x>
<y>1019</y>
</Point>
<Point>
<x>9513</x>
@@ -29888,24 +29888,24 @@
<WorkSpaceShape2>
<Id>{CF52EB80-BE30-40A3-980C-8F262A0A0484}</Id>
</WorkSpaceShape2>
<NamePositionX>9119</NamePositionX>
<NamePositionY>1666</NamePositionY>
<NamePositionX>9125</NamePositionX>
<NamePositionY>1508</NamePositionY>
<Points>
<Point>
<x>9208</x>
<y>1680</y>
<x>9200</x>
<y>1523</y>
</Point>
<Point>
<x>9208</x>
<y>1711</y>
<x>9200</x>
<y>1554</y>
</Point>
<Point>
<x>9119</x>
<y>1742</y>
<x>9140</x>
<y>1584</y>
</Point>
<Point>
<x>9119</x>
<y>1773</y>
<x>9140</x>
<y>1615</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -29931,16 +29931,16 @@
<WorkSpaceShape2>
<Id>{2E5D944C-5C5D-4F01-9057-73779D9CDCAA}</Id>
</WorkSpaceShape2>
<NamePositionX>7470</NamePositionX>
<NamePositionY>752</NamePositionY>
<NamePositionX>7466</NamePositionX>
<NamePositionY>673</NamePositionY>
<Points>
<Point>
<x>8758</x>
<y>1325</y>
<x>8751</x>
<y>1168</y>
</Point>
<Point>
<x>8727</x>
<y>1325</y>
<x>8720</x>
<y>1168</y>
</Point>
<Point>
<x>3876</x>
@@ -30146,16 +30146,16 @@
<WorkSpaceShape2>
<Id>{C9AFAFC7-19FB-4784-A406-4B4CDEABCD21}</Id>
</WorkSpaceShape2>
<NamePositionX>9105</NamePositionX>
<NamePositionY>874</NamePositionY>
<NamePositionX>9102</NamePositionX>
<NamePositionY>795</NamePositionY>
<Points>
<Point>
<x>9058</x>
<y>1207</y>
<x>9051</x>
<y>1050</y>
</Point>
<Point>
<x>9058</x>
<y>1176</y>
<x>9051</x>
<y>1019</y>
</Point>
<Point>
<x>9006</x>
@@ -30748,8 +30748,8 @@
<WorkSpaceShape2>
<Id>{CF52EB80-BE30-40A3-980C-8F262A0A0484}</Id>
</WorkSpaceShape2>
<NamePositionX>9764</NamePositionX>
<NamePositionY>1794</NamePositionY>
<NamePositionX>9775</NamePositionX>
<NamePositionY>1715</NamePositionY>
<Points>
<Point>
<x>10135</x>
@@ -30760,12 +30760,12 @@
<y>1660</y>
</Point>
<Point>
<x>9593</x>
<y>2048</y>
<x>9614</x>
<y>1890</y>
</Point>
<Point>
<x>9562</x>
<y>2048</y>
<x>9583</x>
<y>1890</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -30834,24 +30834,24 @@
<WorkSpaceShape2>
<Id>{DBBBEEE5-BBA2-48F5-9350-350BBFF93EC5}</Id>
</WorkSpaceShape2>
<NamePositionX>7911</NamePositionX>
<NamePositionY>2854</NamePositionY>
<NamePositionX>7926</NamePositionX>
<NamePositionY>2780</NamePositionY>
<Points>
<Point>
<x>7386</x>
<y>2782</y>
<y>2852</y>
</Point>
<Point>
<x>7417</x>
<y>2782</y>
<y>2852</y>
</Point>
<Point>
<x>8606</x>
<y>3045</y>
<x>8635</x>
<y>2827</y>
</Point>
<Point>
<x>8637</x>
<y>3045</y>
<x>8666</x>
<y>2827</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -30877,16 +30877,16 @@
<WorkSpaceShape2>
<Id>{1F6B4A81-9A0B-48B3-84B2-91248263F8C0}</Id>
</WorkSpaceShape2>
<NamePositionX>9726</NamePositionX>
<NamePositionY>3710</NamePositionY>
<NamePositionX>9740</NamePositionX>
<NamePositionY>3601</NamePositionY>
<Points>
<Point>
<x>9729</x>
<y>3540</y>
<x>9758</x>
<y>3322</y>
</Point>
<Point>
<x>9760</x>
<y>3540</y>
<x>9789</x>
<y>3322</y>
</Point>
<Point>
<x>9891</x>
@@ -30920,8 +30920,8 @@
<WorkSpaceShape2>
<Id>{DBBBEEE5-BBA2-48F5-9350-350BBFF93EC5}</Id>
</WorkSpaceShape2>
<NamePositionX>5304</NamePositionX>
<NamePositionY>3536</NamePositionY>
<NamePositionX>5319</NamePositionX>
<NamePositionY>3303</NamePositionY>
<Points>
<Point>
<x>2172</x>
@@ -30932,12 +30932,12 @@
<y>3157</y>
</Point>
<Point>
<x>8606</x>
<y>4036</y>
<x>8635</x>
<y>3570</y>
</Point>
<Point>
<x>8637</x>
<y>4036</y>
<x>8666</x>
<y>3570</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -30963,24 +30963,24 @@
<WorkSpaceShape2>
<Id>{DBBBEEE5-BBA2-48F5-9350-350BBFF93EC5}</Id>
</WorkSpaceShape2>
<NamePositionX>7911</NamePositionX>
<NamePositionY>3140</NamePositionY>
<NamePositionX>7926</NamePositionX>
<NamePositionY>2995</NamePositionY>
<Points>
<Point>
<x>7386</x>
<y>3106</y>
<y>3036</y>
</Point>
<Point>
<x>7417</x>
<y>3106</y>
<y>3036</y>
</Point>
<Point>
<x>8606</x>
<y>3293</y>
<x>8635</x>
<y>3075</y>
</Point>
<Point>
<x>8637</x>
<y>3293</y>
<x>8666</x>
<y>3075</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -31006,24 +31006,24 @@
<WorkSpaceShape2>
<Id>{DBBBEEE5-BBA2-48F5-9350-350BBFF93EC5}</Id>
</WorkSpaceShape2>
<NamePositionX>7911</NamePositionX>
<NamePositionY>3343</NamePositionY>
<NamePositionX>7926</NamePositionX>
<NamePositionY>3211</NamePositionY>
<Points>
<Point>
<x>7386</x>
<y>3267</y>
<y>3221</y>
</Point>
<Point>
<x>7417</x>
<y>3267</y>
<y>3221</y>
</Point>
<Point>
<x>8606</x>
<y>3540</y>
<x>8635</x>
<y>3322</y>
</Point>
<Point>
<x>8637</x>
<y>3540</y>
<x>8666</x>
<y>3322</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -31049,24 +31049,24 @@
<WorkSpaceShape2>
<Id>{DBBBEEE5-BBA2-48F5-9350-350BBFF93EC5}</Id>
</WorkSpaceShape2>
<NamePositionX>7911</NamePositionX>
<NamePositionY>3548</NamePositionY>
<NamePositionX>7926</NamePositionX>
<NamePositionY>3551</NamePositionY>
<Points>
<Point>
<x>7386</x>
<y>3428</y>
<y>3405</y>
</Point>
<Point>
<x>7417</x>
<y>3428</y>
<y>3405</y>
</Point>
<Point>
<x>8606</x>
<y>3788</y>
<x>8635</x>
<y>3818</y>
</Point>
<Point>
<x>8637</x>
<y>3788</y>
<x>8666</x>
<y>3818</y>
</Point>
</Points>
</WorkSpaceLinePERRelationPG83>
@@ -31092,16 +31092,16 @@
<WorkSpaceShape2>
<Id>{0CD0899C-7A52-4F35-AC37-1239971710E8}</Id>
</WorkSpaceShape2>
<NamePositionX>10272</NamePositionX>
<NamePositionY>2156</NamePositionY>
<NamePositionX>10320</NamePositionX>
<NamePositionY>2184</NamePositionY>
<Points>
<Point>
<x>10324</x>
<y>2315</y>
<x>10420</x>
<y>2371</y>
</Point>
<Point>
<x>10324</x>
<y>2284</y>
<x>10420</x>
<y>2340</y>
</Point>
<Point>
<x>10421</x>
@@ -31135,16 +31135,16 @@
<WorkSpaceShape2>
<Id>{0CD0899C-7A52-4F35-AC37-1239971710E8}</Id>
</WorkSpaceShape2>
<NamePositionX>9680</NamePositionX>
<NamePositionY>1661</NamePositionY>
<NamePositionX>9677</NamePositionX>
<NamePositionY>1582</NamePositionY>
<Points>
<Point>
<x>9657</x>
<y>1444</y>
<x>9650</x>
<y>1286</y>
</Point>
<Point>
<x>9688</x>
<y>1444</y>
<x>9681</x>
<y>1286</y>
</Point>
<Point>
<x>9873</x>
@@ -45938,7 +45938,7 @@
<Company>Technikum Wien</Company>
<Version>2.0</Version>
<CreatedDate>2009-04-17T10:15:21.000+01:00</CreatedDate>
<ModifiedDate>2011-11-18T10:58:06.124+01:00</ModifiedDate>
<ModifiedDate>2011-11-25T10:08:59.478+01:00</ModifiedDate>
<Project>FH-Complete 2.0</Project>
<Description>&lt;?xml-stylesheet type="text/xsl" href="FHCompleteTDM3PG83.xsl"?&gt;
</Description>
@@ -141320,10 +141320,10 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
<FKForeignKeys/>
<DictType/>
<Domain/>
<DataType>
<Id>{8D91E2A4-12F5-40E3-BAC2-BFCF7BE1C8B7}</Id>
</DataType>
<UserDataType/>
<DataType/>
<UserDataType>
<Id>{08329601-EAC4-4BE4-9203-95AB41C47F91}</Id>
</UserDataType>
<IndexItems/>
<Default/>
<CheckConstraints/>
@@ -142625,7 +142625,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
</PERUserDataTypePG83>
<PERUserDataTypePG83 ObjectType="2008" CSAOName="PERUserDataTypePG83">
<Id>{F0B7457E-0314-41A3-9B8C-C2FA39AA0ADD}</Id>
<Name>character varying[ ]</Name>
<Name>Character varying[ ]</Name>
<Ordinal>0</Ordinal>
<HistoryID>{96978687-DD4B-43E2-8AA1-090A2AC4E406}</HistoryID>
<GlobalOrder>0</GlobalOrder>
@@ -142645,7 +142645,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
<Param2Min></Param2Min>
<Param2Max></Param2Max>
<Param2Default></Param2Default>
<Caption>character varying[ ]</Caption>
<Caption>Character varying[ ]</Caption>
<DontCheckParams>0</DontCheckParams>
<Attributes>
<Id>{50C8C070-F10E-4B6D-B2ED-702F87F61F8A}</Id>
@@ -142675,6 +142675,57 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
<FunctionTypModIn/>
<EnumTypeList></EnumTypeList>
</PERUserDataTypePG83>
<PERUserDataTypePG83 ObjectType="2008" CSAOName="PERUserDataTypePG83">
<Id>{08329601-EAC4-4BE4-9203-95AB41C47F91}</Id>
<Name>Text[]</Name>
<Ordinal>0</Ordinal>
<HistoryID>{99C48025-280E-405A-9F81-B74A54BB1D31}</HistoryID>
<GlobalOrder>0</GlobalOrder>
<RNOffset>0</RNOffset>
<RNLength>0</RNLength>
<IgnoreNC>0</IgnoreNC>
<GenerateCode>1</GenerateCode>
<BeforeScript></BeforeScript>
<AfterScript></AfterScript>
<Notes></Notes>
<Comments></Comments>
<Param1Name></Param1Name>
<Param1Min></Param1Min>
<Param1Max></Param1Max>
<Param1Default></Param1Default>
<Param2Name></Param2Name>
<Param2Min></Param2Min>
<Param2Max></Param2Max>
<Param2Default></Param2Default>
<Caption>Text[]</Caption>
<DontCheckParams>0</DontCheckParams>
<Attributes>
<Id>{80B9D986-981E-42E8-A04C-9D47377C9A34}</Id>
</Attributes>
<Domains/>
<DictTypes/>
<ToDoItems/>
<Delimiter></Delimiter>
<Element></Element>
<Default></Default>
<Storage>plain</Storage>
<Alignment>int4</Alignment>
<PassedByValue>0</PassedByValue>
<InternalLength></InternalLength>
<CompositeTypeList></CompositeTypeList>
<Schema/>
<FunctionAnalyze/>
<FunctionSend/>
<FunctionReceive/>
<FunctionOutput/>
<FunctionInput/>
<TType>CT</TType>
<GenerateSQLOnly>0</GenerateSQLOnly>
<SQL></SQL>
<FunctionTypModOut/>
<FunctionTypModIn/>
<EnumTypeList></EnumTypeList>
</PERUserDataTypePG83>
</UserDataTypes>
<Relations>
<PERRelationPG83 ObjectType="2004" CSAOName="PERRelationPG83">
+25 -1
View File
@@ -2997,6 +2997,30 @@ if(!@$db->db_query("SELECT 1 FROM system.tbl_webservicelog LIMIT 1"))
echo 'Tabelle system.tbl_webservicelog und system.tbl_webservicetyp hinzugefuegt!<br>';
}
// Beschreibung der Ampel auf Array aendern damit mehrere Sprachen verwendet werden koennen
if($result = $db->db_query("SELECT * FROM information_schema.columns WHERE table_name='tbl_ampel' AND table_schema='public' AND column_name='beschreibung' AND data_type='text'"))
{
//Wenn die Spalte vom Datentyp Text ist wird diese auf Array geaendert
if($db->db_num_rows($result)>0)
{
/*
* - Neue Spalte hinzufuegen
* - Inhalt auf index 1 kopieren
* - Alte Spalte entfernen
* - Neue Spalte umbennen
*/
$qry = "ALTER TABLE public.tbl_ampel ADD COLUMN beschreibung_neu text[];
UPDATE public.tbl_ampel SET beschreibung_neu[1]=beschreibung;
ALTER TABLE public.tbl_ampel DROP COLUMN beschreibung;
ALTER TABLE public.tbl_ampel RENAME COLUMN beschreibung_neu TO beschreibung;";
if(!$db->db_query($qry))
echo '<strong>public.tbl_ampel: '.$db->db_last_error().'</strong><br>';
else
echo 'Tabelle public.tbl_ampel Bezeichnung auf Array geaendert!<br>';
}
}
echo '<br>';
@@ -3243,4 +3267,4 @@ if (!$result=@$db->db_query($sql_query))
echo 'Attribut '.$fulltablename.'.<strong>'.$fieldnameDB.'</strong> existiert in der DB, aber nicht in diesem Skript!<BR>';
}
}
?>
?>
+29 -14
View File
@@ -55,7 +55,15 @@ $datum_obj = new datum();
if($action=='save')
{
$kurzbz = (isset($_POST['kurzbz'])?$_POST['kurzbz']:die('Kurzbz fehlt'));
$beschreibung = (isset($_POST['beschreibung'])?$_POST['beschreibung']:die('Beschreibung fehlt'));
foreach ($_POST as $key=>$value)
{
if(mb_strstr($key,'beschreibung'))
{
$idx = mb_substr($key, mb_strlen('beschreibung'));
$beschreibung[$idx] = $value;
}
}
$benutzer_select = (isset($_POST['benutzer_select'])?$_POST['benutzer_select']:die('Benutzer_select fehlt'));
$deadline = (isset($_POST['deadline'])?$_POST['deadline']:die('Deadline fehlt'));
$vorlaufzeit = (isset($_POST['vorlaufzeit'])?$_POST['vorlaufzeit']:die('Vorlaufzeit fehlt'));
@@ -124,34 +132,41 @@ $datum_obj = new datum();
die('Invalid Action');
break;
}
echo '<form action="'.$_SERVER['PHP_SELF'].'?action=save" method="POST">';
echo '<input type="hidden" name="new" value="'.$new.'">';
echo '<input type="hidden" name="ampel_id" value="'.$ampel->ampel_id.'">';
echo '<input type="hidden" name="new" value="'.htmlspecialchars($new).'">';
echo '<input type="hidden" name="ampel_id" value="'.htmlspecialchars($ampel->ampel_id).'">';
echo '<table>';
echo '<tr>';
echo ' <td>Kurzbz</td>';
echo ' <td><input type="text" name="kurzbz" size="30" maxlength="64" value="'.$ampel->kurzbz.'"></td>';
echo ' <td><input type="text" name="kurzbz" size="30" maxlength="64" value="'.htmlspecialchars($ampel->kurzbz).'"></td>';
echo ' <td></td>';
echo ' <td>Deadline</td>';
echo ' <td><input type="text" name="deadline" size="10" maxlength="10" value="'.$datum_obj->formatDatum($ampel->deadline,'d.m.Y').'"></td>';
echo ' <td><input type="text" name="deadline" size="10" maxlength="10" value="'.htmlspecialchars($datum_obj->formatDatum($ampel->deadline,'d.m.Y')).'"></td>';
echo '</tr>';
echo '<tr valign="top">';
echo ' <td rowspan="2">Beschreibung</td>';
echo ' <td rowspan="2"><textarea name="beschreibung" cols="60" rows="5">'.$ampel->beschreibung.'</textarea></td>';
echo ' <td rowspan="2">Benutzer Select</td>';
echo ' <td rowspan="2"><textarea name="benutzer_select" cols="60" rows="5">'.htmlspecialchars($ampel->benutzer_select).'</textarea></td>';
echo ' <td></td>';
echo ' <td valign="middle">Vorlaufzeit (in Tagen)</td>';
echo ' <td valign="middle"><input type="text" name="vorlaufzeit" size="4" maxlength="4" value="'.$ampel->vorlaufzeit.'"></td>';
echo ' <td valign="middle"><input type="text" name="vorlaufzeit" size="4" maxlength="4" value="'.htmlspecialchars($ampel->vorlaufzeit).'"></td>';
echo '</tr>';
echo '<tr valign="top">';
echo ' <td></td>';
echo ' <td>Verfallszeit (in Tagen)</td>';
echo ' <td><input type="text" name="verfallszeit" size="4" maxlength="4" value="'.$ampel->verfallszeit.'"></td>';
echo '</tr>';
echo '<tr valign="top">';
echo ' <td rowspan="2">Benutzer Select</td>';
echo ' <td rowspan="2"><textarea name="benutzer_select" cols="60" rows="5">'.$ampel->benutzer_select.'</textarea></td>';
echo ' <td></td>';
echo ' <td><input type="text" name="verfallszeit" size="4" maxlength="4" value="'.htmlspecialchars($ampel->verfallszeit).'"></td>';
echo '</tr>';
$sprache = new sprache();
$sprache->getAll();
foreach($sprache->result as $lang)
{
echo '<tr valign="top">';
echo ' <td>Beschreibung '.$lang->sprache.'</td>';
echo ' <td><textarea name="beschreibung'.$lang->sprache.'" cols="60" rows="5">'.htmlspecialchars((isset($ampel->beschreibung[$lang->sprache])?$ampel->beschreibung[$lang->sprache]:'')).'</textarea></td>';
echo ' <td></td>';
echo '</tr>';
}
echo '<tr valign="bottom">';
echo ' <td></td>';
echo ' <td></td>';