'GMT -12', '-11' => 'GMT -11', '-10' => 'GMT -10', '-09' => 'GMT -9',
                   '-08' => 'GMT -8',  '-07' => 'GMT -7',  '-06' => 'GMT -6', '-05' => 'GMT -5',
                   '-04' => 'GMT -4',  '-03' => 'GMT -3',  '-02' => 'GMT -2', '-01' => 'GMT -1',
                   '00'  => 'GMT', '01' => 'GMT +1',  '02'  => 'GMT +2', '03'  => 'GMT +3',
                   '04'  => 'GMT +4',   '05' => 'GMT +5',  '06'  => 'GMT +6', '07'  => 'GMT +7',
                   '08'  => 'GMT +8',   '09' => 'GMT +9',  '10'  => 'GMT +10', '11'=> 'GMT +11', '12' => 'GMT +12');
$time_zone_name = array();
$extension_list = array();
$sofkey_list = array();
$model_list = array();
$device_list = array();
$dialplan_list = array();
//$time_zone = \FreePBX::Sccp_manager()-> extconfigs-> getextConfig('cisco_time');
//$system_time_zone = \FreePBX::Sccp_manager()->getSysnemTimeZone();
//$sofkey_list = \FreePBX::Sccp_manager()-> aminterface->sccp_list_keysets();
//$model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWDevice");
//$extension_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWextension");
//$device_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("SccpDevice");
//$extension_list[]=array(model=>'NONE', vendor=>'CISCO', dns=>'0');
//$device_list[]=array(name=>'NONE', description=>'No Device');
//print_r($metainfo);
if (\FreePBX::Modules()->checkStatus("soundlang")) {
    $syslangs = \FreePBX::Soundlang()->getLanguages();
    if (!is_array($syslangs)) {
        $syslangs = array();
    }
}
if (function_exists('music_list')) {
    $moh_list = music_list();
//    $cur = (isset($mohsilence) && $mohsilence != "" ? $mohsilence : 'default');
}
if (!is_array($moh_list)) {
    $moh_list = array('default');
}
$items = $itm -> children();
if ($h_show==1) {
    $sec_class ='';
    if (!empty($items ->class)) {
        $sec_class = (string)$items ->class;
    }
    ?>
 
    help)) {
        $child->help = 'Help is not available.';
        $child->meta_help = '1';
    }
//    $child->meta_help = '1';          // Remove comments to see original help !
    if ($child['type'] == 'IE') {
        $res_input = '';
        $res_name = '';
        $res_oid = (string)$child->input[0]->name;
        $res_id = $npref.$res_oid;
        if (!empty($metainfo[$res_oid])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_oid]['Description'];
            }
        }
        // --- Add Hiden option
        $res_sec_class ='';
        if (!empty($child ->class)) {
            $res_sec_class = (string)$child ->class;
        }
        if (empty($child->nameseparator)) {
            $child->nameseparator = ' / ';
        }
        $i = 0;
        echo '';
        ?>
        
        label.' -->';
    }
    if ($child['type'] == 'IED') {
        $res_input = '';
        $res_name = '';
        $res_value = '';
        $opt_at = array();
        $res_n =  (string)$child->name;
        if (!empty($metainfo[$res_n])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_n]['Description'];
            }
        }
//        $res_value
        $lnhtm = '';
        $res_id = $napref.$child->name;
        $i = 0;
        $max_row = 255;
        if (!empty($child->max_row)) {
            $max_row = $child->max_row;
        }
        if (!empty($fvalues[$res_n])) {
            if (!empty($fvalues[$res_n]['data'])) {
                $res_value = explode(';', $fvalues[$res_n]['data']);
            }
        }
        if (empty($res_value)) {
            $res_value = array((string) $child->default);
//            $res_value = explode('/', (string) $child->default);
        }
        echo '';
        ?>
    
        label.' -->';
    }
    if ($child['type'] == 'IS') {
        $res_n =  (string)$child->name;
        $res_id = $npref.$res_n;
        $res_ext = str_replace($npref,'',$res_n);
        if (!empty($metainfo[$res_n])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_n]['Description'];
            }
        }
             // --- Add Hiden option
        $res_sec_class ='';
        if (!empty($child ->class)) {
            $res_sec_class = (string)$child ->class;
        }
            echo '';
        ?>
        
        label.' -->';
    }
