Execute("insert into extlines (line, name) values ('".$_POST["co"]."', '".$_POST["name"]."')");
}
# После этих операций данные не будем брать из кеша.
header("Location: ?cacheflush=1");
die;
}
else if (isset($_POST["edit"]) && $_POST["edit"])
{
if ($_POST["co"] == "")
{
header("Location: ?msg=3");
die;
}
if ($_POST["name"] == "")
{
header("Location: ?msg=2");
die;
}
$q4="SELECT 0 FROM extlines WHERE line = '".$_POST["edit"]."'";
if (isset($res->fields[0])){
if(!$demoMode){
$conn->Execute("update extlines set line='".$_POST["co"]."', name = '".$_POST["name"]."' where line = '".$_POST["edit"]."'");
}
}else{
if(!$demoMode){
$conn->Execute("insert into extlines (line, name) values ('".$_POST["co"]."', '".$_POST["name"]."')");
}
}
# После этих операций данные не будем брать из кеша.
header("Location: ?cacheflush=1");
die;
}
else if (isset($_GET["delete"]) && $_GET["delete"])
{
$q5="delete from extlines where line = '".$_GET["delete"]."'";
if(!$demoMode){
$conn->Execute($q5);
}
# После этих операций данные не будем брать из кеша.
header("Location: ?cacheflush=1");
die;
}
$title=strtr($GUI_LANG['ParametersOfLines'],$GUI_LANG['UpperCase'],$GUI_LANG['LowerCase']);
if(empty($export)) include("../include/set/header.html");
?>
".$GUI_LANG['ChangeDefaultAdminPassword']." ";
?> |
|
|
".$GUI_LANG['Lines'].":";
if(isset($_GET["msg"])){
switch ($_GET["msg"])
{
case 2:
echo " ".$GUI_LANG['EnterTheDescriptionOfExternalLine']." ";
break;
case 3:
echo "".$GUI_LANG['EnterALineNumber']." ";
break;
}
}
$q2="SELECT line, name from extlines order by line ASC";
if($debug) echo $q2." ";
$q1="SELECT co from calls group by co order by co ASC";
if($debug) echo $q1." ";
if(isset($cacheflush) && $cacheflush) $res1 = $conn->CacheFlush($q1);
$res1 = $conn->CacheExecute($q1);
if ($res1 && $res1->RecordCount() > 0) {
while ($arr1 = $res1->FetchRow()){
$allIntern[]=$arr1[0];
}
}
$conn->setFetchMode(ADODB_FETCH_NUM);
if(isset($cacheflush) && $cacheflush) $res = $conn->CacheFlush($q2);
$res = $conn->CacheExecute($q2);
if ($res && $res->RecordCount() > 0) {
while (!$res->EOF) {
$allRows[]=$res->fields;
$res->MoveNext();
}
}
if(!empty($allIntern)){
while (list($k, $v) = each($allIntern)) {
if(!empty($allRows)){
reset($allRows);
while (list($ke, $va) = each($allRows)) {
if ($v==$va[0]){
$dobavit=FALSE;
break;
}else{
$dobavit=TRUE;
}
}
}else{
$dobavit=TRUE;
}
if($dobavit){
$tmpArr=array($v);
$allRows[]=$tmpArr;
}
}
}
if(!empty($allRows)){
reset($allRows);
ksort($allRows);
}
echo "
";
include("../include/set/footer.html");
?>
|