<?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/chartjs.js') // old unknow version
    ->appendFile('/js/chartCircle.js') //custom scripts for old version of chart.js
    ->appendFile('/js/chartLine.js') //custom scripts for old version of chart.js
    ->appendFile('/js/script-statistics.js')
;

$this->headLink()
    ->appendStylesheet('/css/styles-statistics.css');


/** @var \App\Entity\Statistic\Site $siteStatistic */
?>

<section class="b-content__title">
    <div class="wrapp">
        <h1><?= _t("Статистика") ?></h1>
        <div class="row">
            <p class="lead col sm-offset-1 sm-10"><?= sprintf(
                    _t("Статистика обновляется ежедневно и охватывает более %s с площадок различной направленности в Украине, России и Казахстане"),
                    $siteStatistic->getSitesCount()) ?> </p>
        </div>
    </div>
</section>

<?= $this->partial('app::statistics/losses') ?>
<?= $this->partial('app::statistics/use-block') ?>
<?= $this->partial('app::statistics/traffic') ?>

<section class="b-content__contact">
    <div class="wrapp">
        <h1><?= _t("Узнайте сколько теряет ваш сайт!") ?></h1>
        <p class="text"><?= _t("Интегрируйте наш счётчик бесплатно и оцените потери сайта из-за блокировщиков.") ?></p>
        <div class="row row-wrap">
            <form action="<?= $this->url('email.counter') ?>" method="post" accept-charset="utf-8" class="form-contact col sm-offset-3 sm-6 xs-offset-2 xs-8" name="contact-email">
            <span class="input input--akira">
            <input class="input__field input__field--akira" type="email" id="e-mail"  name="email" />
            <label class="input__label input__label--akira" for="e-mail">
              <span class="input__label-content input__label-content--akira"><?= _t("Ваш e-mail") ?></span>
            </label>
            </span>
                <input type="submit" value="<?= _t('Получить счетчик')?>">
            </form>
        </div>
        <p class="text">
            <span><?= _t("Уже установили счётчик?") ?></span>
            <a href="#" class="link login-button button-open"><?= _t("Войти в личный кабинет") ?></a>
        </p>
    </div>

</section>
