<!DOCTYPE html>
<html lang="{$lang.short_name}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{$cur_title} - {$config.application}</title>
<link rel="icon" href="images/{if $config.alt_favicon}alt_{/if}favicon.{$config.fav_ext}" type="image/x-icon">
<link rel="stylesheet" href="themes/default/css/fonts.css?{$revision}">
<link rel="stylesheet" href="themes/default/css/style.css?{$revision}">
<script src="themes/default/js/script.js?{$revision}"></script>
</head>

<body>
{include file="templates/index_add.tpl"}
<div id="header">
    <div class="header clearfix">
        <div class="menu_opener clearfix">
            <a href="#" class="menu_opener_btn">
                <span class="btn_icon">
                    <span></span>
                    <span></span>
                    <span></span>
                </span>
                <img src="cache/logo{$config.logo_rand}.{if $config.logo_svg}svg{else}png{/if}" alt="">
            </a>
        </div>
        <div class="right_head clearfix">
            <div class="head_search">
                <input type="submit" value="">
                <input type="text" placeholder="Поиск по программе">
            </div>
            <div class="head_more">
                <ul class="head_more_ul clearfix">
                    {if $user.group_id == 1}
                    <li class="settings">
                        <a href="edit_cat.php" title="{$lang.Settings}"> <!-- class="table_popup_btn" -->
                            <img src="themes/default/images/settings_icon.png" alt="">
                        </a>
                    </li>
                    {/if}
                    <li class="notice header_events_count">
                        <a href="" onclick="eventView('tip'); return false;" title="{$lang.Tips}"> <!-- class="notice_btn" -->
                            <img src="themes/default/images/notice_btn.png" alt="">
                            <span id="tips_count">{$b_events.tip.count}</span>
                        </a>
                        <div class="notice_open">
                            <div class="notice_open_block">
                                <div class="notice_open_title clearfix">
                                    <h4>напоминания</h4>
                                    <a href="#" class="notice_close_btn">
                                        <img src="themes/default/images/x.png" alt="">
                                    </a>
                                </div>
                                <div class="notice_open_body">
                                    <div class="tab" id="tab">
                                        <div id="tab_navbar">
                                            <a href="javascript:void(0);" id="tab1" class="tab_btn active">Все</a>
                                            <a href="javascript:void(0);" id="tab2" class="tab_btn">Активные</a>
                                            <a href="javascript:void(0);" id="tab3" class="tab_btn">Сегодня</a>
                                            <a href="javascript:void(0);" id="tab4" class="tab_btn">Важные</a>
                                            <a href="javascript:void(0);" id="tab5" class="tab_btn">Архив</a>
                                            <div class="tab_navbar_search">
                                                <a href="#"><img src="themes/default/images/grey_search.png" alt=""></a>
                                            </div>
                                        </div>
                                        <div class="tab_body">
                                            <div id="con_tab1" class="notice_tab_blocks active">
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_archive clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>17</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/archive_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Архив! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_spacial clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>21</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/spacial_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Важные!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_active clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>20</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/active_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Активные! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_today clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>22</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/today_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Сегодня!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                            </div>
                                            <div id="con_tab2" class="notice_tab_blocks">
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_active clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>20</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/active_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Активные! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_active clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>20</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/active_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Активные! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_active clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>20</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/active_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Активные! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_active clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>20</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/active_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Активные! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                            </div>
                                            <div id="con_tab3" class="notice_tab_blocks">
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_today clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>22</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/today_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Сегодня!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_today clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>22</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/today_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Сегодня!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_today clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>22</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/today_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Сегодня!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_today clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>22</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/today_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Сегодня!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                            </div>
                                            <div id="con_tab4" class="notice_tab_blocks">
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_spacial clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>21</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/spacial_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Важные!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_spacial clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>21</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/spacial_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Важные!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_spacial clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>21</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/spacial_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Важные!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_spacial clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>21</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/spacial_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Важные!  запланирован платеж!
                                                            <br> Описание: Проверка создания расходов</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                            </div>
                                            <div id="con_tab5" class="notice_tab_blocks">
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_archive clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>17</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/archive_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Архив! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_archive clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>17</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/archive_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Архив! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_archive clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>17</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/archive_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Архив! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                                <div class="notice_body_blocks">
                                                    <a href="#" class="notice_body_btn_blocks notice_archive clearfix">
                                                        <span class="span_type">
                                                            <span class="span_date">
                                                                <span><b>17</b> <br>июн</span>
                                                            </span>
                                                            <img src="themes/default/images/archive_icon.png" alt="">
                                                        </span>
                                                        <span class="span_text">
                                                            <span>Архив! запланирован платеж!
                                                            <br> Описание: Покупка питьевой воды</span>
                                                        </span>
                                                    </a>
                                                    <a href="#" class="favorite_btn"></a>
                                                    <a href="#" class="notice_body_blocks_delete_btn"><img src="themes/default/images/x.png" alt=""></a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                    {if $window_calendar_data.calendars[$user.id]|count>1 || ($window_calendar_data.calendars[$user.id]|count_cb==0 and $user.group_id==1)}
                    <li class="calendar header_events_count">
                        <a href="" onclick="eventView('calendar'); return false;" title="{$lang.Calendars}">
                            <img src="themes/default/images/calendar_btn.png" alt="">
                            <span id="calendar_count">{$window_calendar_data.allTodayEventCnt[$dayToday][$user.id]}</span>
                        </a>
                    </li>
                    {elseif $window_calendar_data.calendars[$user.id]|count_cb==1}
                    <li class="calendar header_events_count">
                        <a href="calendar.php?id={$window_calendar_data.calendars[$user.id][0].id}" title="{$lang.Calendars}">
                            <img src="themes/default/images/calendar_btn.png" alt="">
                        </a>
                    </li>
                    {/if}
                    {if $user.acc_messages}
                    <li class="message header_events_count">
                        <a href="" onclick="eventView('message'); return false;" title="{$lang.Messages}">
                            <img src="themes/default/images/message_btn.png" alt="">
                            <span id="message_count">{$b_events.message.count}</span>
                        </a>
                    </li>
                    {/if}
                    {if $all_bizprocs or $user.group_id==1 or $user.sub_admin_rights.addit_bizproc}
                    <li class="bizproc">
                        <a href="" onclick="bizproc_view(); return false;" title="{$lang.Business_processes}">
                            <img src="images/business-processes.png" alt="">
                        </a>
                    </li>
                    {/if}
                    {if $user.browser_caller}
                    <li class="phone">
                        <a href="phone.php" title="Окно для звонков" target="phone_window">
                            <img src="images/phone-icon.png" alt=""/>
                        </a>
                    </li>
                    {elseif $records_table_link}
                    <li class="phone">
                        <a href="fields.php?table={$records_table_link}" title="Таблица записи разговоров">
                            <img src="images/phone-icon.png" alt=""/>
                        </a>
                    </li>
                    {/if}
                    {if $user.group_id == 1}
                    <li class="help">
                        <a href="edit_support.php" title="{$lang.Support}">
                            <img src="images/top_icon_help.png" alt=""/>
                        </a>
                    </li>
                    {/if}
                    <li class="account">
                        <a href="#" class="acc_btn">
                            <span class="account_img">
                                <img src="themes/default/images/user_pic.png" alt="">
                            </span>
                        </a>
                        <div class="account_open">
                            <div class="account_open_block">
                                <ul>
                                    <li class="user_li">
                                        <a href="user_profile.php">Профиль</a>
                                    </li>
                                    <!-- li class="edit_li">
                                        <a href="#">Редактировать</a>
                                    </li>
                                    <li class="business_procesies_li">
                                        <a href="#">Бизнес-процессы</a>
                                    </li>
                                    <li class="help_li">
                                        <a href="#">Помощь</a>
                                    </li -->
                                    <li class="sign_li">
                                        <a href="login.php?logout">Выход</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div id="main">
    <div class="main clearfix">
        <div class="main_left open">
            <ul class="left_menu_list">
                {foreach from=$user_cats item=one_cat}
                <li id="category{$one_cat.id}" {if $one_cat.id == $cur_cat}class="active"{/if}>
                    <script>
                        function switch_category(cat_id) {
                            if ($('#category' + cat_id).hasClass('active')) {
                                $('#category' + cat_id).removeClass('active');
                            } else {
                                $('.left_menu_list li').removeClass('active');
                                $('#category' + cat_id).addClass('active');
                            }
                        }
                    </script>
                    <a href="{$one_cat.url}" onclick="switch_category({$one_cat.id}); return false;">
                        <img src="themes/default/images/left_menu_icons/2.png" alt="">
                        {$one_cat.name}
                    </a>
                    <div class="left_menu_tables_block">
                        <div class="left_menu_tables_block_scroll">
                            <ul>
                                {foreach from=$one_cat.user_tabs item=one_tab}
                                <li>
                                    {if $one_tab.type=="table"}
                                    <a href="fields.php?table={$one_tab.id}" {if $one_tab.id == $cur_table}class="active"{/if}>{$one_tab.name}</a>
                                    {elseif $one_tab.type=="report"}
                                    <a href="report.php?id={$one_tab.id}" {if $one_tab.id == $cur_report}class="active"{/if}>{$one_tab.name}</a>
                                    {else}
                                    <a href="calendar.php?id={$one_tab.id}" {if $one_tab.id == $cur_calendar}class="active"{/if}>{$one_tab.name}</a>
                                    {/if}
                                </li>
                                {/foreach}
                            </ul>
                            <!-- div class="input_text_table">
                                <input type="text" class="input_text input_text_table_input" value="найти таблицу" readonly>
                                <div class="input_text_table_select">
                                    <div class="input_text_table_select_head">
                                        <h4>таблицы</h4>
                                        <a href="#" class="close">
                                            <img src="themes/default/images/x.png" alt="">
                                        </a>
                                    </div>
                                    <div class="input_text_table_select_body">
                                        <ul class="filter_ul">
                                            <li><a href="#">таблица 1</a></li>
                                            <li><a href="#">таблица 2</a></li>
                                            <li><a href="#">таблица 3</a></li>
                                            <li><a href="#">таблица 4</a></li>
                                            <li><a href="#">таблица 5</a></li>
                                            <li><a href="#">таблица 6</a></li>
                                            <li><a href="#">таблица 7</a></li>
                                            <li><a href="#">таблица 8</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div -->
                        </div>
                    </div>
                </li>
                {/foreach}
            </ul>
            <a href="edit_table.php?cat={$cur_cat}&table=-1" class="add_table">Добавить таблицу</a>
        </div>
        <div class="main_right open">
            <div class="main_right_block">
