<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
use Bookly\Backend\Components\Controls\Buttons;
use Bookly\Backend\Components\Controls\Inputs;
use Bookly\Backend\Components\Support\Lib\Urls;
use Bookly\Lib\Utils;
?>
<style type="text/css">
    #bookly-tbs .page-header > .popover {
        z-index: 1039;
    }
</style>
<span class="bookly-support-panel">
    <?php
    /**
     * Messages
     */
    ?>
    <?php if ( Utils\Common::isCurrentUserAdmin() ) : ?>
        <span class="dropdown">

            <?php if ( $messages_new ) : ?>
                <span class="badge bookly-js-new-messages-count"><?php echo $messages_new ?></span>
            <?php endif ?>
            <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="bookly-bell">
                <?php foreach ( $messages as $message ) : ?>
                    <li><a href="<?php echo $messages_link ?>"><?php echo Utils\DateTime::formatDate( $message['created'] ) . ': ';
                            if ( $message['seen'] ) :
                                echo esc_html( $message['subject'] );
                            else:
                                echo '<b>' . esc_html( $message['subject'] ) . '</b>';
                            endif ?>
                        </a></li>
                <?php endforeach ?>
                <li role="separator" class="divider"></li>
                <li><a href="<?php echo $messages_link ?>"><?php esc_html_e( 'Show all notifications', 'bookly' ) ?></a></li>
                <?php if ( $messages_new ) : ?>
                    <li><a href="#" id="bookly-js-mark-read-all-messages"><?php esc_html_e( 'Mark all notifications as read', 'bookly' ) ?></a></li>
                <?php endif ?>
            </ul>
        </span>
    <?php endif ?>

    <?php
    /**
     * View demo
     */
    ?>
    <?php if ( isset( $demo_links[ $page_slug ] ) ) :
        $target = Utils\Common::prepareUrlReferrers( $demo_links[ $page_slug ], 'demo' ); ?>
        <?php if ( get_user_meta( get_current_user_id(), 'bookly_dismiss_demo_site_description', true ) ) : ?>

        <?php else : ?>
            <div id="bookly-demo-site-info-modal" class="modal fade text-left" tabindex=-1>
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                            <h4 class="modal-title"><?php esc_html_e( 'Visit demo', 'bookly' ) ?></h4>
                        </div>
                        <div class="modal-body">
                            <p>
                                <?php esc_html_e( 'The demo is a version of Bookly Pro with all installed add-ons so that you can try all the features and capabilities of the system and then choose the most suitable configuration according to your business needs.', 'bookly' ) ?>
                            </p>
                            <div class="form-inline">
                                <input type="checkbox" id="bookly-js-dont-show-again" /> <label class="bookly-checkbox-text" for="bookly-js-dont-show-again"><?php esc_html_e( 'don\'t show this notification again', 'bookly' ) ?></label>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <?php Buttons::renderCustom( null, 'bookly-js-proceed-to-demo btn-success btn-lg', esc_html__( 'Proceed to demo', 'bookly' ), array( 'data-target' => $target ) ) ?>
                            <?php Buttons::renderCustom( null, 'btn-default btn-lg', esc_html__( 'Cancel', 'bookly' ), array( 'data-dismiss' => 'modal' ) ) ?>
                        </div>
                    </div>
                </div>
            </div>
            <button data-action="show-demo" class="btn btn-default-outline" title="<?php esc_attr_e( 'View this page at Bookly Pro Demo', 'bookly' ) ?>">
                <i class="fas fa-certificate"></i> <span class="visible-lg-inline"><?php esc_html_e( 'View this page at Bookly Pro Demo', 'bookly' ) ?></span>
            </button>
        <?php endif ?>
    <?php endif ?>

    <?php
    /**
     * Documentation
     */

    ?>
    <a href="<?php echo esc_url( 'http://proje724.ir' ) ?>" id="bookly-help-btn" target="_blank" class="btn btn-default-outline" title="<?php esc_attr_e( 'Documentationx', 'bookly' ) ?>">
        <i class="fas fa-question-circle"></i> <span class="visible-lg-inline"><?php $strpro = '2b7YsdmI2pjZhyA3MjQ=';?> <?php esc_html_e( base64_decode($strpro), 'bookly' ) ?></span>
    </a>

    <?php
    /**
     * Contact us
     */
    ?>


    <?php
    /**
     * Feature requests
     */
    ?>
    <?php if ( get_user_meta( get_current_user_id(), 'bookly_dismiss_feature_requests_description', true ) ) : ?>

    <?php else : ?>


    <?php endif ?>

    <?php
    /**
     * Feedback
     */
    ?>

    <div id="bookly-support-modal" class="modal fade text-left" tabindex=-1>
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title"><?php esc_html_e( 'Leave us a message', 'bookly' ) ?></h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="bookly-support-name" class="control-label"><?php esc_html_e( 'Your name', 'bookly' ) ?></label>
                        <input type="text" id="bookly-support-name" class="form-control" value="<?php echo esc_attr( $current_user->user_firstname . ' ' . $current_user->user_lastname ) ?>" />
                    </div>
                    <div class="form-group">
                        <label for="bookly-support-email" class="control-label"><?php esc_html_e( 'Email address', 'bookly' ) ?> <span class="bookly-color-brand-danger">*</span></label>
                        <input type="text" id="bookly-support-email" class="form-control" value="<?php echo esc_attr( $current_user->user_email ) ?>" />
                    </div>
                    <div class="form-group">
                        <label for="bookly-support-msg" class="control-label"><?php esc_html_e( 'How can we help you?', 'bookly' ) ?> <span class="bookly-color-brand-danger">*</span></label>
                        <textarea id="bookly-support-msg" class="form-control" rows="10"></textarea>
                    </div>
                </div>
                <div class="modal-footer">
                    <?php Inputs::renderCsrf() ?>
                    <?php Buttons::renderCustom( 'bookly-support-send', 'btn-success btn-lg', esc_html__( 'Send', 'bookly' ) ) ?>
                    <?php Buttons::renderCustom( null, 'btn-default btn-lg', esc_html__( 'Cancel', 'bookly' ), array( 'data-dismiss' => 'modal' ) ) ?>
                </div>
            </div>
        </div>
    </div>
</span>