<?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">
    <?php echo mh_draw_form('shopvoting', shopvoting_admin_page_link(Shopvoting::FILENAME_SHOPREVIEW_MANAGE_SNIPPETS, '', true), '', 'post'); ?>

    
<div class="leftupdatebox">
        <?php echo WEB4DESIGN_DE_SR_SAVE_INFO; ?>&nbsp;&nbsp;&nbsp; <input type="submit" name=""
                                                                           value="<?php echo WEB4DESIGN_DE_SR_SAVE_SETTINGS; ?>"/>
</div>
    
        <table class="maintab" style="width:99%">
            <tr>
                <td colspan="3">
                    <?php
                    if ($_POST) {
                        $voting->setSnippets($_POST['snippet_config_data']);
                        $voting->__construct();
                        ?>
                        <div class="speichern"><?php echo WEB4DESIGN_DE_SR_UPDATED; ?></div>
                    <?php } ?>
                </td>
            </tr>
            <tr>
                <td width="48%" style="vertical-align: top;">

                    <p class="adminConfigHeader"><strong><?php echo WEB4DESIGN_DE_SR_SNIPPET_BOX; ?></strong></p>

                    <table class="settingtab">
  
                    <tr>
                    <td style="width: 250px;"><?php echo WEB4DESIGN_DE_SR_RICH_SNIPPETS; ?></td>
                    <td>
                        <select name="snippet_config_data[template_box_show_snippets]">
                            <option value="1"<?php if($voting->template_box_show_snippets == 1) {echo ' selected="selected"';}?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_YES; ?></option>
                            <option value="0"<?php if($voting->template_box_show_snippets == 0) {echo ' selected="selected"';}?>><?php echo WEB4DESIGN_DE_SR_DROPDOWN_NO; ?></option>
                        </select>
                    </td>
                </tr>

        <td><?php echo WEB4DESIGN_DE_SR_RICH_SNIPPETS_TYPE_NAME; ?></td>
            <td>
            <input type="text" name="snippet_config_data[snippet_type_name]" value="<?php echo $voting->snippet_type_name; ?>" style="width: 99%" />
            </td>
        </tr>
                    </table>
                </td>
                <td width="2%">&nbsp;</td>
                <td width="48%" style="vertical-align: top;">
                    <p class="adminConfigHeader"><strong><?php echo WEB4DESIGN_DE_SR_SNIPPET_BOX_CODE_PREVIEW; ?></strong></p>
                    <p><?php echo WEB4DESIGN_DE_SR_SNIPPET_BOX_CODE_PREVIEW_INFO; ?></p>                  
<textarea style="width: 99%; height: 250px;" readonly="readonly">
&lt;script type="application/ld+json"&gt;
{
    "@context": "https://schema.org/",
    "@type": "Organization",
    "name": "<?php echo $voting->snippet_type_name;?>",
                        
    "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "<?php echo $voting->getAverage(Shopvoting::COLUMN_WEB4DESIGN_DE_SHOPRATING);?>",
        "bestRating": "5",
        "worstRating": "1",
        "ratingCount": "<?php echo $voting->getCountDetailVotes(Shopvoting::COLUMN_WEB4DESIGN_DE_SHOPRATING);?>"
    }
}
&lt;/script&gt;</textarea>
                </td>
            </tr>
        </table>

    </form>
    <p class="clr">&nbsp;</p>
</div>
