<?php
session_start();
require_once "../init.php";
require_once "../authority.inc.php";
$lang = $_POST['lang'];
$IDProduct = $_POST['IDProduct'];
$productid = $_POST['productid'];
$ParentID = $_POST['ClassName'];
$Type = $_POST['Type'];
$ProductName = $_POST['ProductName'];
$price = $_POST['price'];
$DiskQuota =  $_POST['DiskQuota'];
$DbType = $_POST['DbType'];
$LineType = $_POST['LineType'];
$ActionClass = $_POST['ActionClass'];
$AutoDo = $_POST['AutoDo'];
$ProductIntro = $_POST['ProductIntro'];
$txtDetail = $_POST['txtDetail'];
$OldIDProduct = $_POST['OldIDProduct'];
$renew_price = $_POST['renew_price'];
$product_new_name = $_POST['product_new_name'];
$product_new_info = $_POST['product_new_info'];

if($product_new_name)
{
	foreach($product_new_name as $key => $info)
	{
		$new_info = trim($info);
		if($new_info != null)
		{
			$new_arr[$new_info] = iconv("GBK", "UTF-8", trim($product_new_info[$key]));
		}
	}
}

$product_info = addslashes(json_encode($new_arr));


?>
<!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/global.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</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>

<? include "../share/top.php"?>
<table width="100%" border="0" cellpadding="1" cellspacing="1">
  <tr>
    <td><? include "news_nav.inc.php"?></td>
  </tr>
  <tr>
    <td height="3" bgcolor="#555555"></td>
  </tr>
  <tr>
    <td height="300" valign="top" align="center">
	<?php
	
	


 

	if($OldIDProduct>=1) $sql = "update types set ";


	else
	
	

	$sql = "insert into types set ";

        $sql .= "ParentID='$ParentID',Type='$Type',productid='$productid',Renew_Price='$Renew_Price',";
	$sql .= "ProductName='$ProductName',Price='$Price',DiskQuota='$DiskQuota',DbType='$DbType',LineType='$LineType',";
	$sql .= "ActionClass='$ActionClass',ProductIntro='$ProductIntro',txtDetail='$txtDetail',AutoDo='$AutoDo', ";
	$sql .= "product_info='$product_info',lang='$lang'";

	if($OldIDProduct>=1) $sql .= "  where IDProduct='$OldIDProduct'";
	$DB->query($sql);
	//删除序列缓存文件,以便前台访问时重新设置序列缓存文件
	$sfile = "../../serialize/products.cache";
	@unlink($sfile);
	echo "<br><br><br>产品 $ProductName 保存成功";
	echo "<br><br><br>您必须 <a href='../settings/cache.php?action=clear&actionname=清空缓存'>[清空网站缓存]</a>才能令您刚作的修改生效,请点击这里<a href='../settings/cache.php?action=clear&actionname=清空缓存'>[清空网站缓存]</a>";
	echo "<br><br><br><a href='pro_class.php'>[返回列表]</a>";
	?>
    </td>
  </tr>
</table>
<? 
$DB->close();
include "../share/bottom.php"?>
</body>
</html>
