📄 ads_dayview.php
字号:
<?
include_once("../adser/top.php");
$sqla="select * from ads_form where 1";
$rsa=mysql_query($sqla);
while($rowa=mysql_fetch_array($rsa)){
$a_id=$rowa["id"];
$arr_adsform[0][$a_id]=$rowa["s_name"];
$arr_adsform[1][$a_id]=$rowa["type"];
$arr_adsform[2][$a_id]=$rowa["width"];
$arr_adsform[3][$a_id]=$rowa["height"];
}
$thisdate=date("Y_m_d");
$thishour=date("H")+0;
$sum_open=0;
$sum_click=0;
$sum_money=0;
$str_disp="";
$sqlfviewd="";
$sql="select link_tit,ads.ads_form_id,daydata.ads_id,sum(daydata.open_num) as open_num,sum(daydata.pv_num) as pv_num,sum(daydata.click_num) as click_num,daydata.rate,daydata.price,daydata.ads_type from ads,daydata where ads.username='$_SESSION[adser_username]' and daydata.date='$date' and ads_id=ads.id and daydata.own_type=1 group by daydata.ads_id order by daydata.ads_id desc";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
$formid=$row["ads_form_id"];
$sqlfviewd.=" and daydata.ads_id!=$row[ads_id]";
$totopennum=0;
for($i=0;$i<=$thishour;$i++){
if($i<10){
$si="0".$i;
}else{
$si=$i;
}
$openfile="../data/".$_SESSION["adser_username"]."/open_".$row["ads_id"]."/$thisdate/$si/$si.txt";
if(file_exists($openfile)){
$fdata=file($openfile);
$fcount=count($fdata);
$totopennum=$totopennum+$fcount;
}
}
$totclicknum=$row[click_num];
$totopen=(empty($totopennum))?1:$totopennum;
$rate=(empty($totopennum))?"0":round($totclicknum/$totopen*100);
$sum_open=$sum_open+$totopennum;
$sum_click=$sum_click+$totclicknum;
if($row[ads_type]==3){
$strtype="<font color=ff3300>*</font>";
}else{
$strtype="";
}
if($totopennum<1 && $row[ads_type]!=3 && $row[ads_type]!=4){
$totmoney=0;
$str_vopen="$totopennum";
}elseif($row[ads_type]==3 || $row[ads_type]==4){
$totmoney=round($totclicknum*$row[price]/10)/100;
$str_vopen=$row["pv_num"];
$rate=round($totclicknum/$str_vopen*100);
}else{
$i_rate=$rate/100;
if($i_rate>$row["rate"]){
$i_rate=$row["rate"];
}
if($i_rate>0.1){
$i_rate=0.1;
}
$totmoney=round($totopennum*$row[price]/1000*((1+$i_rate)*(1+$i_rate)+0.1)*100)/100;
$str_vopen="<a href='view_daydata.php?op=open&adsid=$row[ads_id]' target='_blank' title='点击查看明细'>$totopennum</a>";
}
if(!empty($totclicknum)){
$str_vclick="<a href='view_daydata.php?op=click&adsid=$row[ads_id]' target='_blank' title='点击查看明细'>$totclicknum</a>";
}else{
$str_vclick="$totclicknum";
}
$sum_money=$sum_money+$totmoney;
if($formid==0){
$ads_form=($row["ads_type"]==3)?"文字广告":"弹窗(88*31)";
}else{
$str_type=($row["ads_type"]==4)?"点击":"混合";
$ads_form=$str_type."(".$arr_adsform[2][$formid]."*".$arr_adsform[3][$formid].")";
}
$str_disp.="
<tr align=center class=\"listbody\">
<td>$row[ads_id]</td>
<td align=left>$strtype<a href=ads_statview.php?adsid=$row[ads_id]>$row[link_tit]</a></td>
<td>$ads_form</td>
<td>$str_vopen</td>
<td>$str_vclick</td>
<td>".$rate."%</td>
<td><a href='view_ocpdata.php?adsid=$row[ads_id]' target='_blank'>查看</a></td>
<td>$totmoney</td>
<td><input type=\"button\" name=\"viewweb\" value=\"查看投放网站\" class=subbt onClick=\"viewweb('$date','$row[ads_id]')\"></td>
</tr>";
}
//寻找未结转的
$yestoday=date("Y-m-d",time()-86400);
$sql="select link_tit,ads.ads_form_id,daydata.ads_id,daydata.rate,daydata.price,daydata.ads_type from ads,daydata where ads.username='$_SESSION[adser_username]' and daydata.date='$yestoday' and daydata.ads_type!=3 $sqlfviewd and ads_id=ads.id and daydata.own_type=1 group by daydata.ads_id order by daydata.ads_id desc";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
$formid=$row["ads_form_id"];
$totopennum=0;
for($i=0;$i<=$thishour;$i++){
if($i<10){
$si="0".$i;
}else{
$si=$i;
}
$openfile="../data/".$_SESSION["adser_username"]."/open_".$row["ads_id"]."/$thisdate/$si/$si.txt";
if(file_exists($openfile)){
$fdata=file($openfile);
$fcount=count($fdata);
$totopennum=$totopennum+$fcount;
}
}
$totclicknum=0;
if($totopennum>0){
$totopen=(empty($totopennum))?1:$totopennum;
$rate=(empty($totopennum))?"0":round($totclicknum/$totopen*100);
$sum_open=$sum_open+$totopennum;
$sum_click=$sum_click+$totclicknum;
if($row[ads_type]==3){
$strtype="<font color=ff3300>*</font>";
}else{
$strtype="";
}
if($totopennum<1 && $row[ads_type]!=3 && $row[ads_type]!=4){
$totmoney=0;
$str_vopen="$totopennum";
}elseif($row[ads_type]==3 || $row[ads_type]==4){
$totmoney=round($totclicknum*$row[price]/10)/100;
$rate="0";
$str_vopen="$totopennum";
}else{
$i_rate=$rate/100;
if($i_rate>$row["rate"]){
$i_rate=$row["rate"];
}
if($i_rate>0.1){
$i_rate=0.1;
}
$totmoney=round($totopennum*$row[price]/1000*((1+$i_rate)*(1+$i_rate)+0.1)*100)/100;
$str_vopen="<a href='view_daydata.php?op=open&adsid=$row[ads_id]' target='_blank' title='点击查看明细'>$totopennum</a>";
}
if(!empty($totclicknum)){
$str_vclick="<a href='view_daydata.php?op=click&adsid=$row[ads_id]' target='_blank' title='点击查看明细'>$totclicknum</a>";
}else{
$str_vclick="$totclicknum";
}
$sum_money=$sum_money+$totmoney;
if($formid==0){
$ads_form=($row["ads_type"]==3)?"文字广告":"弹窗(88*31)";
}else{
$str_type=($row["ads_type"]==4)?"点击":"混合";
$ads_form=$str_type."(".$arr_adsform[2][$formid]."*".$arr_adsform[3][$formid].")";
}
$str_disp.="
<tr align=center class=\"listbody\">
<td>$row[ads_id]</td>
<td align=left>$strtype<a href=ads_statview.php?adsid=$row[ads_id]>$row[link_tit]</a></td>
<td>$ads_form</td>
<td>$str_vopen</td>
<td>$str_vclick</td>
<td>".$rate."%</td>
<td><a href='view_ocpdata.php?adsid=$row[ads_id]' target='_blank'>查看</a></td>
<td>$totmoney</td>
<td><input type=\"button\" name=\"viewweb\" value=\"查看投放网站\" class=subbt onClick=\"viewweb('$date','$row[ads_id]')\"></td>
</tr>";
}
}
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function viewweb(date,adsid){
open("view_web.php?viewdate="+date+"&adsid="+adsid);
}
//-->
</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/ab7.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"> 详细记录每一条广告的当天实时数据,包括弹出、点击次数及点/弹比例。点击“查看”可查看对应项具体的数据明细。 </td>
</tr>
<tr>
<td height="20" align="left" valign="middle"> 注:项目名称前带"<font color=ff3300>*</font>"号的为文字广告。在广告规格为点击时"弹出(PV)数"显示的为PV数,为混合时"弹出(PV)数"显示的为弹出数。</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">电话:<?=$cfg_phone?></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="0" cellspacing="1" cellpadding="6" class="listtable">
<tr align="center" class="listbody">
<td class="listtbhd">ID</td>
<td class="listtbhd">项目名称</td>
<td class="listtbhd">广告规格</td>
<td class="listtbhd">弹出(PV)数</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" colspan="2">合 计</td>
<td> </td>
<td><?=$sum_open?></td>
<td><?=$sum_click?></td>
<td colspan="2"> </td>
<td><?=$sum_money?></td>
<td> </td>
</tr>
</table>
<p><br>
<br>
<br>
<br>
<br>
<br>
</p></td>
</tr>
</table>
<?
include_once("foot.php");
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -