<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
<title>Merchant Management platform</title>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/Public/Merchant/images/favicon.ico" >
<LINK rel="Shortcut Icon" href="/Public/Merchant/images/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/html5.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/Public/h-ui_v2.3/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/skin/default/skin.css" rel="stylesheet" type="text/css" id="skin" />
<link href="/Public/h-ui_v2.3/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/Public/Common/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->

<link href="/Public/h-ui_v2.3/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />


<!-- 页面header钩子，一般用于加载插件CSS文件和代码 -->
<?php echo hook('pageHeader');?>

</head>
<body>

	<!-- 主体 -->
	

<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> Home <span class="c-gray en">&gt;</span> <?php echo ($meta_title); ?>
	<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="refresh" ><i class="Hui-iconfont">&#xe68f;</i></a>
	<a class="btn btn-secondary radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:history.go(-1);" title="back" ><i class="Hui-iconfont">&#xe66b;</i></a>
</nav>
<div class="pd-20">
	<form action="<?php echo U();?>" method="post" class="form form-horizontal" id="form-horizontal">
		<div id="tab-category" class="HuiTab">

				<div class="row cl">
					<label class="form-label col-3"><span class="c-red">*</span>title：</label>
					<div class="formControls col-6">
						<input type="text" class="input-text" value="<?php echo ((isset($info["title"]) && ($info["title"] !== ""))?($info["title"]):''); ?>" placeholder="" id="title" name="title" datatype="*" nullmsg="Can't be empty">
					</div>
					<div class="col-3"> </div>
				</div>

				<div class="row cl">
					<label class="form-label col-3">sort：</label>
					<div class="formControls col-6">
						<input type="text" class="input-text" name="sort" value="<?php echo ((isset($info["sort"]) && ($info["sort"] !== ""))?($info["sort"]):'0'); ?>">
					</div>
					<div class="col-3"> </div>
				</div>
				<div class="row cl">
					<label class="form-label col-3">need shoe cabinet：</label>
					<div class="formControls col-6 skin-minimal">
						<input type="checkbox" id="check_type" toName="type" <?php echo ($info['type'] == 1 ? 'checked' : ''); ?>>
						<input type="hidden" name="type" value="<?php echo ($info["type"]); ?>" />
					</div>
					<div class="col-3"> </div>
				</div>
				<div class="row cl">
      				<label class="form-label col-3">icon：</label>
			      	<div class="formControls col-6 upload_imgs">
			      		<script type="text/javascript" src="/Public/static/uploadify/jquery.uploadify.js"></script>
			        	<input type="file" id="upload_img_button" />
                    	<input type="hidden" name="icon" id="cover_id" value="<?php echo ($info["icon"]); ?>" />
                    	<input type="hidden" name="icon_path" id="cover_path" value="<?php echo ($info["icon_path"]); ?>" />
                    	<div class="upload-img-box " style="width:120px;">
	                    <?php if(!empty($info["icon"])): echo get_cover($info['icon'],$info['icon_path']); endif; ?>
                      	</div>
                        <script type="text/javascript">
	                        //上传图片
		                    /* 初始化上传插件 */
		                        $("#upload_img_button").uploadify({
		                        "height"          : 30,
		                        "width"           : 120,
		                        "fileSizeLimit"   : "<?php echo C('IMAGE_SIZE_LIMIT');?>",
		                        "method"          : "GET",  //如果要传参数，就必须改为GET
		                        "swf"             : "/Public/static/uploadify/uploadify.swf",
		                        "fileObjName"     : "download",
		                        "buttonText"      : "Select picture",
		                        "uploader"        : "<?php echo U('File/uploadPicture',array('session_id'=>session_id()));?>",
		                        'removeTimeout'   : 1,
		                        'fileTypeExts'    : '*.jpg; *.png; *.gif;',
		                        'formData': { 'thumb': 1 },//这里只能传静态参数
		                        "onUploadSuccess" : uploadPicture,
		                        'onFallback' : function() {
		                            alert('未检测到兼容版本的Flash.');
		                        },
		                        'onSelectError' : function (file, errorCode, errorMsg) {
		                        	var msgText = "上传失败\n";
		                            switch (errorCode) {
		                                case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:
		                                    //this.queueData.errorMsg = "每次最多上传 " + this.settings.queueSizeLimit + "个文件";
		                                    msgText += "每次最多上传 " + this.settings.queueSizeLimit + "个文件";
		                                    break;
		                                case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
		                                    msgText += "文件大小超过限制( " + this.settings.fileSizeLimit + " )";
		                                    break;
		                                case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
		                                    msgText += "文件大小为0";
		                                    break;
		                                case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
		                                    msgText += "文件格式不正确，仅限 " + this.settings.fileTypeExts;
		                                    break;
		                                default:
		                                    msgText += "错误代码：" + errorCode + "\n" + errorMsg;
		                            }
		                            layer.msg(msgText);
		                        },
		                    });
		                    function uploadPicture(file, data){
		                        var data = $.parseJSON(data);
		                        var src = '';

		                        if(data.status){
		                        	$("#cover_id").val(data.id);
		                            src = '' + data.path;
		                            $("#cover_path").val(src);
		                            $("#cover_id").parent().find('.upload-img-box').html(
		                                '<div class="upload-pre-item upload_images"><div  class="upload_images_del"  ids="'+data.id+'">删除</div><img src="' + src + '" class="upload-pre-item"/></div>'
		                            );

		                        }
		                    }
			  			</script>
			      	</div>
			    	<div class="col-3"> </div>
			    </div>

			    <div class="row cl">
      				<label class="form-label col-3">selected icon：</label>
			      	<div class="formControls col-6 upload_imgs">
			        	<input type="file" id="upload_img_button2" />
                    	<input type="hidden" name="icon2" id="cover2_id" value="<?php echo ($info["icon2"]); ?>" />
                    	<input type="hidden" name="icon2_path" id="cover2_path" value="<?php echo ($info["icon2_path"]); ?>" />
                    	<div class="upload-img-box " style="width:120px;">
	                    <?php if(!empty($info["icon2"])): echo get_cover($info['icon2'],$info['icon2_path']); endif; ?>
                      	</div>
                        <script type="text/javascript">
	                        //上传图片
		                    /* 初始化上传插件 */
		                        $("#upload_img_button2").uploadify({
		                        "height"          : 30,
		                        "width"           : 120,
		                        "fileSizeLimit"   : "<?php echo C('IMAGE_SIZE_LIMIT');?>",
		                        "method"          : "GET",  //如果要传参数，就必须改为GET
		                        "swf"             : "/Public/static/uploadify/uploadify.swf",
		                        "fileObjName"     : "download",
		                        "buttonText"      : "Select picture",
		                        "uploader"        : "<?php echo U('File/uploadPicture',array('session_id'=>session_id()));?>",
		                        'removeTimeout'   : 1,
		                        'fileTypeExts'    : '*.jpg; *.png; *.gif;',
		                        'formData': { 'thumb': 1 },//这里只能传静态参数
		                        "onUploadSuccess" : uploadPicture,
		                        'onFallback' : function() {
		                            alert('未检测到兼容版本的Flash.');
		                        },
		                        'onSelectError' : function (file, errorCode, errorMsg) {
		                        	var msgText = "上传失败\n";
		                            switch (errorCode) {
		                                case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:
		                                    //this.queueData.errorMsg = "每次最多上传 " + this.settings.queueSizeLimit + "个文件";
		                                    msgText += "每次最多上传 " + this.settings.queueSizeLimit + "个文件";
		                                    break;
		                                case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
		                                    msgText += "文件大小超过限制( " + this.settings.fileSizeLimit + " )";
		                                    break;
		                                case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
		                                    msgText += "文件大小为0";
		                                    break;
		                                case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
		                                    msgText += "文件格式不正确，仅限 " + this.settings.fileTypeExts;
		                                    break;
		                                default:
		                                    msgText += "错误代码：" + errorCode + "\n" + errorMsg;
		                            }
		                            layer.msg(msgText);
		                        },
		                    });
		                    function uploadPicture(file, data){
		                        var data = $.parseJSON(data);
		                        var src = '';

		                        if(data.status){
		                        	$("#cover2_id").val(data.id);
		                            src = '' + data.path;
		                            $("#cover2_path").val(src);
		                            $("#cover2_id").parent().find('.upload-img-box').html(
		                                '<div class="upload-pre-item upload_images"><div  class="upload_images_del"  ids="'+data.id+'">delete</div><img src="' + src + '" class="upload-pre-item"/></div>'
		                            );

		                        }
		                    }
			  			</script>
			      	</div>
			    	<div class="col-3"> </div>
			    </div>


		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input type="hidden" name="id" value="<?php echo ((isset($info["id"]) && ($info["id"] !== ""))?($info["id"]):''); ?>">
				<button class="btn btn-primary radius ajax-post" id="submit" type="submit" target-form="form-horizontal"><i class="Hui-iconfont">&#xe632;</i>Submit</button>
				<button class="btn btn-default radius" onclick="javascript:history.back(-1);return false;">&nbsp;&nbsp;Back&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>


	<!-- /主体 -->
	
	<!-- 底部 -->
	<style>
	#tipbox{
	    display: none;
	    position: fixed;
	    height: 50px;
	    right: 30px;
		padding-top:20px;
		text-align:center;
	    bottom: 30px;
	    width: 200px;
	    background-color: #5a98de;
	    z-index: 9999;
	}
