1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-03-09 15:39:59 +00:00

add files to project

This commit is contained in:
janickiy 2020-02-05 06:34:26 +03:00
commit 5cac498444
3729 changed files with 836998 additions and 0 deletions

47
views/search/avinfo.php Normal file
View file

@ -0,0 +1,47 @@
<?php
/* @var $this \yii\web\View */
/* @var $items [] */
/* @var $phone int */
/* @var $resultAntiparkon [] */
/* @var $gibddResult [] */
/* @var $searchRequest \app\models\SearchRequest */
use yii\helpers\Html;
use yii\helpers\Url;
use \yii\helpers\ArrayHelper;
if(!isset($items)) $items = [];
if(!isset($resultAntiparkon)) $resultAntiparkon = [];
if(!isset($gibddResult)) $gibddResult = [];
?>
<?php if(count($items) || count($resultAntiparkon) || count($gibddResult)): ?>
<ul class="cars">
<?php if(is_array($gibddResult)) foreach($gibddResult as $r): ?>
<li>
<b><?=ArrayHelper::getValue($searchRequest, ['user', 'is_admin'])?"Гибдд, Ездит на: ":"Ездит на: ";?></b><?=$r["number"];?>, <?=$r["model"];?>
</li>
<?php endforeach; ?>
<?php if(is_array($resultAntiparkon)) foreach($resultAntiparkon as $r): ?>
<li><b><?=ArrayHelper::getValue($searchRequest, ['user', 'is_admin'])?"Антипаркон: ":"Антипаркон: ";?></b><?=$r["number"];?>, <?=$r["marka"];?></li>
<?php endforeach; ?>
<?php if(is_array($items)) foreach($items as $i): ?>
<li>
<b><?=\yii\helpers\ArrayHelper::getValue($searchRequest, ["user", "is_admin"], false)?"Avinfo, Продавал(а): ":"Продавал(а): ";?></b><?=$i["credate"];?>, <?=$i["marka"];?> <?=$i["model"];?>, <?=$i["year"];?>г., <?=$i["city"];?><?=$i["price"]>0?", ".$i["price"]."р.":"";?>
<?php if(isset($i["images"])): ?>
<?php
$images = array_filter(preg_split('/,/', $i["images"]));
?>
<?php if(count($images)): ?>
<br>
<?php foreach ($images as $i => $img): if(preg_match("/http/", $img)){ continue; } $img = "https://qq.apinomer.com/cars/".$img; ?>
<a href="<?=$img;?>" class="swipebox"><img src="<?=$img;?>" width="100"></a>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php else: ?>
Ничего не найдено
<?php endif; ?>

View file

@ -0,0 +1,28 @@
<?php
/* @var $this \yii\web\View */
/* @var $items [] */
/* @var $phone int */
/* @var $resultAntiparkon [] */
/* @var $gibddResult [] */
use yii\helpers\Html;
?>
<?php if($items || count($resultAntiparkon) || count($gibddResult)): ?>
<ul>
<?php if(is_array($gibddResult)) foreach($gibddResult as $r): ?>
<li><?=preg_replace("/\w/", "*", $r["number"]);?>, <?=preg_replace("/\w/", "*", $r["model"]);?></li>
<?php endforeach; ?>
<?php if(is_array($resultAntiparkon)) foreach($resultAntiparkon as $r): ?>
<li><?=preg_replace("/\w/", "*", $r["number"]);?>, <?=preg_replace("/\w/", "*", $r["marka"]);?></li>
<?php endforeach; ?>
<?php if(is_array($items)) foreach($items as $i): ?>
<li><?=$i["credate"];?>, <?=preg_replace("/\w/", "*", $i["marka"]." ".$i["model"]);?>, <?=$i["year"];?>г., <?=preg_replace("/\w/", "*", $i["city"]);?>, <?=preg_replace("/\w/", "*", $i["price"]);?>р.</li>
<?php endforeach; ?>
</ul>
<div class="sinfo">
Если хотите увидеть информацию без звездочек - зарегистрируйтесь.
<span class="btns"><a href="#signup" class="buy">Регистрация / Вход</a></span>
</div>
<?php else: ?>
Ничего не найдено
<?php endif; ?>

