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

📄 ads_history.php

📁 VIP信息处理系统源码
💻 PHP
字号:
<?
/**********************************
*	历史广告数据统计
***********************************/
include_once("top.php");

$start_date=$s_yy."-".$s_mm."-".$s_dd;
$over_date=$o_yy."-".$o_mm."-".$o_dd;
if($start_date=="--" || $over_date=="--"){
	$datedef=date("Y-m-d",time()-3*86400);
	$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(empty($adsid) || $adsid=="all"){
	$sqlf_adsid="";
}else{
	$sqlf_adsid=" and ads_id='$adsid'";
}
$str_disp="";
$sum_open=0;
$sum_click=0;
$sum_money=0;
$i=0;
$sql="select date,sum( open_num ) as totopen, sum( click_num ) as totclick, sum( web_money ) as tot_money from daydata where web_user='$_SESSION[web_username]' and  own_type=1 $sqlf_date $sqlf_adsid group by date ORDER BY date";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
	$totopen=(empty($row[totopen]))?1:$row[totopen];
	$rate=(empty($row[totopen]))?0:round($row[totclick]/$totopen*100);
	if($date!=$row["date"]){
		$sum_open=$sum_open+$row[totopen];
		$sum_click=$sum_click+$row[totclick];
		$sum_money=$sum_money+$row[tot_money];
		$arr_disp[0][$i]=$row["date"];
		$arr_disp[1][$i]=$row["totopen"];
		$arr_disp[2][$i]=$row["totclick"];
		$arr_disp[3][$i]=$rate;
		$arr_disp[4][$i]=$row["tot_money"];
		$i++;
	}
}
while(list($k,$v)=each($arr_disp[0])){
	$aopen=$arr_disp[1][$k];
	$aclick=$arr_disp[2][$k];
	$rate=$arr_disp[3][$k];
	$money=$arr_disp[4][$k];
	
	$r_open=round($aopen/$sum_open*100);
	$r_click=round($aclick/$sum_click*100);
	
	if($adsid=="all" || empty($adsid)){
		$str_open=$aopen;
		$str_click=$aclick;
		$str_ocdata="--";
	}else{
		if($aopen==0){
			$str_open="0";
			$rate="0";
		}else{
			$str_open="<a href='view_daydata.php?op=open&adsid=$adsid&viewday=$v' target='_blank' title='点击查看 ".$v."日 弹出明细'>".$aopen."</a>";
		}
		$str_click="<a href='view_daydata.php?op=click&adsid=$adsid&viewday=$v' target='_blank' title='点击查看 ".$v."日 点击明细'>".$aclick."</a>";
		$str_ocdata="<a href='view_ocpdata.php?adsid=$adsid&viewday=$v' target='_blank' title='点击查看 ".$v."日 点击/弹出综合图'>查看</a>";
	}

	$str_disp.="
	  <tr align=center class=\"listbody\">
		<td>$v</td>
		<td>$str_open</td>
		<td>$str_click</td>
		<td>".$rate."%</td>
		<td>".$r_open."%</td>
		<td>".$r_click."%</td>
		<td>".$str_ocdata."</td>
		<td>".$money."</td>
	  </tr>";
}
?>
<script 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 picview(){
	document.form_pic.submit();
}
//-->
</script>



