Joywork/templates/object-content_remove_advert.php
2026-05-22 21:21:54 +03:00

108 lines
5.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php //var_dump($objRemoveStatsArray[$obj['id']]);
if(!empty($objRemoveStatsArray[$obj['id']])){
$adverts_remove = $objRemoveStatsArray[$obj['id']];
$plases = array('CIAN_JW_FEED'=>'Циан', 'DOMCLICK_JW_FEED'=>'Домклик', 'AVITO_JW_FEED'=>'Авито', 'EMLS_JW_FEED'=>'Jcat', 'YANDEX_JW_FEED'=>'Яндекс');
$plases_img = array('CIAN_JW_FEED'=>'/images/cian.svg', 'DOMCLICK_JW_FEED'=>'/images/domclick.svg', 'AVITO_JW_FEED'=>'/images/avito.svg', 'EMLS_JW_FEED'=>'/images/jcat.svg', 'YANDEX_JW_FEED'=>'/images/yandex.svg');
$gmtmsk = get_time_zone_user();
$time_zone = '';
if($gmtmsk >= 0){
$time_zone = '+'.$gmtmsk.' hour';
} else {
$time_zone = '-'.$gmtmsk.' hour';
}
?>
<div class="object-content__remove_advert source-how" style="margin-top: -7px">
<div class="jw__popup advert__popup source-how__popup" style="margin-top: 50px;margin-left: -30px; min-height: 90px">
<h4>Рекламное размещение</h4>
<div style="position:relative;z-index:1;">
<ul>
<?php
foreach($adverts_remove as $advert){
if(isset($plases[$advert['destination']])){
$marginB = '-8px';
if($advert['destination'] == 'CIAN_JW_FEED')
$marginB = '-6px';
if($advert['unpublish_user_id'] > 0){
$user_adv = mysql_fetch_assoc(mysql_query("SELECT agency, manager, fio, last_name, first_name, middle_name FROM users WHERE id=$advert[unpublish_user_id]"));
$master = '-';
if ($user_adv) {
// if (!$user_adv['fio']) {
if ($user_adv['middle_name']) {
$user_adv['fio'] = $user_adv['last_name'] . " " . $user_adv['first_name'] . " " . $user_adv['middle_name'];
} else {
$user_adv['fio'] = $user_adv['last_name'] . " " . $user_adv['first_name'];
}
//}
if ($user_adv['agency'])
$master = "Агентство $user_adv[fio]";
else if ($user_adv['manager'])
$master = "Менеджер $user_adv[fio]";
else
$master = "Агент $user_adv[fio]";
}
?>
<li>
<span class="note__text note__text-deny">
<img src="<?= $plases_img[$advert['destination']]?>" class="adv_select adv_avito_selected" style="height: 25px; margin: 0px -7px <?= $marginB ?> -8px">
cнят с публикации <?= date('d.m.Y \в H:i', strtotime($time_zone, strtotime($advert['updated_at'])))?> пользователем <?= $master ?>
</span>
</li>
<?php
} else {
$days = date_diff(new DateTime(), new DateTime($advert['publish_end_date']))->days;
?>
<li>
<span class="note__text note__text-deny">
<img src="<?= $plases_img[$advert['destination']]?>" class="adv_select adv_avito_selected" style="height: 25px; margin: 0px -7px <?= $marginB ?> -8px">
снят с размещения <?= date('d.m.Y \в H:i', strtotime($time_zone, strtotime($advert['publish_end_date'])))?> по причине истечения срока размещения <?= $days ?> дней назад.
</span>
</li>
<?php
}
}
}
?>
</ul>
</div>
</div>
<div class="source-how__button" style="display:inline-block">
<!--<a href="javascript: {}" class="advert__status advert__status-outdate" style="float:left; border-bottom: none; margin: 7px 5px 0px 0px;">Снято</a>-->
<?php
if(isset($adverts_remove['CIAN_JW_FEED'])) { ?>
<img class="remove_advert_icone cian" src="/images/cian_error.svg"/>
<?php }
if(isset($adverts_remove['DOMCLICK_JW_FEED'])) {
?>
<img class="remove_advert_icone domclik" src="/images/domclik_error.svg"/>
<?php
}
if(isset($adverts_remove['AVITO_JW_FEED'])) {
?>
<img class="remove_advert_icone avito" src="/images/avito_error.svg"/>
<?php
}
if(isset($adverts_remove['EMLS_JW_FEED'])) {
?>
<img class="remove_advert_icone jcat" src="/images/jcat_error.svg"/>
<?php
} if(isset($adverts_remove['YANDEX_JW_FEED'])) {
?>
<img class="remove_advert_icone yandex" src="/images/yandex_error.svg"/>
<?php } ?>
</div>
</div>
<?php } ?>