⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 data_historypic.php

📁 VIP信息处理系统源码
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php

  if ($rowdroit['is_admin'] == 1)
  {
    $sqlfadmin = '';
    $sqlfadzer = '';
  }
  else
  {
    $sqlowner = '' . 'select username from advertizer where adser_owner=\'' . $_SESSION['admin_username'] . '\'';
    $rsowner = mysql_query ($sqlowner);
    $sqlfadmin = ' and (';
    $sqlfadzer = ' and (';
    while ($rowner = mysql_fetch_array ($rsowner))
    {
      $sqlfadmin .= '' . 'adser_user=\'' . $rowner['username'] . '\' or ';
      $sqlfadzer .= '' . 'username=\'' . $rowner['username'] . '\' or ';
    }

    $sqlfadmin = substr ($sqlfadmin, 0, strlen ($sqlfadmin) - 4) . ')';
    $sqlfadzer = substr ($sqlfadzer, 0, strlen ($sqlfadzer) - 4) . ')';
  }

  if (($adser_name != 'all_advertizer_everyday' AND !empty ($adser_name)))
  {
    $sqlads = '' . 'select * from ads where username=\'' . $adser_name . '\' and admin_stat!=\'1\' and (ads_stat!=0 or ads_stat!=1) ' . $sqlfadzer . ' order by admin_stat,id desc';
    $rsads = mysql_query ($sqlads);
    while ($rowads = mysql_fetch_array ($rsads))
    {
      $ads_id = $rowads['id'];
      $arr_ads[$ads_id] = $rowads['link_tit'];
      $adstype = $rowads['ads_type'];
      if ($adstype == 3)
      {
        $arr_adstype[$ads_id] = '<font color=ff3300>*</font>';
        continue;
      }
      else
      {
        if ($adstype == 4)
        {
          $arr_adstype[$ads_id] = '<font color=99cc00>#</font>';
          continue;
        }

        continue;
      }
    }
  }

  $start_date = $s_yy . '-' . $s_mm . '-' . $s_dd;
  $over_date = $o_yy . '-' . $o_mm . '-' . $o_dd;
  if (($start_date == '--' OR $over_date == '--'))
  {
    $datedef = date ('Y-m-d', time () - 259200);
    $nowdate = date ('Y-m-d', time () - 86400);
    $sqlf_date = '' . ' and date>=\'' . $datedef . '\' and date<=\'' . $nowdate . '\' ';
  }
  else
  {
    $sqlf_date = '' . ' and date>=\'' . $start_date . '\' and date<=\'' . $over_date . '\' ';
  }

  if (($adsid == 'all' OR empty ($adsid)))
  {
    $sqlf_date .= '';
  }
  else
  {
    $sqlf_date .= '' . ' and ads_id=\'' . $adsid . '\'';
  }

  if ($adser_name == 'all_advertizer_everyday')
  {
    $sqlf_date .= '';
  }
  else
  {
    $sqlf_date .= '' . ' and adser_user=\'' . $adser_name . '\'';
  }

  $str_disp = '';
  $i = 0;
  $maxnum = 0;
  $sumopen = 0;
  $sumclick = 0;
  if ((($adsid != 'all' AND !empty ($adsid)) OR $adser_name == 'all_advertizer_everyday'))
  {
    $sql = '' . 'select date,sum( open_num ) as totopen, sum( click_num ) as totclick, sum( adser_money ) as t_adsermoney, sum( web_money ) as t_webmoney from daydata where 1 ' . $sqlf_date . ' ' . $sqlfadmin . ' GROUP BY date ORDER BY date';
    $rs = mysql_query ($sql);
    while ($row = mysql_fetch_array ($rs))
    {
      if ($date != $row['date'])
      {
        $totopen = (empty ($row[totopen]) ? 1 : $row[totopen]);
        $rate = round ($row[totclick] / $totopen * 100);
        $arr_disp[0][$i] = $row['date'];
        $arr_disp[1][$i] = $row['totopen'];
        $arr_disp[2][$i] = $row['totclick'];
        $arr_disp[3][$i] = $rate;
        ++$i;
        if ($maxnum < $row['totopen'])
        {
          $maxnum = $row['totopen'];
        }

        if ($maxnum < $row['totclick'])
        {
          $maxnum = $row['totclick'];
        }

        $sumopen = $sumopen + $row['totopen'];
        $sumclick = $sumclick + $row['totclick'];
        continue;
      }
    }

    while (list ($k, $v) = each ($arr_disp[0]))
    {
      $aopen = $arr_disp[1][$k];
      $aclick = $arr_disp[2][$k];
      $rate = $arr_disp[3][$k];
      if ($aopen == 0)
      {
        $rate = 0;
      }

      $len_open = round ($aopen / $maxnum * 400);
      $len_click = round ($aclick / $maxnum * 400);
      $r_open = round ($aopen / $sumopen * 100);
      $r_click = round ($aclick / $sumclick * 100);
      if ((($adsid == 'all' OR $adser_name == 'all_advertizer_everyday') OR empty ($adsid)))
      {
        $str_ocdata = '<font color=aaaaaa>--</font>';
        $str_tdd = '' . '
					<table border=0 cellspacing=0 cellpadding=1 width=\'99%\' align=center>
					  <tr><td valign=middle>
						<table border=0 cellspacing=0 cellpadding=0 width=\'' . $len_open . '\'>
						  <tr><td height=\'8\' bgcolor=\'6699ff\'><font size=-6>' . $aopen . '</font></td></tr>
						</table>
					  </td></tr>
					  <tr><td valign=middle>
						<table border=0 cellspacing=0 cellpadding=0 width=\'' . $len_click . '\'>
						  <tr><td height=\'8\' bgcolor=\'99cc00\'><font size=-6>' . $aclick . '</font></td></tr>
						</table>
					  </td></tr>
					</table>';
      }

      $str_tdd = ;
      $str_ropen = $r_open . '%';
      $str_rclick = $r_click . '%';
      $str_disp .= '' . '
			  <tr align=center class="listbody_admin">
				<td>' . $v . '</td>
				<td align=left>
				' . $str_tdd . '
				</td>
				<td>' . $rate . '%</td>
				<td>' . $str_ropen . '</td>
				<td>' . $str_rclick . '</td>
				<td>' . $str_ocdata . '</td>
			  </tr>';
    }
  }
  else
  {
    if ($adser_name != 'all_advertizer_everyday')
    {
      $sql = '' . 'select * from daydata where 1 ' . $sqlf_date . ' ' . $sqlfadmin . ' ORDER BY date';
      $rs = mysql_query ($sql);
      while (true)
      {
        if ($row = mysql_fetch_array ($rs))
        {
          $sdate = $row['date'];
          $ads_id = $row['ads_id'];
          $arr_totopen['' . $sdate] = $arr_totopen['' . $sdate] + $row['open_num'];
          $arr_totclick['' . $sdate] = $arr_totclick['' . $sdate] + $row['click_num'];
          $arr_open['' . $sdate]['' . $ads_id] = $arr_open['' . $sdate]['' . $ads_id] + $row['open_num'];
          $arr_click['' . $sdate]['' . $ads_id] = $arr_click['' . $sdate]['' . $ads_id] + $row['click_num'];
          if ($maxnum < $arr_totopen['' . $sdate])
          {
            $maxnum = $arr_totopen['' . $sdate];
          }

          if ($maxnum < $arr_totclick['' . $sdate])
          {
            $maxnum = $arr_totclick['' . $sdate];
          }

          $sumopen = $sumopen + $row['open_num'];
          $sumclick = $sumclick + $row['click_num'];
        }
      }

      while (list ($k, $v) = each ($arr_totopen))
      {
        $totclick = $arr_totclick['' . $k];
        $len_open = round ($v / $maxnum * 290);
        $len_click = round ($totclick / $maxnum * 290);
        $r_open = round ($v / $sumopen * 100);
        $r_click = round ($totclick / $sumclick * 100);
        $str_list = '';
        while (true)
        {
          if (list ($sk, $sv) = each ($arr_open['' . $k]))
          {
            $sclick = $arr_click['' . $k]['' . $sk];
            $ads_len_open = round ($sv / $maxnum * 290);
            $ads_len_click = round ($sclick / $maxnum * 290);
            $str_list .= '
				<table border=0 cellspacing=0 cellpadding=1 width=\'99%\' align=center>
				  <tr class=listbody><td width=160 rowspan=2 align=right>' . $arr_adstype[$sk] . ('' . '<a href=\'../adser/view_ocpdata.php?adsername=' . $adser_name . '&adsid=' . $sk . '&viewday=' . $k . '\' title=\'点击查看点击/弹窗综合图\' target=\'_blank\'><span class=\'intd\'>' . $arr_ads[$sk] . '</span></a></td><td valign=middle>
					<table border=0 cellspacing=0 cellpadding=0 width=\'' . $ads_len_open . '\'>
					  <tr><td height=\'8\' bgcolor=\'6699ff\' onClick=\'showopen("' . $sk . '","' . $k . '","' . $adser_name . '")\' title=\'点击查看[') . $arr_ads['' . $sk] . ']' . $k . ('' . '日弹出明细记录\' class=\'hand\'><font size=-6>' . $sv . '</font></td></tr>
					</table>
				  </td></tr>
				  <tr class=listbody><td valign=middle>
					<table border=0 cellspacing=0 cellpadding=0 width=\'' . $ads_len_click . '\'>
					  <tr><td height=\'8\' bgcolor=\'99cc00\' onClick=\'showclick("' . $sk . '","' . $k . '","' . $adser_name . '")\' title=\'点击查看[') . $arr_ads['' . $sk] . ']' . $k . ('' . '日点击明细记录\' class=\'hand\'><font size=-6>' . $sclick . '</font></td></tr>
					</table>
				  </td></tr>
				</table>				
				<table border=0 cellspacing=0 cellpadding=1 width=\'99%\' align=center>
				  <tr><td height=1 bgcolor=dddddd></td></tr>
				</table>');
          }
        }

        $totopen = (!empty ($v) ? $v : 1);
        $rate = round ($totclick / $totopen * 100);
        $str_disp .= '' . '
		  <tr align=center class="listbody" height=24>
            <td>' . $k . '</td>
			<td align=left>
				<table border=0 cellspacing=0 cellpadding=1 width=\'99%\' align=center>
				  <tr><td height=1 bgcolor=dddddd></td></tr>
				</table>
				<table border=0 cellspacing=0 cellpadding=1 width=\'99%\' bgcolor=f0f0f0 align=center>
				  <tr><td width=160 align=right><span class=\'intd\'>总弹出</span></td><td valign=middle>
					<table border=0 cellspacing=0 cellpadding=0 width=\'' . $len_open . '\'>
					  <tr><td height=\'8\' bgcolor=\'6699ff\'><font size=-6>' . $v . '</font></td></tr>
					</table>
				  </td></tr>
				  <tr><td width=160 align=right><span class=\'intd\'>总点击</span></td><td valign=middle>
					<table border=0 cellspacing=0 cellpadding=0 width=\'' . $len_click . '\'>
					  <tr><td height=\'8\' bgcolor=\'99cc00\'><font size=-6>' . $totclick . '</font></td></tr>
					</table>
				  </td></tr>
				</table>
				<table border=0 cellspacing=0 cellpadding=1 width=\'99%\' align=center>
				  <tr><td height=1 bgcolor=dddddd></td></tr>
				</table>' . $str_list . '
			</td>
			<td>' . $rate . '%</td>
			<td>' . $r_open . '%</td>
			<td>' . $r_click . '%</td>
	  	  </tr>';
      }
    }
  }

  echo '<s';
  echo 'cript language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location=\'"+selObj.options[selObj.selectedIndex].value+"\'");
  if (restore) selObj.selectedIndex=0;
}
function dataview(){
	document.form_pic.submit();
}
function showopen(id,day,user){
	open("../adser/view_daydata.php?op=open&adsid="+id+"&adsername="+user+"&viewday="+d';
  echo 'ay);
}
function showclick(id,day,user){
	open("../adser/view_daydata.php?op=click&adsid="+id+"&adsername="+user+"&viewday="+day);
}
//-->
</script>

		<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#CCCCCC" bordercolordark="#ffffff" bgcolor="#CCCCCC" >
		  <tr bgcolor="F0F0F0">
			<td>
			  <table width="100%" border="0" cellpadding="0"';
  echo ' cellspacing="0">
			  <form name="hideform" method="post" action="">
			  <tr>
				<td>
				';
  echo '<s';
  echo 'elect name="adsername" onChange="MM_jumpMenu(\'parent\',this,0)">
				  <option value="#">请选择广告主</option>
				  ';
  $sqladser = 'select * from advertizer where admin_stat!=1 order by id';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -