<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>活动图片资源目录配置</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="<?php echo base_url();?>public/js/bootstrap/bootstrap.min.css" >
    <link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>public/css/webuploader.css">
	<link rel="stylesheet" href="<?php echo base_url();?>public/css/diyUpload.css">
	<script type="text/javascript" src="public/js/webuploader.html5only.min.js"></script>
	<script type="text/javascript" src="public/js/diyUpload.js"></script>
    <style type="text/css">
        .thumbnail {
            margin:10px;
        }

        .lang-name {
            margin-left:42px;
        }

        .upimg {
            cursor: pointer;
        }
		*{ margin:0; padding:0;}

		#box{ margin:50px auto; width:540px; min-height:400px; background:#FF9}
		
		#demo{ margin:50px auto; width:540px; min-height:800px; background:#CF9}
    </style>
</head>
<body>
<div id="msg-tip">

</div>
<div class="content_wrapper">
    
    <div class="container-fluid">
        <aside>
            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data"  id="goodForm" action="#" style="margin-top: 20px">
                
                <input type="hidden" value="price" name="type"/>
                <header><i class="fa fa-fw fa-file"></i>活动图片资源目录配置</header>
                <section>
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-sm-12">
                                <button type="button" class="btn btn-success" onclick="javascript:history.back(-1);">返回</button>
                                <button type="button" style="margin:5px;" class="btn btn-primary" onclick="refreshActivityCDN()" role="button">刷新活动图片CDN配置</button>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <div class="container-fluid">
                    	<div class="row">
                    		<?php
                    			foreach($file as $row){
                    		?>
                    		<div class="col-sm-3">
                    			<img src="<?php echo $row['path'].(in_array($pathName,['poster_1','poster_2','poster_3'])?'?time='.time():''); ?>" style="max-width:300px;max-height:100px;" title="<?php echo $row['filename']; ?>">
                    			<p><?php echo $row['filename']; ?></p>
                    			
                    		</div>
                    		<?php } ?>
                    	</div>
                    	<div class="row">
                    		
                        	<div id="box">
								<div id="test" class="webuploader-container"><div class="webuploader-pick">点击选择图片</div>
									<div id="rt_rt_1eg7dfkq4bcccl1gla1tkumea1" style="position: absolute; top: 0px; left: 0px; width: 126px; height: 41px; overflow: hidden; bottom: auto; right: auto;">
										<input type="file" name="file" class="webuploader-element-invisible" multiple="multiple" accept="image/*">
										<label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label>
									</div>
								</div>
							</div>
						</div>
                    </div>
                </section>
            </form>
        </aside>
    </div>
	
	
	
</div>

</body>

<script type="text/javascript">
	$('#test').diyUpload({
		url:'/upload/actioneUploadImgs/<?php echo $pathName;?>',
		success:function( data ) {
			console.info( data );
		},
		error:function( err ) {
			console.info( err );	
		}
	});
    function refreshActivityCDN(){
        if( confirm('确认刷新活动图片CDN配置吗?') ) {
            $.post('/config/refreshActivityCDN/<?php echo $pathName;?>', {
                id: 1
            }, function (data) {
                alert("刷新成功")
            });
        }
    }
</script>
</html>
