<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--{include file=elements/header.css.html}-->
<!--{include file=elements/header.js.html type=common}-->
<!--{include file=elements/header.js.html type=date}-->
</head>
<body>
<div id="outside">
	<!--{include file=frame/top.html}-->
	<div id="mainareaContent">
		<!--{include file=frame/left.html}-->
		<div id="rightContent">
			<div id="topContent">
				<div class="sitmap">
					<span class="r"><!--{include file="elements/uuadvad.html"}--></span>赚钱广告&nbsp;&gt;&nbsp;优告广告&nbsp;&gt;&nbsp;收入查询
				</div>
			</div>
			<div class="tabcontent">
				<a href="index.php?r=Uuadv.adlist" class="link">接广告</a>
				<a href="index.php?r=Uuadv.harvestreport" class="nolink">收入查询</a>
				<div style="float:right;width:360px;height:25px;"><span style="float:left;padding-top:8px;">优拓小贴士：</span>
					<script>
var marqueeContentt=new Array();   //滚动主题

marqueeContentt[0]= '<div style="height:25px;line-height:25px;"><a href="http://www.uudev.net/forum.php?mod=viewthread&tid=499&fromuid=15" target="_blank" style="TEXT-DECORATION:underline; color:#333333" > 同时投放多条广告可能影响广告效益哦!</a></div>';
marqueeContentt[1]= '<div style="height:25px;line-height:25px;"><a href="http://www.uudev.net/forum.php?mod=viewthread&tid=499&fromuid=15"  target="_blank"  style="TEXT-DECORATION:underline; color:#333333" > 主推一两款广告一定是个不错的选择!</a></div>';
marqueeContentt[2]= '<div style="height:25px;line-height:25px;"><a href="http://www.uudev.net/forum.php?mod=viewthread&tid=499&fromuid=15"  target="_blank"  style="TEXT-DECORATION:underline; color:#333333" > 投放到首页顶部的广告更能吸引眼球!</a></div>';
marqueeContentt[3]= '<div style="height:25px;line-height:25px;"><a href="http://www.uudev.net/forum.php?mod=viewthread&tid=499&fromuid=15" target="_blank"  style="TEXT-DECORATION:underline; color:#333333" > 专家讲述不同网站的广告投放技巧!</a></div>';

var marqueeIntervalt=new Array();  //定义一些常用而且要经常用到的变量
var marqueeIdt=0;
var marqueeDelayt=4000;
var marqueeHeightt=25;
var marqueeBoxt;
function initMarqueet() {
 var str=marqueeContentt[0];
 document.write('<div id="marqueeBoxt" style="overflow:hidden;height:'+marqueeHeightt+'px;" onmouseover="clearInterval(marqueeIntervalt[0])" onmouseout="marqueeIntervalt[0]=setInterval(\'startMarqueet()\',marqueeDelayt)"><div>'+str+'</div></div>');
 marqueeIdt++;
 marqueeBoxt = document.getElementById("marqueeBoxt");
 marqueeIntervalt[0]=setInterval("startMarqueet()",marqueeDelayt);
 }
function startMarqueet() {
 var str=marqueeContentt[marqueeIdt];
  marqueeIdt++;
 if(marqueeIdt>=marqueeContentt.length) marqueeIdt=0;
 if(marqueeBoxt.childNodes.length==1) {
	  var nextLine=document.createElement('DIV');
	  nextLine.innerHTML=str;
	  marqueeBoxt.appendChild(nextLine);
  }
 else {
	  marqueeBoxt.childNodes[0].innerHTML=str;
	  marqueeBoxt.appendChild(marqueeBoxt.childNodes[0]);
	  marqueeBoxt.scrollTop=0;
  }
 clearInterval(marqueeIntervalt[1]);
 marqueeIntervalt[1]=setInterval("scrollMarqueet()",2);
 }