/*
 *    Input element Select SLD - Date format
 *                         SLZ - Time Zone
 *
 *                         SLM - Music on hold
 *                         SLK - System KeySet
 *                         SLP - Dial Paterns
 */
    if ($child['type'] == 'SLD'  || $child['type'] == 'SLM'|| $child['type'] == 'SLK'|| $child['type'] == 'SLP') {
//        $value = $child -> select;
        $res_n =  (string)$child ->name;
        $res_id = $npref.$res_n;
        if (!empty($metainfo[$res_n])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_n]['Description'];
            }
        }
        if (empty($child->class)) {
            $child->class = 'form-control';
        }
        if ($child['type'] == 'SLD') {
            $select_opt= $day_format;
        }
        if ($child['type'] == 'SLM') {
            $select_opt= $moh_list;
        }
        if ($child['type'] == 'SLK') {
            if (empty($sofkey_list)) {
                $sofkey_list = \FreePBX::Sccp_manager()->aminterface->sccp_list_keysets();
            }
            $select_opt= $sofkey_list;
        }
        if ($child['type'] == 'SLP') {
            if (empty($dialplan_list)) {
                foreach (\FreePBX::Sccp_manager()->getDialPlanList() as $tmpkey) {
                    $tmp_id = $tmpkey['id'];
                    $dialplan_list[$tmp_id] = $tmp_id;
                }
            }
            $select_opt= $dialplan_list;
        }
//        if ($child['type'] == 'SLZ') {
//            $select_opt= $time_zone;
//        }
        echo '';
        ?>
        
        label.' -->';
    }
/*
 *    Input element Select SLS - System Language
 */
    if ($child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SLA' || $child['type'] == 'SLZ') {
//        $value = $child -> select;
        $res_n =  (string)$child ->name;
        $res_id = $npref.$res_n;
        $child->value ='';
        if (!empty($metainfo[$res_n])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_n]['Description'];
            }
        }
        if ($child['type'] == 'SLS') {
            $select_opt= $syslangs;
        }
        if ($child['type'] == 'SLT') {
            $select_opt= $tftp_lang;
        }
        if ($child['type'] == 'SLZ') {
            $select_opt= $time_zone;
//            $child->value = ($system_time_zone[offset]/60);
        }
        if ($child['type'] == 'SLA') {
            $select_opt ='';
            if (!empty($fvalues[$res_n])) {
                if (!empty($fvalues[$res_n]['data'])) {
                    $res_value = explode(';', $fvalues[$res_n]['data']);
                }
                if (empty($res_value)) {
                    $res_value = array((string) $child->default);
                }
                foreach ($res_value as $key) {
                    $select_opt[$key]= $key;
                }
            }
        }
        if (empty($child->class)) {
            $child->class = 'form-control';
        }
        if (!empty($fvalues[$res_n])) {
            if (!empty($fvalues[$res_n]['data'])) {
                $child->value = $fvalues[$res_n]['data'];
            }
        }
        if (empty($child->value)) {
            if (!empty($child->default)) {
                $child->value = $child->default;
            }
        }
        echo '';
        ?>
        
        
        label.' -->';
    }
