<?php

/**
 * @file
 * popup window for isdn and anolog groups
 */

chdir("..");

include "./includes/variables.php";
include "./misc/database.php";
include("./misc/config_parameter.php");
$ba = new beroAri();
require_once ('./includes/lang.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" href="../includes/images/favicon.ico" type="image/x-icon">
<script type="text/javascript" language="javascript" src="../includes/validation_modul.js"></script>
<script type="text/javascript" language="javascript" src="../includes/js/jquery-1.5.1.js"></script>
<link type="text/css" href="../includes/css/custom-theme/jquery-ui-1.8.10.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="../includes/js/jquery-ui-1.8.10.custom.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
  $('input[name="group"]').focus();
});

function resize(){
	if(window.sizeToContent) window.sizeToContent();
}
function closeW(){
	this.window.close();
}

function ovelapdial_show(val){
	if (val) {
		document.getElementById("odt_empty_dad_tr").style.display="none";
		document.getElementById("odt_tr").style.display="none";
	}else{
		document.getElementById("odt_tr").style.display="";
		document.getElementById("odt_empty_dad_tr").style.display="";
	}
}

function hidec(){
	var config_isdn=document.getElementById('config_isdn');
	config_isdn.style.display="none";
}
function show_config_isdn(){
	var config_isdn=document.getElementById('config_isdn');
	if (config_isdn.style.display=="none"){
		config_isdn.style.display="";
	}else{
		config_isdn.style.display="none";
	}
}

</script>
<TITLE>ISDN</TITLE>
<link rel="stylesheet" href="../includes/template_css.css" type="text/css">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body onload='hidec(); ovelapdial_show(document.getElementById("overlap_dialing").checked); resize();'>
<script type="text/javascript" src="../includes/notes/wz_tooltip.js"></script>
<center>
<?php
@session_start();
if((isset($_SESSION['beroari_time']))&&(($_SESSION['beroari_time']+1200)<time())){
        @session_unset();
        @session_destroy();
        echo "<script>window.opener.location='../index.php?m=sip'</script>";
        echo "<script>this.window.close();</script>";
}else{
        $_SESSION['beroari_time']=time();
}


require_once "./includes/isgwtelnet.php";
function title0($ba,$gr){
	$query=$ba->select("select distinct type from isdn where lif='0' union select distinct type from gsm where lif='0' union select distinct type from analog where lif='0'");
	if (sqlite_num_rows($query)==0){
	$title="<b>Li0()</b>";
	}else{
	while ($entry=$ba->fetch_array($query)){
	$title="<b>Li0(".$entry['type'].")</b>";
	}
	}
	return $title;
}

//Ports von Line interface 0
function ports0($ba,$gr){
	$tab="<table border='0'>";
	$query=$ba->select("select * from isdn where lif='0' and port_type='".$_GET['opt']."'");
	while ($entry=$ba->fetch_array($query)){
		$type=split("-",$entry['type']);
		if ($entry['gr']==$gr){
		$tab .= "<tr><td>Port ".$entry['port']."<input type='checkbox' name='ports[]' checked value='".$entry['port']."'></td></tr>";
		}elseif ($entry['gr']=='NULL'){
		$tab .= "<tr><td>Port ".$entry['port']."<input type='checkbox' name='ports[]' value='".$entry['port']."'></td></tr>";
		}else{
		$tab .= "<tr><td>Port ".$entry['port']."<input type='checkbox' name='ports[]' checked disabled='true' value='".$entry['port']."'></td></tr>";
		}
	}
	$tab .= "</table>";
	return $tab;
}

function title1($ba,$gr){
	$query=$ba->select("select distinct type from isdn where lif='1' union select distinct type from gsm where lif='1' union select distinct type from analog where lif='1'");
	if (sqlite_num_rows($query)==0){
	$title="<b>Li1()</b>";
	}else{
	while ($entry=$ba->fetch_array($query)){
	$title="<b>Li1(".$entry['type'].")</b>";
	}
	}
	return $title;
}

//Ports von Line interface 1
function ports1($ba,$gr){
	$tab="<table border='0'>";
	$query=$ba->select("select * from isdn where lif='1' and port_type='".$_GET['opt']."'");
	while ($entry=$ba->fetch_array($query)){
		$type=split("-",$entry['type']);
		if ($entry['gr']==$gr){
		$tab .= "<tr><td>Port ".$entry['port']."<input type='checkbox' name='ports[]' checked value='".$entry['port']."'></td></tr>";
		}elseif ($entry['gr']=='NULL'){
		$tab .= "<tr><td>Port ".$entry['port']."<input type='checkbox' name='ports[]' value='".$entry['port']."'></td></tr>";
		}else{
		$tab .= "<tr><td>Port ".$entry['port']."<input type='checkbox' name='ports[]' checked disabled='true' value='".$entry['port']."'></td></tr>";
		}
	}
	$tab .= "</table>";
	return $tab;
}

