﻿<?php

/*

================================================================================================
realtime15.php
================================================================================================
Function:
- reads the data from JSON file and creates image(s) for 32" ePaper
================================================================================================
Author: Norbert Hofer (nexturban technologies GmbH)
================================================================================================
Version History:
  ----------------------------------------------------------------------------------------------
  1.0.0.0: Production Version (2018-10-31)
================================================================================================

*/

// 5 Tabs: 0 - 240 | 240 - 480 | 480 - 720 | 720 - 960 | 960 - 1200

function tabs($index = 0)
{
	$svg .= '<g id="tabs">' . "\n";
	$svg .= '	<rect x="0" y="1500" width="1200" height="100" fill="#000" />' . "\n";

	if ($index > 0)
	{
		if ($index == 1)
		{
			$svg .= '	<rect x="10" y="1500" width="260" height="90" fill="#fff"  />' . "\n";
			$svg .= '	<text x="140" y="1560" text-anchor="middle" font-family="Arial-Bold" font-size="28px" fill="#000">Abfahrten</text>' . "\n";
		}
		else
		{
			$svg .= '	<text x="140" y="1560" text-anchor="middle" font-family="Arial" font-size="28px" fill="#fff">Abfahrten</text>' . "\n";
		}

		if ($index == 2)
		{
			$svg .= '	<rect x="270" y="1500" width="260" height="90" fill="#fff"  />' . "\n";
			$svg .= '	<text x="400" y="1560" text-anchor="middle" font-family="Arial-Bold" font-size="28px" fill="#000">Tarife</text>' . "\n";
		}
		else
		{
			$svg .= '	<text x="400" y="1560" text-anchor="middle" font-family="Arial" font-size="28px" fill="#fff">Tarife</text>' . "\n";
		}

		if ($index == 3)
		{
			$svg .= '	<rect x="530" y="1500" width="260" height="90" fill="#fff"  />' . "\n";
			$svg .= '	<text x="660" y="1560" text-anchor="middle" font-family="Arial-Bold" font-size="28px" fill="#000">Aktuelles</text>' . "\n";
		}
		else
		{
			$svg .= '	<text x="660" y="1560" text-anchor="middle" font-family="Arial" font-size="28px" fill="#fff">Aktuelles</text>' . "\n";
		}
	}

	$svg .= '	<image href="./Images/Logo.png" x="902" y="1510" width="288" height="80" />' . "\n";

	$svg .= '</g>' . "\n";
	
	return $svg;
}

?>