/*
 *    Input element Select
 */
    if ($child['type'] == 'SL') {
        $res_n =  (string)$child->name;
        $res_id = $npref.$child->name;
        if (!empty($metainfo[$res_n])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_n]['Description'];
            }
        }
        if (empty($child ->class)) {
            $child->class = 'form-control';
        }
        echo '';
        ?>
        
        label.' -->';
    }
 /*
 *    Input element Select SDM  - Model List
 *                         SDMS - Sip model List
 *                         SDE  - Extension List
 */
    if ($child['type'] == 'SDM' || $child['type'] == 'SDMS' || $child['type'] == 'SDE' || $child['type'] == 'SDD') {
//        $value = $child -> select;
        $res_n =  (string)$child ->name;
        $res_id = $npref.$res_n;
        if (!empty($metainfo[$res_n])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_n]['Description'];
            }
        }
        if (empty($child->class)) {
            $child->class = 'form-control';
        }
        if ($child['type'] == 'SDM') {
            if (empty($model_list)) {
                $model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWDevice");
            }
            $select_opt= $model_list;
        }
        if ($child['type'] == 'SDMS') {
            if (empty($model_list)) {
                $model_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWSipDevice");
            }
            $select_opt= $model_list;
        }
        if ($child['type'] == 'SDE') {
            if (empty($extension_list)) {
                $extension_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("HWextension");
                $extension_list[]=array( 'model' => 'NONE', 'vendor' => 'CISCO', 'dns' => '0');
                foreach ($extension_list as &$data) {
                    $d_name = explode(';', $data['model']);
                    if (is_array($d_name) && (count($d_name) > 1)) {
                        $data['description'] = count($d_name).'x '.$d_name[0];
                    } else {
                        $data['description'] = $data['model'];
                    }
                }
                unset($data);
            }
            $select_opt= $extension_list;
        }
        if ($child['type'] == 'SDD') {
            if (empty($device_list)) {
                $device_list = \FreePBX::Sccp_manager()->dbinterface->HWextension_db_SccpTableData("SccpDevice");
                $device_list[]=array('name' => 'NONE', 'description' => 'No Device');
            }
            $select_opt = $device_list;
        }
        echo '';
        ?>
        
        label.' -->';
    }
    if ($child['type'] == 'ITED') {
        $res_input = '';
        $res_name = '';
        $res_na =  (string)$child->name;
//        $res_value
        $lnhtm = '';
        $res_id = $napref.$child->name;
        $i = 0;
        if (!empty($fvalues[$res_na])) {
            if (!empty($fvalues[$res_na]['data'])) {
                $res_value = explode(';', $fvalues[$res_na]['data']);
            }
        }
        if (empty($res_value)) {
            $res_value = array((string) $child->default);
//            $res_value = explode('/', (string) $child->default);
        }
        echo '';
        ?>
        
';
        echo '';
    }
    if ($child['type'] == 'HLP') {
        $res_n =  (string)$child ->name;
        $res_id = $npref.$res_n;
        if (empty($child->class)) {
            $child->class = 'form-control';
        }
        echo '';
        ?>
        
            
            
        xpath('element') as $value) {
            switch ($value['type']) {
                case 'p':
                case 'h1':
                case 'h2':
                case 'h3':
                case 'h4':
                    echo '<'.$value['type'].'>'._((string)$value).''.$value['type'].'>';
                    break;
                case 'table':
                    echo '<'.$value['type'].' class="table" >';
                    foreach ($value->xpath('row') as $trow) {
                        echo '
';
                        foreach ($trow->xpath('col') as $tcol) {
                            echo '| '._((string)$tcol).'';
                        }
                        echo ' | 
';
                    }
                    echo ''.$value['type'].'>';
                    break;
            }
        }
        ?>
            
         
        label.' -->';
    }
    if ($child['type'] == 'MINFO') {
        $res_n =  (string)$child ->name;
        $res_id = $npref.$res_n;
        if (empty($child->class)) {
            $child->class = 'form-control';
        }
        echo '';
        ?>
        
        label.' -->';
    }
/*
 *    Input element Select SLTZN - System Time Zone
 */
    if ($child['type'] == 'SLTZN') {
//        $value = $child -> select;
        $res_n =  (string)$child ->name;
        $res_id = $npref.$res_n;
        $child->value ='';
        if (!empty($metainfo[$res_n])) {
            if ($child->meta_help == '1' || $child->help == 'Help!') {
                $child->help = $metainfo[$res_n]['Description'];
            }
        }
        if (empty($child->class)) {
            $child->class = 'form-control';
        }
        if (!empty($fvalues[$res_n])) {
            if (!empty($fvalues[$res_n]['data'])) {
                $child->value = $fvalues[$res_n]['data'];
            }
        }
        $child->value = \date_default_timezone_get();
        echo '';
        ?>
        
        
        label.' -->';
    }
}
?>
';
}
?>