RINASim  October 2016
Documentation of framework for OMNeT++
action.php
Go to the documentation of this file.
1 <?php
2 $type = -1;
3 $download = false;
4 
5 if(isset($_GET['show'])) {
6  $type = $_GET['show'];
7 } else if(isset($_GET['download'])) {
8  $type = $_GET['download'];
9  $download = true;
10 }
11 
12 
13 $p = 1;
14 $t = 1;
15 $f = 1;
16 $s = 1;
17 $e = 0;
18 
19 if(isset($_GET['pods'])
20  && filter_input(INPUT_GET, 'pods', FILTER_VALIDATE_INT) !== false
21  && $_GET['pods'] >= 1) {
22  $p = $_GET['pods'];
23 } else { $type = -1; }
24 if(isset($_GET['tors'])
25  && filter_input(INPUT_GET, 'tors', FILTER_VALIDATE_INT) !== false
26  && $_GET['tors'] >= 1) {
27  $t = $_GET['tors'];
28 } else { $type = -1; }
29 if(isset($_GET['fabrics'])
30  && filter_input(INPUT_GET, 'fabrics', FILTER_VALIDATE_INT) !== false
31  && $_GET['fabrics'] >= 1) {
32  $f = $_GET['fabrics'];
33 } else { $type = -1; }
34 if(isset($_GET['spines'])
35  && filter_input(INPUT_GET, 'spines', FILTER_VALIDATE_INT) !== false
36  && $_GET['spines'] >= 1) {
37  $s = $_GET['spines'];
38 } else { $type = -1; }
39 if(isset($_GET['edges'])
40  && filter_input(INPUT_GET, 'edges', FILTER_VALIDATE_INT) !== false
41  && $_GET['edges'] >= 0) {
42  $e = $_GET['edges'];
43 } else { $type = -1; }
44 
45 switch($type) {
46  case 'NED':
47  header('Content-Type: text/ned');
48  if($download) {
49  header('Content-disposition: attachment; filename="BigDC.ned"');
50  }
51  include 'ned.php';
52  break;
53  case 'INI':
54  header('Content-Type: text/ini');
55  if($download) {
56  header('Content-disposition: attachment; filename="omnetpp.ini"');
57  }
58  include 'ini.php';
59  break;
60  case 'Connections':
61  header('Content-Type: text/xml');
62  if($download) {
63  header('Content-disposition: attachment; filename="connectionset.xml"');
64  }
65  include 'connections.php';
66  break;
67 
68  case 'Directory':
69  header('Content-Type: text/xml');
70  if($download) {
71  header('Content-disposition: attachment; filename="directory.xml"');
72  }
73  include 'directory.php';
74  break;
75  default:
76  echo 'Incorrect Input';
77 }
78 
79 ?>
$t
Definition: action.php:14
$e
Definition: action.php:17
$download
Definition: action.php:3
$f
Definition: action.php:15
$s
Definition: action.php:16
if(isset($_GET['show'])) else if(isset($_GET['download'])) $p
Definition: action.php:13
$type
Definition: action.php:2