<?PHP
//VERSION 2006-04-23
$error5="error5 Przykro nam, serwis jest dostepny wylacznie dla
autoryzowanych uzytkownikow $REMOTE_ADDR";
//$komputery="/home/www/netsatmedia_portal/abonenci/www/komputery";

if(file_exists(".config.php")) include(".config.php");


$czy_error_5=exec("cat $komputery |grep $REMOTE_ADDR");
//echo "$REMOTE_ADDR $komputery $czy_error_5 <br>" ;
if($czy_error_5) {



$ADM_USER=$SQL_USER ;
$ADM_USER_PASS=$SQL_USER_PASS ;
$SQL_TABLE_USERS="USERS2";
$SQL_TABLE_ADMIN_USERS="ADMIN_USERS";


if($T_NETWORK_SERVER) {
 $T_NETWORK_SERVER=addslashes("$T_NETWORK_SERVER");
 $T_NETWORK_SERVER_WHERE=" and T_NETWORK_SERVER='$T_NETWORK_SERVER'";
}


if($test) echo "OK"; else {
     $conn=mysql_pconnect($INTERFACE_ADDR,$ADM_USER,$ADM_USER_PASS);
     if (!$conn) die("ERROR podczas tworzenia polaczenia do bazy $SQL_DATABASE !\n");
     mysql_select_db($SQL_DATABASE) or die("ERROR podczas wyboru bazy!");
     $zapSQL="SELECT * FROM $SQL_TABLE_USERS where S_IP='$dana1' $T_NETWORK_SERVER_WHERE LIMIT 0,1 ;";
//echo "$zapSQL";
     $result = mysql_query($zapSQL,$conn) or die("Blad zapytania!");
 //   $user=mysql_fetch_object($result);
 //    if ((mysql_num_rows($result)>0) && ($user->pass==$PHP_AUTH_PW))
while ($h=mysql_fetch_object($result))
{
echo "$h->S_IP;";
echo "$h->P_NAME;";
echo "$h->S_HOST;";
//echo "$h->S_HW;";
//echo "$h->S_HW;";
//S_HW
if(strstr($h->S_HWSTAT,BLOCK)) echo "BLOCK $h->A_STATUS_INFO $h->S_HW;"; else {



if(strstr($h->S_HW,BLOCK)) {
echo "BLOCK;";
} else {
if(strstr($h->S_HW,FREE)) {
echo "FREE;";
 
} else echo "$h->S_HW;"; 
}
} 
//S_HWSTAT_DETECT
//S_HW KONIEC

echo "$h->S_ADDRESS_STREET;";
echo "$h->T_TELBOX_ADDRESS;";
//echo "nowa";
}
}
} else {
echo $error5 ;
}
?>

