<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
            <div class="pull-right">
                <a onclick="buttonApply();" data-toggle="tooltip" title="Apply Changes" class="btn btn-default"><i class="fa fa-plus-circle"></i></a>
                <button type="submit" form="form-buyshop" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
                <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
                <h1>Dresscode theme configuration options</h1>
                <ul class="breadcrumb">
                <?php foreach ($breadcrumbs as $breadcrumb) { ?>
                    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
                <?php } ?>
            </ul>
        </div>
    </div>

    <div class="container-fluid">
        <?php if ($error_warning) { ?>
        <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
            <button type="button" class="close" data-dismiss="alert">&times;</button>
        </div>
        <?php } ?>
        <?php if ($success) { ?>
        <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?>
            <button type="button" class="close" data-dismiss="alert">&times;</button>
        </div>
        <?php } ?>

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>

                <a class="products_button" href="<?php echo $bproduct; ?>">Dresscode Theme Products Options</a>
                <a class="products_button" href="<?php echo $mcategory; ?>">Dresscode Theme Categories Options</a>

            </div>
            <div class="panel-body">
                <form name="settingsform" action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-buyshop" class="form-horizontal">
                    <div class="form-horizontal row">
                        <ul class="nav nav-tabs main_tabs_vertical store_tabs col-sm-2">
                            <li class="active"><a href="#tab-store0" data-toggle="tab">Default Store</a></li>
                            <?php if (sizeof($stores) != 0) : ?>
                            <?php foreach ($stores as $store) : ?>
                            <li><a href="#tab-store<?php echo $store['store_id']; ?>" data-toggle="tab"><?php echo $store["name"]; ?></a></li>
                            <?php endforeach; ?>
                            <?php endif; ?>
                        </ul>
                        <div class="tab-content col-sm-10">
                            <div class="tab-pane active" id="tab-store0">
                                <?php $store["store_id"] = 0; ?>
                                <?php include('options_stores.php'); ?>
                            </div>
                            <?php if (sizeof($stores) != 0) : ?>
                            <?php foreach ($stores as $store) : ?>
                            <div class="tab-pane" id="tab-store<?php echo $store['store_id']; ?>">
                                <?php include('options_stores.php'); ?>
                            </div>
                            <?php endforeach; ?>
                            <?php endif; ?>
                        </div>

                    </div>

                    <input type="hidden" name="buttonForm" value="" />
                </form>
            </div>
        </div>

    </div>








</div>

<script type="text/javascript"><!--
function buttonApply() {document.settingsform.buttonForm.value='apply';$('#form-buyshop').submit();}

