<?php

/*
* Title                   : Pinpoint Booking System WordPress Plugin (PRO)
* File                    : views/smses/views-backend-smses.php
* Author                  : PINPOINT.WORLD
* Copyright               : © 2018 PINPOINT.WORLD
* Website                 : http://www.pinpoint.world
* Description             : Back end smses views class.
*/

if (!class_exists('DOPBSPViewsBackEndSmses')){
    class DOPBSPViewsBackEndSmses extends DOPBSPViewsBackEnd{
        /*
         * Returns SMSes template.
         *
         * @param args (array): function arguments
         *
         * @return SMSes HTML page
         */
        function template($args = array()){
            global $DOPBSP;
            global $DOT;

            $this->getTranslation();
            ?>
            <div class="wrap DOPBSP-admin">

                <!--
                    Header
                -->
                <?php $this->displayHeader($DOPBSP->text('TITLE'),
                                           $DOPBSP->text('SMSES_TITLE')); ?>
                <input type="hidden" name="DOPBSP-sms-ID" id="DOPBSP-sms-ID" value="" />

                <!--
                    Content
                -->
                <div class="dopbsp-main dopbsp-hidden">
                    <table class="dopbsp-content-wrapper">
                        <colgroup>
                            <col id="DOPBSP-col-column1" class="dopbsp-column1" />
                            <col id="DOPBSP-col-column-separator1" class="dopbsp-separator" />
                            <col id="DOPBSP-col-column2" class="dopbsp-column2" />
                        </colgroup>
                        <tbody>
                            <tr>
                                <td id="DOPBSP-column1" class="dopbsp-column">
                                    <div class="dopbsp-column-header">
                                        <?php
                                        if ($DOT->get('page')
                                                && $DOPBSP->classes->backend_settings_users->permission(wp_get_current_user()->ID,
                                                                                                        'use-booking-system')){
                                            ?>
                                            <a href="javascript:DOPBSPBackEndSms.add()" class="dopbsp-button dopbsp-add">
                                                <span class="dopbsp-info"><?php $DOT->echo($DOPBSP->text('SMSES_ADD_SMS_SUBMIT')); ?></span>
                                            </a>
                                            <a href="<?php $DOT->echo(DOPBSP_CONFIG_HELP_DOCUMENTATION_URL,
                                                                      'url'); ?>" target="_blank" class="dopbsp-button dopbsp-help">
                                                <span class="dopbsp-info dopbsp-help">
                                                    <?php $DOT->echo($DOPBSP->text('SMSES_HELP')); ?>
                                                    <br /><br />
                                                    <?php $DOT->echo($DOPBSP->text('SMSES_ADD_SMS_HELP')); ?>
                                                    <br /><br />
                                                    <?php $DOT->echo($DOPBSP->text('HELP_VIEW_DOCUMENTATION')); ?>
                                                </span>
                                            </a>

                                            <?php
                                        }
                                        else{
                                            ?>
                                            <a href="<?php $DOT->echo(DOPBSP_CONFIG_HELP_DOCUMENTATION_URL,
                                                                      'url'); ?>" target="_blank" class="dopbsp-button dopbsp-help">
                                                <span class="dopbsp-info dopbsp-help">
                                                    <?php $DOT->echo($DOPBSP->text('SMSES_HELP')); ?>
                                                    <br /><br />
                                                    <?php $DOT->echo($DOPBSP->text('HELP_VIEW_DOCUMENTATION')); ?>
                                                </span>
                                            </a>
                                            <?php
                                        }
                                        ?>
                                        <br class="dopbsp-clear" />
                                    </div>
                                    <div class="dopbsp-column-content">&nbsp;</div>
                                </td>
                                <td id="DOPBSP-column-separator1" class="dopbsp-separator"></td>
                                <td id="DOPBSP-column2" class="dopbsp-column">
                                    <div class="dopbsp-column-header">&nbsp;</div>
                                    <div class="dopbsp-column-content">&nbsp;</div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <?php
        }
    }
}