function chansel($ba,$gr){
	if ($gr!=""){
		$query=$ba->select("select chansel from isdn where gr='".$gr."'");
		$ret="<select name='chansel'>";
		while ($entry=$ba->fetch_array($query)){
			($entry['chansel']=="standard") ? $ret.= "<option value='standard' selected>standard</option>" : $ret.= "<option value='standard'>standard</option>";
			($entry['chansel']=="random") ? $ret.= "<option value='random' selected>random</option>" : $ret.= "<option value='random'>random</option>";
			($entry['chansel']=="roundrobin") ? $ret.= "<option value='roundrobin' selected>roundrobin</option>" : $ret.= "<option value='roundrobin'>roundrobin</option>";
			$ret.="</select>";
			return $ret;
		}

	}else{
		return "<select name='chansel'>
			<option value='standard'>standard</option>
			<option value='random'>random</option>
			<option value='roundrobin'>roundrobin</option>
			</select>";
	}
}

function chansel_dir($ba,$gr){
	$ret="<select name='chansel_dir'>";
	if ($gr!=""){
		$query=$ba->select("select chansel_dir from isdn where gr='".$gr."'");
		while ($entry=$ba->fetch_array($query)){
			($entry['chansel_dir']=="ascending") ? $ret.="<option value='ascending' selected>ascending</option>" : $ret.="<option value='ascending'>ascending</option>";
			($entry['chansel_dir']=="descending") ? $ret.="<option value='descending' selected>descending</option>" : $ret.="<option value='descending'>descending</option>";
			$ret.="</select>";
			return $ret;
		}

	}else{
		return "<select name='chansel_dir'>
			<option value='ascending'>ascending</option>
			<option value='descending'>descending</option>
			</select>";
	}
}
function portpullup($ba,$gr){
	if ($gr!=""){
		$query=$ba->select("select portpullup from isdn where gr='".$gr."'");
		$ret="<select name='portpullup'>";
		while ($entry=$ba->fetch_array($query)){
			($entry['portpullup']=="0") ? $ret.="<option value='0' selected>Nothing</option>" : $ret.="<option value='0'>Nothing</option>";
			($entry['portpullup']=="1") ? $ret.="<option value='1' selected>Pull Link Up (2s) </option>" : $ret.="<option value='1'>Pull Link Up (2s) </option>";
			($entry['portpullup']=="2") ? $ret.="<option value='2' selected>Pull Link Up (once)</option>" : $ret.="<option value='2'>Pull Link Up (once)</option>";
			$ret.="</select>";
			return $ret;
		}

	}else{
		return "<select name='portpullup'>
			<option value='0'>Nothing</option>
			<option value='1' selected>Pull Link Up (2s) </option>
			<option value='2'>Pull Link Up (once)</option>
			</select>";
	}
}

function tones($ba,$gr){
	if ($gr!=""){
		$query=$ba->select("select tones from isdn where gr='".$gr."'");
		$tones="";
		while ($entry=$ba->fetch_array($query)){
			$tones=$entry['tones'];
		}
		exec('/bin/cat /usr/conf/isgw.tones | /bin/grep "^\[.*\]$" ',$ausgabe);
		$ret="<select name='tones'>";
		foreach ($ausgabe as $value){
			if ($value==$tones){
				$ret.="<option value='".$value."' selected>".$value."</option>";
			}elseif($value!="[general]"){
				$ret.="<option value='".$value."'>".$value."</option>";
			}
		}
		$ret.="</select>";
		return $ret;
	}else{
		exec('/bin/cat /usr/conf/isgw.tones | /bin/grep "^\[.*\]$" ',$ausgabe);
		$ret="<select name='tones'>";
		foreach ($ausgabe as $value){
			if ($value=="[de]"){
				$ret.="<option value='".$value."' selected>".$value."</option>";
			}elseif($value!="[general]"){
				$ret.="<option value='".$value."'>".$value."</option>";
			}
		}
		$ret.="</select>";
		return $ret;
	}
}

