diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index b1eb3c02c6..343463b0b1 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -36,7 +36,6 @@ else { require_once "resources/header.php"; require_once "resources/paging.php"; - //add multi-lingual support $language = new text; $text = $language->get(); @@ -526,9 +525,6 @@ require_once "resources/paging.php"; unset($result); //get the last action and anti-action - //echo "
\n";
- //print_r($details);
- //$detail_anti_action = $row['dialplan_detail_type'].$divider.$row['dialplan_detail_data'];
foreach($details as $group) {
foreach ($group as $row) {
if ($row['dialplan_detail_tag'] == 'action') {
@@ -541,8 +537,6 @@ require_once "resources/paging.php";
}
}
}
- //echo "\n";
- //exit;
//blank row
foreach($details as $group => $row) {
@@ -570,6 +564,102 @@ require_once "resources/paging.php";
}
}
+//get the presets
+ foreach ($_SESSION['time_conditions']['preset'] as $json) {
+ $presets[] = json_decode($json, true);
+ }
+
+//get the time array from the dialplan set it as array dialplan_times
+ $x = 0;
+ foreach($details as $detail_group) {
+ foreach ($detail_group as $row) {
+ if ($row['dialplan_detail_tag'] == 'condition') {
+ $type = $row['dialplan_detail_type'];
+ $data = $row['dialplan_detail_data'];
+ $group = $row['dialplan_detail_group'];
+ //echo "type: ".$type. " data: ".$data."\n";
+ echo "
\n";
+ echo "
\n";
+ }
+ $preset_keys = array();
+ foreach ($presets as $row) {
+ if ($_GET['debug'] == 'true') {
+ echo "
| ".$k." | ".$row[$k]." | ".$k." | ".$times[$k]." | "; + } + if ($row[$k] == $times[$k]) { + if ($_GET['debug'] == 'true') { echo "match | "; } + } + else { + if ($_GET['debug'] == 'true') { echo "no match | "; } + $match = false; + } + if ($_GET['debug'] == 'true') { + echo "
\n"; + print_r($times); + echo "\n"; + echo "
\n"; + print_r($dialplan_times); + echo "\n"; + } + ?>