</style>
<div id="newMessageDIV" style="display:none"></div>
<div id="tipbox" >
	New order received. Please process it as soon as possible！
</div>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/Public/Common/js/common.js"></script>
<script type="text/javascript">
	function play(){
	    {
	        //IE9+,Firefox,Chrome均支持<audio/>
	        $('#newMessageDIV').html('<audio autoplay="autoplay"><source src="/Public/Merchant/images/notify.mp3"'
	        + 'type="audio/wav"/><source src="/Public/Merchant/images/notify.mp3" type="audio/mpeg"/></audio>');
	    }
	    $('#tipbox').css('display','block');

	}

	function refreshOrder(){
		var url = "/index.php?s=/Merchant/Index/hasNewOrder.html";
		$.get(url,function(data){
			if(data==1){
				play();
			}
		});
	}
	$(document).ready(function(){
		setInterval("refreshOrder()",10000);
	});
</script>


	<script type="text/javascript" src="/Public/h-ui_v2.3/lib/icheck/jquery.icheck.min.js"></script>
	<script type="text/javascript">
		$('.skin-minimal input').iCheck({
			checkboxClass: 'icheckbox-blue',
			radioClass: 'iradio-blue',
			increaseArea: '20%'
		});
		$("input[type='checkbox']").click(function(){
		      var name = $(this).attr("toName"),
		          obj = $("input[name='"+name+"']");
		      if($(this).prop('checked')){
		        obj.val(1);
		      }else{
		        obj.val(0);
		      }
		});

	</script>
 <!-- 用于加载js代码 -->
<!-- 页面footer钩子，一般用于加载插件JS文件和JS代码 -->
<?php echo hook('pageFooter', 'widget');?>
<div class="hidden"><!-- 用于加载统计代码等隐藏元素 -->
	
</div>

	<!-- /底部 -->

</body>
</html>