-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpage.parking.php
52 lines (50 loc) · 1.82 KB
/
page.parking.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2015 Sangoma Technologies.
//
$parking_defaults = ["name" => "Lot Name", "type" => "public", "parkext" => "", "parkpos" => "", "numslots" => 4, "parkingtime" => 45, "parkedmusicclass" => "default", "generatehints" => "yes", "generatefc" => "yes", "findslot" => "first", "parkedplay" => "both", "parkedcalltransfers" => "caller", "parkedcallreparking" => "caller", "alertinfo" => "", "cidpp" => "", "autocidpp" => "", "announcement_id" => null, "comebacktoorigin" => "yes", "dest" => "", "rvolume" => ""];
$all_pl['lots'] = parking_get('all');
$heading = parking_views('header',$all_pl);
$data = [];
$action = $_REQUEST['action'] ?? "";
switch ($action) {
case 'modify':
case 'update':
$data = parking_get($_REQUEST['id']) ?: parking_get('default');
$content = parking_views('lot',$data);
break;
case 'add':
$content = parking_views('lot',$parking_defaults);
break;
default:
$mc = \module_functions::create();
$o = parking_views($action,$data);
if(!$o) {
$m = "paging";
$d = $mc->getinfo($m);
if(isset($data['modules'])){
$data['modules']['paging'] = $d[$m]['status'] == "2" ? TRUE : FALSE;
$m = "pagingpro";
$data['modules']['pagingpro'] = $d[$m]['status'] == "2" ? TRUE : FALSE;
$m = "parkpro";
$d = $mc->getinfo($m);
$data['modules']['parkpro'] = $d[$m]['status'] == "2" ? TRUE : FALSE;
}
}
$content = parking_views('overview',$data);
break;
}
?>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="fpbx-container">
<div class="display no-border">
<?php echo $heading ?>
<?php echo $content ?>
</div>
</div>
</div>
</div>
</div>