{include file="public/seller_top" /} 
<div class="seller_main w1200">
    {include file="public/seller_left" /}
    <div class="seller_right">
        <div class="seller_items">
            {include file="public/seller_items" /}
        </div>
        <div class="dssc-form-default">
            <form method="post" enctype="multipart/form-data" action="" id="wm_form">
                <input type="hidden" name="image_quality" value="100" />
                <input type="hidden" name="image_transition" value="20" />
                <input type="hidden" name="wm_text_angle" value="0" />
                <dl>
                    <dt>{$Think.lang.store_watermark_pic}</dt>
                    <dd>
                        <?php if(!empty($store_wm_info['wm_image_name'])){?>
                        <div class="dssc-upload-thumb watermark-pic">
                            <p><img src="{$Think.config.url_domain_root}uploads/home/watermark/<?php echo $store_wm_info['wm_image_name'];?>" id="imgView"/></p>
                            <a href="javascript:void(0);" id="del_image" title="{$Think.lang.store_watermark_del_pic}">X</a>
                            <input type="hidden" id="is_del_image" name="is_del_image" value=""/>
                        </div>
                        <?php }else{?>
                        <div class="dssc-upload-thumb watermark-pic"><p><i class="icon-picture"></i></p></div>
                        <?php }?>
                        <div class="dssc-upload-btn">
                            <a href="javascript:void(0);">
                                <span>
                                    <input type="file" hidefocus="true" size="1" class="input-file" name="image" id="image" nc_type="logo"/>
                                </span>
                                <p><i class="icon-upload-alt"></i>图片上传</p>
                            </a>
                        </div>
                        <p class="hint">{$Think.lang.store_watermark_choose_pic}</p>
                    </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.store_watermark_pic_pos}</dt>
                    <dd>
                        <ul class="dssc-watermark-pos" id="wm_image_pos">
                            <li>
                                <input type="radio" name="image_pos" value="1"<?php if($store_wm_info['wm_image_pos'] == 1){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos1}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="2"<?php if($store_wm_info['wm_image_pos'] == 2){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos2}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="3"<?php if($store_wm_info['wm_image_pos'] == 3){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos3}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="4"<?php if($store_wm_info['wm_image_pos'] == 4){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos4}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="5"<?php if($store_wm_info['wm_image_pos'] == 5){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos5}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="6"<?php if($store_wm_info['wm_image_pos'] == 6){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos6}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="7"<?php if($store_wm_info['wm_image_pos'] == 7){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos7}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="8"<?php if($store_wm_info['wm_image_pos'] == 8){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos8}</label>
                            </li>
                            <li>
                                <input type="radio" name="image_pos" value="9"<?php if($store_wm_info['wm_image_pos'] == 9){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_pic_pos9}</label>
                            </li>
                        </ul>
                        <p class="hint">{$Think.lang.store_watermark_choose_pos}</p>
                    </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.store_watermark_text}</dt>
                    <dd>
                        <p>
                            <textarea name="wm_text" class="textarea w180" ><?php echo $store_wm_info['wm_text'];?></textarea>
                        </p>
                        <p class="hint">{$Think.lang.store_watermark_text_notice},建议用字母和数字</p>
                    </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.store_watermark_text_size}</dt>
                    <dd><input id="wm_text_size" class="text w40"  type="text" name="wm_text_size" value="<?php echo $store_wm_info['wm_text_size'];?>"/><em class="add-on">px</em>
                        <p class="hint">{$Think.lang.store_watermark_text_size_notice}</p>
                    </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.store_watermark_text_color}</dt>
                    <dd>
                        <p><div class="w160">
                            <input id="wm_text_color"  class="text w100"  type="text"  name="wm_text_color" value="<?php echo $store_wm_info['wm_text_color']?$store_wm_info['wm_text_color']:"#CCCCCC"; ?>"/>
                        </div>
                        <div id="colorpanel" style="display:none;width:253px;height:177px;"></div></p>
                        <p class="hint" style="clear: both;">{$Think.lang.store_watermark_text_color_notice}</p>
                    </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.store_watermark_text_font}</dt>
                    <dd>
                        <p>
                            <select name="wm_text_font" class="w80">
                                <?php foreach($file_list as $key=>$value){?>
                                <option value="<?php echo $key;?>"<?php if($store_wm_info['wm_text_font'] == $key){echo ' selected="selected"';}?>><?php echo $value;?></option>
                                <?php }?>
                            </select>
                        </p>
                        <p class="hint">{$Think.lang.store_watermark_text_font_notice},如果文字使用汉字则管理员要安装中文的字体</p>
                    </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.store_watermark_text_pos}</dt>
                    <dd>
                        <ul class="dssc-watermark-pos" id="wm_text_pos">

                            <li>
                                <input type="radio" name="wm_text_pos" value="1"<?php if($store_wm_info['wm_text_pos'] == 1){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos1}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="2"<?php if($store_wm_info['wm_text_pos'] == 2){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos2}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="3"<?php if($store_wm_info['wm_text_pos'] == 3){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos3}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="4"<?php if($store_wm_info['wm_text_pos'] == 4){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos4}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="5"<?php if($store_wm_info['wm_text_pos'] == 5){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos5}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="6"<?php if($store_wm_info['wm_text_pos'] == 6){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos6}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="7"<?php if($store_wm_info['wm_text_pos'] == 7){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos7}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="8"<?php if($store_wm_info['wm_text_pos'] == 8){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos8}</label>
                            </li>
                            <li>
                                <input type="radio" name="wm_text_pos" value="9"<?php if($store_wm_info['wm_text_pos'] == 9){echo ' checked';}?>/>
                                       <label>{$Think.lang.store_watermark_text_pos9}</label>
                            </li>
                        </ul>
                    </dd>
                </dl>
                <div class="bottom">
                    <input type="hidden" name="form_submit" value="ok" />
                    <label class="submit-border"><input type="submit" class="submit" value="{$Think.lang.store_watermark_submit}" /></label>
                </div>
            </form>
        </div>


        <style type="text/css">
            .evo-color div { font-size: 12px; line-height: normal;}
            .evo-color span { font-size: 12px !important; line-height: normal !important;}
        </style>
        <link href="{$Think.config.url_domain_root}static/plugins/colorpicker/evol.colorpicker.css" rel="stylesheet" type="text/css">
        <script src="{$Think.config.url_domain_root}static/plugins/colorpicker/evol.colorpicker.min.js"></script>
        <script>
            $(function () {
                $("div").cssRadio();
                $('#wm_text_color').colorpicker({showOn: 'both'});
                $('#wm_text_color').parent().css("width", '');
                $('#wm_text_color').parent().addClass("color");
                
                $('#del_image').click(function () {
                    var result = confirm('{$Think.lang.store_watermark_del_pic_confirm}');
                    if (result)
                    {
                        $('#image').css('display', 'none');
                        $('#del_image').css('display', 'none');
                        $('#is_del_image').val('ok');
                        $('#wm_form').submit();
                    }
                });
                $('#wm_form').validate({
                    submitHandler: function (form) {
                        ajaxpost('wm_form', '', '', 'onerror')
                    },
                    rules: {
                        wm_text_size: {
                            required: true,
                            number: true
                        },
                        wm_text_color: {
                            required: true,
                            maxlength: 7
                        }
                    },
                    messages: {
                        wm_text_size: {
                            required: '{$Think.lang.store_watermark_text_size_null}',
                            number: '{$Think.lang.store_watermark_text_size_number}'
                        },
                        wm_text_color: {
                            required: '{$Think.lang.store_watermark_text_color_null}',
                            maxlength: '{$Think.lang.store_watermark_text_color_max}'
                        }
                    }
                });
            });

            jQuery.fn.cssRadio = function () {
                $(":input[type=radio] + label").each(function () {
                    if ($(this).prev()[0].checked)
                        $(this).addClass("checked");
                }).hover(
                        function () {
                            $(this).addClass("over");
                        },
                        function () {
                            $(this).removeClass("over");
                        }
                ).click(function () {
                    var contents = $(this).parent().parent(); /*多组控制 关键*/
                    $(":input[type=radio] + label", contents).each(function () {
                        $(this).prev()[0].checked = false;
                        $(this).removeClass("checked");
                    });
                    $(this).prev()[0].checked = true;
                    $(this).addClass("checked");
                }).prev().hide();
            };
        </script>









    </div>
</div>
{include file="public/mall_footer" /}