<?php
/**
 * 本文件说明：         首页页面及接口查询
 * 本文件待完善功能：   页面与PHP分离
 * 本程序作者：         Xiaoni
 * 本程序版本：         v1.0.0812 Alpha
 * 本程序主页:          http://wwww.15so.com
 * 注意事项：           使用免费版本有日查询条数限制。免费版本请保留本站链接
 * 联系作者：           admin@15so.com
 *
 */
require_once 'config.php';
require_once 'func.php';
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <TITLE>备案信息，网站备案详情</TITLE>
        <META content=ICP备案信息，网站备案信息，域名备案信息 name=keywords>
        <META content=备案信息，在线查询ICP备案，网站备案，域名备案的详细信息。 name=description>
        <link href="images/base_new.css" type="text/css" rel=stylesheet>
        <link href="images/tool.css" type="text/css" rel=stylesheet>
        <script src="images/jquery-1.4.min.js" type="text/javascript"></script>
        <script src="images/common.js" type="text/javascript"></script>

    </head>
    <body>
        <div class="tool_lmi"><!--logo,menu-input-->
        <div class="tool_jianj"><!--工具简介-->

            <div class="tool_jtitle">
                <script src="images/tooly.js" type="text/javascript"></script>
            </div>
                            <div class=tool_jianjn>
                                <div class="icp_ip1">
                                    <form id="15so_submit" action="index.php" method="post" onSubmit="return validate_form(this)">
                                        <select class=select style="BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; FLOAT: left; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 9px 0px 0px; WIDTH: 194px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px"  name="type">
                                            <option value="0" <?php if ($_POST['type'] === '0') { echo "select";} ?>>网站域名</option>
                                            <option value="1" <?php if ($_POST['type'] === '1') {  echo "select";} ?>>网站名称</option>
                                            <option value="2" <?php if ($_POST['type'] === '2') { echo "select";} ?>>网站首页网址</option>
                                            <option value="3" <?php if ($_POST['type'] === '3') { echo "select";} ?>>备案/许可号</option>
                                            <option value="4" <?php if ($_POST['type'] === '4') { echo "select"; } ?>>网站IP地址</option>
                                            <option value="5" <?php if ($_POST['type'] === '5') { echo "select"; } ?>>主办单位/个人姓名</option>
                                            <option value="16" <?php if ($_POST['type'] === '16') { echo "select";} ?>>事业法人证号码查询</option>
                                            <option value="6" <?php if ($_POST['type'] === '6') { echo "select"; } ?> >军队代号号码</option>
                                            <option value="11" <?php if ($_POST['type'] === '11') { echo "select";} ?>>社团法人证号码查询</option>
                                            <option value="8" <?php if ($_POST['type'] === '8') { echo "select";} ?>>个人--护照号码</option>
                                            <option value="9" <?php if ($_POST['type'] === '9') { echo "select"; } ?>>个人--身份证</option>
                                            <option value="18" <?php if ($_POST['type'] === '18') {  echo "select";  } ?>>个人-军官证号码查询</option>
                                            <option value="17" <?php if ($_POST['type'] === '17') { echo "select"; } ?>>政府机关组织机构代码证</option>
                                            <option value="12" <?php if ($_POST['type'] === '12') { echo "select"; } ?>>社会团体组织机构代码证</option>
                                            <option value="10" <?php if ($_POST['type'] === '10') { echo "select";} ?>>台胞证号码</option>
                                            <option value="13" <?php if ($_POST['type'] === '13') { echo "select";} ?>>企业工商营业执照号</option>
                                            <option value="14" <?php if ($_POST['type'] === '14') { echo "select"; } ?>>企业-组织机构代码证</option>
                                            <option value="15" <?php if ($_POST['type'] === '15') { echo "select"; } ?>>事业单位-组织机构代码证</option>
                                             </select>
                                             <input class="tool_input1" onFocus="this.select();" onMouseMove="this.select();" id="input_keyword" value="<?php
                                                    if ($_POST['keyword']) {
                                                        echo $_POST['keyword'];
                                                    } else {
?>请输入查询条件<?php } ?>" name="keyword">
                                                    <input class="tool_anniu" type="submit" onsubmit="return check(this)" alt="搜索一下，你懂得">
                                                </form>
                                            </div>
                                            <div class=qingchu></div></div></div>
                                        <div class=icp_table_main>
                                            <table cellSpacing=0 cellPadding=0 width=922 border=0>
                                                <tbody>
                                                    <tr class=icp_tt>
                                                        <td width=30>编号</td>
                                                        <td width=162>主办单位名称</td>
                                                        <td width=57>性质</td>
                                                        <td width=204>网站备案/许可证号</td>
                                                        <td width=146>网站名称</td>
                                                        <td width=177>网站首页网址</td>
                                                        <td width=76>审核时间</td>
                                                        <td width=69>详细信息</td>
                                                    </tr>
<?php
                                                    if (!empty($_POST)) {
                                                        $keyword = strtolower(trim($_POST['keyword']));
                                                        $type = $_POST['type'];
                                                        $str = $apiuser . $apikey . $keyword . $type;
                                                        $vcode = substr(md5($str), 3, 20);
                                                        $url = $apiurl . $keyword . "&type=" . $type . "&encodekey=" . $vcode;
                                                        $content = file_get_contents($url);
                                                        $result = xml2array($content);
                                                        $tmpdata = $result['Result']['IcpInfo'];
                                                        if ($tmpdata['0']) {
                                                            $data = $tmpdata;
                                                        } else {
                                                            $data = array($tmpdata);
                                                        }
?>
<?php foreach ($data as $k => $val) { ?>
                                                            <tr class=icp_lj>
                                                                <td height=36><?php echo $k + 1; ?></td>
                                                                <td ><?php echo $val['cname'] ?></td>
                                                                <td ><?php echo $val['ctype'] ?></td>
                                                                <td ><A href="detail.php?id=<?= $val['apid'] ?>" target=_blank><?php echo $val['icp'] ?></A></td>
                                                                <td><?= $val['sitename'] ?></td>
                                                                            <td ><div style="width:120px;height:20px;overflow-x :hidden;overflow-y:hidden;">
<?php
                                                            $urls = explode("|_|", $val['domain']);
                                                            for ($i = 0; $i < count($urls); $i++) {
                                                                echo $urls[$i] . "<br>";
                                                            }
?></div></td>
                                                                            <td ><?= $val['ctime'] ?></td>
                                                                            <td> <a href="detail.php?id=<?= $val['apid'] ?>" target=_blank>详细信息</a> </td>
                                                                        </tr>
<?php
                                                        }
                                                    } else {
?>
                                                                    <tr class=icp_lj>
                                                                        <td  height=36 colSpan=8>请输入你需要查询的条件！ </td>
                                                                    </tr>
<?php } ?>
                                                            </tbody>
                                                        </table>
                                                    </div>

                            <script type="text/javascript">

                                function validate_required(field,alerttxt)
                                {
                                    with (field)
                                    {
                                        if (value==null||value==""||value=="请输入查询条件")
                                        {alert(alerttxt);return false}
                                        else {return true}
                                    }
                                }

                                function validate_form(thisform)
                                {
                                    with (thisform)
                                    {
                                        if (validate_required(keyword,"请输入查询条件")==false)
                                        { $('#input_keyword').val(""); keyword.focus();return false}
                                    }
                                }
                                SetAllSelects.setAllSelectStyle();
                                window.onresize = function () { SetAllSelects.setAllSelectStyleResize()
                                };
                            </script>
                            </body>
                            </html>

