📄 rakeoff_week.php
字号:
<?
include_once("top.php");
$weekday=date("w");
$nowday=time();
$startday=0;
if($weekday==0){
$startday=$nowday-6*86400;
}else{
$startday=$nowday-($weekday-1)*86400;
}
$sstartday=date("Y-m-d",$startday);
$sqlf_date=" and date>='$sstartday' and date<'$date'";
$str_disp="";
$sum_open=0;
$sum_click=0;
$sum_money=0;
$sum_d_open=0;
$sum_d_click=0;
$sum_d_money=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]' $sqlf_date group by date ORDER BY date";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
$rate=round($row[totclick]/$row[totopen]*100);
$sum_open=$sum_open+$row[totopen];
$sum_click=$sum_click+$row[totclick];
$sum_money=$sum_money+$row[tot_money];
$tdate=$row["date"];
$arr_disp[1]["$tdate"]=$row["totopen"];
$arr_disp[2]["$tdate"]=$row["totclick"];
$arr_disp[3]["$tdate"]=$row["tot_money"];
}
$sqlw="select username from webmember where up_user='$_SESSION[web_username]'";
$rsw=mysql_query($sqlw);
$str_downuser=" 0 ";
while($roww=mysql_fetch_array($rsw)){
$str_downuser.=" or web_user='$roww[username]' ";
}
$sqldown="select date,sum( open_num ) as totopen, sum( click_num ) as totclick, sum( web_money ) as tot_money from daydata where ( $str_downuser ) $sqlf_date group by date ORDER BY date";
$rsdown=mysql_query($sqldown);
while($rowd=mysql_fetch_array($rsdown)){
$tdate=$rowd["date"];
$arr_down[1]["$tdate"]=$rowd["totopen"];
$arr_down[2]["$tdate"]=$rowd["totclick"];
$arr_down[3]["$tdate"]=round($rowd["tot_money"]*$cfg_recommend*1000)/1000;
$sum_d_open=$sum_d_open+$rowd["totopen"];
$sum_d_click=$sum_d_click+$rowd["totclick"];
$sum_d_money=$sum_d_money+round($rowd["tot_money"]*$cfg_recommend*1000)/1000;
}
for($i=0;$i<=6;$i++){
$thisdate=$i*86400+$startday;
$strdate=date("Y-m-d",$thisdate);
if($strdate>=$date){
break;
}
$aopen=$arr_disp[1]["$strdate"]*1;
$aclick=$arr_disp[2]["$strdate"]*1;
$money=$arr_disp[3]["$strdate"]*1;
$dopen=$arr_down[1]["$strdate"]*1;
$dclick=$arr_down[2]["$strdate"]*1;
$dmoney=$arr_down[3]["$strdate"]*1;
$s_money=$dmoney+$money;
$sum_s_money=$sum_s_money+$s_money;
$sqldown="select date,sum( open_num ) as totopen, sum( click_num ) as totclick, sum( web_money ) as tot_money from daydata where ( $str_downuser ) $sqlf_date and date='$v' group by date ORDER BY date";
$rsdown=mysql_query($sqldown);
$rowd=mysql_fetch_array($rsdown);
$str_disp.="
<tr align=center class=\"listbody\">
<td>$strdate</td>
<td>$aopen</td>
<td>$dopen</td>
<td>$aclick</td>
<td>$dclick</td>
<td>$money</td>
<td>$dmoney</td>
<td>$s_money</td>
</tr>";
}
?>
<div align="center">
<table width="1001" border="0" 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/wb6.gif" width="150" height="20"></td>
</tr>
<tr>
<td height="43" align="center" valign="middle">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="left" valign="middle"> 您可以在这里查询到您这周的佣金量。当您帐户中的应付收入达到100元,在每周二或周三,我们会将您上周应得的广告佣金通过银行转到您的</td>
</tr>
<tr>
<td height="20" align="left" valign="middle"> 帐户中。如果您对我们统计的数据存任何问题,请联系我们:
</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>
<td class="listtbhd">合计(元)</td>
</tr>
<?=$str_disp?>
<tr align="center" class="listbody">
<td class="listtbhd" height="25">合 计</td>
<td ><? echo "$sum_open</td><td>$sum_d_open";?></td>
<td ><? echo "$sum_click</td><td>$sum_d_click";?></td>
<td ><? echo "$sum_money</td><td>$sum_d_money";?></td>
<td ><?=$sum_s_money?></td>
</tr>
</table>
<p><br>
<br>
<br>
<br>
<br>
<br>
</p></td>
</tr>
</table>
</div>
<?
include_once("foot.php");
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -