<?php

/*
* Title                   : Pinpoint Booking System WordPress Plugin (PRO)
* Version                 : 2.1.2
* File                    : views/discounts/views-backend-discounts.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 discounts views class.
*/

if (!class_exists('DOPBSPViewsBackEndDiscounts')){
    class DOPBSPViewsBackEndDiscounts extends DOPBSPViewsBackEnd{
        /*
         * Returns discounts template.
         *
         * @param args (array): function arguments
         *
         * @return discounts 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('DISCOUNTS_TITLE')); ?>
                <input type="hidden" name="DOPBSP-discount-ID" id="DOPBSP-discount-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:DOPBSPBackEndDiscount.add()" class="dopbsp-button dopbsp-add">
                                                <span class="dopbsp-info"><?php $DOT->echo($DOPBSP->text('DISCOUNTS_ADD_DISCOUNT_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('DISCOUNTS_HELP')); ?>
                                                    <br /><br />
                                                    <?php $DOT->echo($DOPBSP->text('DISCOUNTS_ADD_DISCOUNT_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('DISCOUNTS_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
        }
    }
}