<?php require_once(THEME_ROOT . '/blocks/head.php'); ?>
<?php require_once(THEME_ROOT . '/blocks/top.php'); ?>

    <br><br>
    <div class="container">
        <div class="row">
            <div class="main" style="text-align:center;">
                <h3><?php echo T('Раздел Поддержки'); ?></h3>

                <a href="/user/tickets" class="top-link-active">
                    <i class="fa fa-arrow-circle-o-down"></i> 
                    <?php echo T('Мои тикеты'); ?>
                </a>
                <a href="/user/new_ticket" class="top-link">
                    <i class="fa fa-arrow-circle-o-up"></i> 
                    <?php echo T('Создать тикет'); ?>
                </a>
            </div>
            <div class="col-sm-12 col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><?php echo T('Ваши обращения'); ?></h3>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered-off table-striped-off table-hover-off" style="margin-bottom: 0px; text-align: center;">
                            <thead>
                                <tr class="active" style="font-weight: 600;">
                                    <td><?php echo T('Дата обращения'); ?></td>
                                    <td><?php echo T('Заголовок'); ?></td>
                                    <td><?php echo T('Статус'); ?></td>
                                </tr>
                            </thead>

                            <tbody>
                                <?php $list = support_get_appeal_list($login);
                                if($list) {
                                    foreach ($list as $row) { ?>
                                        <tr>
                                            <td>
                                                <p><?php echo format_date($row['date']); ?></p>
                                            </td>
                                            <td>
                                                <p>
                                                    <a href="/user/ticket_id/?id=<?php echo $row['id'] ?>">
                                                        <?php echo escape($row['subject']); ?> (<?php echo T('Посмотреть'); ?>)
                                                    </a>
                                                </p>
                                            </td>
                                            <td align="center">
                                                <p>
                                                    <?php echo support_status($row['status']); ?>
                                                </p>
                                            </td>
                                        </tr>
                                    <?php }
                                } else { ?>
                                    <tr>
                                        <td colspan="3" class="danger" align="center">
                                            <?php echo T('Записей не обнаружено'); ?>
                                        </td>
                                    </tr>
                                <?php } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php require_once(THEME_ROOT."/blocks/footer.php"); ?>


