Правка для стилей таблиц статистики и категорий

parent 388e38f1
......@@ -43,7 +43,7 @@ return [
'AdMoney' => 'Комиссия AddCPM'
]
],
'transaction' => [
'transactions' => [
'title' => 'Транзакции',
'type' => 'feed_transactions',
'fields' => ['Views','Clicks','Orders','OrderSum'],
......
/* Таблица стилей к странице категорий фида */
/* .feeds-cats */
.feed-title
{
font-size: 16px;
color: #2E6DA4;
font-size: 14px;
font-style: italic;
font-weight: bold;
}
.table.feeds-cats
{
/*font-family: monospace;*/
font-family: 'RobotoCondensed-Regular', sans-serif;
}
.table.feeds-cats tbody
{
display: none;
}
.table.feeds-cats.open tbody
{
display: table-row-group;
}
.table.feeds-cats thead th.data
{
width: 1px;
min-width: 80px;
text-align: right;
}
.table.feeds-cats .cat-title-main,
.table.feeds-cats .cat-title
{
cursor: pointer;
}
.table.feeds-cats span.group
{
display: inline-block;
min-width: 12px;
color: #697075;
cursor: pointer;
}
.table.feeds-cats tbody tr td.percent
{
text-align: right;
}
.table.feeds-cats tbody tr td.percent .edited
{
cursor: pointer;
border-bottom: 1px dashed #697075;
}
.table.feeds-cats tbody tr td.percent .edited.was-edited,
.table.feeds-cats tbody tr td.percent .edited.was-changed
{
color: #009444;
border-color: #009444;
}
.table.feeds-cats tbody tr td.percent .old-value
{
display: none;
color: #697075;
font-size: 11px;
text-decoration: line-through;
}
.table.feeds-cats tbody tr td.percent .editing-wrap
{
display: none;
}
.table.feeds-cats tbody tr td.percent input.percent-input
{
margin-top: -2px;
width: 45px;
text-align: right;
}
.table.feeds-cats tbody tr td.percent
{
}
.table.feeds-cats tbody tr td.percent.own
{
font-family: 'RobotoCondensed-Bold', sans-serif;
}
.table.feeds-cats tbody tr td.percent.inherited
{
font-family: 'RobotoCondensed-Light', sans-serif;
}
.table.feeds-cats tr.feed-cat
{
display: none;
}
.table.feeds-cats tr.feed-cat[data-parent="0"],
.table.feeds-cats tr.feed-cat.open
{
display: table-row;
}
.table.feeds-cats span.group b.open
{
display: none;
}
.table.feeds-cats span.group.open b.closed
{
display: none;
}
.table.feeds-cats span.group.open b.open
{
display: inline;
}
.table.feeds-cats tr.feed-cat .foreign-id
{
font-family: 'RobotoCondensed-Light', sans-serif;
font-size: 14px;
}
.form-actions
{
display: none;
}
.table.feeds-cats .form-actions .btn
{
height: 24px;
line-height: 12px;
}
.font-bold {
font-weight: bold;
}
.b-subdomains-list
{
font-family: 'RalewayRegular', sans-serif;
font-size: 0.8rem;
line-height: 1.625em;
color: #383838;
}
.b-subdomains-list li
{
margin-bottom: 5px;
}
.b-subdomains-list a
{
color: #383838;
text-decoration: none;
}
.b-subdomains-list a.all-domains
{
display: none;
position: absolute;
top: 1px;
right: 1px;
color: #0071BC;
font-size: 14px;
}
.b-subdomains-list a:hover
{
text-decoration: underline;
}
.b-subdomains-list a.font-bold
{
position: absolute;
top: 0px;
color: #2CA02C;
background-color: #F7F7F7;
}
.b-subdomains-list .sub-domain.state-selected
{
font-weight: bold;
}
.b-subdomains-list .sub-domain-chbx,
.b-subdomains-list .main-domain-chbx
{
margin-right: 5px;
}
.b-subdomains-list.sub-list
{
margin-left: 10px;
margin-top: 30px;
overflow: hidden;
height: 170px;
}
.b-subdomains-list.sub-list:hover
{
overflow-y: scroll;
}
/*
.b-content__losses-right table tr > th:nth-child(2),
.b-content__losses-right table tr > th:nth-child(3),
.b-content__losses-right table tr > th:nth-child(4),
.b-content__losses-right table tr > th:nth-child(5),
.b-content__losses-right table tr > th:nth-child(6),
.b-content__losses-right table tr > th:nth-child(7),
.b-content__losses-right table tr > th:nth-child(8),
.b-content__losses-right table tr > th:nth-child(9)
*/
.b-content__losses-right table tr > th
{
font-family: 'RalewayRegular', sans-serif;
/*font-size: 0.8rem;*/
font-size: 13px;
font-weight: bold;
line-height: 1.625em;
color: #383838;
}
.b-content__losses-right table tr > th.total
{
font-size: 15px;
}
.b-content__losses-right table.short tr > th.money
{
font-size: 15px;
}
.b-content__work {
padding: 70px 0 70px;
background: rgba(185, 203, 209, 0.2);
}
.b-content__work h1 {
margin-bottom: 55px;
text-align: center;
}
.b-add-car__form-item.droplist.chart-dates
{
flex: 1 0 200px;
max-width: 200px;
}
.table-striped.full .block-info
{
}
.table-striped.short .block-info
{
display: none;
}
.table-striped tbody tr td
{
font-size: 12px;
}
.table-striped tbody tr td:first-child
{
font-size: 14px;
}
.table-striped thead.metric tr th
{
border-top: 0;
}
.table-striped thead tr th,
.table-striped tfoot tr td
{
font-weight: bold;
text-align: right;
font-size: 12px;
}
.table-striped thead tr th.minstat-common-th
{
padding: 8px 0 2px 40px;
text-align: center;
border-bottom: none;
}
.table-striped thead tr th.minstat-item-th
{
padding: 0 4px 4px 4px;
width: 1px;
text-align: right !important;
font-size: 11px !important;
}
.table-striped thead tr th.minstat-item-th b
{
/*font-weight: normal;*/
}
.table-striped thead tr th:first-child,
.table-striped tfoot tr td:first-child
{
font-size: 14px;
}
.table-striped.full thead tr th.total,
.table-striped.full tfoot tr td.total,
.table-striped.full tbody tr td.total,
.table-striped.short thead tr th.money,
.table-striped.short tfoot tr td.money,
.table-striped.short tbody tr td.money
{
font-size: 14px;
}
.table-striped tbody tr td
{
text-align: right;
font-family: monospace;
}
.table-striped tbody tr td.in-common-group
{
/*padding: 8px 8px;*/
}
.table-striped tbody tr td .double-val
{
display: inline-block;
}
.table-striped.compare thead tr th b
{
display: inline-block;
/*
min-width: 65px;
text-align: left;
*/
}
.table-striped tbody tr td span.diff
{
display: block;
font-size: 11px;
color: #2CA02C;
/*
float: right;
margin-top: 10px;
margin-left: 5px;
font-size: 11px;
color: #2CA02C;
min-width: 35px;
text-align: left;
*/
}
.table-striped tbody tr td span.diff.negative
{
color: #FF0000;
}
.table-striped thead tr th:first-child,
.table-striped tfoot tr td:first-child,
.table-striped tbody tr td:first-child
{
text-align: left;
}
.table-striped tbody tr.time-not-come
{
color: #999999;
}
.table-striped tbody tr.time-not-come .diff
{
color: #6BC36B;
}
.table-striped tbody tr.time-not-come .diff.negative
{
color: #FF8888;
}
.table-striped.user.full thead tr th.block_money,
.table-striped.user.full tfoot tr td.block_money,
.table-striped.user.full tbody tr td.block_money
{
color: #FF0000;
}
.table-striped.user.full thead tr th.money,
.table-striped.user.full tfoot tr td.money,
.table-striped.user.full tbody tr td.money
{
color: #2CA02C;
}
.table-striped.admin.full thead tr th.block_money,
.table-striped.admin.full tfoot tr td.block_money,
.table-striped.admin.full tbody tr td.block_money,
.table-striped.admin.full thead tr th.income,
.table-striped.admin.full tfoot tr td.income,
.table-striped.admin.full tbody tr td.income
{
color: #2CA02C;
}
.table-striped.admin.full thead tr th.money,
.table-striped.admin.full tfoot tr td.money,
.table-striped.admin.full tbody tr td.money
{
color: #FF0000;
}
.table-striped.full thead tr th.total,
.table-striped.full tfoot tr td.total,
.table-striped.full tbody tr td.total
{
font-weight: bold;
}
......@@ -170,19 +170,19 @@ input[type="checkbox"]
font-family: monospace;
}
.table.table-striped.admin.transaction
.table.table-striped.admin.transactions
{
font-size: 13px;
}
.table.table-striped.admin.transaction thead
.table.table-striped.admin.transactions thead
{
color: #337ab7;
line-height: 14px;
font-weight: bold;
}
table.table-striped.admin.transaction tbody
table.table-striped.admin.transactions tbody
{
font-size: 12px;
}
......@@ -209,24 +209,24 @@ input[type="checkbox"]
border-bottom: 2px solid red;
}
.table.table-striped.admin.transaction thead tr th.OrderSum
.table.table-striped.admin.transactions thead tr th.OrderSum
{
text-align: right;
}
.table.table-striped.admin.viewid thead tr th,
.table.table-striped.admin.transaction.viewid thead tr th.OrderSum
.table.table-striped.admin.transactions.viewid thead tr th.OrderSum
{
width: 1px;
}
.table.table-striped.admin.transaction.viewid thead tr th.Basket
.table.table-striped.admin.transactions.viewid thead tr th.Basket
{
width: 550px;
}
/* .b-basket-content */
.table.table-striped.admin.transaction thead tr th.period
.table.table-striped.admin.transactions thead tr th.period
{
min-width: 100px;
}
......@@ -279,7 +279,7 @@ input[type="checkbox"]
.table.table-striped.admin.transaction thead tr th.OrderSum
.table.table-striped.admin.transactions thead tr th.OrderSum
{
width: 100px;
}
......@@ -289,18 +289,18 @@ input[type="checkbox"]
padding: 2px;
}
.table.table-striped.admin.transaction td.OrderSum
.table.table-striped.admin.transactions td.OrderSum
{
font-weight: bold;
text-align: right;
}
.table.table-striped.admin.transaction td.Pages
.table.table-striped.admin.transactions td.Pages
{
text-align: center;
}
.table.table-striped.admin.transaction tbody tr.total-orders
.table.table-striped.admin.transactions tbody tr.total-orders
{
font-weight: bold;
font-size: 13px;
......
......@@ -98,7 +98,7 @@ $(document).ready(function(){
sortField = 'period';
isDesc = true;
break;
case 'transaction':
case 'transactions':
sortField = 'Timestamp';
isDesc = true;
break;
......@@ -183,8 +183,8 @@ $(document).ready(function(){
$row.appendTo($tableContent);
}
// Добавляем строку "Всего заказов" для отчета 'transaction':
if (dataLineChartStat.report == 'transaction') {
// Добавляем строку "Всего заказов" для отчета 'transactions':
if (dataLineChartStat.report == 'transactions') {
$row = $('<tr class="total-orders">');
$row.append($('<td>').html("Всего заказов: " + dataPeriod.length));
......@@ -227,7 +227,7 @@ $(document).ready(function(){
RenderInterval(dataLineChartStat);
}
if (dataLineChartStat.report == 'transaction') {
if (dataLineChartStat.report == 'transactions') {
RenderInterval(dataLineChartStat);
}
......
......@@ -126,7 +126,7 @@ class Cabinet extends Common
$periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates, $report_conf);
//$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
break;
case 'transaction':
case 'transactions':
$periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates, $report_conf);
break;
default:
......@@ -170,7 +170,7 @@ class Cabinet extends Common
/** @var \App\Model\Feeds\Shops $shopsModel */
$shopsModel = $this->container->get(\App\Model\Feeds\Shops::class);
$shop = $shopsModel->findOne(['users_id' => $userId]);
$shop = $shopsModel->findOne(['users_id' => $userId]); // Пока считаем, что у фида один магазин
if($shop) {
......@@ -327,7 +327,7 @@ class Cabinet extends Common
$periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates, $report_conf);
//$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
break;
case 'transaction':
case 'transactions':
$periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates, $report_conf);
break;
default:
......
......@@ -174,7 +174,7 @@ class ViewId extends Common
$periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates, $report_conf);
//$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
break;
case 'transaction':
case 'transactions':
$periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates, $report_conf);
break;
default:
......
......@@ -54,7 +54,7 @@ class Statistics
);
}
if ($report_type == 'transaction') {
if ($report_type == 'transactions') {
$dataRequest = array(
'method' => $type,
'data' => array(
......@@ -237,8 +237,8 @@ class Statistics
$dataStats['period'] = $period;
}
// Данные для отчета 'transaction':
if ($report_type == 'transaction') {
// Данные для отчета 'transactions':
if ($report_type == 'transactions') {
foreach ($stats['data'] as $item) {
$dataStats['period'][] = $item['ForeignID'];
$dataStats['ViewID'][] = [$item['FeedID'], $item['ViewID']];
......
<?php
/**
* Copyright (c) 2017 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('/js/script-set-prof.js')
;
$this->headLink()
->appendStylesheet('/css/styles-set-prof.css')
;
/** @var \App\Entity\Contacts $contacts */
$contacts = $this->contacts;
?>
<section class="b-content__form">
<div class="wrapp">
<form action="<?= $this->url('adm.contacts', [
'lang' => $this->lang,
])?>" method="post" class="b-content__form-set" name="setting">
<div class="row">
<label for="phones" class="col sm-2 b-content__form-set-item-label">
<p class="text"><?= _t("Телефоны") ?> </p>
</label>
<textarea class="col"
id="phones"
name="phones"
rows="6"><?= implode(PHP_EOL, $contacts->getPhones()) ?></textarea>
</div>
<div class="row">
<label for="mails" class="col sm-2 b-content__form-set-item-label">
<p class="text"><?= _t("Почта") ?> </p>
</label>
<textarea class="col"
id="mails"
name="mails"
rows="3"><?= implode(PHP_EOL, $contacts->getMails()) ?></textarea>
</div>
<div class="row">
<label for="skypes" class="col sm-2 b-content__form-set-item-label">
<p class="text"><?= _t("Skype") ?> </p>
</label>
<textarea class="col"
id="skypes"
name="skypes"
rows="3"><?= implode(PHP_EOL, $contacts->getSkypes()) ?></textarea>
</div>
<div class="row">
<input class="col" type="submit" name="submit" value="<?= _t('Сохранить') ?>">
</div>
</form>
</div>
</section>
</main>
<?php
/**
* Copyright (c) 2017 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->addTemplate('adm::faq/scripts');
/** @var $layoutInfo \App\Entity\LayoutInfo */
$layoutInfo = $this->layoutInfo;
/** @var \App\Entity\FAQ\Category[] $categories */
$categories = $this->categories;
$renderedItems = [];
/** @var \App\Entity\FAQ\Item[] $items */
$items = $this->items;
// @fixme seems there some output buffer bug
// first value of loop foreach ($items[$category->getId()] as $itemKey => $item) rendered as ''
// it's a quick fix and required detailed research
$this->partial('adm::dummy', []);
?>
<form method="post" action="<?= $this->url('adm.faq', []) ?>">
<section class="b-content__title">
<div class="wrapp">
<h1><?= _t("Помощь") ?></h1>
<div class="row">
<p class="lead col sm-offset-1 sm-10"><?= _t("Вопросы с которыми чаще всего сталкиваются наши клиенты") ?></p>
</div>
</div>
</section>
<section class="b-content__accordeon">
<div class="wrapp row">
<div class="b-content__accordeon-category col sm-offset-1 sm-10">
<?php
/** @var \App\Entity\FAQ\Category $category */
foreach ($categories as $category) :
?>
<div class="b-content__accordeon-category-inner m-content__accordeon-category-inner_<?= $category->getId() ?>">
<h2 class="b-content__accordeon-category-title" data-open-category><?= $category->getName() ?>
<button class="btn btn-primary" role="button" type="button" data-action="<?= $this->url('adm.faq.category.edit', [
'id' => $category->getId(),
'lang' => $this->lang
]) ?>"><?= _t('Edit') ?></button>
<div class="btn-group" role="group">
<button type="button" role="button" class="btn btn-primary <?= $category->getHidden() ? '': 'btn-danger' ?>"
data-toggle
data-activate="<?= $this->url('adm.faq.category.activate', [
'id' => $category->getId(),
'lang' => $this->lang,
]) ?>"
data-activate-caption="<?= _t('Activate') ?>"
data-hide="<?= $this->url('adm.faq.category.hide', [
'id' => $category->getId(),
'lang' => $this->lang,
]) ?>"
data-hide-caption="<?= _t('Hide') ?>"
data-value="<?= $category->getHidden() ? 'data-activate' : 'data-hide' ?>"
>
<?= $category->getHidden() ? _t('Activate') : _t('Hide') ?>
</button>
</div>
</h2>
<div class="wrapp-category">
<?php /** @var \App\Entity\FAQ\Item $item */
if ($items[$category->getId()]) {
foreach ($items[$category->getId()] as $itemKey => $item) { ?>
<?= $this->partial('adm::/faq/category-item', [
'itemKey' => $itemKey,
'item' => $item,
'lang' => $this->lang,
'addScripts' => false,
'showButtons' => true,
]);
}
}
?>
<div class="b-content__accordeon-category-item">
<div class="b-content__accordeon-category-item-title lead" data-number='+'>
<button role="button" type="button" class="btn btn-primary" data-action="<?= $this->url('adm.faq.item.create', [
'categoriesId' => $category->getId(),
'lang' => $this->lang,
]); ?>"><?= _t("Добавить новый вопрос/ответ")?></button>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
</form>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
/** @var $itemKey int */
/** @var $item \App\Entity\FAQ\Item */
$item = $this->item;
$itemKey = $this->itemKey ?? 1;
/**
* if mode NOT partial render -> add scripts
* layot should reneder headLink and headScript
*/
$addScripts = $this->addScripts;
if ($addScripts) {
$this->partial('adm::faq/scripts');
}
?>
<div class="b-content__accordeon-category-item">
<div class="b-content__accordeon-category-item-title lead" data-number='<?= $itemKey ?>'>
<?= $item->getName() ?>
<?php if ($this->showButtons) : ?>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group" role="group">
<button type="button" role="button" class="btn btn-primary" data-action="<?= $this->url('adm.faq.item.edit', [
'id' => $item->getId(),
'lang' => $this->lang,
]) ?>">Edit</button>
</div>
<div class="btn-group" role="group">
<button type="button" role="button" class="btn btn-primary <?= $item->getHidden() ? '': 'btn-danger' ?>"
data-toggle
data-activate="<?= $this->url('adm.faq.item.activate', [
'id' => $item->getId(),
'lang' => $this->lang,
]) ?>"
data-activate-caption="<?= _t('Activate') ?>"
data-hide="<?= $this->url('adm.faq.item.hide', [
'id' => $item->getId(),
'lang' => $this->lang,
]) ?>"
data-hide-caption="<?= _t('Hide') ?>"
data-value="<?= $item->getHidden() ? 'data-activate' : 'data-hide' ?>"
>
<?= $item->getHidden() ? _t('Activate') : _t('Hide') ?>
</button>
</div>
</div>
<?php endif; ?>
</div>
<article class="b-content__accordeon-category-item-article">
<div class="wrapp">
<?= $item->getContent() ?>
</div>
</article>
</div>
<?php
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
/** @var \App\Entity\FAQ\Category $category */
$category = $this->category;
$this->partial('adm::faq/scripts');
?>
<section class="b-content__work">
<form method="post" action="<?= $this->url('adm.faq.category.edit', [
'lang' => $this->lang,
'id' => $category->getId()])
?>">
<div class="row wrapp">
<div class="col">
<div class="panel xs-10 <?= $this->error ? 'panel-danger' : 'panel-info'?>">
<div class="panel-heading">
</div>
<div class="panel-body">
<textarea name="name"><?= $category->getName() ?></textarea>
</div>
<div class="panel-footer">
<button role="button" type="submit" class="btn btn-primary"><?= _t('Сохранить и перейти в переводы') ?></button>
<a role="button" class="btn btn-success" href="<?= $this->url('adm.faq', ['lang' => $this->lang]) ?>"><?= _t('Вернуться к списку категорий') ?></a>
</div>
</div>
</div>
</div>
</form>
</section>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
/** @var $itemKey int */
/** @var $item \App\Entity\FAQ\Item */
/** @var $this \Zend\View\Renderer\PhpRenderer */
/** @var \App\Entity\FAQ\Item $item */
$item = $this->item;
$this->partial('adm::faq/scripts');
$this->headScript()
->appendFile('/js/markitup/jquery.markitup.js')
->appendFile('/js/markitup/sets/textile/set.js')
;
$this->headLink()
->appendStylesheet('/js/markitup/skins/markitup/style.css')
->appendStylesheet('/js/markitup/sets/textile/style.css')
;
?>
<section class="b-content__work">
<form method="post" action="<?= $item->getId() ?
$this->url('adm.faq.item.edit', [
'lang' => $this->lang,
'id' => $item->getId()]) :
$this->url('adm.faq.item.create', [
'lang' => $this->lang,
'id' => $item->getFaqCategoriesId()])
?>">
<div class="row wrapp">
<div class="col">
<div class="panel xs-10 <?= $this->error ? 'panel-danger' : 'panel-info'?>">
<div class="panel-heading">
<h1><input type="text" name="name" value="<?= $this->escapeHtml($item->getName()) ?>"></h1>
</div>
<div class="panel-body">
<textarea name="content" data-item><?= $this->escapeHtml($item->getContent()) ?></textarea>
</div>
<div class="panel-footer">
<button role="button" type="submit" name="<?= \App\Action\Admin\FAQ::ACTION_ITEM_SAVE_AND_CONTINUE ?>" class="btn btn-primary"><?= _t('Сохранить и продолжить редактирование') ?></button>
<button role="button" type="submit" name="<?= \App\Action\Admin\FAQ::ACTION_ITEM_SAVE_AND_TRANSLATE ?>" class="btn btn-primary"><?= _t('Сохранить и перейти в переводы') ?></button>
<a role="button" class="btn btn-success" href="<?= $this->url('adm.faq', ['lang' => $this->lang]) ?>"><?= _t('Вернуться к списку категорий') ?></a>
</div>
</div>
</div>
</div>
</form>
</section>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
$this->headScript()
->appendFile('//cdnjs.cloudflare.com/ajax/libs/autosize.js/3.0.18/autosize.min.js')
->appendFile('/js/script-help.js')
->appendFile('/js/adm/help.js')
;
$this->headLink()
->appendStylesheet('/css/styles-help.css')
;
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('/js/adm/feed-page.js')
;
$this->headLink()
->appendStylesheet('/css/styles-feeds-system.css')
;
/** @var $layoutInfo \App\Entity\LayoutInfo */
$layoutInfo = $this->layoutInfo;
$lang = $this->lang;
$feed = $this->feed;
$currencies = $this->currencies;
$formats = $this->formats;
$users = $this->users;
$link_feeds_list = $this->url('adm.feeds', ['lang' => $lang]);
$link_cancel = $this->url('adm.feeds', ['lang' => $lang]);
if($feed)
{
$feed_id = $feed->getId();
$feed_title = $feed->getTitle();
$feed_active = $feed->getActive() ? 'checked' : '';
$feed_clientid = $feed->getClientid();
$feed_url = $feed->getUrl();
$feed_format = $feed->getFormat();
$feed_status = $feed->getStatus();
$feed_defaultcur = $feed->getDefaultcur();
$feed_goodscount = $feed->getGoodscount();
$form_link = $this->url('adm.feed.edit', ['lang' => $lang, 'id' => $feed_id]);
}
else
{
$feed_active = 'checked';
$form_link = $this->url('adm.feed.create',['lang' => $lang]);
}
?>
<section class="b-content__work inner">
<form id="feed-create-form" method="post" action="<?= $form_link ?>">
<div class="panel panel-info">
<!-- Header -->
<div class="panel-heading">
<h1>
<a href="<?=$link_feeds_list ?>">Фиды</a> /
<?php if ($feed): ?>
<span class="offer-id" data-id="<?= $feed_id ?>"><?= $feed_id ?></span> /
<?php else: ?>
<span class="offer-id" data-id="0">Новый</span> /
<?php endif; ?>
</h1>
</div>
<div class="panel-body">
<!-- Активный фид -->
<div class="form-group feed-enable">
<input type="checkbox" id="feed-active" <?=$feed_active ?>>
<label for="feed-active"><?= _t('Активный')?></label>
</div>
<div class="b-left">
<!-- Название -->
<div class="form-group">
<label for="feed-title"><?= _t('Название')?></label>
<input type="text" class="form-control" id="feed-title" name="title" value="<?= $feed_title?>" placeholder="<?= _t('Название') ?>">
</div>
<!-- URL -->
<div class="form-group">
<label for="feed-url"><?= _t('URL')?></label>
<input type="text" class="form-control" id="feed-url" name="url" value="<?= $feed_url?>" placeholder="<?= _t('url') ?>">
</div>
</div>
<div class="b-right">
<!-- Пользователь -->
<div class="form-group">
<label for="feed-clientid"><?= _t('Пользователь')?></label>
<select class="form-control" id="feed-clientid" name="clientid" style="width: 250px;">
<option value="0" ><?= _t('Выберите пользователя') ?></option>
<?php foreach($users as $userId => $userName): ?>
<option value="<?= $userId?>" <?= ($userId == $feed_clientid ? 'selected' : '')?> ><?= $userName ?></option>
<?php endforeach; ?>
</select>
</div>
<!-- Format -->
<div class="form-group">
<label for="feed-format"><?= _t('Формат')?></label>
<select class="form-control" id="feed-format" name="format" style="width: 250px;">
<option value="0"><?= _t('не указано') ?></option>
<?php foreach($formats as $format): ?>
<option value="<?= $format?>" <?= ($format == $feed_format ? 'selected' : '')?> ><?= $format ?></option>
<?php endforeach; ?>
</select>
</div>
<!-- DefaultCUR -->
<div class="form-group">
<label for="feed-defaultcur"><?= _t('Основная валюта')?></label>
<select class="form-control" id="feed-defaultcur" name="defaultcur" style="width: 250px;">
<option value="0" ><?= _t('не указано') ?></option>
<?php foreach($currencies as $currencyCode => $name): ?>
<option value="<?= $currencyCode?>" <?= ($currencyCode == $feed_defaultcur ? 'selected' : '')?> ><?= $currencyCode?> (<?= $name?>)</option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="b-clear"></div>
<!-- Сохранить / Отмена -->
<button type="submit" class="btn btn-primary"><?= _t('Сохранить')?></button>
<a class="btn btn-default cancel-action" href="<?= $link_cancel ?>"><?= _t('Отмена')?></a>
</div>
</div>
</form>
</section>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('/js/adm/feeds.js')
;
$this->headLink()
->appendStylesheet('/css/styles-offers-list.css')
;
$lang = $this->lang;
$feeds = $this->feeds;
$btn_create_link = $this->url('adm.feed.create', [
'lang' => $lang,
]);
$form_link = $this->url('adm.feed.edit',['lang' => $lang, 'id' => 0]);
?>
<section class="b-content__work">
<div class="panel panel-info">
<div class="panel-heading">
<h1 style="padding: 0 0 10px 0;"><?= _t('Список фидов') ?></h1>
<div class="btn-toolbar">
<div class="btn-group" role="group">
<a class="btn btn-primary" href="<?= $btn_create_link ?>"><?= _t('Добавить фида') ?></a>
</div>
</div>
</div>
<div class="panel-body all" style="min-height: 500px;">
<?php /* ?>
<div class="b-offers-list_controls form-group">
<span><?= _t('Отображать:') ?></span>
<select class="form-control items-select data-active">
<option value=""><?= _t('все') ?></option>
<option value="enabled"><?= _t('активные') ?></option>
<option value="disabled"><?= _t('не активные') ?></option>
</select>
<span class="b-data-item_action">
<span class="mark-count">выделено: <b></b></span>&emsp;
</span>
</div>
<?php */ ?>
<table class="table table-striped offers" id="table2excel" data-action="<?= $form_link ?>" data-content="feeds">
<thead>
<tr>
<th width="110px"><input class="select-all" type="checkbox"><b class="action hidden activate" title="сделать активными"></b><b class="action hidden deactivate" title="сделать неактивными"></b><span class="sort" data-sort="id" data-sortasc="1">#ID</span></th>
<th><span class="sort" data-sort="title" data-sortasc="1">Название<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
<th><span class="sort" data-sort="clientid" data-sortasc="1">Пользователь<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
<th><span class="sort" data-sort="url" data-sortasc="1">URL<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
<th><span class="sort" data-sort="format" data-sortasc="1">Format<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
<th><span class="sort" data-sort="status" data-sortasc="1">Status<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
<th><span class="sort" data-sort="defaultcur" data-sortasc="1">DefaultCUR<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
<th><span class="sort" data-sort="goodscount" data-sortasc="1">GoodsCount<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
<th><span class="sort" data-sort="lastcheck" data-sortasc="1">LastCheck<b class="asc">&#9650;</b><b class="desc">&#9660;</b></span></th>
</tr>
</thead>
<tbody>
<?php foreach ($feeds as $feed) : ?>
<tr <?= (!$feed['active'] ? 'class="disabled"' : '')?>>
<td>
<input class="is-active" type="checkbox">
<span class="feed-id"><?= $feed['id'] ?></span>
</td>
<td class="row-user">
<?php
$btn_link = $this->url('adm.feed.edit', [
'lang' => $this->lang,
'id' => $feed['id'],
]);
?>
<span class="feed-title"><a href="<?= $btn_link?>"><?= $feed['title'] ?></a></span>
</td>
<td>
<span class="feed-clientid"><?= $feed['clientid'] ?></span>
</td>
<td>
<span class="feed-url"><?= $feed['url'] ?></span>
</td>
<td>
<span class="feed-format"><?= $feed['format'] ?></span>
</td>
<td>
<span class="feed-status"><?= $feed['status'] ?></span>
</td>
<td>
<span class="feed-defaultcur"><?= $feed['defaultcur'] ?></span>
</td>
<td>
<span class="feed-goodscount"><?= $feed['goodscount'] ?></span>
</td>
<td>
<span class="feed-lastcheck"><?= $feed['lastcheck'] ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="panel-footer">
</div>
</div>
</section>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
//->appendFile('/js/script-main.js')
//->appendFile('/js/adm/main.js')
->appendFile('//cdnjs.cloudflare.com/ajax/libs/autosize.js/3.0.18/autosize.min.js')
->appendFile('/js/jquery.cookie.js')
->appendFile('/js/underscore-min.js')
->appendFile('/js/c3.min.js')
->appendFile('/js/d3.min.js')
->appendFile('/js/script-cabinet.js')
;
$this->headLink()
//->appendStylesheet('/css/styles-main.css')
//->appendStylesheet('/css/styles-main-550.css', 'all and (max-width: 550px)')
->appendStylesheet('/css/styles-cabinet.css')
->appendStylesheet('/css/styles-cabinet-550.css', 'all and (max-width: 550px)')
->appendStylesheet('/css/styles-cabinet-stats.css')
->appendStylesheet('/css/c3.css')
->appendStylesheet('/css/styles-support-index.css')
;
$identity = $this->identity();
$periodStats = $this->periodStats;
$sitesStats = $this->sitesStats;
$subDomains = $this->subDomains;
$dateRange = $this->dateRange;
$currency = $this->currency;
$sitesFilters = $this->sitesFilters;
$listDomainsFilters = $this-> listDomainsFilters;
$segments = $this->segments;
$countries = $this->countries;
$listDomains = $this->listDomains;
$siteStat = $this->siteStat;
switch ($currency['code']) {
case 'USD':
$symb = '&#36;';
break;
case 'UAH':
$symb = '&#8372;';
break;
case 'RUR':
$symb = '&#8381;';
break;
}
?>
<?php if ($siteStat): ?>
<span id="site-stat"></span>
<?php endif; ?>
<?php /* Выпадающие списки сайтов и валют */ ?>
<section class="b-content__site">
<div class="wrapp row row-wrap">
<div id="sites-dropdown" class="b-content__site-droplits droplist col sm-4 xs-12">
<span class="droplist-current text bold tab-input"></span>
<ul class="droplist-block">
<li class="droplist-item text" data-id="all"><?= _t('Все') ?></li>
<?php if ($sitesFilters): ?>
<?php foreach ($sitesFilters as $site) :?>
<li class="droplist-item text" data-id="<?= $site['site'] ?>" data-segment="<?= $site['segment'] ?>" data-country="<?= $site['country'] ?>" data-manager="<?= $site['manager'] ?>" data-src-icon-site='http://<?= $site['site'] ?>/favicon.ico'><?= $site['site'] ?></li>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($listDomains): ?>
<?php foreach ($listDomains as $main_domain) :?>
<li class="droplist-item text" data-id="<?= $main_domain ?>" data-src-icon-site='http://<?= $main_domain ?>/favicon.ico'><?= $main_domain ?></li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
<div class="b-content__site-currency">
<form action="" class="b-content__form-set" name="setting" data-url="<?= $this->url('adm.profile', ['lang' => $this->lang]) ?>" data-url-success="<?= $this->url('adm.index', ['lang' => $this->lang]) ?>">
<div>
<span class="input input--akira currency">
<?php $currencies = $this->currencies; ?>
<input class="input__field input__field--akira" type="hidden" id="setting-money" name="currency" value="<?= $currency['code'] ?>"/>
<span class="droplist-current text bold tab-input" data-symbol="<?=$symb ?>"><?= $currency['code'] ?> (<?= _t($currency['name']) ?>)</span>
<ul class="droplist-block">
<?php foreach($currencies as $code => $name): ?>
<li class="droplist-item text" data-id="<?= $code?>"><?= $code?> (<?= $name?>)</li>
<?php endforeach ?>
</ul>
</span>
</div>
</form>
</div>
</div>
</section>
<textarea id="period-stats" style="display: none;"><?= ($periodStats ? json_encode($periodStats) : '')?></textarea>
<textarea id="sites-stats" style="display: none;"><?= ($sitesStats ? json_encode($sitesStats) : '')?></textarea>
<?php /* Список фильтров */ ?>
<?php if(in_array($identity->getRoleId(), ['admin']) && !$siteStat): ?>
<div class="wrapp filters">
<div>
<div class="btn-group">
<a role="button" class="btn btn-primary add-filter" href="#"><?= _t('Добавить фильтр') ?></a>
</div>
</div>
<div class="patterns">
<div class="filter" style="clear: both;">
<div class="form-group">
<select class="form-control user-filter" name="filter">
<option value="" ><?= _t('Выберите фильтр') ?></option>
<option value="country">Страна</option>
<option value="segment">Сегмент</option>
<option value="manager">Менеджер</option>
</select>
</div>
</div>
<div class="form-group segment">
<select class="form-control user-segment" name="segment">
<option value="" ><?= _t('Выберите сегмент') ?></option>
<?php foreach($segments as $segment): ?>
<option value="<?= $segment?>"><?= $segment?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group country">
<select class="form-control user-country" name="country">
<option value="" ><?= _t('Выберите страну') ?></option>
<?php foreach($countries as $countryCode => $name): ?>
<option value="<?= $countryCode?>"><?= $name?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group manager">
<select class="form-control user-manager" name="manager">
<option value="" ><?= _t('Выберите менеджера') ?></option>
<?php foreach($managers as $id => $name): ?>
<option value="<?= $id?>"><?= $name?></option>
<?php endforeach ?>
</select>
</div>
<div class="delete-filter">&#215;</div>
</div>
</div>
<div style="clear: both;"></div>
<?php endif; ?>
<?php /* Список доменов-поддоменов и сводная таблица */ ?>
<section class="b-content__losses">
<div class="wrapp row row-wrap">
<div class="b-content__losses-left col sm-4 xs-5">
<div class="b-content__losses-left-item">
<?php if(count($listDomainsFilters)): ?>
<ul id="domains-list" class="b-subdomains-list main-list">
<a class="all-domains" href="#">все сайты &rarr;</a>
<?php foreach ($listDomainsFilters as $main_domain) :?>
<li>
<a class="main-domain" data-domain="<?= $main_domain['site'] ?>" data-id="<?= $main_domain['site'] ?>" data-segment="<?= $main_domain['segment'] ?>" data-manager="<?= $main_domain['manager'] ?>" data-country="<?= $main_domain['country'] ?>" href="#">
<?= $main_domain['site'] ?>
</a>
<ul class="b-subdomains-list sub-list" style="display: none;"></ul>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if(count($listDomains)): ?>
<ul id="domains-list" class="b-subdomains-list main-list">
<a class="all-domains" href="#">все сайты &rarr;</a>
<?php foreach ($listDomains as $main_domain) :?>
<li>
<a class="main-domain" data-domain="<?= $main_domain ?>" data-id="<?= $main_domain?>" href="#">
<?= $main_domain ?>
</a>
<ul class="b-subdomains-list sub-list" style="display: none;"></ul>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
<div class="b-content__losses-right col sm-8 xs-7">
<div class="b-content__no-data">Данных по этому домену в системе нет</div>
<div class="b-content__loading summary"></div>
<?php
$is_block_hits = false;
$block_hits_class = 'short';
if ($summaryReport) {
foreach ($summaryReport as $range => $value) {
if ($value['block_hits'] && $value['block_hits'] != 0)
{
$is_block_hits = true;
$block_hits_class = 'full';
break;
}
}
}
?>
<table id="summary-report-table" class="admin <?=$block_hits_class ?>">
<thead>
<tr>
<th></th>
<th></th>
<th class="block-info"><?= _t('Показы блоков') ?></th>
<th class="block-info block_money"><?= _t('Сумма за блоки') ?></th>
<th><?= _t('Показы RTB') ?></th>
<th class="money"><?= _t('Сайт') ?></th>
<th class="income"><?= _t('Система') ?></th>
<th><?= _t('Оборот') ?></th>
<th class="block-info total"><?= _t('Итого') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="text"><?= _t('Сегодня') ?></span></td>
<td></td>
<td class="block-info"><span id="summary-today-block_hits"><?= number_format(intval($summaryReport['today']['block_hits'])) ?></span></td>
<td class="block-info block_money"><span id="summary-today-block_money"><?= number_format((float) $summaryReport['today']['block_money'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-today-hits" class="data"><?= number_format(intval($summaryReport['today']['hits'])) ?></span></td>
<td class="money"><span id="summary-today-money" class="data"><?= number_format((float) $summaryReport['today']['money'], 2) ?> <?=$symb ?></span></td>
<td class="income"><span id="summary-today-income" class="data"><?= number_format((float) $summaryReport['today']['income'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-today-return"><?= number_format((float) $summaryReport['today']['money'] + $summaryReport['today']['income'] + $summaryReport['today']['block_money'], 2) ?> <?=$symb ?></span></td>
<td class="block-info total"><span id="summary-today-total"><?= number_format((float) $summaryReport['today']['block_money'] + $summaryReport['today']['income'], 2) ?> <?=$symb ?></span></td>
</tr>
<tr>
<td><span class="text"><?= _t('Вчера') ?></span></td>
<td></td>
<td class="block-info"><span id="summary-yesterday-block_hits"><?= number_format(intval($summaryReport['yesterday']['block_hits'])) ?></span></td>
<td class="block-info block_money"><span id="summary-yesterday-block_money"><?= number_format((float) $summaryReport['yesterday']['block_money'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-yesterday-hits" class="data"><?= number_format(intval($summaryReport['yesterday']['hits'])) ?></span></td>
<td class="money"><span id="summary-yesterday-money" class="data"><?= number_format((float) $summaryReport['yesterday']['money'], 2) ?> <?=$symb ?></span></td>
<td class="income"><span id="summary-yesterday-income" class="data"><?= number_format((float) $summaryReport['yesterday']['income'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-yesterday-return"><?= number_format((float) $summaryReport['yesterday']['money'] + $summaryReport['yesterday']['income'] + $summaryReport['yesterday']['block_money'], 2) ?> <?=$symb ?></span></td>
<td class="block-info total"><span id="summary-yesterday-total"><?= number_format((float) $summaryReport['yesterday']['block_money'] + $summaryReport['yesterday']['income'], 2) ?> <?=$symb ?></span></td>
</tr>
<tr>
<td><span class="text"><?= _t('30 дней') ?> </span></td>
<td></td>
<td class="block-info"><span id="summary-30days-block_hits"><?= number_format(intval($summaryReport['30days']['block_hits'])) ?></span></td>
<td class="block-info block_money"><span id="summary-30days-block_money"><?= number_format((float) $summaryReport['30days']['block_money'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-30days-hits" class="data"><?= number_format(intval($summaryReport['30days']['hits'])) ?></span></td>
<td class="money"><span id="summary-30days-money" class="data"><?= number_format((float) $summaryReport['30days']['money'], 2) ?> <?=$symb ?></span></td>
<td class="income"><span id="summary-30days-income" class="data"><?= number_format((float) $summaryReport['30days']['income'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-30days-return"><?= number_format((float) $summaryReport['30days']['money'] + $summaryReport['30days']['income'] + $summaryReport['30days']['block_money'], 2) ?> <?=$symb ?></span></td>
<td class="block-info total"><span id="summary-30days-total"><?= number_format((float) $summaryReport['30days']['block_money'] + $summaryReport['30days']['income'], 2) ?> <?=$symb ?></span></td>
</tr>
<tr>
<td><span class="text"><?= _t('Текущий меcяц') ?> </span></td>
<td></td>
<td class="block-info"><span id="summary-cur_month-block_hits"><?= number_format(intval($summaryReport['cur_month']['block_hits'])) ?></span></td>
<td class="block-info block_money"><span id="summary-cur_month-block_money"><?= number_format((float) $summaryReport['cur_month']['block_money'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-cur_month-hits" class="data"><?= number_format(intval($summaryReport['cur_month']['hits'])) ?></span></td>
<td class="money"><span id="summary-cur_month-money" class="data"><?= number_format((float) $summaryReport['cur_month']['money'], 2) ?> <?=$symb ?></span></td>
<td class="income"><span id="summary-cur_month-income" class="data"><?= number_format((float) $summaryReport['cur_month']['income'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-cur_month-return"><?= number_format((float) $summaryReport['cur_month']['money'] + $summaryReport['cur_month']['income'] + $summaryReport['cur_month']['block_money'], 2) ?> <?=$symb ?></span></td>
<td class="block-info total"><span id="summary-cur_month-total"><?= number_format((float) $summaryReport['cur_month']['block_money'] + $summaryReport['cur_month']['income'], 2) ?> <?=$symb ?></span></td>
</tr>
<tr>
<td><span class="text"><?= _t('Прошлый месяц') ?> </span></td>
<td></td>
<td class="block-info"><span id="summary-prev_month-block_hits"><?= number_format(intval($summaryReport['prev_month']['block_hits'])) ?></span></td>
<td class="block-info block_money"><span id="summary-prev_month-block_money"><?= number_format((float) $summaryReport['prev_month']['block_money'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-prev_month-hits" class="data"><?= number_format(intval($summaryReport['prev_month']['hits'])) ?></span></td>
<td class="money"><span id="summary-prev_month-money" class="data"><?= number_format((float) $summaryReport['prev_month']['money'], 2) ?> <?=$symb ?></span></td>
<td class="income"><span id="summary-prev_month-income" class="data"><?= number_format((float) $summaryReport['prev_month']['income'], 2) ?> <?=$symb ?></span></td>
<td><span id="summary-prev_month-return"><?= number_format((float) $summaryReport['prev_month']['money'] + $summaryReport['prev_month']['income'] + $summaryReport['prev_month']['block_money'], 2) ?> <?=$symb ?></span></td>
<td class="block-info total"><span id="summary-prev_month-total"><?= number_format((float) $summaryReport['prev_month']['block_money'] + $summaryReport['prev_month']['income'], 2) ?> <?=$symb ?></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<?php
$is_block_hits = false;
$block_hits_class = 'short';
$block_switch_full_style = 'style="display: none;"';
$block_switch_short_style = 'style="display: flex;"';
if ($periodStats['block_hits'])
{
foreach ($periodStats['block_hits'] as $value) {
if ($value != 0)
{
$is_block_hits = true;
$block_hits_class = 'full';
$block_switch_full_style = 'style="display: flex;"';
$block_switch_short_style = 'style="display: none;"';
break;
}
}
}
?>
<?php /* График */ ?>
<section id="b-content__traffic-chart" class="b-content__traffic">
<div class="b-content__loading chart"></div>
<div class="wrapp">
<div class="b-content__traffic-filter">
<div id="daterange-dropdown" class="b-add-car__form-item droplist chart-dates">
<span class="droplist-current text bold tab-input"></span>
<ul class="droplist-block">
<?php foreach($dateRange as $date): ?>
<li class="droplist-item text" data-date-value="<?= $date->format('Y-m')?>"><?= _t($date->format('F')) .', ' . $date->format('Y') ?></li>
<?php endforeach ?>
</ul>
</div>
<?php if(false): ?>
<div class="b-filter__switch display full <?php if ($is_block_hits): ?>current<?php endif; ?>" <?=$block_switch_full_style ?>>
<span class="b-filter__switch-item text" data-filter-category="block_hits"><?= _t('Показы блоков')?></span>
<span class="b-filter__switch-item text" data-filter-category="block_money"><?= _t('Сумма за блоки')?></span>
<span class="b-filter__switch-item text" data-filter-category="hits"><?= _t('Показы RTB')?></span>
<span class="b-filter__switch-item text" data-filter-category="money"><?= _t('Сайт')?></span>
<span class="b-filter__switch-item text" data-filter-category="income"><?= _t('Система')?></span>
<span class="b-filter__switch-item text" data-filter-category="return"><?= _t('Оборот')?></span>
<span class="b-filter__switch-item text" data-filter-category="total"><?= _t('Итого')?></span>
</div>
<div class="b-filter__switch display short <?php if (!$is_block_hits): ?>current<?php endif; ?>" <?=$block_switch_short_style ?>>
<span class="b-filter__switch-item text" data-filter-category="hits"><?= _t('Показы RTB')?></span>
<span class="b-filter__switch-item text" data-filter-category="money"><?= _t('Сайт')?></span>
<span class="b-filter__switch-item text" data-filter-category="income"><?= _t('Система')?></span>
<span class="b-filter__switch-item text" data-filter-category="return"><?= _t('Оборот')?></span>
</div>
<?php else : ?>
<div class="b-filter__switch display full <?php if ($is_block_hits): ?>current<?php endif; ?>" <?=$block_switch_full_style ?>>
<span class="b-filter__switch-item text" data-filter-category="blocks"><?= _t('Блоки')?></span>
<span class="b-filter__switch-item text" data-filter-category="rtb"><?= _t('RTB')?></span>
<span class="b-filter__switch-item text" data-filter-category="common_total"><?= _t('Итого')?></span>
</div>
<div class="b-filter__switch display short <?php if (!$is_block_hits): ?>current<?php endif; ?>" <?=$block_switch_short_style ?>>
<span class="b-filter__switch-item text" data-filter-category="rtb"><?= _t('RTB')?></span>
<span class="b-filter__switch-item text" data-filter-category="return"><?= _t('Оборот')?></span>
</div>
<?php endif; ?>
</div>
<div id="chart-graph" style="height: 370px;"></div>
</div>
</section>
<?php /* Основная таблица */ ?>
<section id="b-content__traffic-table" class="b-content__traffic">
<div class="b-content__loading table"></div>
<div class="wrapp">
<div class="b-table-filter-sort">
<div class="b-filter__switch display time-table">
<span class="b-filter__switch-item text m-filter__switch-item_active" data-filter-category="days"><?= _t('Дни')?></span>
<span class="b-filter__switch-item text" data-filter-category="sites"><?= _t('Сайты')?></span>
</div>
<div class="b-filter__switch display time-table-sort" style="display: none;">
<span class="b-filter__switch-item text m-filter__switch-item_active" data-sort-category="name"><?= _t('Название')?></span>
<span class="b-filter__switch-item text" data-sort-category="money"><?= _t('Доход')?></span>
</div>
</div>
<table id="table-line" class="table table-striped admin <?=$block_hits_class ?>">
<thead>
<tr>
<th><?= _t('Дата')?></th>
<th class="block-info"><?= _t('Показы блоков')?></th>
<th class="block-info block_money"><?= _t('Сумма за блоки')?></th>
<th><?= _t('Показы RTB')?></th>
<th class="money"><?= _t('Сайт') ?></th>
<th class="income"><?= _t('Система') ?></th>
<th><?= _t('Оборот') ?></th>
<th class="block-info total"><?= _t('Итого') ?></th>
</tr>
</thead>
<tbody>
<?php
$summ_views = 0;
$summ_income = 0;
$summ_income_income = 0;
$summ_block_hits = 0;
$summ_block_money = 0;
$summ_return = 0;
$summ_total = 0;
?>
<?php if($periodStats): ?>
<?php
$periodStats = array_map(function($v){
$v = array_reverse($v);
return $v;
}, $periodStats);
?>
<?php foreach($periodStats['period'] as $i => $date) : ?>
<?php
$summ_views += $periodStats['hits'][$i];
$summ_income += $periodStats['money'][$i];
$summ_block_hits += $periodStats['block_hits'][$i];
$summ_block_money += $periodStats['block_money'][$i];
$summ_income_income += $periodStats['income'][$i];
$summ_return += $periodStats['money'][$i] + $periodStats['income'][$i] + $periodStats['block_money'][$i];
$summ_total += $periodStats['block_money'][$i] + $periodStats['income'][$i];
?>
<tr>
<td><?= $date?></td>
<td class="block-info"><?= number_format(intval($periodStats['block_hits'][$i]))?></td>
<td class="block-info block_money"><?= number_format((float) $periodStats['block_money'][$i], 2)?> <?=$symb ?></td>
<td><?= number_format(intval($periodStats['hits'][$i]))?></td>
<td class="money"><?= number_format((float) $periodStats['money'][$i], 2)?> <?=$symb ?></td>
<td class="income"><?= number_format((float) $periodStats['income'][$i], 2)?> <?=$symb ?></td>
<td><?= number_format((float) $periodStats['money'][$i] + $periodStats['income'][$i] + $periodStats['block_money'][$i], 2) ?> <?=$symb ?></td>
<td class="block-info total"><?= number_format((float) $periodStats['block_money'][$i] + $periodStats['income'][$i], 2) ?> <?=$symb ?></td>
</tr>
<?php endforeach; ?>
<?php endif ?>
</tbody>
<tfoot>
<?php if($periodStats): ?>
<tr>
<td><?= _t('Сумма') ?></td>
<td class="block-info summ-block_hits"><?= number_format($summ_block_hits) ?></td>
<td class="block-info summ-block_money block_money"><?= number_format($summ_block_money, 2) ?> <?=$symb ?></td>
<td class="summ-views"><?= number_format($summ_views) ?></td>
<td class="summ-income money"><?= number_format((float) $summ_income, 2) ?> <?=$symb ?></td>
<td class="summ-income-income income"><?= number_format((float) $summ_income_income, 2) ?> <?=$symb ?></td>
<td class="summ-return return"><?= number_format($summ_return, 2) ?> <?=$symb ?></td>
<td class="block-info summ-total total"><?= number_format($summ_total, 2) ?> <?=$symb ?></td>
</tr>
<?php endif ?>
</tfoot>
</table>
<?php if($sitesStats): ?>
<table id="table-sites" class="table table-striped admin <?=$block_hits_class ?>" style="display: none;">
<thead>
<tr>
<th><?= _t('Сайт')?></th>
<th class="block-info"><?= _t('Показы блоков')?></th>
<th class="block-info block_money"><?= _t('Сумма за блоки')?></th>
<th><?= _t('Показы RTB')?></th>
<th class="money"><?= _t('Сайт') ?></th>
<th class="income"><?= _t('Система') ?></th>
<th><?= _t('Оборот') ?></th>
<th class="block-info total"><?= _t('Итого') ?></th>
</tr>
</thead>
<tbody>
<?php foreach($sitesStats as $i) : ?>
<tr>
<td><?= $i['site'] ?></td>
<td class="block-info"><?= number_format(intval($i['block_hits']))?></td>
<td class="block-info block_money"><?= number_format((float) $i['block_money'], 2)?> <?=$symb ?></td>
<td><?= number_format(intval($i['hits']))?></td>
<td class="money"><?= number_format((float) $i['money'], 2)?> <?=$symb ?></td>
<td class="income"><?= number_format((float) $i['income'], 2)?> <?=$symb ?></td>
<td><?= number_format((float) $i['money'] + $i['income'] + $i['block_money'], 2) ?> <?=$symb ?></td>
<td class="block-info total"><?= number_format((float) $i['block_money'] + $i['income'], 2) ?> <?=$symb ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
</tfoot>
</table>
<?php endif ?>
</div>
</section>
<?php
/**
* Copyright (c) 2017 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('/js/script-set-prof.js')
;
$this->headLink()
->appendStylesheet('/css/styles-set-prof.css')
;
/** @var \App\Entity\Support $support */
$support = $this->support;
/** @var \App\Entity\IdentityInterface $identity */
$identity = $this->identity();
$gravatar = $this->gravatar($identity->getEmail());
$gravatar->setDefaultImg(\Zend\View\Helper\Gravatar::DEFAULT_IDENTICON);
$sxml = new SimpleXMLElement(substr($gravatar, 0, -1) . '/>');
$src = $sxml['src'];
?>
<section class="b-content__title" style="padding-top: 50px;">
<div class="wrapp">
<picture>
<img src="/img/bg-img-logo.svg" alt="No logo">
</picture>
<p class="lead"><?= $identity->getEmail() ?></p>
<p class="b-content__title-settings"><a href="<?= $this->url('adm.logout')?>"><?=_t('Выйти')?></a></p>
</div>
</section>
<section class="b-content__form">
<div class="wrapp">
<form action="" class="b-content__form-set" name="setting" data-url="<?= $this->url('adm.profile', ['lang' => $this->lang]) ?>" data-url-success="<?= $this->url('home', ['lang' => $this->lang]) ?>">
<div>
<label for="setting-password" class="b-content__form-set-item-label">
<p class="text"><?= _t("Старый пароль:") ?> </p>
</label>
<span class="input input--akira">
<input class="input__field input__field--akira" type="password" id="setting-password" name="password" value=""/>
</span>
</div>
<div>
<label for="setting-new-password" class="b-content__form-set-item-label">
<p class="text"><?= _t("Новый пароль:") ?> </p>
</label>
<span class="input input--akira">
<input class="input__field input__field--akira" type="password" id="setting-new-password" name="new-password"/>
</span>
</div>
<div class='wrapp-button submit' data-action="<?= _t('Ваши данные обновлены') ?>">
<input type="submit" name="submit" value="<?= _t('Сохранить') ?>">
</div>
</form>
</div>
</section>
</main>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('/js/adm/supports.js')
;
/** @var $layoutInfo \App\Entity\LayoutInfo */
$layoutInfo = $this->layoutInfo;
$lang = $this->lang;
/** @var \Zend\Db\ResultSet\HydratingResultSet $supports */
$supports = $this->supports;
?>
<section class="b-content__work">
<form method="post" action="<?= $this->url('adm.supports', ['lang' => $this->lang]) ?>">
<div class="panel panel-info">
<div class="panel-heading">
<h1 style="padding: 0 0 10px 0;"><?= _t('Менеджеры') ?></h1>
<div class="btn-toolbar">
<div class="btn-group" role="group">
<a role="button" class="btn btn-primary" href="<?= $this->url('adm.supports.create',['lang' => $this->lang]) ?>"><?= _t('Добавить менеджера') ?></a>
</div>
</div>
</div>
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>
<?= _t('#ID') ?>
</th>
<th>
<?= _t('Менеджер') ?>
</th>
<th>
<?= _t('Добавлен') ?>
</th>
<th>
<?= _t('Роль') ?>
</th>
<th></th>
</tr>
</thead>
<?php /** @var \App\Entity\Support $support */
foreach ($supports as $support) :?>
<tr>
<td>
<?= $support->getId() ?>
</td>
<td>
<?php
$editLink = $this->url('adm.supports.edit', [
'lang' => $lang,
'id' => $support->getId(),
]);
?>
<div class="user-email">
<?php if($support->getId() != 1): ?>
<a href="<?= $editLink ?>"><?= $support->getEmail() ?></a>
<?php else: ?>
<?= $support->getEmail() ?>
<?php endif; ?>
</div>
<div class="user-name"><?= $support->getFullname() ?></div>
</td>
<td>
<?= $support->getDateCreate() ?>
</td>
<td>
<?= $support->getRoleId() ?>
</td>
<td>
<?php if ($support->getId() !== 1) : ?>
<?php
$btn_link = $this->url('adm.index', [
'lang' => $this->lang,
]);
?>
<button type="button" class="btn btn-primary" data-link="<?= $btn_link.'#manager='.$support->getId() ?>"><?= _t(Статистика) ?></button>
<?php
$btn_link_del = $this->url('adm.supports.delete', [
'lang' => $this->lang,
'id' => $support->getId()
]);
?>
<button type="button" class="btn btn-danger" data-delete="<?= $btn_link_del ?>"><?= _t('Удалить') ?></button>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="panel-footer">
</div>
</div>
</form>
</div>
</section>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('/js/adm/supports.js')
;
/** @var $layoutInfo \App\Entity\LayoutInfo */
$layoutInfo = $this->layoutInfo;
$form_link = $this->url('adm.supports.create',['lang' => $this->lang]);
$cancel_link = $this->url('adm.supports',['lang' => $this->lang]);
$supportUser = $this->support;
if($supportUser) {
$form_link = $this->url('adm.supports.edit',['lang' => $this->lang, 'id' => $supportUser->getId()]);
$fullname = $supportUser->getFullname();
$email = $supportUser->getEmail();
$role = $supportUser->getRoleId();
}
?>
<section class="b-content__work">
<form id="support-create-form" method="post" action="<?= $form_link ?>">
<div class="panel panel-info">
<div class="panel-heading">
<h1 style="padding: 0 0 10px 0;"><?= _t('Добавление менеджера') ?></h1>
</div>
<div class="panel-body">
<form action="<?= $form_link?>" method="POST">
<div class="form-group">
<label for="id-name"><?= _t('Имя')?></label>
<input type="text" class="form-control" id="id-name" name="fullname" value="<?= $fullname?>" placeholder="<?= _t('Имя') ?>">
</div>
<div class="form-group">
<label for="id-mail"><?= _t('Email')?></label>
<input type="text" class="form-control" id="id-email" name="email" value="<?= $email?>" placeholder="<?= _t('Email') ?>">
</div>
<div class="form-group">
<label for="user-name"><?= _t('Пароль')?></label>
<input type="text" class="form-control" id="id-password" name="password" value="" placeholder="<?= _t('Пароль') ?>">
</div>
<div class="form-group">
<label for="user-name"><?= _t('Роль')?></label>
<select class="form-control" id="id-role" name="role">
<option value="<?= \App\Acl\Roles::ROLE_ADMIN ?>" <?= ($role == \App\Acl\Roles::ROLE_ADMIN ? 'selected' : '')?> ><?= _t(\App\Acl\Roles::ROLE_ADMIN) ?></option>
<option value="<?= \App\Acl\Roles::ROLE_MANAGER ?>" <?= ($role == \App\Acl\Roles::ROLE_MANAGER ? 'selected' : '')?> ><?= _t(\App\Acl\Roles::ROLE_MANAGER) ?></option>
<option value="<?= \App\Acl\Roles::ROLE_MANAGER_FEED ?>" <?= ($role == \App\Acl\Roles::ROLE_MANAGER_FEED ? 'selected' : '')?> ><?= _t(\App\Acl\Roles::ROLE_MANAGER_FEED) ?></option>
</select>
</div>
<button type="submit" class="btn btn-primary"><?= _t('Сохранить')?></button>
<a class="btn btn-default" href="<?= $cancel_link?>"><?= _t('Отмена')?></a>
</form>
</div>
</div>
</form>
</div>
</section>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('/js/adm/users.js')
;
$this->headLink()
->appendStylesheet('/css/styles-wide-table.css')
;
$lang = $this->lang;
/** @var \Zend\Db\ResultSet\HydratingResultSet $users */
$users = $this->users;
$filters = array(
'segment' => $this->filter_segment,
'category' => $this->filter_category,
'country' => $this->filter_country,
);
$filter_args = function($filter, $value) use ($filters) {
$tmp = $filters;
foreach($tmp as $filterName => $filterValue) {
if($filterName == $filter) {
if($value == '') {
unset($tmp[$filterName]);
} else {
$tmp[$filterName] = $value;
}
}
}
if(!$tmp) {
return '';
}
$tmp = array_filter($tmp);
if(!$tmp) {
return '';
}
return '?'.urldecode(http_build_query($tmp));
};
$pageLink = $this->url('adm.users', [
'lang' => $this->lang,
]);
?>
<section class="b-content__work">
<div class="panel panel-info">
<div class="panel-heading">
<h1 style="padding: 0 0 10px 0;"><?= _t('Пользователи') ?></h1>
<div class="btn-toolbar">
<div class="btn-group" role="group">
<?php
$btn_link = $this->url('adm.users.create', [
'lang' => $this->lang,
]);
?>
<a class="btn btn-primary" href="<?= $btn_link ?>"><?= _t('Добавить пользователя') ?></a>
</div>
</div>
</div>
<div class="panel-body p-support-users">
<form method="post" action="<?= $this->url('adm.users', ['lang' => $this->lang]) ?>">
<table class="table table-striped">
<thead>
<tr>
<th>
<?= _t('Пользователь') ?>
</th>
<th>
<?= _t('Контакты') ?>
</th>
<th>
<?= _t('Добавлен') ?>
</th>
<th>
<?= _t('Менеджер') ?>
</th>
<th>
<?= _t('Комментарий') ?>
</th>
<th></th>
</tr>
</thead>
<?php /** @var \App\Entity\User $user */
foreach ($users as $user) : ?>
<tr>
<td class="row-user">
<?php
$btn_link = $this->url('adm.users.edit', [
'lang' => $this->lang,
'id' => $user->getId(),
]);
$country = $user->getCountry();
?>
<span class="user-segment"><?= $user->getSegment() ?></span>
<span class="user-name"><a href="<?= $btn_link?>"><?= $user->getFullname() ?></a></span>
<?php if($country): ?>
<span class="user-country"><span class="user-country flag flag-<?= strtolower($country->getCode()) ?>"><?= $country->getName() ?></span></span>
<?php endif ?>
</td>
<td>
<span class="user-email"><?= $user->getEmail() ?></span>
<span class="user-phone"><?= $user->getPhone() ?></span>
</td>
<td>
<span class="user-create-date"><?= $user->getDateCreate() ?></span>
</td>
<td>
<?php
$managerName = '';
if(($manager = $user->getManager())) {
$managerName = $manager->getFullname();
}
?>
<span><?= $managerName ?></<span>
</td>
<td>
<?= nl2br($user->getComment()) ?>
</td>
<td class="text-right">
<?php
$btn_link = $this->url('adm.users.statistic', [
'lang' => $this->lang,
'id' => $user->getId(),
]);
?>
<?php /* ?>
<button type="button" class="btn btn-primary" data-link="<?= $btn_link ?>"><?= _t(Статистика) ?></button>
<?php */ ?>
<a class="btn btn-primary" href="<?= $btn_link ?>" target="_blank"><?= _t('Статистика') ?></a>
<?php
$btn_class = '';
$btn_value = '';
$btn_title = '';
$btn_unbnlock_title = _t("Разблокировать");
$btn_block_title = _t("Заблокировать");
if($user->getBlocked()) {
$btn_class = 'btn-primary';
$btn_value = 'data-hide';
$btn_title = $btn_unbnlock_title;
} else {
$btn_class = 'btn-danger';
$btn_value = 'data-activate';
$btn_title = $btn_block_title;
}
$btn_activate_link = $this->url('adm.users.status.unblock', [
'id' => $user->getId(),
'lang' => $this->lang,
]);
$btn_deactivate_link = $this->url('adm.users.status.block', [
'id' => $user->getId(),
'lang' => $this->lang,
]);
?>
<button type="button" class="btn <?= $btn_class ?>"
data-toggle
data-activate="<?= $btn_activate_link ?>"
data-activate-caption="<?= $btn_unblock_title ?>"
data-hide="<?= $btn_deactivate_link ?>"
data-hide-caption="<?= $btn_block_title ?>"
data-value="<?= $btn_value ?>"
><?= $btn_title ?></button>
</td>
</tr>
<?php endforeach; ?>
</table>
</form>
</div>
<div class="panel-footer">
</div>
</div>
</div>
</section>
<?php
$this->headScript()
->appendFile('/js/bootstrap-tokenfield.js')
->appendFile('/js/bootstrap-datepicker.min.js')
->appendFile('/js/bootstrap-datepicker.ru.min.js')
->appendFile('/js/bootstrap-datepicker.en.min.js')
->appendFile('/js/adm/users_form.js')
;
$page = $this->page;
$page_lang = $this->lang;
/** @var \App\Entity\User $user */
$user = $this->user;
$user_id = 0;
$user_date = date('Y-m-d');
$listAllSites = $this->listAllSites;
$sites = $this->sites;
$segments = $this->segments;
$categories = $this->categories;
$countries = $this->countries;
$managers = $this->managers;
$currencies = $this->currencies;
$providers_list = $this->providersList;
$page_title = '';
if($this->page == 'create') {
$form_link = $this->url('adm.users.create', ['lang' => $this->lang]);
$page_title = _t('Добавление пользователя');
} else {
$form_link = $this->url('adm.users.edit', ['lang' => $this->lang, 'id' => $user->getId()]);
$page_title = _t('Редактирование пользователя');
$user_id = $user->getId();
$user_segment = $user->getSegment();
$user_country = $user->getCountryCode();
$user_currency = $user->getCurrencyCode();
$user_date = $user->getDateCreate();
$user_name = $user->getFullName();
$user_email = $user->getEmail();
$user_phone = $user->getPhone();
$user_comment = $user->getComment();
$user_sites = '';
if($sites) {
$user_sites = implode(', ', array_map(function($site) {
return $site['domain'];
}, $sites));
}
$user_categories = $user->getCategories();
$user_treaffic = $user->getTraffic();
$user_manager_id = $user->getSupportId();
$accessSites = $this->accessSites;
$codeProvider = $this->codeProvider;
}
$cancel_link = $this->url('adm.users', ['lang' => $this->lang]);
$site_link = $this->url('adm.users.status.site', ['lang' => $this->lang, 'id' => $user_id]);
?>
<?php /* Шаблон для code-provider */ ?>
<div class="code-provider-pattern">
<div class="input-item">
<select class="form-control code-provider">
<option value="" disabled selected><?= _t('Выберите провайдера') ?></option>
<?php foreach($providers_list as $provider_item): ?>
<option value="<?= $provider_item['id'] ?>"><?= $provider_item['name'] ?></option>
<?php endforeach ?>
</select>
<div class="delete-input">&#215;</div>
</div>
</div>
<section class="b-content__work">
<div class="panel panel-info">
<div class="panel-heading">
<h1 style="padding: 0 0 10px 0;"><?= $page_title ?></h1>
</div>
<div class="panel-body">
<form id="user-form" method="POST" action="<?= $form_link?>">
<div class="form-group">
<label for="user-date-create"><?= _t('Дата активации')?></label>
<input type="text" class="form-control" id="user-date-create" name="date_create" value="<?= $user_date?>" placeholder="<?= _t('Дата активации') ?>" data-language="<?= $page_lang?>" style="width: 105px;">
</div>
<div class="form-group">
<label for="user-manager"><?= _t('Менеджер')?></label>
<select class="form-control" id="user-manage" name="manager" style="width: 250px;">
<option value="0" ><?= _t('Выберите менеджера') ?></option>
<?php foreach($managers as $managerId => $managerName): ?>
<option value="<?= $managerId?>" <?= ($managerId == $user_manager_id ? 'selected' : '')?> ><?= $managerName ?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group">
<label for="user-name"><?= _t('Название')?></label>
<input type="text" class="form-control" id="user-name" name="fullname" value="<?= $user_name?>" placeholder="<?= _t('Название') ?>">
</div>
<div class="form-group">
<label for="user-segment"><?= _t('Сегмент')?></label>
<select class="form-control" id="user-segment" name="segment" style="width: 150px;">
<option value="" ><?= _t('Выберите сегмент') ?></option>
<?php foreach($segments as $segment): ?>
<option value="<?= $segment?>" <?= ($segment == $user_segment ? 'selected' : '')?> ><?= $segment?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group">
<label for="user-country"><?= _t('Страна')?></label>
<select class="form-control" id="user-country" name="country" style="width: 250px;">
<option value="" ><?= _t('Выберите страну') ?></option>
<?php foreach($countries as $countryCode => $name): ?>
<option value="<?= $countryCode?>" <?= ($countryCode == $user_country ? 'selected' : '')?> ><?= $name?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group">
<label for="user-currency"><?= _t('Валюта отображения')?></label>
<select class="form-control" id="user-currency" name="currency" style="width: 250px;">
<option value="USD" ><?= _t('Выберите валюту') ?></option>
<?php foreach($currencies as $currencyCode => $name): ?>
<option value="<?= $currencyCode?>" <?= ($currencyCode == $user_currency ? 'selected' : '')?> ><?= $currencyCode?> (<?= $name?>)</option>
<?php endforeach ?>
</select>
</div>
<div class="form-group">
<label for="user-email"><?= _t('Email')?></label>
<input type="email" class="form-control" id="user-email" name="email" value="<?= $user_email?>" placeholder="<?= _t('Email') ?>">
</div>
<div class="form-group">
<label for="user-phone"><?= _t('Телефон')?></label>
<input type="text" class="form-control" id="user-phone" name="phone" value="<?= $user_phone?>" placeholder="<?= _t('Телефон') ?>">
</div>
<div class="form-group">
<label for="user-email"><?= _t('Пароль')?></label>
<input type="text" class="form-control" id="user-password" name="password" placeholder="<?= _t('Пароль') ?>">
</div>
<?php if($this->page == 'edit'): ?>
<?php if($feeds): ?>
<label for="user-feeds"><?= _t('Фиды текущего пользователя')?></label>
<div class="tokenfield">
<?php foreach($feeds as $feed): ?>
<?php
$feed_link = $this->url('adm.feed.edit', [
'lang' => $this->lang,
'id' => $feed['id'],
]);
?>
<div class="token"><span class="token-label"><a href="<?= $feed_link ?>"><?= $feed['title'] ?></a></span></div>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="form-group">
<label for="user-site"><?= _t('Сайты текущего пользователя')?></label>
<!--
<input type="hidden<?php /* text */?>" class="form-control" id="user-site" name="sites" value="<?= $user_sites?>" data-status-url="<?=$site_link?>">
-->
<?php if($sites): ?>
<div class="tokenfield">
<?php foreach($sites as $site): ?>
<?php
$btn_link = $this->url('adm.sites.edit', [
'lang' => $this->lang,
'id' => $site['id'],
]);
?>
<div class="token"><span class="token-label"><a href="<?= $btn_link ?>"><?= $site['domain'] ?></a></span></div>
<?php endforeach; ?>
</div>
<?php else : ?>
<div class="tokenfield">У пользователя пока нет закрепленных за ним сайтов.</div>
<?php endif; ?>
<div class="btn-group" role="group">
<?php
$btn_link = $this->url('adm.sites.create', [
'lang' => $this->lang,
'userId' => $user_id,
]);
?>
<a class="btn btn-primary" href="<?= $btn_link ?>"><?= _t('Добавить сайт') ?></a>
</div>
</div>
<div class="form-group">
<label for="user-access-site"><?= _t('Другие доступные сайты')?></label>
<?php if($accessSites): ?>
<div class="tokenfield">
<?php foreach($accessSites as $site): ?>
<?php
$btn_link = $this->url('adm.sites.edit', [
'lang' => $this->lang,
'id' => $site->getId(),
]);
?>
<div class="token"><span class="token-label"><a href="<?= $btn_link ?>"><?= $site->getDomain() ?></a></span></div>
<?php endforeach; ?>
</div>
<?php else : ?>
<div class="tokenfield">У пользователя пока нет доступных сайтов.</div>
<?php endif; ?>
</div>
<?php /* ?>
<div class="form-group">
<div style="margin-bottom: 10px;">
<label for="user-access-site"><?= _t('Доступные сайты')?></label>
<input type="text" class="form-control" id="user-access-site" name="access_sites" value="<?= $list_access_sites ?>">
</div>
<select class="form-control access-site" style="width: 250px; display: inline-block;">
<option value="" ><?= _t('Выберите сайт') ?></option>
<?php foreach($listAllSites as $site): ?>
<option value="<?= $site['domain'] ?>"><?= $site['domain'] ?></option>
<?php endforeach ?>
</select>
<a class="btn btn-primary add-access-site" href="#" style="vertical-align: 0px;"><?= _t('Добавить сайт') ?></a>
</div>
<?php */ ?>
<?php endif; ?>
<?php endif; ?>
<div class="form-group code-provider">
<label for="code-provider">Провайдеры, к кодам которых у пользователя есть доступ:</label>
<a class="btn btn-primary edit-item" href="#"><?= _t('Редактировать') ?></a>
<input class="form-control" type="hidden" id="code-provider" name="code_provider" value="">
<?php $providers = ($codeProvider) ? $codeProvider : []; ?>
<div class="values-string">
<?php foreach($providers as $provider): ?>
<span><?= $provider['name'] ?></span>
<?php endforeach ?>
</div>
<div class="values-edit">
<div class="no-values" style="width: 400px;">Нет значений в списке</div>
<div class="values-items">
<?php foreach($providers as $provider): ?>
<div class="input-item">
<select class="form-control code-provider">
<?php foreach($providers_list as $provider_item): ?>
<option value="<?= $provider_item['id'] ?>" <?php if($provider_item['id'] == $provider['id']): ?>selected<?php endif; ?>><?= $provider_item['name'] ?></option>
<?php endforeach ?>
</select>
<div class="delete-input">&#215;</div>
</div>
<?php endforeach ?>
</div>
<div class="controls">
<div class="temp-state"></div>
<a class="btn btn-primary add-item" href="#"><?= _t('Добавить') ?></a>
<a class="btn btn-primary cancel-item" href="#"><?= _t('Отмена') ?></a>
<a class="btn btn-primary save-item" href="#"><?= _t('Сохранить') ?></a>
</div>
</div>
</div>
<?php /* ?>
<div class="form-group">
<label><?= _t('Категория') ?></label>
<?php foreach($categories as $categoryId => $categoryName): ?>
<div class="checkbox">
<label><input type="checkbox" name="category[]" value="<?= $categoryId ?>" <?= (isset($user_categories[$categoryId]) ? 'checked' : '')?> ><?= _t($categoryName) ?></label>
</div>
<?php endforeach ?>
</div>
<?php */ ?>
<div class="form-group">
<label for="user-site-traffic"><?= _t('Траффик') ?></label>
<input type="text" class="form-control" id="user-site-traffic" name="traffic" value="<?= $user_treaffic ?>" placeholder="<?= _t('Траффик') ?>">
</div>
<div class="form-group">
<label for="user-comment"><?= _t('Комментарий')?></label>
<textarea class="form-control" id="user-comment" name="comment" style="height: 100px;"><?= $user_comment?></textarea>
</div>
<button type="submit" class="btn btn-primary"><?= _t('Сохранить') ?></button>
<a class="btn btn-default" href="<?= $cancel_link?>"><?= _t('Отмена') ?></a>
</form>
</div>
</div>
</section>
......@@ -31,7 +31,7 @@ $this->headScript()
$this->headLink()
->appendStylesheet('/css/styles-feeds-stat.css')
->appendStylesheet('/css/styles-feeds-system.css')
->appendStylesheet('/css/styles-cabinet-cats.css')
;
......@@ -59,7 +59,7 @@ $feeds_cats = $this->feeds_cats;
<?php /* Переключатель страниц */ ?>
<div class="b-filter__switch display">
<span class="b-filter__switch-item text"><a href="<?= $this->url('user.cabinet', ['lang' => $this->lang, 'report' => 'common']) ?>"><?= _t('Сводный отчет') ?></a></span>
<span class="b-filter__switch-item text"><a href="<?= $this->url('user.cabinet', ['lang' => $this->lang, 'report' => 'transaction']) ?>"><?= _t('Транзакции') ?></a></span>
<span class="b-filter__switch-item text"><a href="<?= $this->url('user.cabinet', ['lang' => $this->lang, 'report' => 'transactions']) ?>"><?= _t('Транзакции') ?></a></span>
<span class="b-filter__switch-item text m-filter__switch-item_active"><a href="<?= $this->url('user.cabinet.cats', ['lang' => $this->lang]) ?>"><?= _t('Категории') ?></a></span>
</div>
</div>
......
......@@ -193,7 +193,7 @@ if (!$error) {
</span>
<b class="cat" id="<?= $name ?>"><?= _t($title)?></b>
<?php endif; ?>
<?php if($current_report == 'transaction'): ?>
<?php if($current_report == 'transactions'): ?>
<?php if ($name == 'Basket'): ?>
<b class="cat not-sorted" id="<?= $name ?>"><?= _t($title)?></b><br />
<b class="basket-link not-sorted">Товар</b> <b class="quantity not-sorted">Кол-во</b> <b class="price not-sorted">Цена</b>
......
<?php
/*
Фильтры
*/
?>
<ul class="b-template-zones-list"></ul>
<div class="b-minstat-graph-filter">
<div>
<input type="checkbox" id="show-filters" name="show-filters">
<label for="show-filters"><?= _t('Фильтры')?></label>
</div>
<div class="b-filters">
<div class="b-filters_sites-zones">
<div class="b-filters_site-wrap">
<!-- sites -->
<div class="b-filters_site">
<div class="form-group">
<label for="site-list"><?= _t('Сайты')?></label>
<div style="float: right;">
<input type="checkbox" id="site-exclude" name="site-exclude">
<label for="site-exclude"><?= _t('исключить')?></label>
</div>
<div>
<div class="filters-select">
<input type="text" class="form-control filter" id="sites-filter" name="sites-filter" value="" placeholder="фильтр">
<div>
<ul class="list-filter"></ul>
</div>
</div>
<div class="filters-values">
<ul class="values-string-list"></ul>
</div>
</div>
</div>
</div>
</div>
<div class="b-filters_zone-wrap">
<!-- zones -->
<div class="b-filters_zone">
<div class="form-group">
<label for="zone-list"><?= _t('Зоны')?></label>
<div style="float: right;">
<input type="checkbox" id="zone-exclude" name="zone-exclude">
<label for="zone-exclude"><?= _t('исключить')?></label>
</div>
<div>
<div class="filters-select">
<input type="text" class="form-control filter" id="zones-filter" name="zones-filter" value="" placeholder="фильтр">
<div>
<ul class="list-filter"></ul>
</div>
</div>
<div class="filters-values">
<ul class="values-string-list"></ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- geo -->
<div class="b-filters_geo">
<div class="form-group" style="margin-bottom: 0;">
<div>
<label style="margin-bottom: 5px;"><?= _t('Cтраны:')?></label>
<div style="float: right;">
<input type="checkbox" id="geo-exclude" name="geo-exclude">
<label for="geo-exclude"><?= _t('исключить')?></label>
</div>
<br>
<span class="geo-list"></span>
</div>
</div>
</div>
<div style="clear: both; height: 10px;"></div>
</div>
</div>
\ No newline at end of file
<?php
/*
Выбор типа метрики
*/
$page_link = function($metric_type) {
return $this->url('adm.reports', [
'lang' => $this->lang,
'type' => $metric_type,
]);
};
?>
<div class="b-content__metric-type-select">
<div class="select-metric">
<span>Отчёт по: </span>
<div class="dropdown" style="display:inline-block;">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<?= _t($listMetrics[$this->metricType]) ?>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu">
<?php foreach($listMetrics as $type => $title): ?>
<?php $current_class = ($type == $this->metricType) ? 'class="current"' : null; ?>
<li><a href="<?= $page_link($type) ?>" <?= $current_class ?> metric="<?= $type ?>"><?= _t($title) ?></a></li>
<?php endforeach ?>
</ul>
</div>
</div>
<div class="select-dates">
<span>Выберите дни: </span>
<input type='text' id="date-value-1" class="date-value" value="<?=$dates[0] ?>" />
<input type='text' id="date-value-2" class="date-value" value="<?=$dates[1] ?>" />
<input type="checkbox" id="by-days">
<label for="by-days"><?= _t('По дням') ?></label>
<button type="button" class="btn btn-primary"><span><?= _t('Применить') ?></span></button>
</div>
</div>
<?php
/*
Таблица
*/
?>
<section id="b-content__traffic-table" class="b-content__traffic metrics" style="display: none;">
<div class="b-content__loading"></div>
<div class="wrapp">
<div class="b-filter__switch display time-table">
<span class="b-filter__switch-item text" data-filter-category="min"><?= _t('Поминутно')?></span>
<span class="b-filter__switch-item text" data-filter-category="sum"><?= _t('Суммарно')?></span>
</div>
<?php if ($this->metricType == 'minstat') : ?>
<div class="b-filter__switch display count-sites">
<span class="b-filter__switch-item text" data-filter-category="50">50</span>
<span class="b-filter__switch-item text" data-filter-category="100">100</span>
<span class="b-filter__switch-item text" data-filter-category="150">150</span>
</div>
<div class="b-filter__switch display category-table">
<span class="b-filter__switch-item text" data-filter-category="bytime"><?= _t('По дням')?></span>
<span class="b-filter__switch-item text" data-filter-category="bysites"><?= _t('По сайтам')?></span>
<span class="b-filter__switch-item text" data-filter-category="byzones"><?= _t('По зонам')?></span>
<span class="b-filter__switch-item text" data-filter-category="bycountries"><?= _t('По странам')?></span>
</div>
<?php endif; ?>
<table id="table-line" class="table table-striped admin">
<thead class="metric">
<?php foreach($variables as $metric => $categories): ?>
<?php $current_style = ($this->metricType != $metric) ? 'style="display: none;"' : ''; ?>
<?php if($metric == 'minstat'): ?>
<tr data-metric="<?= $metric ?>" <?= $current_style ?>>
<th rowspan="2"><?= _t('Время')?></th>
<th rowspan="2"><b id="sspViewsCnt">Показы</b></th>
<th rowspan="2"><b id="sspClicksCnt">Клики</b></th>
<th rowspan="2"><b id="ctr">CTR</b></th>
<th colspan="3" class="minstat-common-th"><b id="sum">Сумма</b></th>
<th colspan="3" class="minstat-common-th"><b id="site">Сайт</b></th>
<th colspan="3" class="minstat-common-th"><b id="system">Система</b></th>
<th rowspan="2"><b id="ratio">Ratio</b></th>
</tr>
<tr data-metric="<?= $metric ?>" <?= $current_style ?>>
<th class="minstat-item-th" style="width: 100px;"><b id="sspMoney">Деньги</b></th>
<th class="minstat-item-th"><b id="cpm">CPM</b></th>
<th class="minstat-item-th"><b id="cpc">CPC</b></th>
<th class="minstat-item-th" style="width: 100px;"><b id="sspSiteMoney">Деньги</b></th>
<th class="minstat-item-th"><b id="siteCpm">CPM</b></th>
<th class="minstat-item-th"><b id="siteCpc">CPC</b></th>
<th class="minstat-item-th" style="width: 100px;"><b id="sspSystemMoney">Деньги</b></th>
<th class="minstat-item-th"><b id="systemCpm">CPM</b></th>
<th class="minstat-item-th"><b id="systemCpc">CPC</b></th>
</tr>
<?php else : ?>
<tr data-metric="<?= $metric ?>" <?= $current_style ?>>
<th><?= _t('Время')?></th>
<?php foreach($categories as $name => $title): ?>
<th>
<b id="<?= $name ?>">
<?= _t($title)?>
<b class="arrow asc">&and;</b>
<b class="arrow desc">&or;</b>
</b>
</th>
<?php endforeach ?>
</tr>
<?php endif; ?>
<?php if(false): ?>
<tr data-metric="<?= $metric ?>" <?= $current_style ?>>
<th><?= _t('Время')?></th>
<?php if($metric == 'minstat'): ?>
<th><b id="sspViewsCnt">Показы</b></th>
<th><b id="sspClicksCnt">Клики</b></th>
<th><b id="ctr">CTR</b></th>
<th><b id="money">Деньги</b></th>
<th><b id="cpm">CPM</b></th>
<th><b id="cpc">CPC</b></th>
<th><b id="ratio">Ratio</b></th>
<?php else : ?>
<?php foreach($categories as $name => $title): ?>
<th>
<b id="<?= $name ?>">
<?= _t($title)?>
<b class="arrow asc">&and;</b>
<b class="arrow desc">&or;</b>
</b>
</th>
<?php endforeach ?>
<?php endif; ?>
</tr>
<?php endif; ?>
<?php endforeach ?>
</thead>
<tbody>
</tbody>
</table>
</div>
</section>
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript()
->appendFile('//cdnjs.cloudflare.com/ajax/libs/autosize.js/3.0.18/autosize.min.js')
->appendFile('/js/jquery.cookie.js')
->appendFile('/js/underscore-min.js')
->appendFile('/js/c3.min.js')
->appendFile('/js/d3.min.js')
->appendFile('/js/datepicker.min.js')
->appendFile('/js/bootstrap-tokenfield.js')
->appendFile('/js/script-reports-conf.js')
->appendFile('/js/script-reports-charts.js')
->appendFile('/js/script-reports-table.js')
->appendFile('/js/script-reports.js')
;
$this->headLink()
->appendStylesheet('/css/styles-cabinet.css')
->appendStylesheet('/css/styles-cabinet-550.css', 'all and (max-width: 550px)')
->appendStylesheet('/css/styles-cabinet-stats.css')
->appendStylesheet('/css/c3.css')
->appendStylesheet('/css/styles-support-index.css')
->appendStylesheet('/css/datepicker.min.css')
;
$periodStat = $this->periodStat;
?>
<textarea id="period-stats" style="display: none;"><?= ($periodStat ? json_encode($periodStat) : '')?></textarea>
<div class="wrapp" style="margin-bottom: 50px;">
<?= $this->partial('adm::reports/_metrictype', ['lang' => $this->lang, 'dates' => $this->dates,'listMetrics' => $this->listMetrics, 'metricType' => $this->metricType]) ?>
<?= $this->partial('adm::reports/_filters') ?>
<div class="b-content__traffic-filter">
<div>
<div class="b-filter__switch display time" style="display: none;">
<span class="b-filter__switch-item text" data-filter-category="min"><?= _t('Минуты')?></span>
<span class="b-filter__switch-item text" data-filter-category="hour"><?= _t('Часы')?></span>
</div>
<div class="b-filter__switch display days" style="display: none;">
<span class="b-filter__switch-item text" data-filter-category="day"><?= _t('Дни')?></span>
<span class="b-filter__switch-item text" data-filter-category="week"><?= _t('Недели')?></span>
<span class="b-filter__switch-item text" data-filter-category="month"><?= _t('Месяцы')?></span>
</div>
</div>
<?php foreach($variables as $metric => $categories): ?>
<?php $current_class = ($this->metricType == $metric) ? 'current-metric' : ''; ?>
<?php $current_style = ($this->metricType != $metric) ? 'style="display: none;"' : ''; ?>
<?php if($metric == 'minstat'): ?>
<?php /* Показы/Клики/CTR/Деньги/CPM/CPC/Ratio */ ?>
<div class="b-filter__switch display metric-cat current <?= $current_class ?>" data-metric="<?= $metric ?>" <?= $current_style ?>>
<span class="b-filter__switch-item text" data-filter-category="sspViewsCnt" title="sspViewsCnt">Показы</span>
<span class="b-filter__switch-item text" data-filter-category="sspClicksCnt" title="sspClicksCnt">Клики</span>
<span class="b-filter__switch-item text" data-filter-category="ctr" title="ctr">CTR</span>
<span class="b-filter__switch-item text" data-filter-category="money" title="money">Деньги</span>
<span class="b-filter__switch-item text" data-filter-category="cpm" title="cpm">CPM</span>
<span class="b-filter__switch-item text" data-filter-category="cpc" title="cpc">CPC</span>
<span class="b-filter__switch-item text" data-filter-category="ratio" title="ratio">Ratio</span>
</div>
<?php /* Сумма/Сайт/Система */ ?>
<div class="b-filter__switch display metric-cat current metric-data <?= $current_class ?>" data-metric="<?= $metric ?>" <?= $current_style ?>>
<span class="b-filter__switch-item text" data-filter-category="sum" title="sum">Сумма</span>
<span class="b-filter__switch-item text" data-filter-category="site" title="site">Сайт</span>
<span class="b-filter__switch-item text" data-filter-category="system" title="system">Система</span>
</div>
<?php else : ?>
<div class="b-filter__switch display metric-cat current <?= $current_class ?>" data-metric="<?= $metric ?>" <?= $current_style ?>>
<?php foreach($categories as $name => $title): ?>
<span class="b-filter__switch-item text" data-filter-category="<?= $name ?>" title="<?= $name ?>"><?= $title ?></span>
<?php endforeach ?>
</div>
<?php endif; ?>
<?php endforeach ?>
<?php /* ?>
<div class="b-filter__switch display short current" data-metric="<?= $this->metricType?>">
<?php foreach($variables as $name => $title): ?>
<span class="b-filter__switch-item text" data-filter-category="<?= $name ?>"><?= $title ?></span>
<?php endforeach ?>
</div>
<?php */ ?>
</div>
<div class="chart-graph-stat-info">
<h2>По заданным параметрам статистика отсутствует</h2>
</div>
<div class="chart-graph-stat-error">
<h2>Ошибка в статистике</h2>
<div class="message"></div>
</div>
<div id="chart-graph-stat" style="height: 370px;"></div>
<div class="chart-graph-stat-loading"></div>
</div>
<?php /* Таблица */ ?>
<?php if (true/*!$isProvidersMetric*/): ?>
<?= $this->partial('adm::reports/_table') ?>
<?php endif; ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment