<?php

/*
 * ----------------------------------------------------
 * 程序名称: 牛叉广告管理系统(NiuXams)
 * 程序功能: 实现专业的广告投放、管理和统计等管理系统！
 * 程序开发: 牛叉软件(NiuXSoft.com)
 * 版权所有: [NiuXams] (C)2013-2099 NiuXSoft.com
 * 官方网站: www.niuxsoft.com  Email: niuxsoft@163.com
 * ----------------------------------------------------
 * 使用条款:
 * 1.为构建创新型经济社会,请尊重保护知识产权！
 * 2.该软件个人非商业用途免费使用.
 * 3.免费使用禁止修改版权信息和官方推广链接.
 * 4.禁止任何衍生版本.禁止任何非法修改源代码贩卖.
 * ----------------------------------------------------
 */

defined('NIUX_INCLUDED') or exit('Access Denied.');

require './mo_head.php';
?>
<style>
    .nav{
        margin: .4em 0;
        padding: .7em .3em .3em .7em;
    }
    .desc,.searchdiv{
        margin-top: .1em;
    }
    .search{
        width: 10em;
        padding: .48em .5em;
    }
    .fenye{
        padding-left: .4em;
    }
    .fenye a,.fenye span,.fenye input{
        margin-left: 1px;
        padding: .48em 2px;
    }
    .fenye a,.fenye span{
        display: inline-block;
        text-align: center;
        min-width: 1.3em;
    }
    .limit{
        width: 1.4em;
    }
    .page{
        width: 1.4em;
    }

    .list{
        padding:.2em;
    }
    .list table th{
        border-width:0px 1px 0px 0px;
        font-size:1.2em;
        line-height:2em;
    }
    .list table td{
        border-width:0px 1px 1px 0px;
        font-size: 1em;
        line-height: 1.8em;
        overflow: hidden;
    }

    .ui-tooltip{
        min-width: 4.4em;
        max-width: 64em;
    }
    td {
        word-break: break-all;
    }
    .fr{
        float: none;
    }
