<?php
/**
 * @version        Somao_Search X1.0 9:23 2012-1-1 Somao $
 * @package        Somao_Search.Site
 * @copyright      Copyright (c) 2009 - 2012, Somao, Inc.
 * @license        http://www.somao123.com/
 * @link           http://www.somao.cc/
 */
require_once("global.php");
is_login();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>贡献流量</title>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<link href="/css/union.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/union.js"></script>
</head>
<body>
<div id="body">
<?php
if($_GET['type']=="1" or $_GET['type']=="" ){
?>
  <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#39867B">
    <tr>
      <td class="title">流量信息 - 贡献流量 </td>
    </tr>
    <tr>
      <td valign="top" bgcolor="#EFEFEF"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dddddd" class="table">
          <tr>
            <td width="24%" height="30" bgcolor="#efefef"><h4>IP来源</h4></td>
            <td width="48%" bgcolor="#efefef"><h4>实际MAC地址</h4></td>
            <td width="28%" bgcolor="#efefef"><h4>时间</h4></td>
          </tr>
  <?php
  $query=$db->query("select * from ve123_webunion_log where mid='".$user["user_id"]."' and type=1 order by c_time desc limit 0,30");
  while($link=$db->fetch_array($query)){
  ?>
  <tr>
    <td height="30"><?php echo $link["c_ip"];?></td>
    <td align=""><?php echo $link["mac"];?></td>
    <td align=""><?php echo MyDate('Y-m-d  H:i:s',$link["c_time"])?></td>
  </tr>
  <?php
  }
  ?>
		           <tr>
                <td height="25" colspan="3" bgcolor="#efefef">
                  今日IP数：
				  <?php 
				  $rows=$db->get_one("select count(*) as dd from ve123_webunion_log where mid='".$user["user_id"]."' and type=1 and TO_DAYS(FROM_UNIXTIME(c_time))=TO_DAYS(NOW()) ");
				  echo $rows['dd'];
				  ?>
				   / 总IP数：
				   <?php 
				  $rows=$db->get_one("select count(*) as dd from ve123_webunion_log where mid='".$user["user_id"]."' and type=1  ");
				  echo $rows['dd'];
				  ?>  <font color="#FF0000">注意：未保护用户资料，IP地址只显示最新30条</font>
                  </td>
              </tr>
      </table></td>
    </tr>
  </table>
<?php }elseif($_GET['type']=="2"){?>
  <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#39867B">
    <tr>
      <td class="title">流量信息 - 得到流量 </td>
    </tr>
    <tr>
      <td valign="top" bgcolor="#EFEFEF"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dddddd" class="table">
          <tr>
            <td width="24%" height="30" bgcolor="#efefef"><h4>IP来源</h4></td>
            <td width="48%" bgcolor="#efefef"><h4>实际MAC地址</h4></td>
            <td width="28%" bgcolor="#efefef"><h4>时间</h4>            </td>
          </tr>
          
              <?php
  $query=$db->query("select * from ve123_webunion_log where mid='".$user["user_id"]."' and type=2 order by c_time desc  limit 0,30");
  while($link=$db->fetch_array($query)){
  ?>
  <tr>
    <td height="30"><?php echo $link["c_ip"];?></td>
    <td align=""><?php echo $link["mac"];?></td>
    <td align=""><?php echo MyDate('Y-m-d  H:i:s',$link["c_time"])?></td>
  </tr>
  <?php
  }
  ?>
		           <tr>
                <td height="25" colspan="3" bgcolor="#efefef">
                  今日IP数：
				  <?php 
				  $rows=$db->get_one("select count(*) as dd from ve123_webunion_log where mid='".$user["user_id"]."' and type=2  and TO_DAYS(FROM_UNIXTIME(c_time))=TO_DAYS(NOW()) ");
				  echo $rows['dd'];
				  ?>
				   / 总IP数：
				   <?php 
				  $rows=$db->get_one("select count(*) as dd from ve123_webunion_log where mid='".$user["user_id"]."' and type=2  ");
				  echo $rows['dd'];
				  ?>  <font color="#FF0000">注意：未保护用户资料，IP地址只显示最新30条</font>
                  </td>
              </tr>
      </table></td>
    </tr>
  </table>
<?php }?>
<?php foothtml(); ?>