80
views/search/avito.php Normal file
View file

@ -0,0 +1,80 @@
<?php
/* @var $this \yii\web\View */
/* @var $result array */
/* @var $link string */
/* @var $phone int */
/* @var $searchRequest \app\models\SearchRequest */
use yii\helpers\Html;
use yii\helpers\Url;
?>
<?php if(is_array($result) && count($result)): ?>
<?php
krsort($result);
$earliestDate = new DateTime();
$sumPrice = 0;
foreach ($result as $data) {
$date = new DateTime($data['time']);
if ($date->getTimestamp() < $earliestDate->getTimestamp()) {
$earliestDate = $date;
}
$sumPrice += $data['price'];
}
$avgPrice = count($result) == 0 ? 0 : round($sumPrice / count($result));
?>
<table class="rTable">
<?php foreach(array_slice($result, 0, 3) as $item): ?>
<?php
$item["price"] = \Yii::$app->formatter->asDecimal($item["price"]);
if(!isset($cache) && (!$searchRequest->user_id || !$searchRequest->is_payed)) {
$names = preg_split("/ /", $item["title"]);
$xnames = [];
foreach ($names as $name) {
if(mb_strlen($name) > 2) {
$xnames[] = mb_substr($name, 0, 1) . str_repeat("*", mb_strlen($name) - 2) . mb_substr($name, -1);
} else {
$xnames[] = $name;
}
}
$item["title"] = join(" ", $xnames);
$item["price"] = preg_replace("/\d/", "*", $item["price"]);
}
?>
<tr>
<td><span class="rDate"><?=Yii::$app->formatter->asDatetime($item["time"], "dd.MM.yyyy");?> |</span> <span class="rPrice"><?=$item["price"];?> р.</span></td>
<td><?=Html::a($item["title"], Url::toRoute(["result/avito", "phone" => preg_replace("/^7/", "8", $phone), "id" => $item["Id"]]), ["target" => "_blank"]);?></td>
</tr>
<?php endforeach; ?>
<?php if(!isset($cache) && (!$searchRequest->user_id || !$searchRequest->is_payed)): ?>
<?php if(count($result) > 3): ?>
<tr class="rResult"><td colspan="2" class="rRes">Ещё найдено <?= Yii::t('app', '{n,plural,=1{<strong>одно</strong> объявление} few{<strong>#</strong> объявления} many{<strong>#</strong> объявлений} other{<strong>#</strong> объявления}}', ['n' => count($result)-3]) ?> с этим телефоном, покажем после регистрации</td></tr>
<?php endif; ?>
<?php else: ?>
<tr class="rResult">
<?php if(count($result) > 3): ?>
<td><div class="allRes"><a href="<?=Url::toRoute(["result/avito", "phone" => preg_replace("/^7/", "8", $phone)]);?>">Все результаты: <span><?=count($result);?></span></a></div></td>
<td class="rRes">На авито с <strong><?=\Yii::$app->formatter->asDate($earliestDate, "MMMM yyyy")?>г.</strong> Дал <?= Yii::t('app', '{n,plural,=1{<strong>одно</strong> объявление} few{<strong>#</strong> объявления} many{<strong>#</strong> объявлений} other{<strong>#</strong> объявления}}', ['n' => count($result)]) ?> со средним чеком <strong><?=\Yii::$app->formatter->asCurrency($avgPrice, 'RUB');?></strong></td>
<?php else: ?>
<td colspan="2" class="rRes">На авито с <strong><?=\Yii::$app->formatter->asDate($earliestDate, "MMMM yyyy")?>г.</strong> Дал <?= Yii::t('app', '{n,plural,=1{<strong>одно</strong> объявление} few{<strong>#</strong> объявления} many{<strong>#</strong> объявлений} other{<strong>#</strong> объявления}}', ['n' => count($result)]) ?> со средним чеком <strong><?=\Yii::$app->formatter->asCurrency($avgPrice, 'RUB');?></strong></td>
<?php endif; ?>
</tr>
<?php endif; ?>
</table>
<?php if(!isset($cache)): ?>
<?=$this->render("/_parts/_btns", [
"searchRequest" => $searchRequest,
"message" => "Если хотите увидеть объявления целиком"
]);?>
<?php endif; ?>
<?php else: ?>
<p class="no">Ничего не найдено</p>
<?php endif; ?>

