<?php
session_start();
require_once "../init.php";
require_once "../authority.inc.php";

$ParentID = $_GET['ParentID'];
$IDProduct = $_GET['IDProduct'];

$arProType = array();
$proType = new ProductType2();
$tree = $proType->ShowProClassTree('0',0,$arProType);
$arProType3 = array();
$proType3 = new ProductType5();
$tree3 = $proType3->ShowProTypeTree('0',0,$arProType3);
if($IDProduct){
	$proInfo = $proType->GetProduct2($IDProduct);
	$ParentID = $proInfo['ParentID'];
}
$hot="pro";

$AgentInfo = load_config(1);
$uppath=isset($_REQUEST["upPath"])?$_REQUEST["upPath"]."/":"/ueditor/php/upload/image";            
$formName=isset($_REQUEST["formName"])?$_REQUEST["formName"]:"form";         
$editName=isset($_REQUEST["editName"])?$_REQUEST["editName"]:"pic";          
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<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" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="../lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />

<!--[if IE 6]>
<script type="text/javascript" src="../static/h-ui.admin/js/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>栏目设置</title>
<LINK href="../share/style.css" rel="stylesheet">
<script src="../share/jquery.js"></script>
<script src="../share/global.js"></script>
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="../lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="../lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script> 
<script type="text/javascript" src="../static/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> 
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 栏目管理 <span class="c-gray en">&gt;</span> 栏目分类 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<script src="../share/jquery.js"></script>
<script src="../share/global.js"></script>
<script>
function check(form){

   if(form.ProductName.value==""){
       alert("请输入栏目名称");
	   form.ProductName.focus();
	   return false;
   }
}

function add_cs_fun()
{
	var str = '<tr><td><input name="product_new_name[]" type="text" value="">:</td><td><input name="product_new_info[]" type="text" value=""></td></tr>';
	$('#product_info_show table').append(str);
}

function del_cs_fun()
{
	alert('del');
}
</script>



<!--子导航-->

<article class="page-container">
  <? include "news_nav.inc.php"?>
   <form action="pro_class_save.php" method="post" onSubmit="return check(this)" class="form form-horizontal"  id="form-article-add" enctype="multipart/form-data">
      <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>分类名称：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['ProductName']?>" name="ProductName">
      </div>
      <div class="col-5"> </div>
    </div>
    <div class="row cl">
			 <label class="form-label col-xs-4 col-sm-2">设为首页：</label>
   <div class="formControls col-xs-8 col-sm-9">
					     <span  class="select-box">
						 
				<select name='isindex' class="select">
					<option value='0'>设为内页</option>
					<option value='1' <?=$proInfo['isindex']=='1'?'selected':''?>>设为首页</option>
				</select>	
              </span> </div>
		</div>
	
	<div class="row cl">
			 <label class="form-label col-xs-4 col-sm-2">上级分类：</label>
   <div class="formControls col-xs-8 col-sm-9">
					     <span class="select-box">
						 
						 <select name='ClassName' class="select" ><option value='0'>--设为顶级--</option>
                <?
			    for($i=0;$i<count($tree);$i++){
					$selected = ($ParentID==$tree[$i]['IDProduct'])?"selected":"";
                    echo "<option value='".$tree[$i]['IDProduct']."' $selected>".$tree[$i]['Disp']."</option>";
			    }
			    ?></select>		</span> </div>
		</div>






	<div class="row cl">
			 <label class="form-label col-xs-4 col-sm-2">所属语言：</label>
   <div class="formControls col-xs-8 col-sm-9">
					     <span class="select-box">
						 
					   <select name='lang'>
				
    <option value='Chinese'>--默认中文--</option>
                <?
			    for($i=0;$i<count($tree3);$i++){
					$selected = ($proInfo['lang']==$tree3[$i]['ProductName'])?"selected":"";
if($tree3[$i]['ProductName']!=="Chinese")
                    echo "<option value='".$tree3[$i]['ProductName']."' $selected>".$tree3[$i]['Disp']."</option>";
			    }
			    ?>

				</select>	</span> </div>
		</div>




	<div class="row cl">
			 <label class="form-label col-xs-4 col-sm-2">栏目图标：</label>
   <div class="formControls col-xs-8 col-sm-9">
					     <span class="select-box">
						 
				<input type="hidden" name="upPath" value="<?=$uppath?>">
          <input type="hidden" name="editName" value="<?=$editName?>">
          <input type="hidden" name="formName" value="<?=$formName?>">
			<input  type="file" name="file1"  class="inputline" > (如不修改请不要上传,只能上传图片文件)
 <input name="OldLogo" type="hidden" value="<?=$proInfo['pic']?>">
		 <input name="DelOldLogo" id="DelOldLogo" type="checkbox" value="1" onchange="this.form.Logo.disabled = this.checked "> <label for='DelOldLogo'><font color='red'> 不需图片(删除)</font></label>
	
		 <? 
		 	if($proInfo['pic']){
			 	$src = $proInfo['pic'];
		   		if(preg_match("/(.swf)$/i",$proInfo['pic'])){
			  		$imagesize = getimagesize($src);
			  		echo "<br><br><embed width=60px height=60px src='$src' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='$imagesize[0]' height='$imagesize[1]'></embed>";
		   		}
				else
				{
			  		echo "<br><br><img width=60px height=60px style='padding:3px;border:1px solid #ccc;' src='$src'>";
		   		}
		 	}
			else
			{
				$src = '';
				//默认模板
				$src = "../../skin/".$AgentInfo['Skin']."/resources/no_pic.png";
				$html = "<br><img src='$src'>";
				echo $html;
			}
		 ?>			</span> </div>
		</div>


 <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>外部链接：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['menu_link']?>" name="menu_link">
      </div>
      <div class="col-5"> </div>
    </div>
