<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("username")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("id")="" Then
	ef=True
	ec="请选择产品！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
end if

if not ef Then
SERVER_NAME=Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("HTTP_FreeHostAPISITE")<>"" Then SERVER_NAME=Request.ServerVariables("HTTP_FreeHostAPISITE")
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
Set dsdom = Server.CreateObject("ADODB.Recordset")
sql="Select * from FreeHost.FreeHost_Product_Domain where username='"&session("username")&"' and id='"&Request("id")&"'"
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsdom.Open sql,conn,1,1
if dsdom.eof then
	ef=True
	ec="不存在的域名！"
end if
end if

if not ef then
if dsdom("status")<>"正常" then
	ef=True
	ec="只有处于正常状态的域名才能打印证书。"
end if
end If


if not ef then
if IsNull(dsdom("uname1")) then
	ef=True
	ec="新的域名证书只支持2009-1-1后注册的域名,以前注册的请到原始注册商中查看。或者,这是域名是管理员手工在管理区录入的,您可以要求管理员将域名改为预注册状态,录入完整的域名注册人信息后,才能查看证书."
end if
end if


if not ef Then
Dim enc
Enddomaintypeid=GetDomaintype(dsdom("Domain"))
end if





if not ef then%>
<html>
<head>
<title>域名证书</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td,p{font-size:12px;}
a:active{text-decoration:none; color: #000000}a:hover{text-decoration:underline; color: #000000}a:link{text-decoration:none; color: #000000}a:visited{text-decoration:none; color: #000000}td{font-size:12px}.Arial_8 {  font-family: "Arial"; font-size: 8pt}
.Verdana_8 {  font-family: "Verdana"; font-size: 8pt}
.L13 {  line-height: 150%}
.p10 {  font-size: 10.5pt; font-family: "宋体"}
--></style>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v3.0
  //Copyright 1998 Macromedia, Inc. All rights reserved.
  var i,j,aLayer,retVal,curDrag=null,NS=(navigator.appName=='Netscape'), curLeft, curTop;
  if (!document.all && !document.layers) return false;
  retVal = true; if(!NS && event) event.returnValue = true;
  if (MM_dragLayer.arguments.length > 1) {
    curDrag = MM_findObj(objName); if (!curDrag) return false;
    if (!document.allLayers) { document.allLayers = new Array();
      with (document) if (NS) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];
        for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)
          with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];
      } else for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i];}
    curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
    curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
    curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
    curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
    curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
    curDrag.MM_oldZ = (NS)?curDrag.zIndex:curDrag.style.zIndex;
    curLeft= (NS)?curDrag.left:curDrag.style.pixelLeft; curDrag.MM_startL = curLeft;
    curTop = (NS)?curDrag.top:curDrag.style.pixelTop; curDrag.MM_startT = curTop;
    curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop -cU;
    curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop +cD;
    curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
    document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
    if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  } else {
    var theEvent = ((NS)?objName.type:event.type);
    if (theEvent == 'mousedown') {
      var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
      var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
      var maxDragZ=null; document.MM_maxZ = 0;
      for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
        var aLayerZ = (NS)?aLayer.zIndex:aLayer.style.zIndex;
        if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
        var isVisible = (((NS)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);
        if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
          var parentL=0; var parentT=0;
          if (!NS) { parentLayer = aLayer.parentElement;
            while (parentLayer != null && parentLayer.style.position) {
              parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;
              parentLayer = parentLayer.parentElement; } }
          var tmpX=mouseX-(((NS)?pageX:style.pixelLeft+parentL)+MM_hLeft);
          var tmpY=mouseY-(((NS)?pageY:style.pixelTop +parentT)+MM_hTop);
          var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += ((NS)?clip.width :offsetWidth);
          var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS)?clip.height:offsetHeight);
          if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
              || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
      if (curDrag) {
        document.onmousemove = MM_dragLayer; if (NS) document.captureEvents(Event.MOUSEMOVE);
        curLeft = (NS)?curDrag.left:curDrag.style.pixelLeft;
        curTop = (NS)?curDrag.top:curDrag.style.pixelTop;
        MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
        document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;
        if(curDrag.MM_toFront) {
          eval('curDrag.'+((NS)?'':'style.')+'zIndex=document.MM_maxZ+1');
          if (!curDrag.MM_dropBack) document.MM_maxZ++; }
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mousemove') {
      if (document.MM_curDrag) with (document.MM_curDrag) {
        var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
        var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
        newLeft = mouseX-MM_oldX; newTop  = mouseY-MM_oldY;
        if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
        if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
        if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);
        if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);
        MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
        if (NS) {left = newLeft; top = newTop;}
        else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
        if (MM_dragJS) eval(MM_dragJS);
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mouseup') {
      document.onmousemove = null;
      if (NS) document.releaseEvents(Event.MOUSEMOVE);
      if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
      if (document.MM_curDrag) with (document.MM_curDrag) {
        if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
            (Math.pow(MM_targL-((NS)?left:style.pixelLeft),2)+
             Math.pow(MM_targT-((NS)?top:style.pixelTop),2))<=MM_tol) {
          if (NS) {left = MM_targL; top = MM_targT;}
          else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
          MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
        if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
        if(MM_dropBack) {if (NS) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}
        retVal = false; if(!NS) event.returnValue = false; }
      document.MM_curDrag = null;
    }
    if (NS) document.routeEvent(objName);
  } return retVal;
}
//-->
</script>

