<?php

/*
* Title                   : Pinpoint Booking System WordPress Plugin (PRO)
* Version                 : 2.1.2
* File                    : views/extras/views-backend-extras.php
* File Version            : 1.0.6
* Created / Last Modified : 11 October 2015
* Author                  : Dot on Paper
* Copyright               : © 2012 Dot on Paper
* Website                 : http://www.dotonpaper.net
* Description             : Back end extras views class.
*/

if (!class_exists('DOPBSPViewsBackEndExtras')){
    class DOPBSPViewsBackEndExtras extends DOPBSPViewsBackEnd{
        /*
         * Returns extras template.
         *
         * @param args (array): function arguments
         *
         * @return extras 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('EXTRAS_TITLE')); ?>
                <input type="hidden" name="DOPBSP-extra-ID" id="DOPBSP-extra-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 class="dopbsp-column" id="DOPBSP-column1">
                                    <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:DOPBSPBackEndExtra.add()" class="dopbsp-button dopbsp-add">
                                                <span class="dopbsp-info"><?php $DOT->echo($DOPBSP->text('EXTRAS_ADD_EXTRA_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('EXTRAS_HELP')); ?>
                                                    <br /><br />
                                                    <?php $DOT->echo($DOPBSP->text('EXTRAS_ADD_EXTRA_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('EXTRAS_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
        }
    }
}