diff --git a/cis/ampel.php b/cis/ampel.php
new file mode 100755
index 000000000..0a666a257
--- /dev/null
+++ b/cis/ampel.php
@@ -0,0 +1,52 @@
+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 '
'.$rot.'';
+ if($rot>0 && $gelb>0)
+ echo ' | ';
+ if($gelb>0)
+ echo '
'.$gelb.'';
+ echo ' ]';
+ }
+}
+else
+{
+ echo "";
+ //echo microtime();
+}
+?>
\ No newline at end of file
diff --git a/cis/index.php b/cis/index.php
index 8f9cef38f..1503aa2f7 100644
--- a/cis/index.php
+++ b/cis/index.php
@@ -54,8 +54,10 @@ else
| @@ -90,7 +105,8 @@ function changeSprache(sprache) | ||||||||||||||||
| - | + | + | diff --git a/cis/private/tools/ampelverwaltung.php b/cis/private/tools/ampelverwaltung.php new file mode 100755 index 000000000..33e7a03f7 --- /dev/null +++ b/cis/private/tools/ampelverwaltung.php @@ -0,0 +1,149 @@ + + */ +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 ' + + + + + + + + +||||||||||||||
| '.$p->t('tools/ampelStatus').' | +'.$p->t('tools/ampelBeschreibung').' | +'.$p->t('tools/ampelDeadline').' | +'.$p->t('tools/ampelAktion').' | +||||
|---|---|---|---|---|---|---|---|
';
+ switch($ampelstatus)
+ {
+ case 'rot':
+ echo ' ';
+ break;
+ case 'gelb':
+ echo ' ';
+ break;
+ case 'gruen':
+ echo ' ';
+ break;
+ default:
+ break;
+ }
+ echo ' | ';
+ echo ''.$row->beschreibung[$sprache].' | '; + echo ''.$datum_obj->formatDatum($row->deadline,'d.m.Y').' | '; + + if(!$ampel->isBestaetigt($user,$row->ampel_id)) + echo 'bestätigen | '; + else + echo ''; + +// echo " | ".date('d.m.Y',$ts_now)." | "; +// echo "".date('d.m.Y',$ts_vorlaufzeit)." | "; +// echo "".date('d.m.Y',$ts_deadline)." | "; + echo '