<?php widget("fhead");include($path_cache.DS."mod_agent_Shared_fhead.php"); ?>
<body class="mainbg">
	<div id="mainhearder"><span>您的位置：直销商管理系统</a> >> 安全管理 >> IP及所在地绑定</span></div>
	<?php $s = $vd['security'];$sitem='cpucheck';$sitem1='CPU';$sitem2='cpu';$sitem3='CPU编码' ?>
	<div id="tabs5">
		<ul class="menu5" id="menu5">
		<li onclick="location.href='index.php?m=mod_agent&c=PCCheck&a=CPU'" class=hover><span class="mm">CPU绑定</span></li>
		<li onclick="location.href='index.php?m=mod_agent&c=PCCheck&a=HDE';"><span class="mm">硬盘绑定</span></li>
		<li onclick="location.href='index.php?m=mod_agent&c=PCCheck&a=MAC';" ><span class="mm">网卡绑定</span></li>
		</ul>
	</div>
	<div class="main5" id="main5">
	<form name="bindip" method="post" action="index.php?m=mod_agent&c=PCCheck&a=<?php echo $sitem1; ?>Save">
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table1">
		<tr>
		<td width="22%" height="30" class="tableleft1">绑定状态：</td>
		<td width="78%" class="tableright1"><strong><?php if($s[$sitem]==1){ ?><font color=#0000ff>已绑定</font><?php }else{ ?><font color=#cccccc>未绑定</font><?php } ?></strong></td>
		</tr>
		<tr>
		<td width="22%" height="30" class="tableleft1"><?php echo $sitem3; ?>绑定操作：</td>
		<td width="78%" class="tableright1"><input type="radio" name="<?php echo $sitem; ?>" value="1"  id="yesbind" checked><label for="yesbind"><strong><font color=#0000ff>绑定<?php echo $sitem3; ?></font></strong></label> <input type="radio" name="<?php echo $sitem; ?>" value="0" id="nobind" ><label for="nobind"><strong><font color=#ff0000>取消绑定<?php echo $sitem3; ?></font></strong></label></td>
		</tr>
		<?php for($i=0; $i<5; $i++){ ?>
		<tr>
		<td width="22%" height="30" class="tableleft1"><?php echo $sitem3; ?><?php echo $i+1; ?>：</td>
		<td width="78%" class="tableright1">
			<input type="text" class="input" size="25" name="<?php echo $sitem2; ?>[]" id="<?php echo $sitem2; ?>_<?php echo $i; ?>" value="<?php echo $s[$sitem2][$i]; ?>"/>
			<input type="button" name="button" value="取本机<?php echo $sitem3; ?>" class="button" onclick="get<?php echo $sitem2; ?>(<?php echo $i; ?>);">
		</td>
		</tr>
		<?php } ?>
		<tr>
		<td class="tableleft1">&nbsp;</td>
		<td class="tableright1"><a href="index.php" target="_bank"><u>非本机操作请点击此处读取硬件信息</u></a></td>
		</tr>
		<tr>
		<td class="tableleft1">帐户交易密码：</td>
		<td class="tableright1"><input type="password" name="tradepwd" size="25" class='input'/></td>
		</tr>
		
		<tr>
		<td class="tableleft1">&nbsp;</td>
		<td class="tableright1"><input type="submit" name="submit" value="确认设置" class="button" > <input type="reset" name="reset" value="重新填写" class="button"></td>
		</tr>
		</table>
	</td>
	</tr>
	</table>
	</form>
	</div>
<object id="t1" codeBase="<?php echo $vd['sc']; ?>tools/umebiz.cab" classid="CLSID:B8748B60-E34D-42AA-9309-8012CA4964AC" height=0 width=0 ></object>
<input type="hidden" id="tmac" name="tmac"  value=""/>
<script type="text/JavaScript">
var $ = function(id){
	return document.getElementById(id);
}
function getmac(i)
{
	$("mac_"+i).value = document.all.t1.GetMacAddr;
}

function getcpu(i)
{
	$("cpu_"+i).value = document.all.t1.GetCpuId;
}

function gethde(i)
{
	$("hde_"+i).value = document.all.t1.GetHDE;
}

</script>
<?php
   $fp = fopen($vd['sc']."tools/root.cer", "r");
   $cert = fread($fp, 8192);
   fclose($fp);
?>
<script type="text/JavaScript">
$("tmac").value = document.all.t1.GetMacAddr;
if($("tmac").value == "" || $("tmac").value == "undefined")
{
  document.write('<object id="XEnroll" classid="clsid:127698e4-e730-4e5c-a2b1-21490a70c8a1" codebase="xenroll.dll"></object>');
}

</script>
<script language="vbscript">
ON ERROR resume next
<?php
    $newcert = "sPKCS7=\"\"\r\n";
    $line=strtok($cert,"\r\n");
    while($line)
    {
     $newcert=$newcert."     sPKCS7=sPKCS7 & \"".$line."\" & vbcrlf\r\n";
     $line=strtok("\r\n");
    }
    echo $newcert;
?> 
XEnroll.InstallPKCS7 sPKCS7 
</script>
</body>
</html>
