{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" /}
            <a uri="{:url('/Home/Selleralbum/album_add')}" nc_type="dialog" dialog_title="{$Think.lang.album_class_add}" class="dssc-btn dssc-btn-green" style="right: 100px;">
                <i class="icon-folder-open "></i>{$Think.lang.album_class_add}
            </a>
        </div>

        <?php if(!empty($aclass_info)){?>
        <a id="open_uploader" href="JavaScript:void(0);" class="dssc-btn dssc-btn-acidblue"><i class="icon-cloud-upload"></i>{$Think.lang.album_class_list_img_upload}</a>
        <div class="upload-con" id="uploader" style="display: none;">
            <form method="post" action="" id="fileupload" enctype="multipart/form-data">
                <div class="upload-con-div">{$Think.lang.album_class_list_sel_img_class}{$Think.lang.ds_colon}
                    <select name="category_id" id="category_id" class="select w80">
                        <?php foreach ($aclass_info as $v){?>
                        <option value='<?php echo $v['aclass_id']?>' class="w80"><?php echo $v['aclass_name']?></option>
                        <?php }?>
                    </select>
                </div>
                <div class="upload-con-div">选择文件：
                    <div class="dssc-upload-btn"> <a href="javascript:void(0);"><span>
                                <input type="file" hidefocus="true" size="1" class="input-file" name="file" multiple="multiple"/>
                            </span>
                            <p><i class="icon-upload-alt"></i>{$Think.lang.album_class_list_img_upload}</p>
                        </a> </div>
                </div>
                <div nctype="file_msg"></div>
                <div class="upload-pmgressbar" nctype="file_loading"></div>
                <div class="upload-txt"><span><?php echo lang('album_batch_upload_description').config('image_max_filesize').'KB'.lang('album_batch_upload_description_1');?></span> </div>
            </form>
        </div>
        <?php }?>
    
    <div id="pictureIndex" class="dssc-picture-folder">
        <table class="search-form">
            <tbody>
                <tr>
                    <td>&nbsp;</td>
                    <th>{$Think.lang.album_sort}</th>
                    <td class="w100">
                        <form name="select_sort" id="select_sort" class="sortord">
                            <select  name="sort" id="img_sort">
                                <option value="4" {if condition="$Think.get.sort eq '4'"}selected{/if}>{$Think.lang.album_sort_desc}</option>
                                <option value="5" {if condition="$Think.get.sort eq '5'"}selected{/if}>{$Think.lang.album_sort_asc}</option>
                                <option value="0" {if condition="$Think.get.sort eq '0'"}selected{/if}>{$Think.lang.album_sort_time_desc}</option>
                                <option value="1" {if condition="$Think.get.sort eq '1'"}selected{/if}>{$Think.lang.album_sort_time_asc}</option>
                                <option value="2" {if condition="$Think.get.sort eq '2'"}selected{/if}>{$Think.lang.album_sort_class_name_desc}</option>
                                <option value="3" {if condition="$Think.get.sort eq '3'"}selected{/if}>{$Think.lang.album_sort_class_name_asc}</option>
                            </select>
                        </form>
                    </td>
                </tr>
            </tbody>
        </table>
        <?php if(!empty($aclass_info)){?>
        <div class="dssc-album">
            <ul>
                <?php foreach ($aclass_info as $v){?>
                <li class="hidden">
                    <dl>
                        <dt>
                        <div class="covers">
                            <a href="{:url('/Home/Selleralbum/album_pic_list',['id'=>$v.aclass_id])}">
                                <?php if($v['aclass_cover'] != ''){ ?>
                                <img id="aclass_cover" src="<?php echo cthumb($v['aclass_cover'], 240, session('store_id'));?>">
                                <?php }else{?>
                                <i class="icon-camera-retro"></i>
                                <?php }?>
                            </a>
                        </div>
                        <h3 class="title"><a href="{:url('/Home/Selleralbum/album_pic_list',['id'=>$v.aclass_id])}"><?php echo $v['aclass_name'];?></a></h3>
                        </dt>
                        <dd class="buttons"><span nc_type="dialog" dialog_title="{$Think.lang.album_class_deit}" dialog_id='album_<?php echo $v['aclass_id'];?>' dialog_width="480" uri="{:url('/Home/Selleralbum/album_edit',['id'=>$v.aclass_id])}"><a href="JavaScript:void(0);"><i class="icon-pencil"></i>{$Think.lang.album_class_edit}</a></span>
                            <?php if($v['is_default'] != '1'){?>
                            <a href="javascript:void(0)" onclick="ajax_get_confirm('{$Think.lang.album_class_delete_confirm_message}', '{:url('/Home/Selleralbum/album_del',['id'=>$v.aclass_id])}');"><i class="icon-remove-sign"></i>{$Think.lang.album_class_delete}</a>
                            <?php }?>
                        </dd>
                    </dl>
                </li>
                <?php }?>
            </ul>
        </div>
        <?php }else{?>
        <div class="warning-option"><i class="icon-warning-sign">&nbsp;</i><span>{$Think.lang.no_record}</span></div>
        <?php }?>
    </div>
    <script type="text/javascript" src="{$Think.config.url_domain_root}static/plugins/js/fileupload/jquery.iframe-transport.js" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.config.url_domain_root}static/plugins/js/fileupload/jquery.ui.widget.js" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.config.url_domain_root}static/plugins/js/fileupload/jquery.fileupload.js" charset="utf-8"></script>
<script type="text/javascript">

$(function() {
    //鼠标触及区域li改变class
    $(".dssc-album ul li").hover(function() {
        $(this).addClass("hover");
    }, function() {
        $(this).removeClass("hover");
    });
    //凸显鼠标触及区域、其余区域半透明显示
//    $(".dssc-album > ul > li").jfade({
//        start_opacity:"1",
//        high_opacity:"1",
//        low_opacity:".5",
//        timing:"200"
//    });
    
    // ajax 上传图片
    var upload_num = 0; // 上传图片成功数量
    $('#fileupload').fileupload({
        dataType: 'json',
        url: "{:url('/Home/Selleralbum/image_upload')}",
        add: function (e,data) {
        	$.each(data.files, function (index, file) {
                $('<div nctype=' + file.name.replace(/\./g, '_') + '><p>'+ file.name +'</p><p class="loading"></p></div>').appendTo('div[nctype="file_loading"]');
            });
            data.submit();
        },
        done: function (e,data) {
            var param = data.result;
            $this = $('div[nctype="' + param.origin_file_name.replace(/\./g, '_') + '"]');
            $this.fadeOut(3000, function(){
                $(this).remove();
                if ($('div[nctype="file_loading"]').html() == '') {
                    setTimeout("window.location.reload()", 1000);
                }
            });
            if(param.state == 'true'){
                upload_num++;
                $('div[nctype="file_msg"]').html('<i class="icon-ok-sign">'+'</i>'+'{$Think.lang.album_upload_complete_one}'+upload_num+'{$Think.lang.album_upload_complete_two}');

            } else {
                $this.find('.loading').html(param.message).removeClass('loading');
            }
        }
    });

});

$(function(){
	$("#img_sort").change(function(){
		$('#select_sort').submit();
	});
});
</script>


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