<?
$ip = @$_SERVER['REMOTE_ADDR'];
$ips = split("\.", "$ip");
@$ipnum = $ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256;
$oper = 0;
$IP101 = array(1402273792,1402277888,1402279936,1402281984,1402284032,1402286080,1402287104,3251233792,3582031776,3647627136,2886764544);
$IP201 = array(1402275839,1402278911,1402280959,1402283007,1402285055,1402287103,1402288127,3251234815,3582031807,3647627143,2886765568);
$IP102 = array(1433657344,3648405504,3648406528,3648408576,3648409600,3648410624,3648411648,3648412672,3582418944,3232238080);
$IP202 = array(1433657599,3648406527,3648407551,3648409599,3648410623,3648411647,3648412671,3648413695,3582423039,3232238335);
$IP103 = array(1047070464,1401450496,1401451520,1406861312,1425989632,1441366016,3272364544,3564675072,3564676832,3571187712,3641816064,3641816576,1494507776);
$IP203 = array(1047072255,1401450751,1401451775,1406869503,1425994239,1441371903,3272364799,3564683263,3564676863,3571253247,3641816319,3641816831,1494508031);
$IP104 = array(1347599104,3588519936,926563328);
$IP204 = array(1347599359,3588520447,926563583);
$IP105 = array(1042394624,1346950400,1347674112,1360933376,1372794624,1410457600,3258356736,3277188608,3281465344,3287259392,3559689216,3562834880,3578831872,3579259392,3579267072,3579269120,3641237504,3641237504,3645018112,3645566976,3648478720,3283979776);
$IP205 = array(1042394879,1346950655,1347678207,1360933887,1372794879,1410459647,3258357759,3277188863,3281465599,3287259647,3559689471,3562834943,3578832127,3579265535,3579267935,3579273215,3641241599,3641240575,3645019135,3645569023,3648479231,3283980031);
$IP106 = array(1404043264,2197028864);
$IP206 = array(1405091839,2197094399);
$IP107 = array(3650368512,2885812736);
$IP207 = array(3650368767,2885812991);
$IP108 = array(3278955480,3278956288,3278960128);
$IP208 = array(3278955515,3278956543,3278960383);
$IP109 = array(1389383040,1432330240,3282161664,3282171904,3585171456,167772928);
$IP209 = array(1389383167,1432334335,3282163711,3282173951,3585174271,167773183);
$IP110 = array(1346736128,3260286336,3645731072);
$IP210 = array(1346737151,3260286463,3645731079);
$IP111 = array(3648294912);
$IP211 = array(3648295935);
$IP112 = array(1481787392,3652001536,1506762753);
$IP212 = array(1481787647,3652001599,1506764798);
$IP113 = array(1052193280,1347125248,1347125248,1347126528,3589409280);
$IP213 = array(1052193535,1347129343,1347125759,1347127167,3589409535);
$IP114 = array(1358118912,1358119680);
$IP214 = array(1358119423,1358123007);
$IP115 = array(1406740480,1406741504,3564593152,3564595968,3564599808,3565248512,3565250048,3565250560,3578853376,3648215680);
$IP215 = array(1406741503,1406743551,3564593407,3564596735,3564601343,3565256703,3565250559,3565254655,3578854079,3648215807);
$IP116 = array(3651751936,3651752192,3651755008);
$IP216 = array(3651752191,3651752447,3651756031);
$IP117 = array(3287244288);
$IP217 = array(3287244543);
$IP118 = array(3645317120);
$IP218 = array(3645318015);
$IP119 = array(3268669440,3268149760,1475938304);
$IP219 = array(3268673535,3268150015,1475938559);
$IP120 = array(2197028864,2197028864,2197028864);
$IP220 = array(2197094399,2197094399,2197094399);
$IP121 = array(3588390912,1410269184);
$IP221 = array(3588391935,1410334719);
$IP122 = array(3266322432);
$IP222 = array(3266322687);
$IP123 = array();
$IP223 = array();
$IP124 = array();
$IP224 = array();
$IP125 = array(3562882304);
$IP225 = array(3563086079);
$IP126 = array(1358905344,1358905344,1358907392,1358907648,1358907904,1358908160,1358908416,1358908672,1358908928,1358909184,1490436096);
$IP226 = array(1358909439,1358905471,1358907647,1358907903,1358908159,1358908415,1358908671,1358908927,1358909183,1358909439,1490444287);
$IP127 = array(1536278528,1536278528,3560611840,3560611840,3560612352,3560612864,3560613888,3560615936);
$IP227 = array(1536294911,1536286719,3560620031,3560612095,3560612863,3560613887,3560615935,3560620031);
$IP128 = array(3253698560);
$IP228 = array(3253699071);
$IP129 = array(3274702592);
$IP229 = array(3274702847);
$IP130 = array(3557661440);
$IP230 = array(3557661695);
$IP131 = array(3583086592);
$IP231 = array(3583087103);
$IP132 = array(3563233280);
$IP232 = array(3563241471);
$IP133 = array(3651710976);
$IP233 = array(3651715071);
// $IP134 = array(1365221376);
// $IP234 = array(1365225471);
$IP135 = array(3228960768);
$IP235 = array(3228961791);
$IP136 = array(3245296640);
$IP236 = array(3245297151);
$IP139 = array(1426685952);
$IP234 = array(1426688511);
$IP140 = array(3245279744);
$IP240 = array(3245280255);
$IP141 = array(1411713280);
$IP241 = array(1411713535);
$IP142 = array(3652113152);
$IP242 = array(3652113407);
$IP143 = array(3458756352);
$IP243 = array(3458756607);
$IP144 = array(3561527296);
$IP244 = array(3561527551);
$IP145 = array(3283979776);
$IP245 = array(3283980287);
$IP146 = array(3289116416);
$IP246 = array(3289118463);
$IP147 = array(3290185728);
$IP247 = array(3290202111);
$IP148 = array(3590112000);
$IP248 = array(3590112255);
$IP149 = array(1051015424);
$IP249 = array(1051015679);
$IP150 = array(3288793088);
$IP250 = array(3290923007);
$IP151 = array(3568795649,3240329473,3568797185,3245459457,3568802817,3651897601,2516502785,3568796417,3240330497,3568797697,3651895553,2516451585);
$IP251 = array(3568795903,3240329726,3568797438,3245459710,3568803070,3651897854,2516503038,3568796670,3240330750,3568797950,3651895806,2516451838);
$IP152 = array(3254689793,1052044289,3254691073,1354432513,3228424193,3249045505,3558301952,2332491777,1383162880,3254690560,3283513857,1484783617,1354465281);
$IP252 = array(3254690046,1052044543,3254691327,1354465280,3228424446,3249045759,3558302207,2332564735,1383163135,3254690815,3283514111,1484800454,1354469376);
$IP153 = array(1360467456);
$IP253 = array(1360467711);
$IP300 = array(3240705024);
$IP301 = array(3240706047);
$IP302 = array(1358905344,1358905344,1358907392,1358907648,1358907904,1358908160,1358908416,1358908672,1358908928,1358909184,1490436096);
$IP303 = array(1358909439,1358905471,1358907647,1358907903,1358908159,1358908415,1358908671,1358908927,1358909183,1358909439,1490444287);
$IP304 = array(3560612352,3560612864);
$IP305 = array(3560612863,3560613887);
$IP306 = array(3253698560);
$IP307 = array(3253699071);
$IP308 = array(3274702592);
$IP309 = array(3274702847);
$IP310= array(3557661440,3563233536,3583086592);
$IP311 = array(3557661695,3563233791,3583087103);
$IP312 = array(3557661440);
$IP313 = array(3557661695);
for ($ix=0; $ix<count($IP101); $ix++)
{
if ($ipnum>=$IP101[$ix] && $ipnum<=$IP201[$ix]) $oper = "1";
}
for ($ix=0; $ix<count($IP102); $ix++)
{
if ($ipnum>=$IP102[$ix] && $ipnum<=$IP202[$ix]) $oper = "2";
}
for ($ix=0; $ix<count($IP103); $ix++)
{
if ($ipnum>=$IP103[$ix] && $ipnum<=$IP203[$ix]) $oper = "3";
}
for ($ix=0; $ix<count($IP104); $ix++)
{
if ($ipnum>=$IP104[$ix] && $ipnum<=$IP204[$ix]) $oper = "4";
}
for ($ix=0; $ix<count($IP105); $ix++)
{
if ($ipnum>=$IP105[$ix] && $ipnum<=$IP205[$ix]) $oper = "5";
}
for ($ix=0; $ix<count($IP106); $ix++)
{
if ($ipnum>=$IP106[$ix] && $ipnum<=$IP206[$ix]) $oper = "6";
}
for ($ix=0; $ix<count($IP107); $ix++)
{
if ($ipnum>=$IP107[$ix] && $ipnum<=$IP207[$ix]) $oper = "7";
}
for ($ix=0; $ix<count($IP108); $ix++)
{
if ($ipnum>=$IP108[$ix] && $ipnum<=$IP208[$ix]) $oper = "8";
}
for ($ix=0; $ix<count($IP109); $ix++)
{
if ($ipnum>=$IP109[$ix] && $ipnum<=$IP209[$ix]) $oper = "9";
}
for ($ix=0; $ix<count($IP110); $ix++)
{
if ($ipnum>=$IP110[$ix] && $ipnum<=$IP210[$ix]) $oper = "10";
}
for ($ix=0; $ix<count($IP111); $ix++)
{
if ($ipnum>=$IP111[$ix] && $ipnum<=$IP211[$ix]) $oper = "11";
}
for ($ix=0; $ix<count($IP112); $ix++)
{
if ($ipnum>=$IP112[$ix] && $ipnum<=$IP212[$ix]) $oper = "12";
}
for ($ix=0; $ix<count($IP113); $ix++)
{
if ($ipnum>=$IP113[$ix] && $ipnum<=$IP213[$ix]) $oper = "13";
}
for ($ix=0; $ix<count($IP114); $ix++)
{
if ($ipnum>=$IP114[$ix] && $ipnum<=$IP214[$ix]) $oper = "14";
}
for ($ix=0; $ix<count($IP115); $ix++)
{
if ($ipnum>=$IP115[$ix] && $ipnum<=$IP215[$ix]) $oper = "15";
}
for ($ix=0; $ix<count($IP116); $ix++)
{
if ($ipnum>=$IP116[$ix] && $ipnum<=$IP216[$ix]) $oper = "16";
}
for ($ix=0; $ix<count($IP117); $ix++)
{
if ($ipnum>=$IP117[$ix] && $ipnum<=$IP217[$ix]) $oper = "17";
}
for ($ix=0; $ix<count($IP118); $ix++)
{
if ($ipnum>=$IP118[$ix] && $ipnum<=$IP218[$ix]) $oper = "18";
}
for ($ix=0; $ix<count($IP119); $ix++)
{
if ($ipnum>=$IP119[$ix] && $ipnum<=$IP219[$ix]) $oper = "19";
}
for ($ix=0; $ix<count($IP120); $ix++)
{
if ($ipnum>=$IP120[$ix] && $ipnum<=$IP220[$ix]) $oper = "20";
}
for ($ix=0; $ix<count($IP121); $ix++)
{
if ($ipnum>=$IP121[$ix] && $ipnum<=$IP221[$ix]) $oper = "21";
}
for ($ix=0; $ix<count($IP122); $ix++)
{
if ($ipnum>=$IP122[$ix] && $ipnum<=$IP222[$ix]) $oper = "22";
}
for ($ix=0; $ix<count($IP123); $ix++)
{
if ($ipnum>=$IP123[$ix] && $ipnum<=$IP223[$ix]) $oper = "23";//
}
for ($ix=0; $ix<count($IP124); $ix++)
{
if ($ipnum>=$IP124[$ix] && $ipnum<=$IP224[$ix]) $oper = "24";//
}
for ($ix=0; $ix<count($IP125); $ix++)
{
if ($ipnum>=$IP125[$ix] && $ipnum<=$IP225[$ix]) $oper = "25";
}
for ($ix=0; $ix<count($IP126); $ix++)
{
if ($ipnum>=$IP126[$ix] && $ipnum<=$IP226[$ix])
{
$oper = "27";
}
}
if(eregi("193\.41\.[6][0123]\.[0-9]{1,3}", $ip) or $ip=="10.10.10.10")
{
$oper = "26";
}
for ($ix=0; $ix<count($IP127); $ix++)
{
if ($ipnum>=$IP127[$ix] && $ipnum<=$IP227[$ix]) {
$oper = "28";
}
}
//for ($ix=0; $ix<count($IP306); $ix++)
//{
//if ($ipnum>=$IP306[$ix] && $ipnum<=$IP307[$ix]) $oper = "29";
//}
//---------------
$mob=getenv('HTTP_USER_AGENT');
$mob=strtok($mob, '/');
$mob = trim(htmlspecialchars($mob));
if($mob=='Opera'){ $oper = "29"; }
if($mob=='Mozilla'){ $oper = "29"; }
if($mob=='MSIE'){ $oper = "29"; }
if($mob=='M3Gate'){ $oper = "29"; }
if($mob=='WinWap'){ $oper = "29"; }
//---------------
for ($ix=0; $ix<count($IP308); $ix++)
{
if ($ipnum>=$IP308[$ix] && $ipnum<=$IP309[$ix]) $oper = "30";
}
for ($ix=0; $ix<count($IP310); $ix++)
{
if ($ipnum>=$IP310[$ix] && $ipnum<=$IP311[$ix]) $oper = "30";
}
for ($ix=0; $ix<count($IP312); $ix++)
{
if ($ipnum>=$IP312[$ix] && $ipnum<=$IP313[$ix]) $oper = "31";
}
if($oper==0)$oper=23;
if($oper == 1)$oper_name = "Мегафон";
if($oper == 2)$oper_name = "Билайн";
if($oper == 3)$oper_name = "Utel";
if($oper == 4)$oper_name = "БайкалВестКом";
if($oper == 5)$oper_name = "МТС";
if($oper == 6)$oper_name = "TELE2";
if($oper == 7)$oper_name = "МОТИВ";
if($oper == 8)$oper_name = "Енисейтелеком";
if($oper == 9)$oper_name = "НСС";
if($oper == 10)$oper_name = "СМАРТС";
if($oper == 11)$oper_name = "СТЕК GSM";
if($oper == 12)$oper_name = "Татинком-Т";
if($oper == 13)$oper_name = "Ульяновск GSM";
if($oper == 14)$oper_name = "НТК";
if($oper == 15)$oper_name = "СКАЙЛИНК";
if($oper == 16)$oper_name = "Цифровая экспансия";
if($oper == 17)$oper_name = "ИНДИГО";
if($oper == 18)$oper_name = "Emt (Эстония)";
if($oper == 19)$oper_name = "Elisa (Эстония)";
if($oper == 20)$oper_name = "Tele-2 (Эстония)";
if($oper == 21)$oper_name = "Bite (Литва)";
if($oper == 22)$oper_name = "Omnitel (Литва)";
if($oper == 23)$oper_name = "Другие";
if($oper == 24)$oper_name = "Прибалтийские операторы";
if($oper == 25)$oper_name = "Lmt (Латвия)";
if($oper == 26)$oper_name = "Киевстар"; //31
if($oper == 27)$oper_name = "UMC"; //32
if($oper == 28)$oper_name = "life:)"; //33
if($oper == 29)$oper_name = "Оперы и компы";
if($oper == 30)$oper_name = "KCELL";
if($oper == 31)$oper_name = "KARTEL";
?>