View file

@ -0,0 +1,66 @@
<?php
/* @var $this \yii\web\View */
/* @var $result array */
/* @var $link string */
/* @var $phone int */
use yii\helpers\Html;
use yii\helpers\Url;
?>
<?php if(count($result)): ?>
<?php
krsort($result);
$earliestDate = new DateTime();
$sumPrice = 0;
foreach ($result as $data) {
$date = new DateTime($data['time']);
if ($date->getTimestamp() < $earliestDate->getTimestamp()) {
$earliestDate = $date;
}
$sumPrice += $data['price'];
}
$avgPrice = count($result) == 0 ? 0 : round($sumPrice / count($result));
?>
<table class="rTable">
<?php foreach(array_slice($result, 0, 3) as $item): ?>
<?php
$names = preg_split("/ /", $item["title"]);
$xnames = [];
foreach ($names as $name) {
if(mb_strlen($name) > 2) {
$xnames[] = mb_substr($name, 0, 1) . str_repeat("*", mb_strlen($name) - 2) . mb_substr($name, -1);
} else {
$xnames[] = $name;
}
}
$item["title"] = join(" ", $xnames);
?>
<tr>
<td><span class="rDate"><?=Yii::$app->formatter->asDatetime($item["time"], "dd.MM.yyyy");?> |</span> <span class="rPrice"><?=preg_replace("/\d/", "*", \Yii::$app->formatter->asDecimal($item["price"]));?> р.</span></td>
<td><?=$item["title"];?></td>
</tr>
<?php endforeach; ?>
<tr class="rResult">
<?php if(count($result) > 3): ?>
<td colspan="2" class="rRes">Ещё найдено <?= Yii::t('app', '{n,plural,=1{<strong>одно</strong> объявление} few{<strong>#</strong> объявления} many{<strong>#</strong> объявлений} other{<strong>#</strong> объявления}}', ['n' => count($result)-3]) ?> с этим телефоном, покажем после регистрации</td>
<?php endif; ?>
</tr>
</table>
<div class="sinfo">
Если хотите увидеть все объявления - зарегистрируйтесь.
<span class="btns"><a href="#signup" class="buy">Регистрация / Вход</a></span>
</div>
<?php else: ?>
<p class="no">Ничего не найдено</p>
<?php endif; ?>

7
views/search/dating.php Normal file
View file

@ -0,0 +1,7 @@
<?php
/* @var $this \yii\web\View */
/* @var $result int */
/* @var $time int */
?>
<?=($result)?"<p>Зарегистрирован (А)</p>":"<p class=\"no\">Не зарегистрирован (А)</p>";?>

4
views/search/disable.php Normal file
View file

@ -0,0 +1,4 @@
<?php
/* @var $this \yii\web\View */
?>
<p>Данный блок выключен</p>

31
views/search/facebook.php Normal file
View file

@ -0,0 +1,31 @@
<?php
/* @var $this \yii\web\View */
/* @var $result array */
/* @var $searchRequest \app\models\SearchRequest */
use yii\helpers\Html;
use yii\helpers\Url;
?>
<?php if(count($result)): ?>
<?php foreach($result as $item): ?>
<?php if(isset($item["photo"])) {
$item["photo"] = preg_match('/^http/ium', $item["photo"])?preg_replace("/\'\./", "", $item["photo"]):"data:image/jpg;base64,".$item["photo"];
} ?>
<div class="faceb">
<?php if(isset($item["link"])): ?>
<?=Html::a((isset($item["photo"])?Html::img($item["photo"]):"").$item["name"], isset($item["link"])?$item["link"]:"#", ["target" => "_blank"]);?>
<?php else: ?>
<?=Html::img($item["photo"]).$item["name"];?>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php if(!isset($cache)): ?>
<?=$this->render("/_parts/_btns", [
"searchRequest" => $searchRequest,
"message" => "Если хотите увидеть фотографию, имя и ссылку на профиль"
]);?>
<?php endif; ?>
<?php else: ?>
<p class="no">Ничего не найдено</p>
<?php endif; ?>