function scrollMarqueet() {
	 marqueeBoxt.scrollTop++;
	 if(marqueeBoxt.scrollTop%marqueeHeightt==marqueeHeightt){
	  	clearInterval(marqueeIntervalt[1]);
	  }
}
initMarqueet();
</script>
				</div>
			</div>
			<div id="secrightContent">
				<div class="tableContent2">
						<div class="searchbar" style="height:62px;">
							
							<div style="height:31px; line-height:25px; background:#EBF3FF; border:1px #DFECFD solid; padding:0px 3px;">
								<div style="float:right;padding:0px 20px;; background:#ccdfed;-moz-border-radius:20px; margin-top:3px;">您的广告顾问:QQ<a href="tencent://message/?uin=<!--{$qq}-->&Site=http://www.taogao.net&Menu=yes"><!--{$qq}--></a>
								<img border="0" src="http://wpa.qq.com/pa?p=1:<!--{$qq}-->:4">   昨日收入<!--{if $yesterday_income !=''}--><!--{$yesterday_income|string_format:"%.3f"}--><!--{else}-->0.000<!--{/if}-->元[<a href="index.php?r=Uuadv.harvestreport&begin_date=<!--{$yesterday_start_date}-->&end_date=<!--{$yesterday_end_date}-->">查看明细</a>]  本月收入<!--{if $month_income !=''}--><!--{$month_income|string_format:"%.3f"}--><!--{else}-->0.000<!--{/if}-->元[<a href="index.php?r=Uuadv.harvestreport&begin_date=<!--{$month_start_date}-->&end_date=<!--{$month_end_date}-->">查看明细</a>]  可结算收入<!--{if $balance !=''}--><!--{$balance|string_format:"%.3f"}--><!--{else}-->0.000<!--{/if}-->[<a href="javascript:toSettleAccount();">申请结算</a>] 
						<script>
function toBindUser(){
	var str = "<table width=\"100%\"><tr><td height=\"50px\" align=\"center\">";
	str += "<img src=\"images/ajax.gif\"/>绑定中，请稍候......";
	str += "</td></tr></table>";	
	$.popbox({title:"绑定优告账户", content:str});
	$.ajax({
		type: "get",
		url: "index.php?r=Uuadv.binduser",
		cache: false,
		dataType:'json',
		success: function(data){
			var str  = '<div style="background:#e2f0fd; margin:10px 0px; border:#aedcfe 1px solid;">';
				if(data.flag==0){
					str += '<div style="background:url(images/key.gif) 25px 15px no-repeat #e2f0fd; height:120px; padding-left:120px; padding-top:15px;">';
				}else{
					str += '<div style="background:url(images/key_open.gif) 25px 15px no-repeat #e2f0fd; height:120px; padding-left:120px; padding-top:15px;">';
				}
				str += '<span style="color:#985919;">'+data.msg+'</span><br>';
				str += '<br/>客服QQ:<a href="tencent://message/?uin='+data.qq+'&Site=http://www.taogao.net&Menu=yes">'+data.qq+'</a>';
				str += '</div></div>';
			$.popbox.setcontent({title:"绑定优告账户", content:str});
		}
	});	
}

function check_login(){
	var str = "<table width=\"100%\"><tr><td height=\"50px\" align=\"center\">";
	str += "<img src=\"images/ajax.gif\"/>";
	str += "</td></tr></table>";	
	$.popbox({title:"超级管理员身份验证", content:str});
	$.ajax({
		type: "get",
		url: "index.php?r=Uuadv.checklogin",
		cache: false,
		success: function(data){
			$.popbox.setcontent({title:"超级管理员身份验证", content:data});
		}
	});
}

function toSettleAccount(){
	$.popbox({title:"申请结算", content:popstr_search});
	$.ajax({
		type: "get",
		url: "index.php?r=Uuadv.to_settle_account",
		cache: false,
		success: function(data){
			$.popbox.setcontent({title:"申请结算", content:data});
		}
	});			
}