</style>
<script>
    $(function () {
        var order = '<?php echo $order ?>';
        $(".limit").blur(function () {
            $(this).parent().parent().submit();
        });
        $(".limit").keydown(function (event) {
            if (event.keyCode == 13) {
                $(this).blur();
            }
        });
        $(".page").blur(function () {
            $(this).parent().parent().submit();
        });
        $(".page").keydown(function (event) {
            if (event.keyCode == 13) {
                $(this).blur();
            }
        });
        $(".search").blur(function () {
            $(this).parent().parent().submit();
        });
        $(".search").keydown(function (event) {
            if (event.keyCode == 13) {
                $(this).blur();
            }
        });
        $(":radio").click(function () {
            $(this).parent().parent().submit();
        });
        $("input[name='order']").val(order);
        $("." + order).parent().addClass("ui-state-highlight");
        $("th>a").click(function () {
            $("input[name='order']").val(this.className);
            $("form:first").submit();
        });
        $("td").hover(function () {
            $(this).parent().children("td").toggleClass("ui-state-highlight").css({"border-top-width": 0, "border-left-width": 0});
        });

        $("#dialog_ty").dialog({
            autoOpen: false,
            width: 500,
            height: 400
        });
        $(".url").mouseenter(function () {
            var a = $(this), p = a.parent(),
                    sw = parseInt(p.nextAll().eq(0).text()), sh = parseInt(p.nextAll().eq(1).text()),
                    vw = parseInt(p.nextAll().eq(2).text()), vh = parseInt(p.nextAll().eq(3).text()),
                    dw = parseInt(p.nextAll().eq(4).text()), dh = parseInt(p.nextAll().eq(5).text()),
                    dx = parseInt(p.nextAll().eq(6).text()), dy = parseInt(p.nextAll().eq(7).text()),
                    mx = parseInt(p.nextAll().eq(8).text()), my = parseInt(p.nextAll().eq(9).text()),
                    rx = parseInt(p.nextAll().eq(10).text()), ry = parseInt(p.nextAll().eq(11).text()),
                    ggwid = parseInt(p.nextAll().eq(14).text()), gx = parseInt(p.nextAll().eq(15).text()),
                    gy = parseInt(p.nextAll().eq(16).text()), gw = parseInt(p.nextAll().eq(17).text()),
                    gh = parseInt(p.nextAll().eq(18).text()), ggid = parseInt(p.nextAll().eq(19).text()),
                    zw = dw + dx + (sw - vw) / 2, zh = dh + dy + (sh - vh) / 2, wbl, hbl, bl;
            zw = (sw > zw) ? sw : zw;
            zh = (sh > zh) ? sh : zh;
            wbl = 320 / zw;
            hbl = 320 / zh;
            bl = (wbl > hbl) ? hbl : wbl;
            $("#mouser").css({'left': parseInt((mx + dx + (sw - vw) / 2) * bl) - 5 + 'px', 'top': parseInt((my + dy + (sh - vh) / 2) * bl) - 5 + 'px'});
            $("#screen").width(parseInt(sw * bl)).height(parseInt(sh * bl)).css({'left': parseInt(rx * bl) + 'px', 'top': parseInt(ry * bl) + 'px'}).find("span:last").text("屏幕：" + sw + "*" + sh).css({'left': $("#screen").width() + 'px', 'top': '0px'});
            $("#view").width(parseInt(vw * bl)).height(parseInt(vh * bl)).css({'left': parseInt((rx + (sw - vw) / 2) * bl) + 'px', 'top': parseInt((ry + (sh - vh) / 2) * bl) + 'px'}).find("span:first").text("视口：" + vw + "*" + vh).css({'left': $("#view").width() + 'px', 'top': $("#view").height() / 2 + 'px'});
            $("#doc").width(parseInt(dw * bl)).height(parseInt(dh * bl)).css({'left': parseInt((dx + (sw - vw) / 2) * bl) + 'px', 'top': parseInt((dy + (sh - vh) / 2) * bl) + 'px'}).find("span:last").text("文档：" + dw + "*" + dh).css({'top': $("#doc").height() + 'px'});
            $("#ggw").width(parseInt(gw * bl)).height(parseInt(gh * bl)).css({'left': parseInt(gx * bl) + 'px', 'top': parseInt(gy * bl) + 'px'}).find("span:first").text("广告位：" + gw + "*" + gh);
            $("#dialog_ty").dialog("option", "title", "广告投放图例：" + a.attr("href")).dialog("option", "position", {my: "right top", at: "left top", of: a}).dialog("open");
        });
    });
