<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<title>新增自定义表单</title>
		<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="../static/web/css/admin.css">
		<script src="../static/web/js/jquery.min.js"></script>
		<script src="../static/web/js/bootstrap.min.js"></script>
		<script src="js/main.js"></script>
	</head>
	<body>
		<form name="form1" action="diy_add.php?action=add" method="post" onSubmit="return checkSubmit();">
			<table align="center" class="table maintable my-3">
				<tr>
					<td bgcolor="#f5f5f5" colspan="2"><a href="diy_main.php">自定义表单管理</a> - 新增自定义表单</td>
				</tr>
				<tr>
					<td width="260">自定义表单id：</td>
					<td>
						<input type="text" name="diyid" id="diyid" class="admin-input-sm" value="<?php echo $newdiyid?>">
						<span>（创建后不可修改，并具有唯一性）</span>
					</td>
				</tr>
				<tr>
					<td>定义表单名称：</td>
					<td>
						<input type="text" name="name" id="name" class="admin-input-sm" value="自定义表单<?php echo $newdiyid;?>">
						<span>（自定义表单的中文名称，在后台管理，前台发布等均使用此名字）</span>
					</td>
				</tr>
				<tr>
					<td>数据表：</td>
					<td>
						<input type="text" name="table" id="table" class="admin-input-sm" value="<?php echo $cfg_dbprefix;?>diyform<?php echo $newdiyid;?>">
						<span>（用于保存自定义表单数据，不能和已有表名重复，自定义表单数据表创建后不可修改表名）</span>
					</td>
				</tr>
				<tr>
					<td>字段配置：</td>
					<td>信息索引类字段系统已经加入，您只需要添加其它个性化字段即可</td>
				</tr>
				<tr>
					<td>列表模板：</td>
					<td><input type="text" name="listtemplate" id="listtemplate" class="admin-input-sm" value="list_diyform<?php echo $newdiyid;?>.htm"></td>
				</tr>
				<tr>
					<td>文档模板：</td>
					<td><input type="text" name="viewtemplate" id="viewtemplate" class="admin-input-sm" value="view_diyform<?php echo $newdiyid;?>.htm"></td>
				</tr>
				<tr>
					<td>发布模板：</td>
					<td><input type="text" name="posttemplate" id="posttemplate" class="admin-input-sm" value="post_diyform<?php echo $newdiyid;?>.htm"></td>
				</tr>
				<tr>
					<td>前台列表和文档页公开：</td>
					<td>
						<label><input type="radio" name="public" value="2"> 完全公开</label>
						<label><input type="radio" name="public" value="1" checked="1"> 公开审核过的</label>
						<label><input type="radio" name="public" value="0"> 不公开</label>
					</td>
				</tr>
				<tr>
					<td bgcolor="#f5f5f5" colspan="2" align="center">
						<button type="submit" name="button" id="button" class="btn btn-success btn-sm">保存</button>
						<button type="button" id="button2" class="btn btn-outline-success btn-sm" onclick="location='diy_main.php';">返回</button>
					</td>
				</tr>
			</table>
		</form>
		<script>
			function checkSubmit() {
				if (document.form1.name.value == '') {
					ShowMsg("自定义表单名称不能为空");
					return false;
				}
				return true;
			}
		</script>
	</body>
</html>