function checkBingingStatus(){
	$.popbox({title:"查询优告账户绑定结果", content:popstr_search});
	$.ajax({
		type: "get",
		url: "index.php?r=Uuadv.check_binding_status",
		cache: false,
		dataType:'json',
		success: function(data){
			var str  = '<div style="background:#e2f0fd; margin:10px 0px; border:#aedcfe 1px solid;">';
				if(data.flag==1){
					str += '<div style="background:url(images/key_open.gif) 25px 15px no-repeat #e2f0fd; height:120px; padding-left:120px; padding-top:15px;">';
				}else{
					str += '<div style="background:url(images/key.gif) 25px 15px no-repeat #e2f0fd; height:120px; padding-left:120px; padding-top:15px;">';
				}
				str += '<span style="color:#985919;">'+data.msg+'</span><br>';
				str += '<br/>客服QQ:<a href="tencent://message/?uin='+data.qq+'&Site=http://www.taogao.net&Menu=yes">'+data.qq+'</a>';
				str += '</div></div>';
			$.popbox.setcontent({title:"查询优告账户绑定结果", content:str});
			$("#firesbox_close").bind("click",function(){
				window.location.reload();
			});
		}
	});	
}
</script>
						</div></div>
						<div style="height:31px; line-height:25px; padding-top:5px;">
							
							报表类型&nbsp;<select id="query_type">
								<option value="1" <!--{if $query_type == 1}-->selected<!--{/if}-->>按日期</option>
								<option value="2" <!--{if $query_type == 2}-->selected<!--{/if}-->>按广告</option>
							</select>
							&nbsp;报表时间&nbsp;<input type="text" class="date" id="begin_date" value="<!--{$begin_date}-->"/>-<input type="text" class="date" id="end_date" value="<!--{$end_date}-->"/>
							&nbsp;<button id="sub" type="submit" class="but2font">查询</button>
						</div>
						</div>
						<div id="income_list"></div><div style="height:10px;"></div>
						<div id="incomeDetail"></div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script>
$(document).ready(function(){
	$.ajax({
		type: "GET",
		url: "index.php",
		beforeSend: function(){
			$("#income_list").html('<table width="100%"><tr><td height=50 align="center">正在查询中...<img src="images/ajax.gif"></td></tr></table>');
			$("#incomeDetail").empty();
		},
		timeout:50000,
		cache: false,
		data: "r=Uuadv.income_list&random="+Math.random()+"&query_type="+$("#query_type").val()+"&begin_date="+$("#begin_date").val()+"&end_date="+$("#end_date").val(),
		error : function() {
			$("#income_list").html('请求失败');
  		},
		success: function(data){
			$("#income_list").html(data);
		}
	});	
	$("#sub").bind("click",function(){
		$.ajax({
			type: "GET",
			url: "index.php",
			beforeSend: function(){
				$("#income_list").html('<table width="100%"><tr><td height=50 align="center">正在查询中...<img src="images/ajax.gif"></td></tr></table>');
				$("#incomeDetail").empty();
			},
			timeout:50000,
			cache: false,
			data: "r=Uuadv.income_list&random="+Math.random()+"&query_type="+$("#query_type").val()+"&begin_date="+$("#begin_date").val()+"&end_date="+$("#end_date").val(),
			error : function() {
				$("#income_list").html('请求失败');
	  		},
			success: function(data){
				$("#income_list").html(data);
			}
		});		
	})
});	
function customRange(input){
	return {
		minDate : (input.id == "end_date" ? $("#begin_date").datepicker("getDate") : null),
		maxDate : (input.id == "begin_date" ? $("#end_date").datepicker("getDate") : null)
	}
}
$("#begin_date, #end_date").datepicker({
    beforeShow : customRange, buttonImageOnly : false
});

function detailByDate(harvestDate){
	$.ajax({
		type: "get",
		url: "index.php",
		beforeSend: function(){
			$("#incomeDetail").html('<table width="100%"><tr><td height=50 align="center">正在查询中...<img src="images/ajax.gif"></td></tr></table>');
		},
		timeout:50000,
		cache: false,
		data: "r=Uuadv.income_detail_by_date&harvest_date="+harvestDate+"&random="+Math.random(),
		error : function() {
			$("#incomeDetail").html('请求失败');
  		},
		success: function(data){
			$("#incomeDetail").html(data);
		}
	});
}

function detailByAd(adId, beginDate, endDate, adName){
	$.ajax({
		type: "get",
		url: "index.php",
		beforeSend: function(){
			$("#incomeDetail").html('<table width="100%"><tr><td height=50 align="center">正在查询中...<img src="images/ajax.gif"></td></tr></table>');
		},
		timeout:50000,
		cache: false,
		data: "r=Uuadv.income_detail_by_ad&ad_id="+adId+"&begin_time="+beginDate+"&end_time="+endDate+"&ad_name="+encodeURIComponent(adName)+"&random="+Math.random(),
		error:function() {
			$("#incomeDetail").html('请求失败');
  		},		
		success: function(data){
			$("#incomeDetail").html(data);
		}
	});
}
</script>
</html>