<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>后台用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel='stylesheet' type='text/css' href='__PUBLIC__/css/admin-style.css' />
<script language="JavaScript" type="text/javascript" charset="utf-8" src="__PUBLIC__/jquery/jquery-1.7.2.min.js"></script>
<script language="JavaScript" type="text/javascript" charset="utf-8" src="__PUBLIC__/js/admin.js"></script>
<script charset="utf-8" src="__PUBLIC__/editor/kindeditor.js"></script>
<script charset="utf-8" src="__PUBLIC__/editor/lang/zh_CN.js"></script>
<script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#content');
        });
</script>
<script language="javascript">
$(document).ready(function(){
	$("#myform").submit(function(){
		if($feifeicms.form.empty('myform','chanpin_name') == false){
			return false;
		}
		if($("#chanpin_cid").val()==0){
			alert('请选择分类');
			return false;
		}
	});
	$("#tabs>a").click(function(){
		var no = $(this).attr('id');
		var n = $("#tabs>a").length;
		showtab('tabs',no,n);
		$("#tabs>a").removeClass("on");
		$(this).addClass("on");
		return false;
	});
});
</script>
</head>
<body class="body">
<!--图片预览框-->
<div id="showpic" class="showpic" style="display:none;"><img name="showpic_img" id="showpic_img" width="120" height="160"></div>
<script language="javascript">
// 显示标签框
function showtags($sid){
	var offset = $(".xy_tag").offset();
	var left = offset.left;
	var top = offset.top+30;
	var html = $.ajax({
		url: "?s=Admin-Tag-Showajax-sid-"+$sid,
		async: false
	}).responseText;
	$("#showtags").html(html);
	$("#showtags").css({left:left,top:top,display:""});
}
// 添加标签
function addtag($tag,$sid){
	if($sid == 1){
		var val = $('#chanpin_keywords').val();
		if(val!=''){
			val = val+','+$tag;
		}else{
			val = $tag;
		}
		$('#chanpin_keywords').val(val);		
	}else if($sid == 1){
		var val = $('#news_keywords').val();
		if(val!=''){
			val = val+','+$tag;
		}else{
			val = $tag;
		}
		$('#news_keywords').val(val);			
	}else{
		alert('tag error');
	}
}
// 关闭标签框
function tag_close(){
	$("#showtags").css('display','none');
}
</script>
<!--标签选择框-->
<div id="showtags" style="position:absolute;display:none;" class="showtags"><a href="javascript:tag_close()">关闭</a></div>
<?php if(($chanpin_id)  >  "0"): ?><form name="update" action="?s=Admin-Chanpin-Update" method="post" name="myform" id="myform">
<input type="hidden" name="chanpin_id" value="<?php echo ($chanpin_id); ?>">
<?php else: ?>
<form name="add" action="?s=Admin-Chanpin-Insert" method="post" name="myform" id="myform"><?php endif; ?> 
<div class="title">
	<div class="tabs" id="tabs"><a href="javascript:void(0)" class="on" id="1"><?php echo ($chanpin_tplname); ?>产品</a><a href="javascript:void(0)" id="2">其它设置</a></div>
    <div class="right"><a href="?s=Admin-Chanpin-Show">返回产品管理</a></div>
