/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
210.1.1 by Suren A. Chilingaryan
Support of Appled devices by Toni Pirhonen
1
<?php
2
header("Content-type: text/xml");
3
header("Cache-Control: no-cache, must-revalidate");
4
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
5
6
	
7
//Commented lines are missing properties still to be added.
8
9
	$return = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><result>";
10
11
	if(isset($_GET['p_id'])){
12
		$page = $_GET['p_id'];
13
	 	switch($page){
14
			case "main":				
15
				$return .= "<history></history>";
16
				$return .= "<heading>Main</heading>";
17
				$return .= "<page>p_id=main</page>";
18
				$return .= "<value name='Data Source' page='p_id=sourcefront'/>";		
19
				$return .= "<value name='Controls' page='p_id=controls'/>";		
20
				//$return .= "<value name='Current' page='p_id=sourcefront'/>";		
21
				break;
22
			case "controls":
23
				$return .= "<history>p_id=main</history>";
24
				$return .= "<heading>Controls</heading>";
25
				$return .= "<page>p_id=controls</page>";
26
				//$return .= "<value name='Export' page='p_id=controlsexp'/>";
27
				$return .= "<value name='Aggregator' page='p_id=controlsaggr'/>";
28
				$return .= "<value name='Search' page='p_id=controlssearch'/>";
29
				break;
30
			case "controlssearch":
31
				$return .= "<history>p_id=controls</history>";
32
				$return .= "<heading>Search</heading>";
33
				$return .= "<page>controlssearch</page>";
34
				break;
35
			case "sourcefront":
36
				$return .= "<history>p_id=main</history>";
37
				$return .= "<heading>Data Source</heading>";
38
				$return .= "<page>p_id=sourcefront</page>";
39
				$return .= "<value name='Source' page='p_id=sourceselect'/>";
40
				$return .= "<value name='Time' page='p_id=sourcetime'/>";
41
			//	$return .= "<value name='Axes' page='p_id=sourceaxes'/>";
42
				break;
43
			case "sourcetime":
44
				$return .= "<history>p_id=sourcefront</history>";
45
				$return .= "<heading>Time</heading>";
46
				$return .= "<page>p_id=sourcetime</page>";
47
				$return .= "<value name='Custom' page='p_id=sourcetimecustom'/>";
48
				$return .= "<value name='Window' page='p_id=sourcetimewindow'/>";
49
				break;
50
			case "sourcetimecustom":
51
				$return .= "<history>p_id=sourcetime</history>";
52
				$return .= "<heading>CustomTime</heading>";
53
				$return .= "<page>p_id=sourcetimecustom</page>";
54
				break;
55
			case "sourcetimewindow":
56
				$return .= "<history>p_id=sourcetime</history>";
57
				$return .="<heading>Window</heading>";
58
				$return .= "<page>p_id=sourcetimewindow</page>";
59
				$return .= "<value window='window=31536000' name='1 Year' />";
60
				$return .= "<value window='window=2592000' name='1 Month' />";
61
				$return .= "<value window='window=604800' name='1 Week' />";
62
				$return .= "<value window='window=86400' name='1 Day' />";
63
				$return .= "<value window='window=3600' name='1 Hour' />";
64
				break;
65
			default: 	
66
				$return .= "<history>p_id=main</history>";
67
				$return .= "<heading>ERROR</heading>";
68
	  			$return .= "<value name='Invalid pageid' page = 'p_id=main'/>";						
69
				break;
70
		}
71
	} else {
72
		$return .= "<history></history>";
73
		$return .= "<heading>Main</heading>";
74
		$return .= "<value name='Data Source' page='p_id=sourcefront'/>";		
75
		$return .= "<value name='Controls' page='p_id=controls'/>";		
76
		$return .= "<value name='Current' page='p_id=sourcefront'/>";	
77
	}
78
	$return .= "</result>";
79
	echo $return;
80
?>