</head>

<body bgcolor="#FFFFFF" text="#000000" link="#FFFF00" >
<br>
<body bgcolor="#CCCCCC" text="#000000" link="#FFFF00" vlink="#FFFF00" alink="#FFFF00" onLoad="MM_dragLayer('Layer1','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,0,'',false,'')">
  <tr> 
    <td>
      <table border="0" cellspacing="0" cellpadding="0" align="left" width="600">
        <tr bgcolor="#CC3333"> 
          <td colspan="3" height="14">&nbsp;</td>
        </tr>
        <tr> 
          <td rowspan="2" width="14" bgcolor="#CC3333">&nbsp;</td>
          <td width="610"> 
            <table width="610" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td height="76">

                  <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
                    <tr> 
                      <td align="center" colspan="3"> <br>
                        <table width="90%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td rowspan="2" valign="middle"> 
                             							
                              <div align="center"><img src="/style/img/domain/certificate.gif" width="350" height="100"></div>
	
                            </td>
                            <td> 
                              
							  <div align="center"><img src="/style/img/domain/coin.gif" width="139" height="115"></div>
							  
                            </td>
                          </tr>
                          <tr> 
                            <td height="36" valign="middle"> 
                              
							  <div align="center"><br>
                                <font color="#666666" size="1" face="Arial, Helvetica, sans-serif">ICANN 
                                标志由互联网<br>
                                名称与数字地址分配机构所有</font> </div>
							  
                            </td>
                          </tr>
                        </table>
                        <table width="80%" border="0" cellspacing="0" cellpadding="3">

                          <tr> 
                            <td> 
						

								<%If Enddomaintypeid=2 Or Enddomaintypeid=3 Or Enddomaintypeid=70 Or Enddomaintypeid=25 then%>
								<p>本证书由中国互联网络信息中心<font face="Arial, Helvetica, sans-serif">CNNIC(China Internet Network Information 
                                Center)</font>授权，并由（<font face="Arial, Helvetica, sans-serif"><%=SERVER_NAME%></font>)制作并颁发此证。<b><br>
                                <br>
								<%else%>
                                <p>本证书由互联网名称与数字地址分配机构<font face="Arial, Helvetica, sans-serif">ICANN(The 
                                Internet Corporation for Assigned Names and Numbers)</font>授权，并由（<font face="Arial, Helvetica, sans-serif"><%=SERVER_NAME%></font>)制作并颁发此证。<b><br>
                                <br>
								<%End if%>
								
                                证明　

								<table width="500" border="1" cellpadding="2" cellspacing="0" bordercolorlight="#666666" bordercolordark="#FFFFFF">
              <tr> 
                <td width="209" align="right">域名:</td>
                <td width="291">&nbsp;<%=dsdom("Domain")%></td>
              </tr>
              <tr> 
                <td width="209" class="Verdana_8" align="right">Domain Name:</td>      
                <td width="291">&nbsp;<%=dsdom("Domain")%></td>
              </tr>
              <tr> 
                <td width="209" align="right">注册所有人:</td>
                <td width="291">&nbsp;<%=dsdom("uname1")%></td>
              </tr>
              <tr> 
                <td width="209" class="Verdana_8" align="right">Registrar:</td>
                <td width="291">&nbsp;<%=dsdom("uname2")%></td>
              </tr>
              <tr> 
                <td width="209" align="right">注册时间:</td>
                <td width="291">&nbsp;<%=dsdom("starttime")%></td>
              </tr>
              <tr> 
                <td width="209" class="Verdana_8" align="right">Regist Date:</td>      
                <td width="291">&nbsp;<%=dsdom("starttime")%></td>
              </tr>
              <tr> 
                <td width="209" align="right">到期时间:</td>
                <td width="291">&nbsp;<%=dsdom("endtime")%></td>
              </tr>
              <tr> 
                <td width="209" class="Verdana_8" align="right">Close Date:</td>      
                <td width="291">&nbsp;<%=dsdom("endtime")%></td>
              </tr>
		  