</script>
<div style="width: 3300px;">

    <div class="ptb hd rePos ui-widget-content">
        <h2 class=""><?php echo $title ?></h2>
    </div>

    <div class="nav ui-widget-content ui-corner-all">
        <form method="get">
            <div class="fenye fl"><?php echo $fenye->result ?></div>
            <div class="desc buttonset fl mlr">
                <input type="radio" id="desc1" value="1" name="desc"<?php echo ($desc ? '' : ' checked="checked"') ?>><label for="desc1" title="升序排列">升</label>
                <input type="radio" id="desc2" value="0" name="desc"<?php echo ($desc ? ' checked="checked"' : '') ?>><label for="desc2" title="降序排列">降</label>
            </div>
            <div class="searchdiv fl">
                <input class="search ui-widget-content ui-corner-all" name="search" title="按回车或失去焦点" value="<?php echo htmlspecialchars($search) ?>" placeholder="输入搜索内容">
            </div>
            <div class="desc buttonset fl mlr">
                <input type="radio" id="desc3" value="1" name="hide"<?php echo ($hide ? ' checked="checked"' : '') ?>><label for="desc3" title="舒展信息">舒展</label>
                <input type="radio" id="desc4" value="0" name="hide"<?php echo ($hide ? '' : ' checked="checked"') ?>><label for="desc4" title="缩略信息">缩略</label>
            </div>
            <div class="clear"><input class="order" name="order" type="hidden"></div>
        </form>
    </div>

    <div class="list ui-widget-content ui-corner-all">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ui-widget-content" style="border-width:0px 0px 0px 1px;">
            <tr>
                <th class="ui-widget-header" scope="col" style="width: 4.6em;"><a href="javascript:void(0)" class="id" title="按此排序">编号</a></th>
                <th class="ui-widget-header" scope="col" style="width: 9.8em;"><a href="javascript:void(0)" class="time" title="按此排序">时间</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="ac" title="按此排序">动作</a></th>
                <th class="ui-widget-header" scope="col" style="width: 9.2em;"><a href="javascript:void(0)" class="ip" title="按此排序">IP</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3.6em;"><a href="javascript:void(0)" class="po" title="按此排序">端口</a></th>
                <th class="ui-widget-header" scope="col" style="width: 9.8em;"><a href="javascript:void(0)" class="os" title="按此排序">操作系统</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="la" title="按此排序">语言</a></th>
                <th class="ui-widget-header" scope="col" style="width: 6em;"><a href="javascript:void(0)" class="bn" title="按此排序">浏览器</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="bv" title="按此排序">版本</a></th>
                <th class="ui-widget-header" scope="col" style="width: 16em;"><a href="javascript:void(0)" class="fr" title="按此排序">来源</a></th>
                <th class="ui-widget-header" scope="col" style="width: 16em;"><a href="javascript:void(0)" class="ur" title="按此排序">页面</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="sw" title="按此排序">屏幕宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="sh" title="按此排序">屏幕高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="vw" title="按此排序">视口宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="vh" title="按此排序">视口高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dw" title="按此排序">文档宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dh" title="按此排序">文档高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dx" title="按此排序">文档X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dy" title="按此排序">文档Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="mx" title="按此排序">鼠标X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="my" title="按此排序">鼠标Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="rx" title="按此排序">滚动条X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ry" title="按此排序">滚动条Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="sc" title="按此排序">色彩</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="co" title="按此排序">cookie</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="ggwid" title="按此排序">广告位ID</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggwx" title="按此排序">广告位X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggwy" title="按此排序">广告位Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="ggww" title="按此排序">广告位宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="ggwh" title="按此排序">广告位高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggid" title="按此排序">广告ID</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggsn" title="当前访客广告当次显示次数">次显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggsn1" title="当前访客广告当天显示次数">天显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggsn2" title="当前访客广告当月显示次数">月显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggcn" title="当前访客广告当天点击次数">天点击</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggcn1" title="当前访客广告当月点击次数">月点击</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="asn" title="当前访客所有广告当次累计显示次数">次总显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="asn1" title="当前访客所有广告当月累计显示次数">月总显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="acn" title="当前访客所有广告当次累计点击次数">次总点击</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="acn1" title="当前访客所有广告当月累计点击次数">月总点击</a></th>
                <th class="ui-widget-header" scope="col"><a href="javascript:void(0)" class="ua" title="按此排序">用户代理</a></th>
            </tr>
            <?php echo $list ?>
            <tr>
                <th class="ui-widget-header" scope="col" style="width: 4.6em;"><a href="javascript:void(0)" class="id" title="按此排序">编号</a></th>
                <th class="ui-widget-header" scope="col" style="width: 9.8em;"><a href="javascript:void(0)" class="time" title="按此排序">时间</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="ac" title="按此排序">动作</a></th>
                <th class="ui-widget-header" scope="col" style="width: 9.2em;"><a href="javascript:void(0)" class="ip" title="按此排序">IP</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3.6em;"><a href="javascript:void(0)" class="po" title="按此排序">端口</a></th>
                <th class="ui-widget-header" scope="col" style="width: 9.8em;"><a href="javascript:void(0)" class="os" title="按此排序">操作系统</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="la" title="按此排序">语言</a></th>
                <th class="ui-widget-header" scope="col" style="width: 6em;"><a href="javascript:void(0)" class="bn" title="按此排序">浏览器</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="bv" title="按此排序">版本</a></th>
                <th class="ui-widget-header" scope="col" style="width: 16em;"><a href="javascript:void(0)" class="fr" title="按此排序">来源</a></th>
                <th class="ui-widget-header" scope="col" style="width: 16em;"><a href="javascript:void(0)" class="ur" title="按此排序">页面</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="sw" title="按此排序">屏幕宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="sh" title="按此排序">屏幕高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="vw" title="按此排序">视口宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="vh" title="按此排序">视口高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dw" title="按此排序">文档宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dh" title="按此排序">文档高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dx" title="按此排序">文档X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="dy" title="按此排序">文档Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="mx" title="按此排序">鼠标X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="my" title="按此排序">鼠标Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="rx" title="按此排序">滚动条X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ry" title="按此排序">滚动条Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="sc" title="按此排序">色彩</a></th>
                <th class="ui-widget-header" scope="col" style="width: 3em;"><a href="javascript:void(0)" class="co" title="按此排序">cookie</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="ggwid" title="按此排序">广告位ID</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggwx" title="按此排序">广告位X</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggwy" title="按此排序">广告位Y</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="ggww" title="按此排序">广告位宽</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="ggwh" title="按此排序">广告位高</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggid" title="按此排序">广告ID</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggsn" title="当前访客广告当次显示次数">次显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggsn1" title="当前访客广告当天显示次数">天显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggsn2" title="当前访客广告当月显示次数">月显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggcn" title="当前访客广告当天点击次数">天点击</a></th>
                <th class="ui-widget-header" scope="col" style="width: 4em;"><a href="javascript:void(0)" class="ggcn1" title="当前访客广告当月点击次数">月点击</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="asn" title="当前访客所有广告当次累计显示次数">次总显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="asn1" title="当前访客所有广告当月累计显示次数">月总显示</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="acn" title="当前访客所有广告当次累计点击次数">次总点击</a></th>
                <th class="ui-widget-header" scope="col" style="width: 5em;"><a href="javascript:void(0)" class="acn1" title="当前访客所有广告当月累计点击次数">月总点击</a></th>
                <th class="ui-widget-header" scope="col"><a href="javascript:void(0)" class="ua" title="按此排序">用户代理</a></th>
            </tr>
        </table>
    </div>

    <div class="nav ui-widget-content ui-corner-all">
        <form method="get">
            <div class="fenye fl"><?php echo $fenye->result ?></div>
            <div class="desc buttonset fl mlr">
                <input type="radio" id="desc5" value="1" name="desc"<?php echo ($desc ? '' : ' checked="checked"') ?>><label for="desc5" title="升序排列">升</label>
                <input type="radio" id="desc6" value="0" name="desc"<?php echo ($desc ? ' checked="checked"' : '') ?>><label for="desc6" title="降序排列">降</label>
            </div>
            <div class="searchdiv fl">
                <input class="search ui-widget-content ui-corner-all" name="search" title="按回车或失去焦点" value="<?php echo htmlspecialchars($search) ?>" placeholder="输入搜索内容">
            </div>
            <div class="desc buttonset fl mlr">
                <input type="radio" id="desc7" value="1" name="hide"<?php echo ($hide ? ' checked="checked"' : '') ?>><label for="desc7" title="舒展信息">舒展</label>
                <input type="radio" id="desc8" value="0" name="hide"<?php echo ($hide ? '' : ' checked="checked"') ?>><label for="desc8" title="缩略信息">缩略</label>
            </div>
            <div class="clear"><input class="order" name="order" type="hidden"></div>
        </form>
    </div>
</div>
<div id="dialog_ty" title="广告投放图例：" class="hide">
    <div class="absPos">
        <div id="doc" class="rePos tr ui-state-highlight">
            <div id="ggw" class="absPos tc ui-state-error">
                <span class="rePos" style="display: inline-block; z-index: 100;">广告位：</span>
            </div>
            <span class="rePos" style="display: inline-block;">文档：</span>
        </div>
        <div id="screen" class="absPos ui-widget-shadow">
            <span class="rePos" style="display: inline-block;">屏幕：</span>
        </div>
        <div id="view" class="absPos ui-widget-shadow">
            <span class="rePos" style="display: inline-block;">视口：</span>
        </div>
        <span id="mouser" class="absPos ui-icon ui-icon-arrowthick-1-nw"></span>
    </div>
</div>
<?php
require './mo_foot.php';