74
views/search/free.php Normal file
View file

@ -0,0 +1,74 @@
<?php
/* @var $this \yii\web\View */
/* @var $items array */
/* @var $operator array */
/* @var $searchRequest \app\models\SearchRequest */
use app\models\ResultCache;
use \yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Url;
$names = $photos = [];
if (isset($items)) {
$names = array_filter(ArrayHelper::getColumn($items, "name"));
$names = array_unique($names);
$photos = array_filter(ArrayHelper::getColumn($items, "photo"));
}
if (!isset($jobCount)) $jobCount = 0;
$jobCount = (int)$jobCount;
$time = ((int)$jobCount + 1) * 5;
?>
<?php if($searchRequest->is_payed == -1): ?>
<?php else: ?>
<div class="results clfix">
<?php if(count($names)): ?>
<div class="resLeft">
<div class="result" id="names">
<div class="resultInner resultInnerFirst">
<div class="resultTitle ic2">Информация</div>
<div class="resultCont">
<ul class="names">
<?php foreach ($names as $name): ?>
<li><?=$name;?></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="resRight">
<div class="result" id="avatars">
<div class="resultInner resultInnerFirst">
<div class="resultTitle ic1">Возможные фотографии</div>
<div class="resultCont">
<ul class="photos">
<?php foreach($photos as $photo): ?>
<li><?=Html::img("data:image/jpg;base64,".$photo, ["height" => 200]); ?></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
<?php else: ?>
<p class="payments-info" style="margin-bottom: 50px"><img src="/img/pay/payments_info.png">Демо поиск по <b>2</b> источникам результатов не дал. Полная проверка будет проводится по <b>18</b> источникам, и скорей всего мы найдем для вас информацию.</p>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (false): ?>
<script><?php endif; ?>
<?php ob_start(); ?>
$('.popup').find('.close').bind('click', function () {
$(this).parent().hide();
});
$('.infos li').bind('click', function () {
$('.popup').show();
});
<?php $js = ob_get_contents(); ob_end_clean(); $this->registerJs($js); ?>

25
views/search/google.php Normal file
View file

@ -0,0 +1,25 @@
<?php
/* @var $this \yii\web\View */
/* @var $items array */
/* @var $urls array */
/* @var $phone int */
use yii\helpers\Html;
$items = array_filter($items, function($row) use ($urls) {
list($url) = $row;
$shortUrl = urldecode(preg_replace('/(http|https)\:\/\/(.+?)\/(.*)/', '$2', $url));
return !array_key_exists($shortUrl, $urls);
});
?>
<?php if($items): ?>
<div class="allRes"><?=Html::a("Найдено результатов: <span>".count($items)."</span>", ["result/google", "phone" => preg_replace('/^7/', '8', $phone)], ["target" => "_blank"]);?></div>
<?php if(isset($is_vip) && $is_vip && isset($photos)): ?>
<p>Поиск был по <?=$photos;?> фотографиям</p>
<?php endif;?>
<?php else: ?>
<p class="no">Ничего не найдено</p>
<?php endif; ?>

11
views/search/guest.php Normal file
View file

@ -0,0 +1,11 @@
<?php
/* @var $this \yii\web\View */
use yii\helpers\Url;
?>
<div class="sinfo">
Данные не запрашивались, информация будет доступна после регистрации
<span class="btns">
<a href="#signup" class="buy">Регистрация / Вход</a>
</span>
</div>

View file

@ -0,0 +1,22 @@
<?php
/* @var $this \yii\web\View */
/* @var $result array */
/* @var $searchRequest \app\models\SearchRequest */
use yii\helpers\Html;
use yii\helpers\Url;
?>
<?php if(count($result)): ?>
<?php foreach($result as $item): ?>
<div class="faceb">
<?php if(isset($item["link"])): ?>
<?=Html::a((isset($item["photo"])?Html::img("data:image/jpg;base64,".$item["photo"]):"").\yii\helpers\ArrayHelper::getValue($item, "name", "имя не известно"), isset($item["link"])?$item["link"]:"#", ["target" => "_blank"]);?>
<?php else: ?>
<?=(isset($item["photo"])?Html::img("data:image/jpg;base64,".$item["photo"]):"").$item["name"];?>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php else: ?>
<p class="no">Ничего не найдено</p>
<?php endif; ?>

