add.html 7.99 KB
<!DOCTYPE html>
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>后台管理系统</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" type="text/css" href="__PUB__style/pp.css">
<link rel="stylesheet" type="text/css" href="__PUB__style/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="__PUB__style/bootstrap-responsive.min.css">
<script type="text/javascript" src="__PUB__js/bootstrap.min.js"></script>
<script type="text/javascript" src="__PUB__js/jquery.min.js"></script>
<script type="text/javascript" src="__PUB__js/common.js"></script>
<link rel="stylesheet" href="__ROOTPUB__kindeditor/themes/default/default.css" />
<script charset="utf-8" src="__ROOTPUB__kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__ROOTPUB__kindeditor/lang/zh_CN.js"></script>
<script>
KindEditor.ready(function(K) {
	
	var editor1 = K.editor({
		uploadJson : "<{:U('Kind/upload_json')}>",
		fileManagerJson : "<{:U('Kind/file_manager_json')}>",
		allowFileManager : true
	});
	K('#uploadid').click(function() {
		editor1.loadPlugin('image', function() {
			editor1.plugin.imageDialog({
				imageUrl : K('#picid').val(),
				clickFn : function(url, title, width, height, border, align) {
					K('#picid').val(url);
					//K('#picida').src(url);
					document.getElementById('picida').src=url;
					editor1.hideDialog();
				}
			});
		});
	});
	
});
</script>
<style>
#upid {
font-family: "宋体";
}
</style>
</head>
<body style="margin: 10px 0px;">
<div style="margin:0 auto; width:98%;">
<form name="form" action="" method="post">
<table class="table table-condensed table-bordered table-hover">
<tbody><tr>
	<td colspan="2" style="padding-left:10px;">
	<div style="float:left">
    <b>新增分类</b>
    </div>
    <div style="float:right">
     [<a href="<{:U('Category/index')}>"><u>返回列表</u></a>]
    </div>
	</td>
</tr>
<tr>
	<td height="26" align="right" class="text_right_wid_140 pad_right_10"><font color="red">栏目名称:</font></td>
	<td><input name="catname" type="text" id="catname" size="30" class="iptxt"></td>
</tr>
<tr>
	<td height="26" align="right" class="text_right_wid_140 pad_right_10"><font color="red">英文名称:</font></td>
	<td><input name="catename" type="text" id="catename" size="30" class="iptxt"></td>
</tr>
<tr>
	<td height="26" align="right" class="text_right_wid_140 pad_right_10"><font color="red">所属栏目:</font></td>
	<td>
		<select name="upid" id="upid" style="width:200px">
			<option value="0">顶级栏目</option>
			<volist name="cat_list" id="vo">
				<option value="<{$vo.id}>" <if condition="$vo.id eq $_GET['id']">selected</if> >
					<{$vo.tname}>
				</option>
			</volist>
		</select>
	</td>
</tr>

	<tr>
		<td height="26" align="right" class="text_right_wid_140 pad_right_10"><font color="red">栏目类型:</font></td>
		<td>               
			<select name="type" id="type" style="width:200px">
				<option value="1">内容列表</option>
				<option value="2">内容单页</option>
				<option value="3">栏目主页</option>
				<option value="4">列表主页</option>
				<option value="5">单页主页</option>
				<option value="0">外部链接</option>
			</select>
		</td>
	</tr>

<tr>
	<td height="26" align="right" class="text_right_wid_140 pad_right_10"><font color="red">模块名称:</font></td>
	<td><input name="module_name" type="text" id="module_name"></td>
</tr>
<tr>
	<td height="26" align="right" class="text_right_wid_140 pad_right_10"><font color="red">方法名称:</font></td>
	<td><input name="action_name" type="text" id="action_name"></td>
</tr>
	
<tr>
	<td height="26" align="right" class="text_right_wid_140 pad_right_10"> 是否导航显示: </td>
	<td><input name="isshow" type="radio" value="1" />显示 &nbsp; <input name="isshow" type="radio" value="0" checked />不显示</td>
</tr>
          
<tr>
	<td height="26" align="right" class="text_right_wid_140 pad_right_10"> 排列顺序: </td>
	<td><input name="sort" size="6" type="text" value="<{$maxsort}>" class="pubinputs" class="width_60"></td>
