|
1 && Day < 7) {\n"; $ivrconditionjs .= " return true;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= " else {\n"; $ivrconditionjs .= " return false;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= "}\n"; $ivrconditionjs .= "\n"; $ivrconditionjs .= "function isweekend( Day ) {\n"; $ivrconditionjs .= " if (Day > 1 && Day < 7) {\n"; $ivrconditionjs .= " return false;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= " else {\n"; $ivrconditionjs .= " return true;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= "}\n"; $ivrconditionjs .= "\n"; $ivrconditionjs .= "function isofficehours( Hours ) {\n"; $ivrconditionjs .= " if (Hours >= 9 && Hours < 17) {\n"; $ivrconditionjs .= " return true;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= " else {\n"; $ivrconditionjs .= " return false;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= "}\n"; $ivrconditionjs .= "\n"; $ivrconditionjs .= "function isafterhours( Hours ) {\n"; $ivrconditionjs .= " if (Hours >= 9 && Hours < 17) {\n"; $ivrconditionjs .= " return false;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= " else {\n"; $ivrconditionjs .= " return true;\n"; $ivrconditionjs .= " }\n"; $ivrconditionjs .= "}\n"; $ivrconditionjs .= "\n"; $ivrconditionjs .= "//set default\n"; $ivrconditionjs .= "condition = true;\n"; $ivrconditionjs .= "\n"; $ivrconditionjs .= "//Holiday?\n"; $ivrconditionjs .= "if (isholiday( Month, Date )) {\n"; $ivrconditionjs .= " console_log( \"info\", \"holiday\\n\" );\n"; $ivrconditionjs .= " condition = false;\n"; $ivrconditionjs .= "}\n"; $ivrconditionjs .= "\n"; $ivrconditionjs .= "//Weekend?\n"; $ivrconditionjs .= "if (isweekend( Day )) {\n"; $ivrconditionjs .= " console_log( \"info\", \"weekend\\n\" );\n"; $ivrconditionjs .= " condition = false;\n"; $ivrconditionjs .= "}\n"; $ivrconditionjs .= "\n"; $ivrconditionjs .= "// After Hours?\n"; $ivrconditionjs .= "if (isafterhours( Hours )) {\n"; $ivrconditionjs .= " console_log( \"info\", \"after hours\\n\" );\n"; $ivrconditionjs .= " condition = false;\n"; $ivrconditionjs .= "}\n"; $ivrconditionjs .= "\n"; if (isset($id) && $a_ivr[$id]) { $pconfig['ivrid'] = $a_ivr[$id]['ivrid']; $ivrid = $a_ivr[$id]['ivrid']; $pconfig['ivrextension'] = $a_ivr[$id]['ivrextension']; $pconfig['ivrname'] = $a_ivr[$id]['ivrname']; $pconfig['recordingidaction'] = $a_ivr[$id]['recordingidaction']; $pconfig['recordingidantiaction'] = $a_ivr[$id]['recordingidantiaction']; $pconfig['ivrtimeout'] = $a_ivr[$id]['ivrtimeout']; $pconfig['ivrcalltimeout'] = $a_ivr[$id]['ivrcalltimeout']; $pconfig['ivrcontext'] = $a_ivr[$id]['ivrcontext']; $pconfig['ivrdirectdial'] = $a_ivr[$id]['ivrdirectdial']; $pconfig['ivrringback'] = $a_ivr[$id]['ivrringback']; $pconfig['ivrcidnameprefix'] = $a_ivr[$id]['ivrcidnameprefix']; $pconfig['ivrconditionjs'] = ($a_ivr[$id]['ivrconditionjs']); $pconfig['ivrdescr'] = $a_ivr[$id]['ivrdescr']; } if ($_POST) { unset($input_errors); $pconfig = $_POST; if ($_GET['act'] == "del") { if ($_GET['type'] == 'options') { if ($a_ivroptions[$_GET['optionid']]) { unset($a_ivr_options[$_GET['optionid']]); write_config(); sync_package_v_ivr(); header("Location: v_auto_attendant_edit.php?id=".$_GET['id']); exit; } } } if (!$input_errors) { $ivrent = array(); if (strlen($_POST['ivrid']) > 0) { $ivrent['ivrid'] = $_POST['ivrid']; } else { $ivrent['ivrid'] = guid(); } $ivrent['ivrextension'] = $_POST['ivrextension']; $ivrent['ivrname'] = $_POST['ivrname']; $ivrent['recordingidaction'] = $_POST['recordingidaction']; $ivrent['recordingidantiaction'] = $_POST['recordingidantiaction']; $ivrent['ivrtimeout'] = $_POST['ivrtimeout']; $ivrent['ivrcalltimeout'] = $_POST['ivrcalltimeout']; $ivrent['ivrcontext'] = $_POST['ivrcontext']; $ivrent['ivrdirectdial'] = $_POST['ivrdirectdial']; $ivrent['ivrringback'] = $_POST['ivrringback']; $ivrent['ivrcidnameprefix'] = $_POST['ivrcidnameprefix']; $ivrent['ivrconditionjs'] = base64_encode($_POST['ivrconditionjs']); $ivrent['ivrdescr'] = $_POST['ivrdescr']; if (isset($id) && $a_ivr[$id]) { //update $a_ivr[$id] = $ivrent; } else { //add $a_ivr[] = $ivrent; } //touch($d_hostsdirty_path); write_config(); sync_package_v_ivr(); header("Location: v_auto_attendant.php"); exit; } } include("head.inc"); ?>
$v_label: Auto Attendant: Edit\n"; } if ($input_errors) print_input_errors($input_errors); ?>
|