<?php
include_once(_DIR_TO_CLASS . '/c_page.php');

class c_page_cab_send_report_journal extends c_page
{
    public $h1 = 'Журнал';
    public $journal_report = [];

    function set_head_tags()
    {
        parent::set_head_tags();
        $this->HEAD['css'][] = _PATH_TO_EXT . '/send_report/style.css';
    }

    function second_menu_config()
    {
        $this->second_menu['/cab/send_report/'] = array('title' => 'Список отчетов');
        $this->second_menu['/cab/send_report/journal/'] = array('title' => 'Журнал');
    }

    function block_main()
    {
        $this->journal_report = SEND_REPORT()->get_send_report_journal();
        ?>
        <table class="basic full send_report_list">
            <tr>
                <th>ID</th>
                <th>Дата</th>
                <th>Отчет</th>
                <th>Отправка</th>
                <th>Получатели</th>
                <th>Тип</th>
            </tr>
            <?
            foreach ($this->journal_report as $rec) {
                ?>
                <tr>
                    <td><? echo $rec['pkey'] ?></td>
                    <td><? echo $rec['date'] ?></td>
                    <td><? echo $rec['obj_name'] ?></td>
                    <td><? echo $rec['send_name'] ?></td>
                    <td><? echo $rec['send_email'] ?></td>
                    <td><? switch ($rec['send_type']) {
                            case '0': echo 'Период день'; break;
                            case '1': echo 'Период неделя'; break;
                            case '2': echo 'Период месяц'; break;
                            case '3': echo 'Цикл день'; break;
                            case '4': echo 'Цикл неделя'; break;
                            case '5': echo 'Цикл месяц'; break;
                        }
                        ?></td>
                </tr>
                <?
            }
            ?>
        </table>
    <?}


}

?>