</tr>
<tr attr="hidden">
    <td height="26" align="right" class="text_right_wid_140 pad_right_10">链接地址:</td>
    <td><input name="linkurl" type="text" id="linkurl" class="width_220" value=""><span class="note">(例如:http://www.baidu.com)</span></td>
</tr>
<tr attr="show">
    <td height="26" align="right" class="text_right_wid_140 pad_right_10">Banner:</td>
    <td><input name="banner" type="text" id="picid" value="<{$data.banner}>"><input type="button" value="上传图片" style="cursor:pointer;" id="uploadid"> <!-- <span style="color:#ccc;">(尺寸:2200*560)</span> --></td>
</tr>
<tr attr="show">
    <td height="26" align="right" class="text_right_wid_140 pad_right_10"></td>
    <td><img src="<{$data.banner|Thumb}>" id="picida" style=" max-height:150px; max-width:550px;"></td>
</tr>
<tr attr="show">
	<td height="26" align="right" class="text_right_wid_140 pad_right_10">SEO标题:</td>
	<td><input name="title" type="text" id="seotitle" size="30" style="width:400px;" class="iptxt"></td>
</tr>
<tr attr="show">
	<td height="80" align="right" class="text_right_wid_140 pad_right_10">关键词: </td>
	<td><textarea name="keywords" style="height:60px; width:500px;" cols="60"></textarea></td>
</tr> 

<tr attr="show">
	<td height="80" align="right" class="text_right_wid_140 pad_right_10">描述: </td>
	<td><textarea name="description" style="height:60px; width:500px;" cols="60"></textarea></td>
</tr>  

<tr attr="show" id="attachment">
	<td height="80" align="right" class="text_right_wid_140 pad_right_10">附件选择: </td>
	<td><input type="checkbox" name="picnum[]" value="1" onclick="set_img_size('1');">单图 &nbsp; <input type="checkbox" name="picnum[]" value="2" onclick="set_img_size('2');">多图 &nbsp; <input type="checkbox" name="picnum[]" value="3">附件</td>
</tr>	  
 
<tr><td colspan="2" style="text-align:center">

<input name="domain" type="submit" style=" background:url(__PUB__img/button_save.gif); width:60px; height:22px; border:0" value="   ">
&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1);"><img src="__PUB__img/button_back.gif" width="60" height="22" border="0"></a></td></tr>   
        </tbody></table>

</form>
</div>
</body>
<script>
	$(function(){
		$('tr[attr="hidden"]').css('display','none');
		type_change();
		$('#upid').change(function(){
			var cid=$(this).children('option:selected').val();
			var validate={
				id : cid,
			};
			$.get("<{:U('getMaxSort')}>",validate,function(data){
				$(':input[name="sort"]').val(data);
			});
		});
		set_img_size(1);
		set_img_size(2);//图片尺寸
		$('#type').change(function(){
			type_change();
		});
	});
	//内容模型
	function type_change()
	{
		var type=$('#type').children('option:selected').val();
		if(type == 0)
		{
			$('tr[attr="show"]').css('display','none')
			$('tr[attr="hidden"]').css('display','table-row');
		}
		else
		{
			$('tr[attr="show"]').css('display','table-row')
			$('tr[attr="hidden"]').css('display','none');
		}
	}

	//图片尺寸
	function set_img_size(num)
	{
		if(num == 1)
		{
			if($(':input[name="picnum[]"]:eq('+(num-1)+')').is(':checked'))
				$('#attachment').after('<tr id="picnum1"><td height="26" align="right" class="text_right_wid_140 pad_right_10">单图尺寸:</td><td><input name="img_size" type="text" size="30" style="width:400px;" class="iptxt" value="<{$data.img_size}>"></td></tr>');
			else
				$('#picnum1').remove();
		}
		if(num == 2)
		{
			if($(':input[name="picnum[]"]:eq('+(num-1)+')').is(':checked'))
				$('#attachment').after('<tr id="picnum2"><td height="26" align="right" class="text_right_wid_140 pad_right_10">多图尺寸:</td><td><input name="imgs_size" type="text" size="30" style="width:400px;" class="iptxt" value="<{$data.imgs_size}>"></td></tr>');
			else
				$('#picnum2').remove();
		}

	}
</script>
</html>