<?php
session_start();
require_once "../init.php";
require_once "../authority.inc.php";
$arProType = array();
$proType = new ProductType();
$tree = $proType->ShowProTypeTree('0',0,$arProType);
//print_r($tree);
$hot="pro";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>产品类别列表</title>
<LINK href="../share/style.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />

<script src="../share/global.js"></script>
</head>
<body>

<div id="topLink">
<div id="topInfo">
	<span class="tTitle">系统管理</span>
	<span class="sarr"> > </span> 产品管理
	
</div>
</div><div class="page-container">
<!--子导航-->
<? include "nav.inc.php"?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table table-border table-bordered table-bg table-hover table-sort">
  <tr id="tr">
    <td colspan="8">产品类别管理 <span class="sarr"> > </span> <a href='pro_class_form.php'>增加产品类别</a></td>
  </tr>
    <tr  class="text-c">
    <td>ID</td><td>名称</td> <td>缩略图</td> <td>语言</td> <td>类别</td><td>价格</td><td>状态</td><td>操作</td>
  </tr>
     <?
	  $treestring .= "";
	  for($i=0;$i<count($tree);$i++){
$proInfo = $proType->GetProduct($tree[$i]['IDProduct']);
if ($proInfo['show_index']==0 && $tree[$i]['Type']==product){
$proInfo['show_index']="√";}
elseif($proInfo['show_index']==1 && $tree[$i]['Type']==product){
	$proInfo['show_index']="X";}
	else
		  {
	$proInfo['show_index']="";
	}




	      $treestring .= "<tr class='text-c'>";
		    $treestring .= "<td>" .$tree[$i]['IDProduct'] . "</td>";
          $treestring .= "<td style='text-align:left;'>" .$tree[$i]['Disp'] . "</td>";
		  if($proInfo['pic']){
		    $treestring .= "<td><img width=90px height=60px style='padding:3px;border:1px solid 
#ccc;' src=" .$proInfo['pic'] . "></td>";
			}
			else
		  {
			   $treestring .= "<td>" .$proInfo['pic'] . "</td>";
			 
			}
		    $treestring .= "<td>" .$proInfo['lang'] . "</td>";
			
  $treestring .= "<td>" .$proInfo['Type'] . "</td>";
    $treestring .= "<td>" .$proInfo['Price'] . "</td>";
  $treestring .= "<td>" .$proInfo['show_index'] . "</td>";
		  $treestring .= "<td class='f-14 td-manage'>  ";
		  $treestring .= "<a  style='text-decoration:none' class='ml-5' href='pro_class_form.php?IDProduct=".$tree[$i]['IDProduct']."'>编辑</a> |";
		  $treestring .= "<a style='text-decoration:none' class='ml-5' href='pro_class_del.php?IDProduct=".$tree[$i]['IDProduct']."' onclick=\"return confirm('确认删除吗?');\">删除</a> ";
		  if($tree[$i]['Type']=='class'){
			  $treestring .= "|<a  style='text-decoration:none' class='ml-5' href='pro_class_form.php?ParentID=".$tree[$i]['IDProduct']."'>增加子类</a> ";
		  }
		  $treestring .= "</td></tr>";
	  }
      $treestring .= "";
	  echo $treestring;
	 ?>
 
  
</table></div>
<? 
$DB->close();
include "../share/bottom.php"?>
</body>
</html>
