<head>
<meta http-equiv="Content-type" content="text/html; charset=windows-1251">
</head>
<body>
<?PHP
require("mssql_conect.php");
$result = mssql_query('SELECT iModuleNum,sCallOutRight,sNewServiceRight,iPSN FROM tbl_STUserData
WHERE iStatus=1 AND iModuleNum=1');
if($row["iPSN"]>=384 and $row["iPSN"]<=1535){
$iModule="ATC-6";
}elseif($row["iPSN"]>=0 and $row["iPSN"]<=351 or $row["iPSN"]>=1536 and $row["iPSN"]<=1887){
$iModule="ATC-7";
}elseif($row["iPSN"]>=1920 and $row["iPSN"]<=2111){
$iModule="ATC-Zeid";
}elseif($row["iPSN"]>=3072 and $row["iPSN"]<=3295){
$iModule="ATC-Hatap";
}elseif($row["iPSN"]>=2688 and $row["iPSN"]<=2751){
$iModule="ATC-Imamnazar";
}elseif($row["iPSN"]>=2304 and $row["iPSN"]<=2687){
$iModule="ATC-Niyazow";
}elseif($row["iPSN"]>=3456 and $row["iPSN"]<=3839){
$iModule="ATC-M.Gala";
}elseif($row["iPSN"]>=6912 and $row["iPSN"]<=7295 or $row["iPSN"]>=3840 and $row["iPSN"]<=4191){
$iModule="ATC-K.Ayak";
}elseif($row["iPSN"]>=4224 and $row["iPSN"]<=4607){
$iModule="ATC-Bashsaka";
}elseif($row["iPSN"]>=4608 and $row["iPSN"]<=5375 or $row["iPSN"]>=6144 and $row["iPSN"]<=6527){
$iModule="ATC-Gabshal";
}elseif($row["iPSN"]>=5376 and $row["iPSN"]<=6143 or $row["iPSN"]>=6528 and $row["iPSN"]<=6911){
$iModule="ATC-Gabasagal";
}else{
$iModule=$row["iModuleNum"];
}
$arr[$iModule]["emkost"]++;
if(ereg("^(0){5}[0-1]{11}$", $row["sCallOutRight"])){ $arr[$iModule]["free_numb"]++;
}
if($row["sCallOutRight"]{3}=="1") $arr[$iModule]["national_tool"]++;
if($row["sCallOutRight"]{4}=="1") $arr[$iModule]["international_tool"]++;
if($row["sNewServiceRight"]{19}=="1") $arr[$iModule]["clip"]++;
if($row["sNewServiceRight"]{1}=="1") $arr[$iModule]["hot_line"]++;
if($row["sNewServiceRight"]{2}=="1") $arr[$iModule]["call_pwd"]++;
if($row["sNewServiceRight"]{4}=="1") $arr[$iModule]["mcid_service"]++;
if($row["sNewServiceRight"]{5}=="1") $arr[$iModule]["als"]++;
if($row["sNewServiceRight"]{7}=="1") $arr[$iModule]["cfu"]++;
if($row["sNewServiceRight"]{8}=="1") $arr[$iModule]["cfb"]++;
if($row["sNewServiceRight"]{9}=="1") $arr[$iModule]["cfnr"]++;
if($row["sNewServiceRight"]{11}=="1") $arr[$iModule]["call_waiting"]++;
if($row["sNewServiceRight"]{23}=="1") $arr[$iModule]["RIO"]++;
if($row["sNewServiceRight"]{45}=="1") $arr[$iModule]["TCIR"]++;
//В этой части добавляю пару и более условий-браузер не может отобразить страницу(Кол-во условий может составлять до 64)
}
//print_r($arr)."<br>";
?>
<table border>
<tr>
<td align=center>Наименование ВАТС</td>
<td align=center>8ка</td>
<td align=center>10ка</td>
<td align=center>CLIP</td>
<td align=center>CW</td>
<td align=center>HotLine</td>
<td align=center>CFU</td>
<td align=center>CFB</td>
<td align=center>CFNR</td>
<td align=center>ALS</td>
<td align=center>CBA</td>
<td align=center>TCIR</td>
<td align=center>RIO</td>
</tr>
<?PHP
foreach($arr as $mod => $key){
echo"<tr><td align=center>".$mod."</td>";
echo"<td align=center>".$arr[$mod]["national_tool"]."</td>";
echo"<td align=center>".$arr[$mod]["international_tool"]."</td>";
echo"<td align=center>".$arr[$mod]["clip"]."</td>";
echo"<td align=center>".$arr[$mod]["call_waiting"]."</td>";
echo"<td align=center>".$arr[$mod]["hot_line"]."</td>";
echo"<td align=center>".$arr[$mod]["cfu"]."</td>";
echo"<td align=center>".$arr[$mod]["cfb"]."</td>";
echo"<td align=center>".$arr[$mod]["cfnr"]."</td>";
//тоже самое происходит здесь, если раскоментировать строчки - браузер не может отобразить страницу..
/*echo"<td align=center>".$arr[$mod]["als"]."</td>";
echo"<td align=center>".$arr[$mod]["call_pwd"]."</td>";
echo"<td align=center>".$arr[$mod]["TCIR"]."</td>";
echo"<td align=center>".$arr[$mod]["RIO"]."</td>";*/
echo "</tr>";
}
?>
</table>
</body>
</html>