jQuery(document).ready(function(){

    /* initialisation of store 0 default */

    //set active background pattern
    jQuery(function() {
        var $radios = jQuery('#buyshop_general_bgpattern_container0 input:radio');
        if($radios.is(':checked') === false) {
            $radios.filter('[value="<?php echo $buyshop_general['bgpattern'][0]; ?>"]').attr('checked', true);
        }
    });


    jQuery("#buyshop_general_font0").val(jQuery("#buyshop_general_font0").data("active")).attr('selected', true);
        jQuery(function(){
            fontSelect=jQuery("#buyshop_general_font0");
            fontUpdate=function(){
                curFont=jQuery("#buyshop_general_font0").val();
                jQuery("#buyshop_general_font_preview0").css({ fontFamily: curFont });
                jQuery("<link />",{href:"http://fonts.googleapis.com/css?family="+curFont,rel:"stylesheet",type:"text/css"}).appendTo("head");
            }
            fontSelect.change(function(){
                fontUpdate();
            }).keyup(function(){
                        fontUpdate();
                    }).keydown(function(){
                        fontUpdate();
                    });
            jQuery("#buyshop_general_font0").trigger("change");
            fontUpdate();
        })
        jQuery("#buyshop_general_themecolor0").ColorPicker({
                color: jQuery('#buyshop_general_themecolor0').val(),
                onShow: function (colpkr) {
                    jQuery(colpkr).fadeIn(500);
                    return false;
                },
                onHide: function (colpkr) {
                    jQuery(colpkr).fadeOut(500);
                    return false;
                },
                onChange: function (hsb, hex, rgb) {
                    jQuery('#buyshop_general_themecolor0').css('backgroundColor', '#' + hex);
                    jQuery('#buyshop_general_themecolor0').val('#' + hex);
                }
            }
        );
        jQuery("#buyshop_general_contentbgcolor0").ColorPicker( {
                    color: jQuery('#buyshop_general_contentbgcolor0').val(),
                    onShow: function (colpkr) {
                        jQuery(colpkr).fadeIn(500);
                        return false;
                    },
                    onHide: function (colpkr) {
                        jQuery(colpkr).fadeOut(500);
                        return false;
                    },
                    onChange: function (hsb, hex, rgb) {
                        jQuery('#buyshop_general_contentbgcolor0').css('backgroundColor', '#' + hex);
                        jQuery('#buyshop_general_contentbgcolor0').val('#' + hex);
                    }
                }
        );
        jQuery("#buyshop_general_fontcolor0").ColorPicker( {
                    color: jQuery('#buyshop_general_fontcolor0').val(),
                    onShow: function (colpkr) {
                        jQuery(colpkr).fadeIn(500);
                        return false;
                    },
                    onHide: function (colpkr) {
                        jQuery(colpkr).fadeOut(500);
                        return false;
                    },
                    onChange: function (hsb, hex, rgb) {
                        jQuery('#buyshop_general_fontcolor0').css('backgroundColor', '#' + hex);
                        jQuery('#buyshop_general_fontcolor0').val('#' + hex);
                    }
                }
        );

        jQuery("#buyshop_general_productlabels_saleposition0").val(jQuery("#buyshop_general_productlabels_saleposition0").data("active")).attr('selected', true);
        jQuery("#buyshop_general_productlabels_videoposition0").val(jQuery("#buyshop_general_productlabels_videoposition0").data("active")).attr('selected', true);
    /* initialisation of store 0 default */


    /* stores */
    <?php if (sizeof($stores) != 0) : ?>
    <?php foreach ($stores as $store) : ?>

    //set active background pattern
    jQuery(function() {
        var $radios = jQuery("#buyshop_general_bgpattern_container<?php echo $store['store_id']; ?> input:radio");
        if($radios.is(':checked') === false) {
            $radios.filter('[value="<?php echo $buyshop_general['bgpattern'][$store['store_id']]; ?>"]').attr('checked', true);
        }
    });


    jQuery("#buyshop_general_font0").val(jQuery("#buyshop_general_font0").data("active")).attr('selected', true);
    jQuery(function(){
        fontSelect=jQuery("#buyshop_general_font0");
        fontUpdate=function(){
            curFont=jQuery("#buyshop_general_font0").val();
            jQuery("#buyshop_general_font_preview0").css({ fontFamily: curFont });
            jQuery("<link />",{href:"http://fonts.googleapis.com/css?family="+curFont,rel:"stylesheet",type:"text/css"}).appendTo("head");
        }
        fontSelect.change(function(){
            fontUpdate();
        }).keyup(function(){
                    fontUpdate();
                }).keydown(function(){
                    fontUpdate();
                });
        jQuery("#buyshop_general_font0").trigger("change");
        fontUpdate();
    })

    jQuery("#buyshop_general_themecolor0").ColorPicker( {
                color: jQuery('#buyshop_general_themecolor0').val(),
                onShow: function (colpkr) {
                    jQuery(colpkr).fadeIn(500);
                    return false;
                },
                onHide: function (colpkr) {
                    jQuery(colpkr).fadeOut(500);
                    return false;
                },
                onChange: function (hsb, hex, rgb) {
                    jQuery('#buyshop_general_themecolor0').css('backgroundColor', '#' + hex);
                    jQuery('#buyshop_general_themecolor0').val('#' + hex);
                }
            }
    );
    jQuery("#buyshop_general_contentbgcolor0").ColorPicker( {
                color: jQuery('#buyshop_general_contentbgcolor0').val(),
                onShow: function (colpkr) {
                    jQuery(colpkr).fadeIn(500);
                    return false;
                },
                onHide: function (colpkr) {
                    jQuery(colpkr).fadeOut(500);
                    return false;
                },
                onChange: function (hsb, hex, rgb) {
                    jQuery('#buyshop_general_contentbgcolor0').css('backgroundColor', '#' + hex);
                    jQuery('#buyshop_general_contentbgcolor0').val('#' + hex);
                }
            }
    );
    jQuery("#buyshop_general_fontcolor0").ColorPicker( {
                color: jQuery('#buyshop_general_fontcolor0').val(),
                onShow: function (colpkr) {
                    jQuery(colpkr).fadeIn(500);
                    return false;
                },
                onHide: function (colpkr) {
                    jQuery(colpkr).fadeOut(500);
                    return false;
                },
                onChange: function (hsb, hex, rgb) {
                    jQuery('#buyshop_general_fontcolor0').css('backgroundColor', '#' + hex);
                    jQuery('#buyshop_general_fontcolor0').val('#' + hex);
                }
            }
    );


    jQuery("#buyshop_general_productlabels_saleposition0").val(jQuery("#buyshop_general_productlabels_saleposition0").data("active")).attr('selected', true);
    jQuery("#buyshop_general_productlabels_videoposition0").val(jQuery("#buyshop_general_productlabels_videoposition0").data("active")).attr('selected', true);

    /* end initialisation for multstore options begin */

    <?php endforeach; ?>
    <?php endif; ?>

    /* end stores */

    <?php foreach ($languages as $language) : ?>
    $('#input-description-customblock<?php echo $language['language_id']; ?>-0').summernote({height: 300});
    <?php endforeach; ?>



});
//--></script>



<?php echo $footer; ?>