<table width="1001" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f7f7f7">
  <tr>
    <td width="200" height="323" valign="top" bgcolor="#E8EEF4">
      <?	include("menu.php");	?></td>
    <td align="center" valign="top" class="bgconn"> 
      <table width="98%" border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td height="40" class="orange_text"> 
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  
                <td height="30" align="left" valign="middle"><img src="../image/ab8.gif" width="150" height="20"></td>
                </tr>
                <tr>
                  <td align="center" valign="middle"> 
                    <table width="99%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="20" align="left" valign="middle">&nbsp;&nbsp;&nbsp; 可查询您的每一条广告的历史记录详细记录,可选择按广告项目及时间段查看,点击“图形显示”将以图形方式显示。默认为三日前数据。</td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr>
                  <td height="25" align="left" valign="middle"> 
                    <table width="50%" border="0" cellpadding="0" cellspacing="0">
                      <tr align="center" valign="middle">
                        <td width="5%"><img src="../image/bot14.gif" width="16" height="16"></td>
                        <td width="52%" align="left"><a href="message_add.php?tit=历史广告数据统计"><span class="bluetext">关于本问题给我们留言</span></a></td>
                        <td width="6%"><img src="../image/bot13.gif" width="16" height="16"></td>
                        <td width="37%" align="left"><span class="orange_text">电话:+86-756-2292213</span></td>
                      </tr>
                    </table></td>
                </tr>
              </table></td>
          </tr>
		  <tr>
            <td height="4" bgcolor="#556D85" ></td>
          </tr>
		  <tr><td height="3"></td></tr>
      </table>
		
      <table width="98%" 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" cellspacing="0">
			  <form name="hideform" method="post" action="">
			  <tr>
				<td><select name="adsname" onChange="MM_jumpMenu('parent',this,0)">
				  <option value="#">请选择广告项目</option>
				  <?
				  	$sqlads="select distinct link_tit,ads.id from ads,daydata where web_user='$_SESSION[web_username]' and ads_id=ads.id and  daydata.own_type=1 order by ads.id desc";
					$rsads=mysql_query($sqlads);
					while($rowads=mysql_fetch_array($rsads)){
						echo "<option value=\"?adsid=$rowads[id]\" ";
						if($rowads[id]==$adsid){
							echo " selected";
						}
						echo ">$rowads[link_tit]</option>";
					}
				  ?>
				  <option value="?adsid=all" <? echo ($adsid=="all")?" selected":"";?>>全部广告项目</option>
                </select>
				  <input name="adsid" type="hidden" id="adsid" value="<?=$adsid?>"></td>
			    <td align="right">
				  <table width="1%"  border="0" align="right" cellspacing="1">
					  <tr>
						<td width="1"><select name="s_yy">
							<?
					$s_this_y=date("Y",time()-3*86400);
					$s_this_m=date("m",time()-3*86400);
					$s_this_d=date("d",time()-3*86400);
					for($s_j=2004;$s_j<=$s_this_y;$s_j++){
					 if(empty($s_yy)){
					 $s_yy=$s_this_y;
					 }else{
					 $s_yy=$s_yy;
					 }
					 if($s_yy==$s_j){
					 $s_sldy="selected";
					 }else{
					 $s_sldy="";
					 }
					echo "<option $s_sldy>$s_j</option>";
					}
					?>
						</select></td>
						<td width="1">年</td>
						<td width="1"><select name="s_mm">
							<?
					for($s_i=1;$s_i<=12;$s_i++){
					 if($s_i<=9){
					 $s_k="0".$s_i;
					 }else{
					 $s_k=$s_i;
					 }
					 if(empty($s_mm)){
					  $s_mm=$s_this_m;
					  }else{
					  $s_mm=$s_mm;
					  }
					   if($s_mm==$s_k){
					   $s_sld="selected";
					   }else{
					   $s_sld="";
					   }
					echo "<option $s_sld>$s_k</option>";
					}
					?>
						</select></td>
						<td width="1">月</td>
						<td width="1"><select name="s_dd">
							<?
					for($s_i=1;$s_i<=31;$s_i++){
					 if($s_i<=9){
					 $s_l="0".$s_i;
					 }else{
					 $s_l=$s_i;
					 }
					 if(empty($s_dd)){
					  $s_dd=$s_this_d;
					  }else{
					  $s_dd=$s_dd;
					  }
					   if($s_dd==$s_l){
					   $s_sldd="selected";
					   }else{
					   $s_sldd="";
					   }
					echo "<option $s_sldd>$s_l</option>";
					}
					?>
						</select></td>
						<td width="1">日</td>
					  </tr>
					</table></td>
					<td> 至 </td>
					<td width="1%"><table width="1%"  border="0" cellspacing="1">
					  <tr>
						<td width="1"><select name="o_yy">
							<?
					$o_this_y=date("Y",time()-86400);
					$o_this_m=date("m",time()-86400);
					$o_this_d=date("d",time()-86400);
					for($o_j=2004;$o_j<=$o_this_y;$o_j++){
					 if(empty($o_yy)){
					 $o_yy=$o_this_y;
					 }else{
					 $o_yy=$o_yy;
					 }
					 if($o_yy==$o_j){
					 $o_sldy="selected";
					 }else{
					 $o_sldy="";
					 }
					echo "<option $o_sldy>$o_j</option>";
					}
					?>
						</select></td>
						<td width="1">年</td>
						<td width="1"><select name="o_mm">
							<?
					for($o_i=1;$o_i<=12;$o_i++){
					 if($o_i<=9){
					 $o_k="0".$o_i;
					 }else{
					 $o_k=$o_i;
					 }
					 if(empty($o_mm)){
					  $o_mm=$o_this_m;
					  }else{
					  $o_mm=$o_mm;
					  }
					   if($o_mm==$o_k){
					   $o_sld="selected";
					   }else{
					   $o_sld="";
					   }
					echo "<option $o_sld>$o_k</option>";
					}
					?>
						</select></td>
						<td width="1">月</td>
						<td width="1"><select name="o_dd">
							<?
					for($o_i=1;$o_i<=31;$o_i++){
					 if($o_i<=9){
					 $o_l="0".$o_i;
					 }else{
					 $o_l=$o_i;
					 }
					 if(empty($o_dd)){
					  $o_dd=$o_this_d;
					  }else{
					  $o_dd=$o_dd;
					  }
					   if($o_dd==$o_l){
					   $o_sldd="selected";
					   }else{
					   $o_sldd="";
					   }
					echo "<option $o_sldd>$o_l</option>";
					}
					?>
				
						</select></td>
						<td width="1">日</td>
					  </tr>
					</table>
				</td><td>
				  <input type="submit" name="Submit" value="查看" class=subbt2>
                  <input type="button" name="Submit2" value="图形显示" class=subbt onClick="picview()"></td>
			  </tr></form>
			  </table>
		  </td></tr>
	  </table>
      <table width="98%" border="0" cellspacing="1" cellpadding="6" class="listtable">
        <tr  align="center" class="listbody"> 
              <td class="listtbhd">日  期</td>
              <td class="listtbhd">弹出次数</td>
              <td class="listtbhd">点击次数</td>
              <td class="listtbhd">点/弹比例</td>
              <td class="listtbhd">弹出占区间比例</td>
              <td class="listtbhd">点击占区间比例</td>
              <td class="listtbhd">点/弹综合图</td>
              <td class="listtbhd">金额(元)</td>
            </tr>
            <?=$str_disp?>
        <tr  align="center" class="listbody"> 
			  <td class="listtbhd">合  计</td>
			  <td><?=$sum_open?></td>
			  <td><?=$sum_click?></td>
			  <td colspan="4">&nbsp;</td>
			  <td><?=$sum_money?></td>
            </tr>
          </table>
	  	  <p><br>
          <br>
          <br>
  	  <form name="form_pic" method="post" action="ads_historypic.php">
  	    <input name="adsid" type="hidden" id="adsid" value="<?=$adsid?>">
      </form>
	  	  <br>
            <br>
          </p></td>
  </tr>
</table>
<?
include_once("foot.php");
?>

⌨️ 快捷键说明

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