select width,height from ad_region where regionID=#regionID# select a.logID from ad_campaign a,ad_campaignID b where a.regionID=#regionID# and b.campaignID=a.campaignID and b.startDate<=now() and now()<=b.endDate and a.show=0 group by a.campaignID,a.logID having sum(a.exposed)<=(select campaign from ad_campaignID where campaignID=a.campaignID) select * from ad_banner where bannerID=(select bannerID from ad_campaign where logID=#ID#) var str=""; str+="#altText#"; document.write(str); update ad_campaign set show=1, exposed=exposed+1 where logID=#ID# select * from ad_exposeLog where logID=#ID# and (datepart('d',ED)=datepart('d',now()) and datepart('m',ED)=datepart('m',now()) and datepart('yyyy',ED)=datepart('yyyy',now())) insert into ad_exposeLog(logID,ED,count) values(#ID#,#now()#,1) update ad_exposeLog set Count=Count+1 where logID=#ID# and (datepart('d',ED)=datepart('d',now()) and datepart('m',ED)=datepart('m',now()) and datepart('yyyy',ED)=datepart('yyyy',now())) select a.logID from ad_campaign a,ad_campaignID b where a.regionID=#regionID# and b.campaignID=a.campaignID and b.startDate<=now() and now()<=b.endDate group by a.campaignID,a.logID having sum(a.exposed)<=(select campaign from ad_campaignID where campaignID=a.campaignID) update ad_campaign set show=0 where logID in(#IDs#) select * from ad_banner where bannerID=(select bannerID from ad_campaign where logID=#ID#) var str=""; str+="#altText#"; document.write(str); update ad_campaign set show=1, exposed=exposed+1 where logID=#ID# select * from ad_exposeLog where logID=#ID# and (datepart('d',ED)=datepart('d',now()) and datepart('m',ED)=datepart('m',now()) and datepart('yyyy',ED)=datepart('yyyy',now())) insert into ad_exposeLog(logID,ED,count) values(#ID#,#now()#,1) update ad_exposeLog set Count=Count+1 where logID=#ID# and (datepart('d',ED)=datepart('d',now()) and datepart('m',ED)=datepart('m',now()) and datepart('yyyy',ED)=datepart('yyyy',now())) select redirectURL,fileURL,altText from ad_region where regionID=#regionID# var str=""; str+="#altText#"; document.write(str);