function overlap_dialing($ba,$gr){
	if ($gr!=""){
		$query=$ba->select("select overlap_dialing from isdn where gr='".$gr."'");
		$overlap_dialing="";
		while ($entry=$ba->fetch_array($query)){
			$overlap_dialing=$entry['overlap_dialing'];
		}
		if ($overlap_dialing=='1' || $overlap_dialing=='yes') return "<input type='checkbox' name='overlap_dialing' id='overlap_dialing' value='1' onchange='ovelapdial_show(this.checked)' checked>";
		elseif ($overlap_dialing=='0' || $overlap_dialing=='no') return "<input type='checkbox' name='overlap_dialing' id='overlap_dialing' onchange='ovelapdial_show(this.checked)' value='1'>";
		return "<input type='checkbox' name='overlap_dialing' id='overlap_dialing' onchange='ovelapdial_show(this.checked)' value='1'>";
	}else{
		$ret="<input type='checkbox' name='overlap_dialing' id='overlap_dialing' onchange='ovelapdial_show(this.checked)' value='1'>";
		return $ret;
	}
}

function qsig($ba,$gr){
	if ($gr!=""){
		$query=$ba->select("select qsig from isdn where gr='".$gr."'");
		$qsig="";
		while ($entry=$ba->fetch_array($query)){
			$qsig=$entry['qsig'];
		}
		if ($qsig=='1' || $qsig=='yes') return "<input type='checkbox' name='qsig' value='1' checked>";
		elseif ($qsig=='0' || $qsig=='no') return "<input type='checkbox' name='qsig' value='1'>";
		return "<input type='checkbox' name='qsig' value='1'>";
	}else{
		$ret="<input type='checkbox' name='qsig' value='1'>";
		return $ret;
	}
}

function odt($ba,$gr){
	if ($gr!=""){
		$query=$ba->select("select odt from isdn where gr='".$gr."'");
		$odt="";
		while ($entry=$ba->fetch_array($query)){
			$odt=$entry['odt'];
		}

		$ret="<input name='odt' id='odt' value='".$odt."'>";
		return $ret;
	}else{
		$ret="<input name='odt' id='odt' value='3'>";
		return $ret;
	}
}

function odt_empty_dad($ba,$gr){
	if ($gr!=""){
		$query=$ba->select("select odt_empty_dad from isdn where gr='".$gr."'");
		$odt="";
		while ($entry=$ba->fetch_array($query)){
			$odt=$entry['odt_empty_dad'];
		}

		$ret="<input name='odt_empty_dad' id='odt_empty_dad' value='".$odt."'>";
		return $ret;
	}else{
		$ret="<input name='odt_empty_dad' id='odt_empty_dad' value='15'>";
		return $ret;
	}
}

function showdefmc($config_values){
	$isgw = new isgwtelnet();
	$result=$isgw->isgw_login();
	if ($result!=false){
		$dialplanc=$isgw->isgw_dialplanconfig();
		$zeilen=split("\n",$dialplanc);
		foreach ($zeilen as $zeile){
			if (stripos($zeile,'[')===0){
				preg_match("/\[(?<bez>.+)\]\[(?<name>.+)\][\s]*(?<desc>.+)[\s]*\<(?<val>.*)\>[\s]*'(?<def>.*)'/",$zeile,$res);
				if (!in_array($res['name'],$config_values) && ($res['bez']=="i" || $res['bez']=="i"))
				echo "<script>
							var extra_tooltip=document.getElementById('extra_tooltip');
							extra_tooltip.innerHTML=extra_tooltip.innerHTML+'<p>".DIALPLAN_OPTION_DIS."<b>&nbsp;".$res['name']."</b><br>".DIALPLAN_VALUES_DIS."<b>&nbsp;&lt;".$res['val']."&gt;</b><br><i>".$res['desc']."</i></p>';
						</script>";
			}
		}
		$ba=new beroAri();
		$query=$ba->select("select config from isdn where gr='".$_GET['gr']."' group by gr");
		while  ($entry = $ba->fetch_array($query)) {
			$config=$entry['config'];
		}
		if ($config!=""){
			$configs=split(',',$config);
			foreach ($configs as $value){
				$key=split('=',$value);
				if ($key[0]!="" && $key[1]!="" && !in_array($key[0],$config_values)) {
					echo "<script>var addit_options=document.getElementById('addit_options');
							if (addit_options.innerHTML=='')
								addit_options.innerHTML='".$key[0]."=".$key[1]."';
							else
								addit_options.innerHTML=addit_options.innerHTML+'\\n".$key[0]."=".$key[1]."';</script>";
				}elseif ($key[0]!="" && $key[1]=="" && !in_array($key[0],$config_values)){
					echo "<script>var addit_options=document.getElementById('addit_options');
							if (addit_options.innerHTML=='')
								addit_options.innerHTML='".$key[0]."=';
							else
								addit_options.innerHTML=addit_options.innerHTML+'\\n".$key[0]."=';</script>";
				}
			}
		}
	}
}

