{if !isset($RSThemes['pages'][$templatefile]['config']['hideKnowledgebaseSearchbar']) || $RSThemes['pages'][$templatefile]['config']['hideKnowledgebaseSearchbar'] != '1'}
    <div class="section">
        <div class="section-header">
            <h2 class="section-title">{$rslang->trans('support.need_help')}</h2>
        </div>
        <div class="section-body">
            <div class="search-box search-box-{$searchBoxStyle}">
                <div role="form" data-knowledgebase-search data-ajax-url="{$WEB_ROOT}/templates/{$template}">
                    <div class="search-group search-group-lg">
                        <div class="search-field">
                            <input 
                                class="form-control" 
                                type="text" 
                                name="search" 
                                placeholder="{$LANG.howcanwehelp}" 
                                data-knowledgebase-search-input
                            />
                            <div class="search-field-icon"><i class="lm lm-search" aria-hidden="true"></i></div>
                            <div class="search-field-loader loader hidden" data-knowledgebase-search-loader>                     
                                {include file="$template/includes/common/loader.tpl" classes="spinner-sm"}
                            </div>
                            <div class="search-field-results list-group" data-knowledgebase-search-results data-lang-nodata="{$LANG.knowledgebasenoarticles}" data-lang-nodata-desc="{$rslang->trans('support.kb_search_sidebar.no_data_desc')}" data-btn-clear-lang="{$rslang->trans('generals.clear_filters')}"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{/if}
        <div class="section">
    <div class="section-header">
        <h2 class="section-title">{$rslang->trans('support.choose_support_department')}</h2>
    </div>
    <div class="section-body">
        {if $departments}
            <div class="row row-eq-height">
                {foreach from=$departments key=num item=department}
                    <div class="col-md-4">
                        <a tabindex="0" href="{$smarty.server.PHP_SELF}?step=2&amp;deptid={$department.id}" class="panel panel-default panel-support panel-department-box">
                            <div class="panel-body">
                                <h5 class="support-title">
                                {if is_array($graphics['department']) && $graphics['department'][$department.id]->enabled && $graphics['department'][$department.id]->getJson()->condensed->type}
                                    {assign var=graphic value=$graphics['department'][$department.id]->getJson()->condensed->graphic}
                                    {assign var=graphicType value=$graphics['department'][$department.id]->getJson()->condensed->type}
                                    <span class="graphic-item">
                                        {if $graphicType == "icon"}
                                                {include file="$template/assets/svg-icon/{$graphic}"}
                                        {else if $graphicType == "media"}
                                            <img src="{$WEB_ROOT}/templates/{$template}/assets/img/page-manager/{$graphic}" alt="{$department.name}">
                                        {else if $graphicType == "font-icon"}
                                            <span class="graphic-item-bg">
                                                <i class="{$graphic}"></i>
                                            </span>
                                        {/if}
                                    </span>
                                {else}
                                    <i class="lm lm-envelope"></i>
                                {/if}
                                    {$department.name}
                                </h5>
                                {if $department.description}
                                    <p class="support-desc text-body-color">{$department.description}</p>
                                {/if}
                            </div>
                            <div class="panel-footer">
                                 <span class="btn btn-sm btn-primary-faded btn-block">{$LANG.navopenticket}</span>
                            </div>
                            {* If active supporthours in department  *}
                            {if $supportHours && file_exists("templates/$template/includes/support-hours/departments-hours.tpl")}
                                {include file="{$template}/includes/support-hours/departments-hours.tpl"}
                            {/if}
                            {* 
                                -- Start of integration code --
                                - Integration code for: Premium Support Tickets For WHMCS from ModulesGarden
                                - Module URL: https://www.modulesgarden.com/products/whmcs/premium-support-tickets
                            *}
                            {if $PremiumSupportTickets.$num}
                                <div class="panel-footer">                       
                                    {if $PremiumSupportTickets.$num.canCreate}
                                        <span class="label label-success">{$PremiumSupportTickets.$num.message}</span>
                                        <p>
                                            {$PremiumSupportTickets.$num.havePointsMsg} {$PremiumSupportTickets.$num.havePoints}
                                        </p>
                                    {else}
                                        <span class="label label-danger">{$PremiumSupportTickets.$num.message}</span>
                                        <p>
                                            {$PremiumSupportTickets.$num.requiredPointsMsg} {$PremiumSupportTickets.$num.requiredPoints} <br />
                                            {$PremiumSupportTickets.$num.havePointsMsg} {$PremiumSupportTickets.$num.havePoints} <br />
                                        </p>
                                    {/if}
                                </div>
                            {/if}
                            {* -- End of integration code -- *}
                        </a>    
                        
                    </div>
                {/foreach}
            </div>
        {else}
            <div class="message message-no-data">
                <div class="message-image">
                    {include file="$template/includes/common/svg-icon.tpl" icon="ticket"}  
                </div>
                <h6 class="message-title">{$LANG.nosupportdepartments}</h6>
            </div>
        {/if}
    </div>
</div>