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

$IDHost = $_GET['ID'];
$key = $_GET['key'];
$op = $_GET['op'];
$backUrl = $_GET['backUrl'];

if(!CheckHashKey('host'.$IDHost,$key)){
   $DB->close();
   die("非法入侵");
}
$OpArr = array("stop"=>"停用","start"=>"启动","delete"=>"删除");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?=$OpArr[$op]?>产品</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" />
</head>
<body>
<? include "../share/top.php"?>
<div id="topLink">
<div id="topInfo">
	<span class="tTitle">产品管理</span>
	<span class="sarr"> >> </span><a href="<?=$GLOBALS["parentpath"]?>">返回到管理首页</a>
</div>
</div><div class="page-container">
<!--子导航-->
<? include "product_nav.inc.php"?>
<!--结束-->

        <table width="100%"  border="0" cellpadding="0" cellspacing="0" id="table" class="table">
          <tr align="center" bgcolor="#EEEEEE">
            <td><?=$OpArr[$op]?>产品</td>
          </tr>
          <tr bgcolor="#FFFFFF" height="300">
            <td bgcolor="#FFFFFF" align='center'>
			<?
			echo "$IDHost *********";
				$hostimpl = new HostImpl($IDHost);
				if($op=="stop") $result = $hostimpl->Stop();
				elseif($op=="start") $result = $hostimpl->Start();
				elseif($op=="delete") $result = $hostimpl->Delete();
		        if($result==1) echo "操作成功";
			    else echo $hostimpl->ErrorMsg;
				echo "<br><br> <a href='".$backUrl."'>[返回]</a>";
			?>
            </td>
        </table>
<br></div>
<? 
$DB->close();
include "../share/bottom.php";
?>
</body>
</html>