</table>
			
                        <div id="Layer2" style="position:absolute; width:115.5pt; height:114.75pt; z-index:2; left: 312.75pt; top: 332.25pt">
<%
Set dsreg = Server.CreateObject("ADODB.Recordset")	
if session("agentname")<>"n" then
Sql="Select * from FreeHost.FreeHost_Agent where username='"&session("agentname")&"'"
else
Sql="Select * from FreeHost.FreeHost_Admuser where superuser='freehost'"
end If

	dsreg.Open Sql,conn,1,1
if not dsreg.eof then
if dsreg("upgiflen")>0 then%>
<img src="domaingif.asp"><%end if
end if
%>
						
						</div>
                           

                        <br>
                        <br>
                        <table width="80%" border="0" align="center">
                          <tr> 
                            <td> 
                              <p align="left" >以下说明与本证书主文一起构成本证书统一整体，不可分割：<br>
                                <br>
                                <font style="font-size:9pt;line-height:13pt"> 
                                1．本证书表明证书上列出的组织或者个人是列出的域名的合法注册人。该注册人依法享有该域名项下之各项权利。<br>
                                2．本证书并不表明的运营商对本证书所列域名是否贬斥、侵害或毁损任何第三人之合法权利或利益作出任何明示或默示之评判、确认、担保，或作出其它任何形式之意思表示。亦无任何责任或义务作出上述之评判、确认、担保，或作出其它任何形式之意思表示。<br>
                                3．因本证书中所列域名之注册或使用而可能引发与任何第三人之纠纷或冲突,均由该域名注册人本人承担，不承担任何法律责任。亦不在此类纠纷或冲突中充当证人、调停人或其它形式之参与人。<br>
                                4．本证书不得用于非法目的，不承担任何由此而发生或可能发生之法律责任。</font></p>
                              <p align="left" > 当本证书持有、出具、展示或以其它任何形式使用时，即表明本证书之持有人或接触人已审读、理解并同意以上各条款之规定。</p>
                            </td>
                          </tr>
                        </table>
                        <br>
                      </td>
                    </tr>
                    <tr> 
                      <td colspan="3" height="20" rowspan="2"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" height="20">
                          <tr bgcolor="#CCCCCC"> 
                            <td> 
                              <div align="center">关于域名的相关情况，请查询 <%=SERVER_NAME%></div>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>

                </td>
              </tr>
            </table>
          </td>
          <td rowspan="2" width="14" bgcolor="#CC3333">&nbsp;</td>
        </tr>
        <tr> 
          <td width="610" height="14" bgcolor="#CC3333">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>