<?php
/**
 * Shop-Reviews
 *
 * @released under the GNU General Public License
 * inspired and in parts based on
 * Copyright (c) 2003 osCommerce
 * @author H-P Sausen
 * @copyright (c) since 2010 web4design.de
 * @contact webmaster@web4design.de
 * @version 3.0
 */

include(MH_DIR_CONFIG . 'config_shopvoting/admin/common.php');
include(MH_DIR_CONFIG . 'config_shopvoting/admin/common_header.php');
?>


<div id="borderbox">


    <!--<form action="-->
    <?php //echo shopvoting_admin_page_link(Shopvoting::FILENAME_SHOPREVIEW_MANAGE_CONFIG); ?><!--" method="post">-->
    <?php echo mh_draw_form('shopvoting', shopvoting_admin_page_link(Shopvoting::FILENAME_SHOPREVIEW_MANAGE_CONFIG, '', true), '', 'post'); ?>


    <div class="leftupdatebox">
        <?php echo WEB4DESIGN_DE_SR_SAVE_INFO; ?>&nbsp;&nbsp;&nbsp; <input type="submit" name="save_settings" value="<?php echo WEB4DESIGN_DE_SR_SAVE_SETTINGS; ?>"/>
    </div>
    <table class="maintab">
        <tr>
            <td colspan="2">
                <?php
                if (mh_post('save_settings')) {
                    $voting->setAdminConfig($_POST);
                    $voting->__construct();
                    ?>
                    <div class="speichern"><?php echo WEB4DESIGN_DE_SR_UPDATED; ?></div>
                <?php } ?>
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top;" width="50%">

                <table class="settingtab">
                    <tr>
                        <td style="text-align: center; background: #efefef;" colspan="2">
                            <strong><?php echo WEB4DESIGN_DE_SR_GLOBAL_SETTINGS; ?></strong></td>
                    </tr>
                    <tr>
                        <td class="borderline" width="45%">
                            <?php echo WEB4DESIGN_DE_SR_ACTIVE_STATUS; ?>
                        </td>
                        <td width="55%" class="borderline">
                            <select name="voting_module_active" size="1">
                                <option value="0" <?php if ($voting->voting_module_active == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->voting_module_active == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_REVIEWS_PER_PAGE; ?></td>
                        <td class="borderline">
                            <input type="text" name="entry_per_page_frontend" maxlength="3" size="3"
                                   value="<?php echo $voting->entry_per_page_frontend; ?>">
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_LOGO_URL; ?></td>
                        <td class="borderline">
                            <input type="text" name="logo_url" class="admininputwidth"
                                   value="<?php echo $voting->logo_url; ?>">
                        </td>
                    </tr>

                    <?php
                    // start of about us check
                    if ($voting->checkAboutUs() === true) {
                        ?>

                        <tr>
                            <td class="borderline"><?php echo WEB4DESIGN_DE_SR_ABOUT_US_ID; ?></td>
                            <td class="borderline">
                                <input type="text" name="about_us_id" maxlength="10" class="admininput3quarterfwidth"
                                       value="<?php echo $voting->about_us_id; ?>"/>
                            </td>
                        </tr>

                        <?php
                    } // end of about us check
                    ?>


                </table>


                <table class="settingtab" width="100%">
                    <tr>
                        <td colspan="3" style="text-align: center; background: #efefef;">
                            <strong><?php echo WEB4DESIGN_DE_SR_AUTHORITY_PER_GROUP; ?></strong></td>
                    </tr>
                    <tr>
                        <td class="borderline"><strong><?php echo WEB4DESIGN_DE_SR_READ; ?></strong></td>
                        <td class="borderline"><strong><?php echo WEB4DESIGN_DE_SR_WRITE; ?></strong></td>
                        <?php if (mh_fn('FILENAME_DISPLAY_VVCODES') || (mh_cfg('MODULE_CAPTCHA_LOGGED_IN') != '' || mh_cfg('MODULE_CAPTCHA_USE_COLOR') != '')) { ?>

                            <td class="borderline"><strong><?php echo WEB4DESIGN_DE_SR_CAPTCHA; ?></strong></td>
                        <?php } ?>

                    </tr>
                    <tr>
                        <td class="borderline" width="130">
                            <?php
                            echo $voting->getCheckboxGroup('customer_group_read[]', $voting->customer_group_read);
                            ?>
                        </td>
                        <td class="borderline" width="130">
                            <?php
                            echo $voting->getCheckboxGroup('customer_group_write[]', $voting->customer_group_write);
                            ?>
                        </td>
                        <?php if (mh_fn('FILENAME_DISPLAY_VVCODES')|| (mh_cfg('MODULE_CAPTCHA_LOGGED_IN') != '' || mh_cfg('MODULE_CAPTCHA_USE_COLOR') != '')) { ?>
                            <td class="borderline" width="130">
                                <?php
                                echo $voting->getCheckboxGroup('customer_group_captcha[]', $voting->customer_group_captcha);
                                ?>
                            </td>
                        <?php } ?>
                    </tr>
                </table>

                <table class="settingtab" style="margin-top: 15px;">
                    <tr>
                        <td style="text-align: center; background: #efefef;" colspan="2">
                            <strong><?php echo WEB4DESIGN_DE_SR_CONFIGURATION_MAIL; ?></strong></td>
                    </tr>
                    <tr>
                        <td class="borderline" width="45%" style="vertical-align:top;">
                            <?php echo WEB4DESIGN_DE_SR_SEND_INFO_MAIL_TO_ADMIN; ?>
                        </td>
                        <td class="borderline" width="55%">
                            <select name="send_admin_email" size="1">
                                <option value="0" <?php if ($voting->send_admin_email == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->send_admin_email == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <td class="borderline" style="vertical-align:top;">
                            <?php echo WEB4DESIGN_DE_SR_ADMIN_EMAIL; ?>
                        </td>
                        <td class="borderline">
                            <input type="text" name="admin_email" maxlength="96" class="admininputwidth"
                                   value="<?php echo $voting->admin_email; ?>">
                        </td>
                    </tr>

                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_SEND_MAIL_TO_CUSTOMER; ?></td>
                        <td class="borderline">
                            <select name="send_mail_after" size="1">
                                <option value="0" <?php if ($voting->send_mail_after == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->send_mail_after == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_MAIL_DOMAIN_TITLE; ?></td>
                        <td class="borderline">
                            <input type="text" name="email_domain_subject" maxlength="255" class="admininputwidth"
                                   value="<?php echo $voting->email_domain_subject; ?>"/>
                        </td>
                    <tr>
                        <td colspan="2"><?php echo WEB4DESIGN_DE_SR_MAIL_DOMAIN_SUBJECT; ?></td>
                    </tr>
                    </tr>

                    <?php
                    // start of coupon check
                    if ($voting->checkCouponTable() === true) {
                        ?>
                        <tr>
                            <td class="borderline"><?php echo WEB4DESIGN_DE_SR_SEND_COUPON_CODE_MAIL; ?></td>
                            <td class="borderline">
                                <select name="coupon_code_check" size="1">
                                    <option value="0" <?php if ($voting->coupon_code_check == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                    <option value="1" <?php if ($voting->coupon_code_check == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="borderline"><?php echo WEB4DESIGN_DE_SR_COUPON_CODE; ?></td>
                            <td class="borderline">
                                <input type="text" name="coupon_code" maxlength="32" class="admininput3quarterfwidth"
                                       value="<?php echo $voting->coupon_code; ?>"/>
                            </td>
                        </tr>

                        <?php
                    } // end of coupon check
                    ?>
                </table>


                <table class="settingtab" style="margin-top: 15px;">
                    <tr>
                        <td style="text-align: center; background: #efefef;" colspan="2">
                            <strong><?php echo WEB4DESIGN_DE_SR_CONFIGURATION_PRIVACY; ?></strong></td>
                    </tr>
                    <tr>
                        <td class="borderline" width="45%" style="vertical-align:top;">
                            <?php echo WEB4DESIGN_DE_SR_CONFIGURATION_PRIVACY_CHECKBOX; ?>
                        </td>
                        <td class="borderline" width="55%">
                            <select name="privacy_checkbox" size="1">
                                <option value="0" <?php if ($voting->privacy_checkbox == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->privacy_checkbox == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <td class="borderline" width="45%" style="vertical-align:top;">
                            <?php echo WEB4DESIGN_DE_SR_CONFIGURATION_PRIVACY_SELECT_TEXT; ?>
                        </td>
                        <td class="borderline" width="55%">
                            <select name="privacy_show_text" size="1">
                                <option value="0" <?php if ($voting->privacy_show_text == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->privacy_show_text == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_CONFIGURATION_PRIVACY_TEXT; ?></td>
                        <td class="borderline">
                            <input type="text" name="privacy_content_id" maxlength="255" class="admininputwidth" value="<?php echo $voting->privacy_content_id; ?>"/>
                        </td>
                    </tr>

                    <tr>
                        <td class="borderline" width="45%" style="vertical-align:top;">
                            <?php echo WEB4DESIGN_DE_SR_CONFIGURATION_SAVE_IP; ?>
                        </td>
                        <td class="borderline" width="55%">
                            <select name="privacy_save_ip" size="1">
                                <option value="0" <?php if ($voting->privacy_save_ip == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->privacy_save_ip == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>                    


                </table>




            </td>
            <td style="vertical-align: top;" width="50%">
                <table class="settingtab">
                    <tr>
                        <td style="text-align: center; background: #efefef;" colspan="2">
                            <strong><?php echo WEB4DESIGN_DE_SR_GLOBAL_RESTRICTIONS; ?></strong></td>
                    </tr>

                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_NUMBER_OF_CHARACTERS; ?></td>
                        <td class="borderline">
                            <input type="text" name="front_page_character" maxlength="5" size="5"
                                   value="<?php echo $voting->front_page_character; ?>">
                        </td>
                    </tr>

                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_AUTOMATIC_ACTIVATE; ?></td>
                        <td class="borderline">
                            <select name="activate_votings" size="1">
                                <option value="0" <?php if ($voting->activate_votings == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->activate_votings == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_OBLIGATION_ORDER_ID; ?></td>
                        <td class="borderline">
                            <select name="required_order_id" size="1">
                                <option value="0" <?php if ($voting->required_order_id == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->required_order_id == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_OBLIGATION_ORDER_EMAIL; ?></td>
                        <td class="borderline">
                            <select name="required_order_id_email" size="1">
                                <option value="0" <?php if ($voting->required_order_id_email == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->required_order_id_email == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_ORDER_NUMBER_UNIQUE; ?></td>
                        <td class="borderline">
                            <select name="block_order_number" size="1">
                                <option value="0" <?php if ($voting->block_order_number == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->block_order_number == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>


                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_SHOW_ALL_LANGUAGES; ?></td>
                        <td class="borderline">
                            <select name="show_all_languages" size="1">
                                <option value="0" <?php if ($voting->show_all_languages == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->show_all_languages == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_BADWORDS; ?></td>
                        <td class="borderline">
                            <select name="badwords" size="1">
                                <option value="0" <?php if ($voting->badwords == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->badwords == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>

                    <!--
                    <tr>
                        <td style="text-align: center; background: #efefef; border-top: 10px solid #fff;" colspan="2">
                            <strong><?php echo WEB4DESIGN_DE_SR_RICH_SNIPPET_TITLE; ?></strong></td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_SNIPPET_AUTHOR; ?></td>
                        <td class="borderline">
                            <input type="text" name="snippet_author" maxlength="255" class="admininputwidth"
                                   value="<?php echo $voting->snippet_author; ?>"/>
                        </td>
                    </tr>
                    -->
                    <tr>
                        <td style="text-align: center; background: #efefef; border-top: 10px solid #fff;" colspan="2">
                            <strong><?php echo WEB4DESIGN_DE_SR_OBLIGATION_FIELD_TOPIC; ?></strong></td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_OBLIGATION_FIELD_NAME; ?></td>
                        <td class="borderline">
                            <select name="required_name" size="1">
                                <option value="0" <?php if ($voting->required_name == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->required_name == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_OBLIGATION_FIELD_COMMENT; ?></td>
                        <td class="borderline">
                            <select name="required_comment" size="1">
                                <option value="0" <?php if ($voting->required_comment == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->required_comment == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_PAGE_OBLIGATION; ?></td>
                        <td class="borderline">
                            <select name="obligation_page" size="1">
                                <option value="0" <?php if ($voting->obligation_page == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->obligation_page == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_DELIVERY_OBLIGATION; ?></td>
                        <td class="borderline">
                            <select name="obligation_delivery" size="1">
                                <option value="0" <?php if ($voting->obligation_delivery == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->obligation_delivery == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_SERVICE_OBLIGATION; ?></td>
                        <td class="borderline">
                            <select name="obligation_service" size="1">
                                <option value="0" <?php if ($voting->obligation_service == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->obligation_service == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="borderline"><?php echo WEB4DESIGN_DE_SR_PRODUCTS_OBLIGATION; ?></td>
                        <td class="borderline">
                            <select name="obligation_products" size="1">
                                <option value="0" <?php if ($voting->obligation_products == '0') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                                <option value="1" <?php if ($voting->obligation_products == '1') echo 'selected="selected"'; ?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            </select>
                        </td>
                    </tr>


                </table>
            </td>
        </tr>
    </table>


    <div style="padding: 5px 15px 0 0; margin: 15px 0 0 0; text-align: right; border-top: 1px solid #cccccc;"></div>
    </form>
    <p class="clr">&nbsp;</p>
</div>