function show_confadd($config_values){
	$isgw = new isgwtelnet();
	$result=$isgw->isgw_login();
		if ($result!=false){

	$dialplanc=$isgw->isgw_dialplanconfig();
	$zeilen=split("\n",$dialplanc);
	foreach ($zeilen as $zeile){
		if (stripos($zeile,'[')===0){
			preg_match("/\[(?<bez>.+)\]\[(?<name>.+)\][\s]*(?<desc>.+)[\s]*\<(?<val>.*)\>[\s]*'(?<def>.*)'/",$zeile,$res);
			if (!in_array($res['name'],$config_values) && ($res['bez']=="i" || $res['bez']=="p"))
			echo "<script>
						var extra_tooltip=document.getElementById('extra_tooltip');
						extra_tooltip.innerHTML=extra_tooltip.innerHTML+'<p>".DIALPLAN_OPTION_DIS."<b>&nbsp;".$res['name']."</b><br>".DIALPLAN_VALUES_DIS."<b>&nbsp;&lt;".$res['val']."&gt;</b><br><i>".$res['desc']."</i></p>';
						var addit_options=document.getElementById('addit_options');
						if (addit_options.innerHTML=='')
							addit_options.innerHTML='".$res['name']."=".$res['def']."';
						else
							addit_options.innerHTML=addit_options.innerHTML+'\\n".$res['name']."=".$res['def']."';
					</script>";
		}
	}
}
}


$config_values=array("ec","ectl","dnumplan", "isdn_oad_setting","from_pstn_src_setting",
						"onumplan","screen","pres", "isdn_oad2_setting", "clir_on_oad",
						"bearer_cap","cd","isdn_qsigname_setting","isdn_redirected_nr_setting");

