123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386 |
- <?php
- /** @var yii\web\View $this */
- use yii\helpers\Html;
- use yii\widgets\DetailView;
- $cache = Yii::$app->cache;
- $month = array(
- 1 => 'Январь',
- 2 => 'Февраль',
- 3 => 'Март',
- 4 => 'Апрель',
- 5 => 'Май',
- 6 => 'Июнь',
- 7 => 'Июль',
- 8 => 'Август',
- 9 => 'Сентябрь',
- 10 => 'Октябрь',
- 11 => 'Ноябрь',
- 12 => 'Декабрь'
- );
- $sstart = date("Y-m-d", strtotime( date("Y-m-01")." 12 months ago"));
- $send = date("Y-m-d", strtotime( date("Y-m-01")." 1 days ago"));
- $mstart = date("Y-m-d", strtotime( date("Y-m-01")." 2 months ago"));
- $mend = date("Y-m-d", strtotime( date("Y-m-01")." 1 months ago"));
- //Прошлый период
- $sstartl = date("Y-m-d", strtotime( $sstart." 12 months ago"));
- $sendl = date("Y-m-d", strtotime( $send." 12 months ago"));
- $this->title = "Аналитика $sstart - $send";
- $this->params['breadcrumbs'][] = ['label' => $this->title, 'url' => ['index']];
- // $r = $model->YGetByTime(['date1'=>$mstart, 'date2'=>$mend,'dimensions'=>'ym:s:publisherArticle','metrics'=>'ym:s:publisherviews','filters'=>'(ym:s:publisherArticle!n)','sort'=>'-ym:s:publisherviews']);
- // print_a($r);
- ?>
- <section class="content">
- <div class="container-fluid">
- <div class="row">
- <div class="col-12">
- <div class="alert bg-gray disabled color-palette alert-dismissible">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- <h5><i class="icon fas fa-info"></i> Alert!</h5>
- <h2>Периуды текущий: <span class="text-white"><b><?=$sstart?> - <?=$send?></b></span>, предыдущий: <span class="text-white"><?=$sstartl?> - <?=$sendl?></span></h2>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-12">
- <div class="callout callout-info">
- <h5><i class="fas fa-info"></i> amic.ru:</h5>
- Данные <b>amic.ru</b> по данным liveinternet
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Отказы</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute"> </span><span id="bc"></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Меньше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartb" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">ядро</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute yadroamic"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartYadro" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Посетители</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute us"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartUsers" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Посетители среднесуточно</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute um"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartUsersm" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Просмотры</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute vs"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartVis" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Просмотров на посетителя</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute deep"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Страницпросмотренно пользователем ср.</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartDeep" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Средняя длительность (мин.)</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute time"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartTime" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Поисковый трафик</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute search"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Все поисковые системы</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartSearch" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-6">
- <div class="card">
- <div class="card-header border-0">
- <div class="d-flex justify-content-between">
- <h3 class="card-title">Региональные (Барнаул, Новосибирск, Горно-Алтайск) среднесуточные</h3>
- <a href="javascript:void(0);">View Report</a>
- </div>
- </div>
- <div class="card-body">
- <div class="d-flex">
- <p class="d-flex flex-column">
- <span class="text-bold text-lg RegEx">820</span>
- <span>среднесуточные в месяц</span>
- </p>
- <p class="ml-auto d-flex flex-column text-right">
- <span class="text-success">
- <span class="Regp">12.5%</span>
- </span>
- <span class="text-muted">От всех пользователей</span>
- </p>
- </div>
- <div class="position-relative mb-4">
- <div class="chartjs-size-monitor">
- <div class="chartjs-size-monitor-expand">
- <div class=""></div>
- </div>
- <div class="chartjs-size-monitor-shrink">
- <div class=""></div>
- </div>
- </div>
- <canvas id="jschartRegEx" style="display: block; width: 770px; height: 200px;" class="chartjs-render-monitor" width="770" height="200"></canvas>
- </div>
- <div class="d-flex flex-row justify-content-end">
- </div>
- </div>
- </div>
- </div>
- <div class="col-6">
- <div class="card">
- <div class="card-header border-0">
- <div class="d-flex justify-content-between">
- <h3 class="card-title">Региональные (Барнаул)</h3>
- <a href="javascript:void(0);">View Report</a>
- </div>
- </div>
- <div class="card-body">
- <div class="d-flex">
- <p class="d-flex flex-column">
- <span class="text-bold text-lg region">820</span>
- <span>Месяц</span>
- </p>
- </div>
- <div class="position-relative mb-4">
- <div class="chartjs-size-monitor">
- <div class="chartjs-size-monitor-expand">
- <div class=""></div>
- </div>
- <div class="chartjs-size-monitor-shrink">
- <div class=""></div>
- </div>
- </div>
- <canvas id="jschartRegion" style="display: block; width: 770px; height: 200px;" class="chartjs-render-monitor" width="770" height="200"></canvas>
- </div>
- <div class="d-flex flex-row justify-content-end">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-6">
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Источники</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute"></span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartSource" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-12">
- <div class="card">
- <div class="card-header border-0">
- <h3 class="card-title">Источники</h3>
- <div class="card-tools">
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-download"></i>
- </a>
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-bars"></i>
- </a>
- </div>
- </div>
- <div class="card-body table-responsive p-0">
- <table class="table table-striped table-valign-middle" id="reftab">
- <thead>
- <tr>
- <th>Источник</th>
- <th class="sorting">Переходов</th>
- <th>Динамика</th>
- <th class="sorting">Пред. месяц</th>
- </tr>
- </thead>
- <tbody id="referertab">
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-3">
- <div class="card">
- <div class="card-header border-0">
- <h3 class="card-title">Таблица amic.ru</h3>
- <div class="card-tools">
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-download"></i>
- </a>
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-bars"></i>
- </a>
- </div>
- </div>
- <div class="card-body table-responsive p-0">
- <table class="table table-striped table-valign-middle">
- <thead>
- <tr class="bg-purple">
- <th>Показатель</th>
- <th>Значение</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Посетителей суммарно
- </td>
- <td class="us">$13 USD</td>
- </tr>
- <tr>
- <td>
- Просмотров суммарно
- </td>
- <td class="vs">$29 USD</td>
- </tr>
- <tr>
- <td>
- Региональных посетителей
- </td>
- <td class="region">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Ядро
- </td>
- <td class="yadroamic">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- % посетителей региона
- </td>
- <td class="regpercent">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Яндекс Дзен (канал)
- </td>
- <td class="refdzen">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Яндекс Дзен (Новости)
- </td>
- <td class="refdzennews">$1,230 USD</td>
- </tr>
- <thead>
- <tr class="bg-purple">
- <th>Показатель</th>
- <th>Значение</th>
- </tr>
- </thead>
- <tr>
- <td>
- Посетителей среднесуточно
- </td>
- <td class="um">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Глубина
- </td>
- <td class="deep">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Длительность
- </td>
- <td class="time">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Трафик поисковый
- </td>
- <td class="search">$1,230 USD</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-3">
- <div class="card">
- <div class="card-header border-0">
- <h3 class="card-title">Таблица amic.ru прогноз</h3>
- <div class="card-tools">
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-download"></i>
- </a>
- <a href="https://docs.google.com/spreadsheets/d/1JTBQyUF9CEgQKF-_8vFSRMOlrlqVfs1zcdMgZkmrAaY/edit?usp=sharing" class="btn btn-tool btn-sm">
- <i class="fas fa-bars"></i>
- </a>
- </div>
- </div>
- <div class="card-body table-responsive p-0">
- <table class="table table-striped table-valign-middle">
- <thead>
- <tr class="bg-purple">
- <th>Показатель</th>
- <th>Значение</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Просмотры суммарно
- </td>
- <td class="vs">$13 USD</td>
- </tr>
- <tr>
- <td>
- Посетители суммарно
- </td>
- <td class="us">$29 USD</td>
- </tr>
- <tr>
- <td>
- Посетители среднесуточно
- </td>
- <td class="um">$29 USD</td>
- </tr>
- <tr>
- <td>
- Регионалы (Новосибирск+Барнаул+Горно-Алтайск)
- </td>
- <td class="RegEx">$29 USD</td>
- </tr>
- <tr>
- <td>
- Длительность
- </td>
- <td class="time">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Глубина
- </td>
- <td class="deep">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Ядро
- </td>
- <td class="yadroamic">$1,230 USD</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-3">
- <div class="card">
- <div class="card-header border-0">
- <h3 class="card-title">Таблица altapress.ru</h3>
- <div class="card-tools">
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-download"></i>
- </a>
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-bars"></i>
- </a>
- </div>
- </div>
- <div class="card-body table-responsive p-0">
- <table class="table table-striped table-valign-middle">
- <thead>
- <tr class="bg-purple">
- <th>Показатель</th>
- <th>Значение</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Посетителей суммарно
- </td>
- <td class="usA">$13 USD</td>
- </tr>
- <tr>
- <td>
- Просмотров суммарно
- </td>
- <td class="vsA">$29 USD</td>
- </tr>
- <tr>
- <td>
- Региональных посетителей
- </td>
- <td class="regA">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- Ядро
- </td>
- <td class="yadroA">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- % посетителей региона
- </td>
- <td class="regpA">$1,230 USD</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-3">
- <div class="card">
- <div class="card-header border-0">
- <h3 class="card-title">Таблица tolknews.ru</h3>
- <div class="card-tools">
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-download"></i>
- </a>
- <a href="#" class="btn btn-tool btn-sm">
- <i class="fas fa-bars"></i>
- </a>
- </div>
- </div>
- <div class="card-body table-responsive p-0">
- <table class="table table-striped table-valign-middle">
- <thead>
- <tr class="bg-purple">
- <th>Показатель</th>
- <th>Значение</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Посетителей суммарно
- </td>
- <td class="usT">$13 USD</td>
- </tr>
- <tr>
- <td>
- Просмотров суммарно
- </td>
- <td class="vsT">$29 USD</td>
- </tr>
- <tr>
- <td>
- Региональных посетителей
- </td>
- <td class="regT">$1,230 USD</td>
- </tr>
- <tr>
- <td>
- % посетителей региона
- </td>
- <td class="regpT">$1,230 USD</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-12">
- <div class="callout callout-info">
- <h5><i class="fas fa-info"></i> altapress.ru:</h5>
- Данные <b>altapress.ru</b> по данным liveinternet
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Посетители</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute usA"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartUsersA" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Просмотры</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute vsA"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartVisA" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Ядро</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute yadroA"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartYadroA" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Посетители amic vs altapress</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartAmA" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="callout callout-info">
- <h5><i class="fas fa-info"></i> tolknews.ru:</h5>
- Данные <b>tolknews.ru</b> по данным liveinternet
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Посетители</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute usT"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartUsersT" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Просмотры</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute vsT"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartVisT" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-body">
- <div class="row u-mb-large">
- <div class="col-xl-12">
- <div class="c-graph-card" data-mh="secondary-graphs">
- <div class="c-graph-card__content u-flex u-justify-between u-align-items-baseline">
- <h3 class="c-graph-card__title u-h4">Посетители amic vs tolknews</h3>
- <div class="u-text-right">
- <h4 class="u-h1 u-mb-zero"> <span class="u-text-small u-text-uppercase u-text-mute"> </span></h4>
- <span class="u-text-small u-text-uppercase u-text-mute">Больше - лучше</span>
- </div>
- </div>
- <div class="c-graph-card__chart">
- <canvas id="jschartAmT" height="300" role="img" ></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- <?
- $end = true;
- $dcur = strtotime($sstart);
- $m = '';
- $e = strtotime($send);
- $count = 0;
- while( $end ){
- $m .= ($m)?', ':'';
- $m .= '"'.$month[date('n', $dcur)].'"';
- $dcur = strtotime( date("Y-m-d",$dcur).' +1 month' );
- $count++;
- if( $dcur > $e ) $end = false;
- }
- $smoth = $m;
- $s = '';
- $gm = [];
- $end = true;
- $dcur = strtotime($sstart);
- $e = strtotime($send);
- while( $end ){
- $gm[] = ['g'=>date('Y', $dcur), 'm'=>date('n', $dcur)];
- $dcur = strtotime( date("Y-m-d", $dcur).' +1 month' );
- if( $dcur > $e ) $end = false;
- }
- $aregm = $model->GetRegionsSite();
- //print_a($aregm);
- ?>
- <script>
- <?
- $js_array = json_encode($gm);
- echo "var gm = ". $js_array . ";\n";
- $js_array = json_encode($aregm);
- echo "var aregm = ". $js_array . ";\n";
- ?>
- $(function(){
- var cuser = 0;
- var creg = 0;
- var regusersum = 0;
- var usersum = 0;
- var newssum = 0;
- var hdata = [];
- var myevent = new Event('alldata', {bubbles: true});
- // document.dispatchEvent(myevent);
- /*
- ###############################
- Отказы
- ###############################
- */
- $.getJSON("/manager/analytics/ajax-yglob", {dstart:'<?=$sstart?>',dend:'<?=$send?>'}, function( data ) {
- if( data.status == 'ok' ){
- var data_all = data.data;
- $.getJSON("/manager/analytics/ajax-yglob", {dstart:'<?=$sstartl?>',dend:'<?=$sendl?>'}, function( data1 ) {
- if( data1.status == 'ok' ){
- var data_l = data1.data;
- }else{
- var data_l = null;
- }
- Chuser( data_all, data_l, 'bo', 'jschartb' );
- x = data_all['bo'].split(',').map(Number);
- $('#bc').text(x[x.length-1]);
- });
- }else{
- console.log(data.msg);
- }
- });
- var automat = [
- {metr: 'https://www.liveinternet.ru/stat/amicru/visitors.csv?id=2', chart:'jschartYadro', info:'yadroamic'},
- {metr: 'https://www.liveinternet.ru/stat/amicru/index.csv?id=8&total=yes', chart:'jschartUsers', info:'us'},
- {metr: 'https://www.liveinternet.ru/stat/amicru/index.csv?id=8&total=no', chart:'jschartUsersm', info:'um'},
- {metr: 'https://www.liveinternet.ru/stat/amicru/index.csv?id=0&total=yes', chart:'jschartVis', info:'vs'},
- {metr: 'https://www.liveinternet.ru/stat/amicru/index.csv?id=ratio&total=yes', chart:'jschartDeep', info:'deep'},
- {metr: 'https://www.liveinternet.ru/stat/amicru/index.csv?id=6&total=yes', chart:'jschartTime', info:'time'},
- {metr: 'https://www.liveinternet.ru/stat/amicru/index.csv?slice=barnaul&id=8&total=yes', chart:'jschartRegion', info:'region'},
- {metr: 'https://www.liveinternet.ru/stat/amicru/searches.csv?id=total&relgraph=no&total=yes', chart:'jschartSearch', info:'search'},
- //altapress
- {metr: 'https://www.liveinternet.ru/stat/altapress/visitors.csv?id=2', chart:'jschartYadroA', info:'yadroA'},
- {metr: 'https://www.liveinternet.ru/stat/altapress/index.csv?id=8&total=yes', chart:'jschartUsersA', info:'usA'},
- {metr: 'https://www.liveinternet.ru/stat/altapress/index.csv?id=0&total=yes', chart:'jschartVisA', info:'vsA'},
- // tolknews.ru
- {metr: 'https://www.liveinternet.ru/stat/tolknews.ru/index.csv?id=8&total=yes', chart:'jschartUsersT', info:'usT'},
- {metr: 'https://www.liveinternet.ru/stat/tolknews.ru/index.csv?id=0&total=yes', chart:'jschartVisT', info:'vsT'},
- ];
- var cnt = automat.length;
- /*
- ###############################
- Обработка и вывод графиков
- ###############################
- */
- function chauto(el){
- var metr = el.metr;
- var ch = el.chart;
- var info = el.info;
- var YY = '<?=date("Y")?>';
- var MM = <?=(int) date("n")?>;
- $.getJSON("/manager/analytics/ajax-getlive", {metrics:metr,type:'2d'}, function( data ) {
- if( data.status == 'ok' ){
- // data_all = data.datas;
- console.log(data);
- cnt--;
- var l = data.data.length;
- if( typeof data.data[l-1][YY][MM] != "undefined" ){
- var shift = 1;
- }else{
- var shift = 0;
- }
- var data_sp = data.datas.split(',');
- var data_sp1 = data.datas.split(',');
- if( shift ) data_sp.pop();
- var a = data_sp.slice( data_sp.length-<?=$count?>-shift );
- var a2 = data_sp1.slice( -(<?=$count?>+12+shift) );
- var data_1 = a.toString();
- var data_2 = a2.toString();
- hdata[info] = data_1;
- if( cnt == 0 ) document.dispatchEvent(myevent);
- Chuser( data_1, data_2, '', ch );
- // x = data_1['bo'].split(',').map(Number);
- $('.'+info).text(data_sp[data_sp.length-1]);
- if( info == 'um' ){
- cuser = data_sp[data_sp.length-1];
- }
- if( info == 'um' && creg ){
- var per = Math.round( creg*100/cuser, 1);
- $('.Regp').text(per+'%');
- }
- if( info == 'us' ){
- usersum = a[a.length-1];
- if( usersum && regusersum ) {
- $('.regpercent').text(Math.round(regusersum*100/usersum,2)+'');
- }
- }
- if( info == 'region' ){
- regusersum = a[a.length-1];
- if( usersum && regusersum ) {
- $('.regpercent').text(Math.round(regusersum*100/usersum,2)+'');
- }
- }
- if( info == 'usA' ){
- $('.regpA').text( Math.round(aregm['altapress'][2]*100/a[a.length-1],1)+'' );
- $('.regA').text( aregm['altapress'][2] );
- }
- if( info == 'usT' ){
- $('.regpT').text( Math.round(aregm['tolknews.ru'][2]*100/a[a.length-1],1)+'' );
- $('.regT').text( aregm['tolknews.ru'][2] );
- }
- }else{
- console.log(data.msg);
- }
- });
- }
- /*
- ###############################
- Обход по данным из списка
- ###############################
- */
- automat.forEach( el => chauto(el) );
- /*
- ###############################
- Источники
- ###############################
- */
- $.getJSON("/manager/analytics/ajax-y-referer", {dstart:'<?=$sstart?>',dend:'<?=$send?>'}, function( data ) {
- if( data.status == 'ok' ){
- totals=data.sum[0];
- total = totals[totals.length-1];
- var dataset = [];
- var datasetn = [];
- data.data.forEach( el => {
- var ref = el.dimensions[0].name;
- var crefc = Math.round(el.metrics[0][el.metrics[0].length-1]);
- var crefp = Math.round(el.metrics[0][el.metrics[0].length-2]);
- var perc = Math.round(crefp*100/crefc,1);
- var delta = crefc-crefp;
- gper = Math.round(crefc*100/total,1);
- if( gper > 0.8 ){
- dataset.push(gper);
- datasetn.push(ref+' '+gper+'%');
- }
- if( ref == 'zen.yandex.com' ){
- $('.refdzen').text(crefc);
- }
- if( ref == 'dzen.ru' || ref == 'm.dzen.ru' ){
- newssum = newssum+crefc;
- $('.refdzennews').text(newssum);
- }
- tr = document.createElement("tr");
- td = document.createElement("td");
- newContent = document.createTextNode(el.dimensions[0].name);
- td.appendChild(newContent);
- tr.appendChild(td);
- td = document.createElement("td");
- newContent = document.createTextNode(Math.round(el.metrics[0][el.metrics[0].length-1]));
- td.appendChild(newContent);
- tr.appendChild(td);
- td = document.createElement("td");
- sty = (delta>=0)?'fa-arrow-up':'fa-arrow-down';
- sty1 = (delta>=0)?'success':'danger';
- $(td).html('<small class="text-'+sty1+' mr-1"><i class="fas '+sty+'"></i>'+perc+'%</small>');
- newContent = document.createTextNode(Math.round(delta));
- td.appendChild(newContent);
- tr.appendChild(td);
- td = document.createElement("td");
- newContent = document.createTextNode(crefp);
- td.appendChild(newContent);
- tr.appendChild(td);
- currenttab = document.getElementById("referertab");
- currenttab.appendChild(tr);
- }
- );
- $('#reftab').DataTable({paging: false,
- columnDefs: [{
- orderable: false,
- targets: 2
- }],
- "responsive": true, "lengthChange": false, "autoWidth": false,
- order: [[1, 'desc']]
- });
- $('.dataTables_length').addClass('bs-select');
- var coloR = [];
- for (let i = 0; i < dataset.length; i++) {
- coloR.push(dynamicColors());
- }
- const datas = {
- labels: datasetn,
- datasets: [
- {
- // label: 'Dataset 1',
- data: dataset,
- backgroundColor:coloR,
- }
- ]
- };
- const config = {
- type: 'doughnut',
- data: datas,
- options: {
- cutoutPercentage: 30,
- responsive: true,
- maintainAspectRatio: false,
- legend: {
- display: true,
- },
- tooltips: {
- enabled: true
- }
- },
- };
- var chart1 = document.getElementById('jschartSource');
- var barChartSales = new Chart(chart1, config);
- }else{
- console.log(data.msg);
- }
- });
- var dynamicColors = function() {
- var r = Math.floor(Math.random() * 255);
- var g = Math.floor(Math.random() * 255);
- var b = Math.floor(Math.random() * 255);
- return "rgb(" + r + "," + g + "," + b + ")";
- };
- /*
- ###############################
- Расширеный региональный трафик
- ###############################
- */
- var metr = encodeURIComponent('https://www.liveinternet.ru/stat/amicru/regions.csv?id=56&id=8&id=82&id=checked&total=yes');
- $.getJSON("/manager/analytics/ajax-getlive", {metrics:metr,type:'3d'}, function( data ) {
- if( data.status == 'ok' ){
- // data_all = data.datas;
- // console.log(data.data);
- var dreg1 = [];
- var dreg2 = [];
- var dreg3 = [];
- var dregall = [];
- gm.forEach( el => {
- // console.log(el['g']+' '+el['m']);
- dregall.push( data.data[el['g']][el['m']][4] );
- dreg1.push( data.data[el['g']][el['m']][1] );
- dreg2.push( data.data[el['g']][el['m']][2] );
- dreg3.push( data.data[el['g']][el['m']][3] );
- });
- var regAll = dregall.toString();
- var reg1 = dreg1.toString();
- var reg2 = dreg2.toString();
- var reg3 = dreg3.toString();
- //Chuser( regAll, null, '', 'jschartRegEx' );
- var dataset = [
- {
- type: 'bar',
- label: "Барнаул",
- backgroundColor: '#00aaff',
- data: dreg1,
- stack: 'Stack 0',
- }
- ];
- dataset.push( {
- type: 'bar',
- label:'Новосибирск',
- backgroundColor: '#88ff7f',
- data: dreg2,
- stack: 'Stack 0',
- });
- dataset.push( {
- type: 'bar',
- label:'Горно-Алтайск',
- backgroundColor: '#0055ff',
- data: dreg3,
- stack: 'Stack 0',
- });
- dataset.push( {
- type: 'line',
- label:'Суммарно',
- borderColor:'#ff881370',
- backgroundColor: '#ff881360',
- fill: true,
- data: dregall,
- stack: 'Stack 1',
- });
- var barChart1Datax = {
- labels: [<?=$smoth?>],
- datasets: dataset
- };
- creg = dregall[dregall.length-1];
- $('.RegEx').text(creg);
- if( cuser ){
- var per = Math.round( creg*100/cuser, 1);
- $('.Regp').text(per+'%');
- }
- // console.log(barChart1Datax);
- var chart1 = document.getElementById('jschartRegEx');
- var barChartSales = new Chart(chart1, {
- data: barChart1Datax,
- options: {
- legend: {
- display: true
- },
- barThickness: 20,
- responsive: true,
- maintainAspectRatio: true,
- scales: {
- xAxes: [{
- display: true,
- offset: true,
- ticks: {
- fontSize: '11',
- fontColor: '#969da5'
- },
- }],
- yAxes: [{
- display: true,
- ticks: {
- beginAtZero: true,
- // max: 100
- }
- }],
- }
- }
- });
- }else{
- console.log(data.msg);
- }
- });
- document.addEventListener("alldata", function(event) {
- /*
- ###############################
- ### Сравнение с алтапресс ###
- ###############################
- */
- var data_1 = hdata['us'];
- var data_2 = hdata['usA'];
- gr = Chuser( data_1, data_2, '', 'jschartAmA', 'amic.ru', 'altapress.ru', false );
- // gr.legend.legendItems[0].text = 'amic.ru';
- // gr.legend.legendItems[1].text = 'altapress.ru';
- /*
- ###############################
- ### Сравнение с tolknews ###
- ###############################
- */
- var data_1 = hdata['us'];
- var data_2 = hdata['usT'];
- gr = Chuser( data_1, data_2, '', 'jschartAmT', 'amic.ru', 'tolknews.ru', false );
- });
- /*
- ###############################
- ### Вывод графика ###
- ###############################
- */
- function Chuser( data, data2, t, el, t1='Текущий период', t2='Предыдущий период', tr=true ){
- var chart1 = document.getElementById(el);
- // var chart1 = $('#'+el).get(0).getContext('2d');
- // console.log( data['u'].split(',').map(Number) );
- if( t == '' ){
- if( Array.isArray(data) ){
- var datac = data;
- }else{
- var datac = data.split(',').map(Number)
- }
- if( data2 !== null ){
- var datal = data2.split(',').map(Number)
- }
- if( datac.length < 2 ){
- datac.push(0)
- }
- }else{
- // data[t] = data[t] + ',0'
- var datac = data[t].split(',').map(Number)
- if( data2 !== null ){
- var datal = data2[t].split(',').map(Number)
- }
- if( datac.length < 2 ){
- datac.push(0)
- }
- }
- var dataset = [
- {
- label: t1,
- fill: true,
- backgroundColor: '#00aaff',
- data: datac,
- type: 'bar'
- }
- ];
- if( data2 !== null ){
- dataset.push( {
- label: t2,
- fill: true,
- backgroundColor: '#ffaa7f50',
- data: datal,
- type: 'bar'
- });
- }
- if( tr ){
- dataset.push( {
- fill: false,
- label:'трэнд',
- borderColor:'#00aa00',
- backgroundColor: '#ffff7f20',
- data: datac,
- type: 'line'
- });
- }
- //console.log(dataset);
- var barChart1Data = {
- labels: [<?=$smoth?>],
- datasets: dataset
- };
- if(chart1) {
- var barChartSales = new Chart(chart1, {
- data: barChart1Data,
- options: {
- legend: {
- display: true
- },
- barThickness: 20,
- responsive: true,
- maintainAspectRatio: false,
- scales: {
- xAxes: [{
- display: true,
- offset: true,
- ticks: {
- fontSize: '11',
- fontColor: '#969da5'
- },
- gridLines: {
- color: 'rgba(0,0,0,0.5)',
- zeroLineColor: 'rgba(0,0,0,0.5)'
- }
- }],
- yAxes: [{
- display: true,
- ticks: {
- beginAtZero: true,
- // max: 100
- }
- }]
- }
- }
- });
- return barChartSales;
- }
- }
- });
- <?=$this->render('/stats/chartjs');?>
- </script>
|