<div class="content-area knowledge-base-wraper">
    <div class="container">
        <div class="knowledge-base-search2">
            <div class="knowledge-base-search-box2">
                <h1>
                    <?php echo $this->user->lang('Knowledge Base'); ?>
                </h1>
                <div class="knowledge-search-box">
                    <form action="index.php" method="GET" id="support-search" class="support-search-big">
                        <input type="hidden" name="fuse" value="knowledgebase">
                        <input type="hidden" name="controller" value="articles">
                        <input type="hidden" name="view" value="search">
                        <input name="subject" type="text" class="knowledge-search-input" placeholder="<?php echo $this->user->lang('Enter your question'); ?>">
                        <input type="submit" class="knowledge-search-submit" value="">
                    </form>
                </div>
                <p>
                <?php
                    echo $this->user->lang(
                        "Can't find what you're looking for? %sCreate a ticket.%s",
                        '<a href="index.php?fuse=support&controller=ticket&view=submitticket">',
                        '</a>'
                    );
                ?>
                </p>
            </div>
        </div>
        <?php if (count($this->category) > 0 && count($this->category['articles']) > 0) { ?>
        <div class="knowledge-base-boxes-block">
            <div class="row">
                <div class="col-lg-12 col-md-6-12">
                    <div class="knowledge-base-box">
                        <h4>
                            <a href="<?php echo $category['href']; ?>">
                                <?php
                                    echo html_entity_decode($this->category['categoryName'], ENT_QUOTES); ?>
                            </a>
                        </h4>
                        <ul class="knowledge-box-ul">
                            <?php foreach ($this->category['articles'] as $article) { ?>
                            <li>
                                <a class="articleName" data-order="<?php echo $article['myorder'];?>" href="<?php echo $article['href']; ?>">
                                    <?php echo html_entity_decode($this->escape($article['title']), ENT_QUOTES); ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <?php } ?>
        <?php if (count($this->categories) > 0) {?>
        <div class="knowledge-base-boxes-block">
            <div class="row">
                <?php foreach ($this->categories as $category) { ?>
                <div class="col-lg-4 col-md-6">
                    <div class="knowledge-base-box">
                        <h4>
                            <a href="<?php echo $category['href']; ?>">
                                <?php
                                    echo html_entity_decode($category['categoryName'], ENT_QUOTES) . ' (' . $category['categoryCounter']. ')'; ?>
                            </a>
                        </h4>
                        <ul class="knowledge-box-ul cm-height">
                            <?php foreach ($category['articles'] as $article) { ?>
                            <li>
                                <a href="<?php echo $article['href']; ?>">
                                    <?php echo html_entity_decode($this->escape($article['title']), ENT_QUOTES); ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                        <a href="<?php echo $category['href']; ?>" class="show-all-btn">
                            <span class="show-all">
                                <?php echo $this->user->lang('SHOW ALL'); ?>
                            </span>
                        </a>
                    </div>
                </div>
                <?php } ?>
            </div>
        </div>
        <?php } ?>
    </div>
</div>