//echo "<script>window.opener.location='../index.php?m=isdn'</script>";
print "<br><table align=\"center\" bgcolor=\"#f0f0ec\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"450\">
<colgroup>
<col width=\"39\"></col>
</colgroup>
<tbody><tr>
<td colspan=\"2\"><img src=\"../includes/images/bg_top.png\"></td>
</tr>
<tr>
<td background=\"../includes/images/bg_left.png\" style='background-repeat:repeat-y;' width=\"30\"><img src=\"../includes/images/trans.gif\" height=\"10\" width=\"39\"></td>
<td><p align='left'><img src=\"../includes/images/berofixlogo.png\"/><hr size= \"1\" noshade></p><p><center><font size='3'>PSTN</font></p><br><br>";

	echo ("<form class='extensions_form' name='isdn' action='isdn_submit.php?opt=".$_GET['opt']."' method='POST' onsubmit=\"return (check_blank(group.value,'group name') && specChar(group.value,'Group name'));\">
			<table border='1' style='border-collapse:collapse' width='290'>
			<tr>
			<td colspan='2'>
			<table border=0 align='center'>
			<tr>
			<td><b>".PSTN_NAME_DIS.":</b>&nbsp;</td>
			<td>&nbsp;<input type='text' name='group' value='".$_GET['gr']."' onmouseover=\"Tip('".ISDN_GROUP_NAME."');\" onmouseout='UnTip();'></td>
			</tr>
			<tr>
			<td valign='top' style='padding-top:5px;'><b>".PSTN_PORTS_DIS.":</b>&nbsp;</td>
			<td>
			<table>
			<tr>
			<td valign='top' colspan='2'>
			<table border='1' style='border-collapse:collapse;' width='100%' onmouseover=\"Tip('".ISDN_PORTS_TABLE."');\" onmouseout='UnTip();'>
			<tr>
			<td width='65'>".title0($ba,$_GET['gr'])."</td>
			<td width='65'>".title1($ba,$_GET['gr'])."</td>
			</tr>
			<tr>
			<td valign='top'>".ports0($ba,$_GET['gr'])."</td>
			<td valign='top'>".ports1($ba,$_GET['gr'])."</td>
			</tr>
			</table>
			</td>
			</tr>
			</table>

			</td>
			</tr>
			<tr onmouseover=\"Tip('".ISDN_CHANSEL."');\" onmouseout='UnTip();'>
			<td><b>".PSTN_CHANSEL_DIS.":</b></td><td>".chansel($ba,$_GET['gr'])."</td>
			</tr>
			</tr>
			<tr>
			<td><b>".PSTN_CHANSEL_DIR_DIS.":</b></td><td>".chansel_dir($ba,$_GET['gr'])."</td>
			</tr>
			<tr onmouseover=\"Tip('".ISDN_TONES."');\" onmouseout='UnTip();'>
			<td><b>".PSTN_TONES_DIS.":</b></td>
			<td>".tones($ba,$_GET['gr'])."</td>
			</tr>
			<tr id='odt_tr' onmouseover=\"Tip('".ISDN_ODT."');\" onmouseout='UnTip();'>
			<td><b>".PSTN_ODT_DIS.":</b></td>
			<td>".odt($ba,$_GET['gr'])."</td>
			</tr>
			<tr id='odt_empty_dad_tr' onmouseover=\"Tip('".ISDN_ODT_EMPTY_DAD."');\" onmouseout='UnTip();'>
			<td><b>".PSTN_OVERLAPDIAL_TIMEOUT_EMPTY_DAD_DIS.":</b></td>
			<td>".odt_empty_dad($ba,$_GET['gr'])."</td>
			</tr>
			<tr onmouseover=\"Tip('".ISDN_OVERLAPDIALING."');\" onmouseout='UnTip();'>
			<td><b>".PSTN_OVERLAP_DIALING_DIS.":</b></td>
			<td>".overlap_dialing($ba,$_GET['gr'])."</td>
			</tr>
			<tr onmouseover=\"Tip('".ISDN_QSIG."');\" onmouseout='UnTip();'>
			<td><b>".PSTN_QSIG_SUPPORT_DIS.":</b></td>
			<td>".qsig($ba,$_GET['gr'])."</td>
			</tr>
			<tr onmouseover=\"Tip('".ISDN_PORTPULLUP."');\" onmouseout='UnTip();'>
			<td><b>".PSTN_PORTPULLUP_DIS.":</b></td>
			<td>".portpullup($ba,$_GET['gr'])."</td>
			</tr>
			<tr>
			<td align='center' colspan='2'><a href='#' onclick='show_config_isdn();'>".PSTN_MORE_DIS."...</a></td>
			</tr>

			</table>
			</td>
			</tr>
			</table>
			<br/>
			<table border='1' cellspacing='0' id='config_isdn' width='400' style='border-collapse:collapse;'>
			<tr>
				<td><table border='0'>
					<tr><td colspan='2' align='center'><b>".DIALPLAN_CONFIGURATION_DIS."</b></td></tr>
					<tr onmouseover=\"Tip('".EC."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_EC_DIS."</b></td>
		    			<td>".ec()."</td>
					</tr>
					<tr onmouseover=\"Tip('".EC_TAIL."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_EC_TAIL_LENGTH_DIS."</b></td>
						<td>".ec_tail()."</td>
					</tr>
					<tr onmouseover=\"Tip('".DNUMPLAN."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_DNUMPLAN_DIS."</b></td>
						<td>".dialplans('dnumplan')."</td>
					</tr>
					<tr onmouseover=\"Tip('".ONUMPLAN."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_ONUMPLAN_DIS."</b></td>
						<td>".dialplans('onumplan')."</td>
					</tr>
					<tr onmouseover=\"Tip('".SCREENING."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_SCREENING_DIS."</b></td>
		    			<td>".screen()."</td>
					</tr>
					<tr onmouseover=\"Tip('".PRES."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_PRESENTATION_DIS."</b></td>
		    			<td>".pres()."</td>
					</tr>
					<tr onmouseover=\"Tip('".BEARER."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_BEARER_DIS."</b></td>
		    			<td>".bearer_cap()."</td>
					</tr>
					<tr onmouseover=\"Tip('".CD."')\" onmouseout='UnTip()'>
						<td><b>".DIALPLAN_CALL_DEFLECTION_DIS."</b></td>
		    			<td>".cd()."</td>
					</tr>
					<tr onmouseover=\"Tip('".CLIR_ON_OAD."')\" onmouseout='UnTip()' id='clir_on_oad_tr'>
						<td><b>".DIALPLAN_CLIR_ON_OAD_DIS."</b></td>
		    			<td>".clir_on_oad('isdn')."</td>
					</tr>
					<tr onmouseover=\"Tip('".FROM_PSTN_SRC_SETTING."')\" onmouseout='UnTip()' id='pstn_src_setting_tr'>
						<td><b>".DIALPLAN_FROM_PSTN_SRC_SETTING_DIS."</b></td>
						<td>".from_pstn_src_setting('isdn')."</td>
					</tr>
					<tr>
						<td colspan='2'>&nbsp;</td>
					</tr>
					<tr>
						<th colspan='2'>".DIALPLAN_CALLER_ID_MAPPING_DIS."</th>
					</tr>
					<tr onmouseover=\"Tip('".ISDN_OAD_SETTING."')\" onmouseout='UnTip()' id='isdn_oad_setting_tr'>
						<td><b>".DIALPLAN_ISDN_OAD_SETTING_DIS."</b></td>
						<td>".caller_id_mapping_pstn('isdn_oad_setting')."</td>
					</tr>
					<tr onmouseover=\"Tip('".ISDN_OAD2_SETTING."')\" onmouseout='UnTip()' id='isdn_oad2_setting_tr'>
						<td><b>".DIALPLAN_ISDN_OAD2_SETTING_DIS."</b></td>
						<td>".caller_id_mapping_pstn('isdn_oad2_setting')."</td>
					</tr>
					<tr onmouseover=\"Tip('".ISDN_QSIGNAME_SETTING."')\" onmouseout='UnTip()' id='isdn_qsigname_setting_tr'>
						<td><b>".DIALPLAN_ISDN_QSIGNAME_SETTING_DIS."</b></td>
						<td>".caller_id_mapping_pstn('isdn_qsigname_setting')."</td>
					</tr>
					<tr onmouseover=\"Tip('".ISDN_REDIRECTED_NR_SETTING."')\" onmouseout='UnTip()' id='isdn_redirected_nr_setting_tr'>
						<td><b>".DIALPLAN_ISDN_REDIRECTED_NR_SETTING_DIS."</b></td>
						<td>".caller_id_mapping_pstn('isdn_redirected_nr_setting')."</td>
					</tr>
					<tr>
						<td colspan='2'>&nbsp;</td>
					</tr>
						<tr onmouseover=\"Tip('".ADDIT_OPTIONS."')\" onmouseout='UnTip()'>
						<td colspan='2'><b>".DIALPLAN_ADDITIONAL_CONFIG_DIS."</b></td>
					</tr>
					<tr onmouseover=\"Tip('".ADDIT_OPTIONS."')\" onmouseout='UnTip()'>
						<td colspan='2'><textarea name='addit_options' id='addit_options' rows='4' style='width:305px;'></textarea></td>
					</tr>
					<tr>
						<td colspan='2'>
						<br>
						<b>".DIALPLAN_ADDITIONAL_CONFIG_DOC_DIS."</b>
						</td>
					</tr>
					<tr>
						<td colspan='2'>
						<p id='extra_tooltip' style='height: 150px; width:305px; overflow: auto; border: 1px solid #A31D26; background: none repeat scroll 0% 0% rgb(238, 238, 238); color: rgb(0, 0, 0);'>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>");
			if (isset($_GET['gr'])){
				showdefmc($config_values);
			}else{
				show_confadd($config_values);
			}
			echo ("<br/>
			<input type='hidden' name='gr_upd' value='". $_GET['gr']."'>
			<input name='submit' type='submit' value='".BUTTON_SAVE."' onmouseover=\"Tip('".ISDN_SAVE."');\" onmouseout='UnTip();'>
			 &nbsp;&nbsp;<input name='close' type='button' value='".BUTTON_CLOSE."' onclick='javascript:closeW();' onmouseover=\"Tip('".POPUPS_BUTTON_CLOSE."');\" onmouseout='UnTip();'>
			</form>");



print "<hr size= \"1\" noshade>";
print "<br><a href=\"http://www.beronet.com\" target=\"_blank\" onfocus=\"if (this.blur()) { this.blur(); }\"><img src=\"../includes/images/beroLogo.gif\" align=\"right\" border=\"0\"></a>";
print "</center></td></tr>
<tr>
<td colspan=\"2\" style=\"background-repeat:no-repeat\" background=\"../includes/images/bg_bottom.png\"><img src=\"../includes/images/trans.gif\" border=\"0\" height=\"39\" width=\"10\"><div style=\"color: white;\" align=\"right\">&nbsp;&nbsp;&nbsp;</div>
</td></tr></table>";
?>
</center>
</body>
</html>

