📄 ads_dayview.php
字号:
<?
include_once("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");
$sum_open=0;
$sum_click=0;
$sum_money=0;
$str_disp="";
$sqlfviewd="";
$sql="select link_tit,ads.id,ads.ads_form_id,ads.username,daydata.date,daydata.open_num,daydata.click_num,daydata.profit,daydata.rate,daydata.ads_type,daydata.price,daydata.coltime,daydata.pv_num from ads,daydata where web_user='$_SESSION[web_username]' and daydata.date='$date' and ads_id=ads.id and daydata.own_type=1 order by ads.id desc";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
$formid=$row["ads_form_id"];
$sqlfviewd.=" and ads.id!='$row[id]'";
$intcoltime=(empty($row["coltime"]))?time():$row["coltime"];
$openfile="../data/".$row["username"]."/open_".$row["id"]."/".date("Y_m_d",$intcoltime)."/".date("H",$intcoltime)."/".$_SESSION["web_username"].".txt";
if(file_exists($openfile)){
$fdata=file($openfile);
$fcount=count($fdata);
$totopennum=$row[open_num]+$fcount;
}else{
$totopennum=$row[open_num];
}
$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;
$rate="0";
$str_vopen="$totopennum";
}elseif($row[ads_type]==3 || $row[ads_type]==4){
$str_vopen="$totopennum";
$pvrate=round($totclicknum/$row["pv_num"]*1000)/1000;
if($pvrate<$cfg_pminlimit){
$ipvrate=1;
}elseif($pvrate>$cfg_pmaxlimit){
$ipvrate=0;
}else{
$ipvrate=($cfg_pmaxlimit-$pvrate)/($cfg_pmaxlimit-$cfg_pminlimit);
}
$totmoney=round($totclicknum*$row[price]*$row[profit]/10*$ipvrate)/100;
$rate="0";
}else{
$i_rate=$rate/100;
if($i_rate>$row["rate"]){
$i_rate=$row["rate"];
}
if($i_rate>0.1){
$i_rate=0.1;
}
$web_price=$row[price]*$row[profit];
$totmoney=round($totopennum*$web_price/1000*(1+$i_rate)*(1+$i_rate)*100)/100;
$str_vopen="<a href='view_daydata.php?op=open&adsid=$row[id]' target='_blank' title='点击查看明细'>$totopennum</a>";
}
if(!empty($totclicknum)){
$str_vclick="<a href='view_daydata.php?op=click&adsid=$row[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 align=left>$strtype<a href=getcode_dlg.php?user=$_SESSION[web_username]&s=$SESSID&adsid=$row[id] target=_blank>$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[id]' target='_blank'>查看</a></td>
<td>$totmoney</td>
</tr>";
}
$yestoday=date("Y-m-d",time()-86400);
$sqlq="select link_tit,ads.id,ads.ads_form_id,ads.username,daydata.date,daydata.click_num,daydata.profit,daydata.rate,daydata.ads_type,daydata.price,daydata.coltime from ads,daydata where web_user='$_SESSION[web_username]' and daydata.date='$yestoday' and daydata.ads_type!=3 $sqlfviewd and ads_id=ads.id and daydata.own_type=1 order by ads.id desc";
$rsq=mysql_query($sqlq);
while($row=mysql_fetch_array($rsq)){
$formid=$row["ads_form_id"];
$thishour=$thishour+0;
$totopennum=0;
for($i=0;$i<=$thishour;$i++){
if($i<10){
$si="0".$i;
}else{
$si=$i;
}
$openfile="../data/".$row["username"]."/open_".$row["id"]."/$thisdate/$si/$_SESSION[web_username].txt";
if(file_exists($openfile)){
$fdata=file($openfile);
$fcount=count($fdata);
$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;
$rate="0";
$str_vopen="$totopennum";
}elseif($row[ads_type]==3 || $row[ads_type]==4){
$totmoney=round($totclicknum*$row[price]*$row[profit]/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;
}
$web_price=$row[price]*$row[profit];
$totmoney=round($totopennum*$web_price/1000*(1+$i_rate)*(1+$i_rate)*100)/100;
$str_vopen="<a href='view_daydata.php?op=open&adsid=$row[id]' target='_blank' title='点击查看明细'>$totopennum</a>";
}
if(!empty($totclicknum)){
$str_vclick="<a href='view_daydata.php?op=click&adsid=$row[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 align=left>$strtype<a href=getcode_dlg.php?user=$_SESSION[web_username]&s=$SESSID&adsid=$row[id] target=_blank>$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[id]' target='_blank'>查看</a></td>
<td>$totmoney</td>
</tr>";
}
}
?>
<table width="1001" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="F7F7F7">
<tr>
<td width="200" height="323" align="left" 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"> 注:(1)项目名称前带"<font color=ff3300>*</font>"号的为文字广告;<br>
(2)"预计金额"为对应广告金额的预计值,预计金额在广告项目为点击广告时将决定于广告的显示量和点击量的一个综合值。</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">广告项目名称</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> </td>
<td><?=$sum_open?></td>
<td><?=$sum_click?></td>
<td colspan="2"> </td>
<td><?=$sum_money?></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 + -