1<?php
2
3/**
4 * Based on GET parameter we load:
5 * 	- all circuits
6 *  - all providers
7 *  - specific circuit
8 *  - specific provider
9 *
10 * For all circuits and all providers we also show menu
11 *
12 */
13
14# verify that user is logged in
15$User->check_user_session();
16
17# get hidden fields
18$hidden_circuit_fields = json_decode($User->settings->hiddenCustomFields, true);
19$hidden_circuit_fields = is_array(@$hidden_circuit_fields['circuits']) ? $hidden_circuit_fields['circuits'] : array();
20
21$hidden_provider_fields = json_decode($User->settings->hiddenCustomFields, true);
22$hidden_provider_fields = is_array(@$hidden_provider_fields['circuitProviders']) ? $hidden_provider_fields['circuitProviders'] : array();
23
24# menu
25include("app/tools/circuits/menu.php");
26
27# perm check
28if ($User->get_module_permissions ("circuits")<1) {
29	$Result->show("danger", _("You do not have permissions to access this module"), false);
30}
31# load subpage
32elseif (!isset($_GET['subnetId']) || (@$_GET['subnetId']=="providers" && !isset($_GET['sPage'])) ) {
33	// all circuits
34	if(!isset($_GET['subnetId'])) {
35		include('physical-circuits/all-circuits.php');
36	}
37	// all providers
38	else {
39		include('providers/all-providers.php');
40	}
41}
42else {
43	// specific provider
44	if($_GET['subnetId']=="providers") {
45		include("providers/provider-details.php");
46	}
47	elseif ($_GET['subnetId']=="logical") {
48		if(isset($_GET["sPage"])){
49			include("logical-circuits/logical-circuit-details.php");
50		}else{
51			include('logical-circuits/logical-circuits.php');
52		}
53	}
54	// map
55	elseif ($_GET['subnetId']=="circuit_map") {
56		include('all-circuits-map.php');
57	}
58	// settings
59	elseif ($_GET['subnetId']=="options") {
60		include('options.php');
61	}
62	// specific circuit
63	else {
64		include("physical-circuits/circuit-details.php");
65	}
66}