</div>
<div class="form">
<table border="0" cellpadding="0" cellspacing="0" class="table" id="tabs1">
  <tr>
    <td class="tl">产品名称：</td>
    <td class="tr"><input type="text" name="chanpin_name" id="chanpin_name" value="<?php echo ($chanpin_name); ?>" maxlength="255" error="* 名称不能为空" class="w300 ti_5">
    <label><select name="chanpin_cid" id="chanpin_cid" style="width:100px"><option value=0>选择分类</option><?php if(is_array($listchanpin)): $i = 0; $__LIST__ = $listchanpin;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$gxlcms): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($gxlcms["list_id"]); ?>" <?php if(($gxlcms["list_id"])  ==  $chanpin_cid): ?>selected<?php endif; ?>><?php echo ($gxlcms["list_name"]); ?></option><?php if(is_array($gxlcms['son'])): $i = 0; $__LIST__ = $gxlcms['son'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$gxlcms): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($gxlcms["list_id"]); ?>" <?php if(($gxlcms["list_id"])  ==  $chanpin_cid): ?>selected<?php endif; ?>>├ <?php echo ($gxlcms["list_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?><?php endforeach; endif; else: echo "" ;endif; ?></select></label> <label><select name="chanpin_status"><option value="1">显示</option><option value="0" <?php if(($chanpin_status)  ==  "0"): ?>selected<?php endif; ?>>隐藏</option></select></label> </td>
  </tr>
  <tr>
    <td class="tl">产品备注：</td>
    <td class="tr">
	<input type="text" name="chanpin_title" id="chanpin_title" maxlength="255" value="<?php echo ($chanpin_title); ?>" class="w300 ti_5"> <label><select name="chanpin_area" id="chanpin_area" style="width:100px"><?php if(!empty($chanpin_area)): ?><option value='<?php echo ($chanpin_area); ?>'><?php echo ($chanpin_area); ?></option><?php endif; ?><option value=''>出产地区</option><?php if(is_array($chanpin_area_list)): $i = 0; $__LIST__ = $chanpin_area_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($val); ?>"><?php echo ($val); ?></option><?php endforeach; endif; else: echo "" ;endif; ?></select></label> 
	<lable><select name="chanpin_year" id="chanpin_year"><?php if(!empty($chanpin_year)): ?><option value='<?php echo ($chanpin_year); ?>'><?php echo ($chanpin_year); ?></option><?php endif; ?><option value=''>年代</option><?php if(is_array($chanpin_year_list)): $i = 0; $__LIST__ = $chanpin_year_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($val); ?>"><?php echo ($val); ?></option><?php endforeach; endif; else: echo "" ;endif; ?></select></label></td>
  </tr>
  <tr>
    <td class="tl">日期：</td>
    <td class="tr" style="position:relative">
	
	生产日期：<label><input type="text" name="chanpin_filmtime" id="chanpin_filmtime" maxlength="10" value="<?php if(!empty($chanpin_filmtime)): ?><?php echo (date('Y-m-d',$chanpin_filmtime)); ?><?php endif; ?>" class="w100 ct" title="如：2013-07-20"></label> 更新日期：<label><input type="text" name="chanpin_addtime" id="chanpin_addtime" value="<?php echo (date('Y-m-d H:i:s',$chanpin_addtime)); ?>" class="w120"> <input name="checktime" type="checkbox" style="border:none;width:auto; position:absolute; top:5px" value="1" <?php echo ($checktime); ?> title="勾选则使用系统当前时间"></label></td>
  </tr>
       
  <tr>
    <td class="tl">产品图片：</td>
    <td class="tr"><label style="float:left; margin-top:3px; margin-right:5px"><input type="text" name="chanpin_pic" id="chanpin_pic" maxlength="255" value="<?php echo ($chanpin_pic); ?>" class="w300 ti_5" onMouseOver="if(this.value)showpic(event,this.value,'<?php echo C("upload_path");?>/');" onMouseOut="hiddenpic();"></label><iframe src="?s=Admin-Upload-Show-sid-chanpin" scrolling="no" topmargin="0" width="280" height="26" marginwidth="0" marginheight="0" frameborder="0" align="left" style="margin-top:3px; float:left"></iframe></span></td>
  </tr>
  <tr>
    <td class="tl">产品TAG：</td>
    <td class="tr"><input type="text" name="chanpin_keywords" id="chanpin_keywords"  maxlength="255" value="<?php echo ($chanpin_keywords); ?>" class="w300 xy_tag ti_5"> <img src="__PUBLIC__/images/admin/edit.gif" onClick="javascript:showtags(1);" class="navpoint" ></td>
  </tr>
  <script language="javascript">
	var $urln=<?php echo count($chanpin_url);?>;
	function addurl(){
		var $old = $("#urllist>tr:last").html();
		$urln = $("#urllist>tr").length;
		$old = $old.replace("播放地址"+$urln,"播放地址"+($urln+1));
		$("#urllist>tr:last-child").after('<tr>'+$old+'</tr>');
		$("#urllist>tr:last #chanpin_play").val($("#chanpin_play:last option").val());
		$("#urllist>tr:last #chanpin_server").val($("#chanpin_server:last option").val());
		$("#urllist>tr:last textarea").val('');
	}
  </script>
  <!--地址列表 -->

  <tr>
    <td class="tl">产品简介：</td>
    <td class="tr padding-5050"><textarea name="chanpin_content" id="content" style="width:99%;height:300px;"><?php echo ($chanpin_content); ?></textarea></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="table" id="tabs2" style="display:none">
  <tr>
    <td class="tl">推荐星级：</td>
    <td class="tr" id="abc"><input name="chanpin_stars" id="chanpin_stars" type="hidden" value="<?php echo ($chanpin_stars); ?>"><?php if(is_array($chanpin_starsarr)): $i = 0; $__LIST__ = $chanpin_starsarr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$ajaxstar): ++$i;$mod = ($i % 2 )?><img src="__PUBLIC__/images/admin/star<?php echo ($ajaxstar); ?>.gif" onClick="addstars('chanpin',<?php echo ($i); ?>);" id="star_<?php echo ($i); ?>" class="navpoint"><?php endforeach; endif; else: echo "" ;endif; ?></td>
  </tr>  
  <tr>
    <td class="tl">标题颜色：</td>
    <td class="tr" id="abc"><select name="chanpin_color" id="chanpin_color" class="w70">
    <?php if(!empty($chanpin_color)): ?><option value='<?php echo ($chanpin_color); ?>'><?php echo ($chanpin_color); ?></option><?php endif; ?><option value="">颜色</option>                               
    <option value='#000000' style='background-color:#000000' <?php if(($news_color)  ==  "#000000"): ?>selected<?php endif; ?>></option>
    <option value='#FFFFFF' style='background-color:#FFFFFF' <?php if(($news_color)  ==  "#FFFFFF"): ?>selected<?php endif; ?>></option>
    <option value='#008000' style='background-color:#008000' <?php if(($news_color)  ==  "#008000"): ?>selected<?php endif; ?>></option>
    <option value='#FFFF00' style='background-color:#FFFF00' <?php if(($news_color)  ==  "#FFFF00"): ?>selected<?php endif; ?>></option>
    <option value='#FF0000' style='background-color:#FF0000' <?php if(($news_color)  ==  "#FF0000"): ?>selected<?php endif; ?>></option>
    <option value='#0000FF' style='background-color:#0000FF' <?php if(($news_color)  ==  "#0000FF"): ?>selected<?php endif; ?>></option>
    <option value=''>无色</option></select></td>
  </tr>
  <tr>
    <td class="tl">首字母：</td>
    <td class="tr"><input type="text" name="chanpin_letter" id="chanpin_letter" value="<?php echo ($chanpin_letter); ?>" maxlength="1" class="w50"></td>
  </tr>
  <tr>
    <td class="tl">总人气：</td>
    <td class="tr"><input type="text" name="chanpin_hits" id="chanpin_hits" maxlength="15" value="<?php echo ($chanpin_hits); ?>" class="w50"></td>
  </tr>       
  <tr>
    <td class="tl">月人气：</td>
    <td class="tr"><input type="text" name="chanpin_hits_month" id="chanpin_hits_month" maxlength="15" value="<?php echo ($chanpin_hits_month); ?>" class="w50"></td>
  </tr> 
  <tr>
    <td class="tl">周人气：</td>
    <td class="tr"><input type="text" name="chanpin_hits_week" id="chanpin_hits_week" maxlength="15" value="<?php echo ($chanpin_hits_week); ?>" class="w50"></td>
  </tr>
  <tr>
    <td class="tl">日人气：</td>
    <td class="tr"><input type="text" name="chanpin_hits_day" id="chanpin_hits_day" maxlength="15" value="<?php echo ($chanpin_hits_day); ?>" class="w50"></td>
  </tr> 
  <tr>
    <td class="tl">评分值：</td>
    <td class="tr"><input type="text" name="chanpin_gold" id="chanpin_gold" value="<?php echo ($chanpin_gold); ?>" maxlength="4" class="w50"></td>
  </tr> 
  <tr>
    <td class="tl">评分人数：</td>
    <td class="tr"><input type="text" name="chanpin_golder" id="chanpin_golder" value="<?php echo ($chanpin_golder); ?>" maxlength="8" class="w50"></td>
  </tr> 
  <tr>
    <td class="tl">顶：</td>
    <td class="tr"><input type="text" name="chanpin_up" id="chanpin_up" value="<?php echo ($chanpin_up); ?>" maxlength="8" class="w50"></td>
  </tr>
  <tr>
    <td class="tl">踩：</td>
    <td class="tr"><input type="text" name="chanpin_down" id="chanpin_down" value="<?php echo ($chanpin_down); ?>" maxlength="8" class="w50"></td>
  </tr>
  <tr>
    <td class="tl">录入编辑：</td>
    <td class="tr"><input type="text" name="chanpin_inputer" id="chanpin_inputer" value="<?php echo ($chanpin_inputer); ?>" maxlength="15" class="w150"></td>
  </tr>   
  <tr>
    <td class="tl">时间：</td>
    <td class="tr"><input type="text" name="chanpin_addtime" id="chanpin_addtime" maxlength="25" value="<?php echo (date('Y-m-d H:i:s',$chanpin_addtime)); ?>" class="w150"> <input name="checktime" type="checkbox" style="border:none;width:auto" value="1" <?php echo ($checktime); ?> title="勾选则使用系统当前时间"></td>
  </tr> 
  <tr>
    <td class="tl">独立模板：</td>
    <td class="tr"><input type="text" name="chanpin_skin" id="chanpin_skin" value="<?php echo ($chanpin_skin); ?>" maxlength="25" class="w150"></td>
  </tr>  
  <tr>
    <td class="tl">来源：</td>
    <td class="tr"><input type="text" name="chanpin_reurl" id="chanpin_reurl" value="<?php echo ($chanpin_reurl); ?>" maxlength="150" class="w300"></td>
  </tr>              
  <tr>
    <td class="tl">跳转URL：</td>
    <td class="tr"><input type="text" name="chanpin_jumpurl" id="chanpin_jumpurl" value="<?php echo ($chanpin_jumpurl); ?>" maxlength="150" class="w300"></td>
  </tr>   
</table>
<ul class="footer">
	<input type="submit" name="submit" value="提交"> <input type="reset" name="reset" value="重置">
</ul>
</div>
</form>
<script type="text/javascript">
KE.show({
	id : 'content',
	resizeMode : 1,
	allowPreviewEmoticons : false,
	allowUpload : false,
	items : [
	'source', '|', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
	'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
	'insertunorderedlist', '|', 'image', 'link', 'unlink', 'about']
});
//KE.show({ id : 'content'});
var $content = $('#content').val();
	document.getElementById("myform").onreset = function(){
	KE.html('content', $content);
}
</script>
<br /><center>Version：<font color="#FF0000"><?php echo L("gxlcms_version");?></font></center>
</body>
</html>