46
views/search/result.php Normal file
View file

@ -0,0 +1,46 @@
<?php
/* @var $this \yii\web\View */
/* @var $isGuest boolean */
/* @var $index integer */
/* @var $operator array */
/* @var $is_cache boolean */
/* @var $searchRequest \app\models\SearchRequest */
use yii\helpers\Url;
if(!isset($operator)) $operator = false;
?>
<?php if(!$searchRequest->is_payed): ?>
<div class="searchStatusInner <?=$searchRequest->user_id?"searchFinished":"searchErr";?>">
<?php if($operator): ?>
Поиск завершен, <?=\yii\helpers\ArrayHelper::getValue($operator, "operator");?>(<?=\yii\helpers\ArrayHelper::getValue($operator, "region");?>)
<?php else: ?>
Поиск завершен.
<?php endif; ?>
<?php /*<strong>ПОИСК ЗАВЕРШЕН ЧАСТИЧНО</strong>. Вам нужно <a href="#signup">зарегистрироваться</a> и вы сможете увидеть всю информацию. */ ?>
<?php /*Вам нужно <a href="<?=Url::toRoute(["pay/index"]);?>">Купить доступ</a> или взять <a class="free" href="<?=Url::toRoute(["try/index"]);?>">Бесплатный тест</a>*/ ?>
</div>
<?php else: ?>
<?php if($searchRequest->source_id == \app\models\SearchRequest::SOURCE_MOBILE): ?>
<div class="searchStatusInner searchFinished <?=$searchRequest->is_payed==2?"free":"";?>">
<?php if($searchRequest->is_payed == 2): ?>
Поиск бесплатный. Качество <?=$index;?>%. <?php if($operator): ?><?=$operator["operator"];?>(<?=$operator["region"];?>)<?php endif; ?>
<?php else: ?>
Поиск платный. Качество <?=$index;?>%. <?php if($operator): ?><?=$operator["operator"];?>(<?=$operator["region"];?>)<?php endif; ?>
<?php endif; ?>
</div>
<?php else: ?>
<div class="searchStatusInner searchFinished">
<?php if($operator): ?>
Поиск завершен, индекс использования номера <strong><?=$index;?>%</strong>, Оператор - <strong><?=$operator["operator"];?></strong>. Регион - <strong><?=$operator["region"];?></strong>
<?php else: ?>
Поиск завершен, индекс использования номера <strong><?=$index;?>%</strong>.
<?php endif; ?>
<?php if($searchRequest->is_payed == 2): ?>
<br>Проверка была <b style="color: green; font-weight: bold;">бесплатна</b>, так как ничего не найдено!
<?php endif; ?>
</div>
<?php endif;?>
<?php endif; ?>

27
views/search/scorista.php Normal file
View file

@ -0,0 +1,27 @@
<?php
/* @var $this \yii\web\View */
use yii\helpers\ArrayHelper;
use yii\helpers\Json;
/* @var $searchRequest \app\models\SearchRequest */
?>
<?php if(is_null($scoristaResult)): ?>
Ничего не найдено
<?php else: ?>
<?=\yii\helpers\Html::a("Результаты поиска", ["result/scorista", "phone" => preg_replace('/^7/', '8', $searchRequest->phone)]);?>
<?php
$result = Json::decode($scoristaResult);
$items = ArrayHelper::getValue($result, "DetailItems");
?>
<div class="scorista_item">
<?php foreach ($items[0] as $p): ?>
<?php if(preg_match("/паспорт/iu", ArrayHelper::getValue($p, "title"))): continue; endif; ?>
<?php if(trim(ArrayHelper::getValue($p, "value")) === ""): continue; endif; ?>
<p>
<b><?= ArrayHelper::getValue($p, "title"); ?></b>: <?= ArrayHelper::getValue($p, "value"); ?>
</p>
<?php endforeach; ?>
</div>
<?php endif; ?>

