Файл: public_html/mobiles/services/wmid/index.php
Строк: 94
<?
$title = 'Проверка WMID';
include '../../head.php';
echo '<div class="title">С помощью данного сервиса, вы сможете проверить информацию любого WMID!</div>';
echo '<div class="menu">';
$wm = (isset($_GET['wmid']) && is_numeric($_GET['wmid'])) ? $_GET['wmid'] : '';
if($wm !== ''){
# ---------------------------------------------------------------------------------------------------
# А эту часть кода я взял в открытых просторах рунета, преобразовывает bl с картинки в число.
# Даже не пытайтесь разбираться - гиблое дело :D
# ---------------------------------------------------------------------------------------------------
function itfalse($x)
{
global $se;$ok=0;
for ($j = 3; $j < 15; $j++)
{
if ($se[$x][$j] == 40) { $ok++; }
} return $ok;
}
function iscount2($x,$y)
{
if (($x == 7) and ($y == 7)) { return 0; }
if (($x == 1) and ($y == 0)) { return 1; }
if (($x == 3) ){ return 2; }
if (($x == 2) and ($y == 6)) { return 3; }
if (($x == 2) and ($y == 1)){ return 4; }
if (($x == 6) and ($y == 5)){ return 5; }
if (($x == 7) and ($y == 4)){ return 6; }
if (($x == 1) and ($y == 2)){ return 7; }
if (($x == 6) and ($y == 6)){ return 8; }
if (($x == 4)){ return 9; }
}
function iscount($x,$y)//1 2 digit
{
if ( ($x == 1) and ($y == 0) ){ return 1; }
if (($x == 5) and ($y == 4)) { return 2; }
if (($x == 2) and ($y == 7)) { return 3; }
if (($x == 2) and ($y == 10)){ return 4; }
if (($x == 7) and ($y == 5)) { return 5; }
if (($x == 8) and ($y == 5)){ return 6; }
if (($x == 1) and ($y == 3)){ return 7; }
if (($x == 7) and ($y == 7)){ return 8; }
if (($x == 5) and ($y == 8)){ return 9; }
if (($x == 8) and ($y == 8)){ return 0; }
}
$wmid = file_get_contents('http://stats.wmtransfer.com/Levels/pWMIDLevel.aspx?wmid='.$wm.'&w=35&h=18&bg=0XDBE2E9');
$img = imagecreatefromstring($wmid);
for ($i = 4; $i < 35; $i++)
{
for ($j = 3; $j < 15; $j++)
{
$se[$i][$j] = (imagecolorat ($img, $i, $j));
}
}
$is = false;
$w = '';
if ( (itfalse(4) ==6 ) and (itfalse(5) ==7 ) and (itfalse(6) ==1 ) and (itfalse(7) ==2 ) and (itfalse(8) == 7 ))
{
$is = true;
$w='no';
}
if (!( itfalse(18) or itfalse(20) or itfalse(19) or ($is) ) )
{
//one digit
$p1 =itfalse(23,$se);
$p2 = itfalse(28,$se);
$w = (iscount($p1, $p2));
$is = true;
}
if ( ! ( itfalse(13) or itfalse(14) or itfalse(12) or ($is)) )
{
//two digit
$p1 =itfalse(17,$se);
$p2 = itfalse(22,$se);
$w = (iscount($p1, $p2));
$p1 =itfalse(25,$se);
$p2 = itfalse(30,$se);
$w .= (iscount($p1, $p2));
$is = true;
}
if (!( itfalse(7) or itfalse(8) or itfalse(6) or ($is) ) )
{
//tree digit
$p1 = itfalse(11,$se);
$p2 =itfalse(16,$se);
$w= (iscount2($p1, $p2));
$p1 =itfalse(18,$se);
$p2 =itfalse(23,$se);
$w.=(iscount2($p1, $p2));
$p1 =itfalse(25,$se);
$p2 =itfalse(30,$se);
$w.= (iscount2($p1, $p2));
$is = true;
}
if ($is == false)
{
$p1 = itfalse(6,$se);
$p2 =itfalse(11,$se);
$w = (iscount2($p1, $p2));
$p1 = itfalse(13,$se);
$p2 =itfalse(18,$se);
$w.= (iscount2($p1, $p2));
$p1 = itfalse(20,$se);
$p2 =itfalse(25,$se);
$w.= (iscount2($p1, $p2));
$p1 = itfalse(27,$se);
$p2 =itfalse(32,$se);
$w.= (iscount2($p1, $p2));
}
# $w = bl текстом
# ---------------------------------------------------------------------------------------------------
if($w !== 'no'){
$html = file_get_contents("http://arbitrage.webmoney.ru/asp/claims.asp?wmid=$wm");
$html = iconv('cp1251','utf-8',$html);
preg_match_all('|<td>(.*?)</td>|si',$html,$out);
$names = array('Тип','BL','Отзывов','Претензий');
$values = array_splice($out[1],2,4);
foreach($values as $k => $v){if($k<>1) {$values[$k] = trim(strip_tags($v));} else {$values[$k] = $w;}}
$info = array_combine($names,$values);
foreach($info as $k => $v){
echo '<b>'.$k.':</b> '.$v.'<br/>';
}
echo '<form action="http://arbitrage.webmoney.ru/asp/newclaims.asp">
<input type="submit" value="Написать Претензию" />
<input type="hidden" name="procwmid" value=""></form><a href="?">Назад</a>';
} else {echo 'Ошибка! WMID должен состоять из 13 цифр!<br/><a href="?">Назад</a>';}
} else {
echo '<form action="?" method="get">WMID:<br/>
<input type="text" name="wmid" value="" size="10" maxlength="13" /><br />
<input type="submit" value="Проверить" />
</form>';}
echo '</div>';
include '../../foot.php';
?>