<div class="row cl">
			 <label class="form-label col-xs-4 col-sm-2">可否再分：</label>
   <div class="formControls col-xs-8 col-sm-9">
					     <span  class="select-box">
						 
				<select name='Type' class="select">
					<option value='class'>可再分</option>
					<option value='product' <?=$proInfo['Type']=='product'?'selected':''?>>不可再分</option>
				</select>	
              </span> </div>
		</div>

	
	
	<div class="row cl">
			 <label class="form-label col-xs-4 col-sm-2">显示隐藏：</label>
   <div class="formControls col-xs-8 col-sm-9">
					     <span  class="select-box">
						 
				<select name='showindex' class="select">
					<option value='1'>显示</option>
					<option value='0' <?=$proInfo['showindex']=='0'?'selected':''?>>隐藏</option>
				</select>	
              </span> </div>
		</div>

	
    
      <div class="col-5"> </div>
    </div>


   <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>排序：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['productid']?>" name="productid"><br><font color=red>数值越小,同级栏目在导航中越靠前显示</font>
      </div>
      <div class="col-5"> </div>
    </div>

   <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>seo标题：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['title']?>" name="title">
      </div>
      <div class="col-5"> </div>
    </div>


   <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>seo关键词：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['keywords']?>" name="keywords">
      </div>
      <div class="col-5"> </div>
    </div>

<div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>seo网站描述：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['description']?>" name="description">
      </div>
      <div class="col-5"> </div>
    </div>

<div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>头部样式：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['head_css']?>" name="head_css">
      </div>
      <div class="col-5"> </div>
    </div>


<div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>内容区样式：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['main_css']?>" name="main_css">
      </div>
      <div class="col-5"> </div>
    </div>


<div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>底部样式：</label>
    <div class="formControls col-xs-8 col-sm-9">
        <input type="text" class="input-text"  placeholder="" id="user-name" value="<?=$proInfo['foot_css']?>" name="foot_css">
      </div>
      <div class="col-5"> </div>
    </div>


   <div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
<input name="OldIDProduct" type="hidden" value="<?=$proInfo['IDProduct']?>">
        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
      </div>
    </div>
  </form>
</div>
</article>




<? 
$DB->close();
include "../share/bottom.php"?>
</body>
</html>


