<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>发布<?php echo $cInfos['typename'];?>-会员中心-<?php echo $cfg_webname;?></title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/style.css">
	</head>
	<body class="body-bg">
		<?php obtaintheme('top.htm');?>
		<main class="container py-3">
			<div class="pannel-main-container shadow-sm rounded">
				<nav aria-label="breadcrumb">
					<ol class="breadcrumb">
						<li class="breadcrumb-item"><a href="/">首页</a></li>
						<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li>
						<li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li>
					</ol>
				</nav>
				<form name="addcontent" action="<?php echo $cfg_memberurl;?>/soft_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();">
					<input type="hidden" name="dopost" value="save">
					<input type="hidden" name="channelid" value="<?php echo $channelid;?>">
					<input type="hidden" id="litpic" name="litpic">
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="title">标题</label>
						<div class="col-sm-10"><input type="text" name="title" id="title" class="form-control" placeholder="请输入标题"></div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="tags">标签</label>
						<div class="col-sm-10"><input type="text" name="tags" id="tags" class="form-control" placeholder="请输入标签"></div>
					</div>
					<div class="form-group row">
						<span class="col-sm-2 col-form-label">缩略图</span>
						<div class="col-sm-10">
							<img id="imgLitpic" src="/static/web/img/thumbnail.jpg" class="thumbnail-md mr-3">
							<span class="btn btn-success btn-sm" id="btnUploadLitpic">上传缩略图</span>
							<input id="iptLitpic" type="file" name="iptLitpic" class="d-none">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="writer">作者</label>
						<div class="col-sm-10"><input type="text" name="writer" id="writer" class="form-control" value="<?php echo $cfg_ml->M_UserName?>"></div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="typeid">发布栏目</label>
						<div class="col-sm-10">
							<?php
							$typeOptions = GetOptionList(0,$channelid);
							echo "<select name='typeid' id='typeid' class='form-control'>";
							echo "<option value='0' selected>请选择文档栏目</option>";
							echo $typeOptions;
							echo "</select>";
							?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="description">描述</label>
						<div class="col-sm-10"><textarea name="description" id="description" class="form-control" placeholder="请输入描述"></textarea></div>
					</div>
					<div class="form-row">
						<div class="form-group col-md-6">
							<label for="filetype">文件类型</label>
							<select name="filetype" id="filetype" class="form-control">
								<option value=".exe" selected="selected">.exe</option>
								<option value=".zip">.zip</option>
								<option value=".rar">.rar</option>
								<option value=".iso">.iso</option>
								<option value=".gz">.gz</option>
								<option value="其它">其它</option>
							</select>
						</div>
						<div class="form-group col-md-6">
							<label for="language">界面语言</label>
							<select name="language" id="language" class="form-control">
								<option value="简体中文" selected="selected">简体中文</option>
								<option value="英文软件">英文软件</option>
								<option value="繁体中文">繁体中文</option>
								<option value="其它类型">其它类型</option>
							</select>
						</div>
					</div>
					<div class="form-row">
						<div class="form-group col-md-6">
							<label for="softtype">软件类型</label>
							<select name="softtype" id="softtype" class="form-control">
								<option value="国产软件" selected="selected">国产软件</option>
								<option value="国外软件">国外软件</option>
								<option value="汉化补丁">汉化补丁</option>
							</select>
						</div>
						<div class="form-group col-md-6">
							<label for="accredit">授权方式</label>
							<select name="accredit" id="accredit" class="form-control">
								<option value="共享软件" selected="selected">共享软件</option>
								<option value="免费软件">免费软件</option>
								<option value="开源软件">开源软件</option>
								<option value="商业软件">商业软件</option>
								<option value="破解软件">破解软件</option>
								<option value="游戏外挂">游戏外挂</option>
							</select>
						</div>
					</div>
					<div class="form-row">
						<div class="form-group col-md-6">
							<label for="os">运行环境</label>
							<input type="text" id="os" name="os" value="win7,win10,win11" class="form-control">
						</div>
						<div class="form-group col-md-6">
							<label for="softrank">软件等级</label>
							<select name="softrank" id="softrank" class="form-control">
								<option value="1">一星</option>
								<option value="2">二星</option>
								<option value="3" selected="selected">三星 </option>
								<option value="4">四星</option>
								<option value="5">五星</option>
							</select>
						</div>
					</div>
					<div class="form-row">
						<div class="form-group col-md-6">
							<label for="officialDemo">官方网址</label>
							<input type="text" name="officialUrl" id="officialDemo" class="form-control">
						</div>
						<div class="form-group col-md-6">
							<label for="officialUrl">演示网址</label>
							<input type="text" name="officialDemo" id="officialUrl" class="form-control">
						</div>
					</div>
					<div class="form-row">
						<div class="form-group col-md-6">
							<label for="softsize">软件大小</label>
							<div class="input-group">
								<input type="text" name="softsize" id="softsize" class="form-control">
								<div class="input-group-append">
									<select name="unit" id="unit" class="form-control btn-send">
										<option value="MB" selected="selected">MB</option>
										<option value="KB">KB</option>
										<option value="GB">GB</option>
									</select>
								</div>
							</div>
						</div>
						<div class="form-group col-md-6">
							<label for="source">软件来源</label>
							<input type="text" name="source" id="source" class="form-control">
						</div>
					</div>
					<?php PrintAutoFieldsAdd(stripslashes($cInfos['fieldset']),'autofield');?>
					<div class="form-group row">
						<span class="col-sm-2 col-form-label">正文</span>
						<div class="col-sm-10"><?php GetEditor("body","",400,"Member");?></div>
					</div>
					<div class="form-group">
						<label for="softurl1">软件网址：</label>
						<div class="input-group mb-3">
							<input type="text" name="softurl1" id="softurl1" class="form-control d-inline-block w-75">
							<div class="input-group-append"><span class="btn btn-success btn-sm btn-send" onclick="SelectSoft('addcontent.softurl1')">选择</span></div>
						</div>
						<label for="servermsg1">下载名称：</label>
						<input type="text" name="servermsg1" id="servermsg1" class="form-control" value="本地下载">
					</div>
					<div class="form-group">
						<span>其它地址：</span>
						<input type="text" name="picnum" id="picnum" value="5" class="form-control w-25 mr-2">
						<button type="button" name="kkkup" id="kkkup2" onclick="MakeUpload();" class="btn btn-success btn-sm">添加网址</button>
						<button type="button" name="submit3" id="btsh3" onclick="ShowHideAddr();" class="btn btn-success btn-sm">隐藏网址</button>
					</div>
					<div id="morelink" style="display:none">
						<?php echo "<div id='uploadfield'></div>";?>
					</div>
					<div class="text-center">
						<button type="submit" class="btn btn-success btn-sm">提交</button>
						<button type="reset" class="btn btn-outline-success btn-sm" onclick="location.reload();">重置</button>
						<a href="<?php echo $cfg_memberurl;?>/content_list.php?channelid=<?php echo $channelid;?>" class="btn btn-outline-success btn-sm">返回</a>
					</div>
				</form>
			</div>
		</main>
		<?php obtaintheme('foot.htm');?>
		<script src="/static/web/js/user.main.js"></script>
		<script>
			var startNum = 2;
			function MakeUpload() {
				var upfield = document.getElementById("uploadfield");
				var morelinkobj = document.getElementById("morelink");
				var endNum = parseInt(document.addcontent.picnum.value) + startNum - 1;
				morelinkobj.style.display = "block";
				if (endNum > 12) endNum = 12;
				for (startNum; startNum <= endNum; startNum++) {
					upfield.innerHTML += "<div class='form-group'><label>软件网址" + startNum + "：</label><div class='input-group mb-3'><input type='text' name='softurl" + startNum + "' class='form-control' placeholder='请选择软件上传或填写软件网址'><div class='input-group-append'><span class='btn btn-success btn-sm btn-send' onclick=\"SelectSoft('addcontent.softurl"+startNum+"')\">选择</span></div></div><label>下载名称" + startNum + "：</label><input type='text' name='servermsg" + startNum + "' value='服务器" + startNum + "' class='form-control'></div>";
				}
			}
			function ShowHideAddr() {
				document.getElementById('morelink').style.display = (document.getElementById('morelink').style.display == 'block' ? 'none' : 'block');
				document.getElementById('btsh3').value = (document.getElementById('morelink').style.display == 'block' ? '隐藏网址' : '显示网址');
			}
		</script>
		<?php include(DEDEMEMBER."/templets/widget_litpic.htm");?>
	</body>
</html>