21
views/search/sprut.php Normal file
View file

@ -0,0 +1,21 @@
<?php
/* @var $this \yii\web\View */
/* @var $items int */
/* @var $phone string */
use yii\helpers\Url;
if (!$items) {
echo 'Ничего не найдено';
return;
}
$lines = explode("\n", $items);
echo implode("\n", array_splice($lines, 0, 10));
if (count($lines) > 10) {
echo '<div class="allRes"><a href="' . Url::toRoute(["result/scorista", "phone" => $phone]) . '">Подробнее</a></div>';
}

12
views/search/viber.php Normal file
View file

@ -0,0 +1,12 @@
<?php
/* @var $this \yii\web\View */
/* @var $result array */
use yii\helpers\Html;
?>
<?php if(isset($result["photo"])): ?>
<img src="data:image/gif;base64,<?=$result["photo"];?>" height="50" style="margin-right: 7px;">
<?php else: ?>
Фото не найдено
<?php endif; ?>

44
views/search/vk.php Normal file
View file

@ -0,0 +1,44 @@
<?php
/* @var $this \yii\web\View */
/* @var $result array */
/* @var $phone $phone */
/* @var $searchRequest \app\models\SearchRequest */
use yii\helpers\Html;
use yii\helpers\Url;
if($result) foreach($result as $i => $item) {
if(!isset($item["name"])) unset($result[$i]);
}
?>
<?php if(count($result)): ?>
<?php foreach($result as $item): ?>
<?php if(isset($item["photo"])) {
$item["photo"] = preg_match('/^http/ium', $item["photo"])?preg_replace("/\'\./", "", $item["photo"]):"data:image/jpg;base64,".$item["photo"];
} ?>
<div class="vkp">
<?php if(isset($item["link"])): ?>
<?=Html::a((isset($item["photo"])?Html::img($item["photo"]):"").$item["name"], $item["link"], ["target" => "_blank"]);?><br>
<?php elseif(isset($item["id"])):?>
<?=Html::a((isset($item["photo"])?Html::img($item["photo"]):"").$item["name"], "https://vk.com/id".$item["id"], ["target" => "_blank"]);?><br>
<?php else: ?>
<?=(isset($item["photo"])?Html::img($item["photo"]):"").$item["name"];?><br>
<?php endif; ?>
<?php if(isset($item["raw"]) && $searchRequest->user_id && $searchRequest->user->is_vip): ?>
<p><?=$item["raw"];?></p>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php if(!isset($cache)): ?>
<?=$this->render("/_parts/_btns", [
"searchRequest" => $searchRequest,
"message" => "Если хотите увидеть фотографию, имя и ссылку на профиль"
]);?>
<?php endif; ?>
<?php else: ?>
<?php if(isset($is_guest) && $is_guest): ?>
<?=$this->render("guest");?>
<?php else: ?>
<p class="no">Ничего не найдено</p>
<?php endif; ?>
<?php endif; ?>

134
views/search/wecan.php Normal file
View file

@ -0,0 +1,134 @@
<?php
/* @var $this \yii\web\View */
use app\models\RequestResult;
use app\models\ResultCache;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
/* @var $operator array */
/* @var $searchRequest \app\models\SearchRequest */
$inst = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_INSTAGRAM])->one();
$fb = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_FACEBOOK])->one();
$vk2012 = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_VK_2012])->one();
$vkOpen = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_VK_OPEN])->one();
$avito = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_AVITO])->one();
$avitoItems = 0;
if($avito) {
$avitoData = \yii\helpers\Json::decode($avito->data);
$avitoItems = count($avitoData);
}
$avinfo = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_AVINFO_API])->one();
$avinfoItems = 0;
if($avinfo) {
$avinfoData = \yii\helpers\Json::decode($avinfo->data);
if(isset($autoResult["auto"])) {
$avinfoItems = count($avinfoData["auto"]);
}
}
$autoItems = 0;
$antiparkon = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_ANTIPARKON])->one();
if($antiparkon) {
$antiparkonData = \yii\helpers\Json::decode($antiparkon->data);
$autoItems += count($antiparkonData);
}
$gibdd = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_GIBDD])->one();
if($gibdd) {
$gibddData = \yii\helpers\Json::decode($gibdd->data);
$autoItems += count($gibddData);
}
$names = [];
$numbaster = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_NUMBUSTER])->one();
if($numbaster) {
$numbasterData = \yii\helpers\Json::decode($numbaster->data);
$names[] = count($numbasterData);
}
$truecaller = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_TRUECALLER])->one();
if($truecaller) {
$truecallerData = \yii\helpers\Json::decode($truecaller->data);
$names[] = count($truecallerData);
}
$viber = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_VIBER])->one();
if($viber) {
if($viber->index > 0) {
$names[] = 1;
}
}
$telegram = RequestResult::find()->where(["request_id" => $searchRequest->id, "type_id" => ResultCache::TYPE_TELEGRAM])->one();
if($telegram) {
if($telegram->index > 0) {
$names[] = 1;
}
}
?>
<div class="searchStatusInner searchFinished">
<?php if($operator): ?>
Поиск завершен, <?=\yii\helpers\ArrayHelper::getValue($operator, "operator");?>(<?=\yii\helpers\ArrayHelper::getValue($operator, "region");?>)
<?php else: ?>
Поиск завершен.
<?php endif; ?>
</div>
<div class="we-can-found">
<p>По данному номеру телефона мы нашли<br>следующую информацию:</p>
<div>
<div class="--left">
<ul>
<?php if(ArrayHelper::getValue($fb, "index", 0) > 0): ?>
<li><img src="/img/free/fb.png" width="32"><span>Аккаунт на Facebook</span></li>
<?php endif; ?>
<?php if(ArrayHelper::getValue($vk2012, "index", 0) > 0 || ArrayHelper::getValue($vkOpen, "index", 0) > 0): ?>
<li><img src="/img/free/vk.png" width="32"><span>Анкету Вконтакте</span></li>
<?php endif; ?>
<?php if(ArrayHelper::getValue($inst, "index", 0) > 0): ?>
<li><img src="/img/Logo-instagram.png" width="32"><span>Инстаграмм человека</span></li>
<?php endif; ?>
<?php foreach ($names as $ni => $n):?>
<?php if(!$ni): ?>
<li><span>Имя из чужой телефонной книги</span></li>
<?php else: ?>
<li><span>Ещё имя из чужой телефонной книги</span></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<div class="--right">
<ul>
<?php if($avitoItems > 0): ?>
<li><img src="/img/free/avito.png" width="32"><span><?=\Yii::t('app', '{n,plural,=0{Объявлений нет} =1{Одно объявление} one{# объявление} few{# объявления} many{# объявлений} other{# объявления}}', ['n' => $avitoItems]);?> на Avito</span></li>
<?php endif; ?>
<?php if($avinfoItems > 0): ?>
<li><img src="/img/free/autoru.png" width="32" style="margin-top: 8px;"><span><?=\Yii::t('app', '{n,plural,=0{Автомобилей нет} =1{Один автомобиль} one{# автомобиль} few{# автомобиля} many{# автомобилей} other{# автомобиля}}', ['n' => $avinfoItems]);?> которые продавались на auto.ru</span></li>
<?php endif; ?>
<?php if($autoItems > 0): ?>
<li><img src="/img/free/cars.png" width="32" style="margin-top: 8px;"><span><?=\Yii::t('app', '{n,plural,=0{Автомобилей нет} =1{Один автомобиль} one{# автомобиль} few{# автомобиля} many{# автомобилей} other{# автомобиля}}', ['n' => $autoItems]);?> на которых ездил человек</span></li>
<?php endif; ?>
<ul>
</div>
</div>
<p>Чтобы увидеть эти данные. вам необходимо пополнить счёт и выполнить платную проверку</p>
<p>
<?php if ($searchRequest->user_id): ?>
<a href="<?= Url::toRoute(["pay/index"]); ?>" class="button">Купить информацию
за <?= \Yii::$app->params["cost"]; ?> руб.</a>
<?php else: ?>
<a href="#signup" class="button">Регистрация / Вход</a>
<?php endif; ?>
</p>
</div>