# Copyright (c) 2003 AdCycle.com All rights reserved.
# http://www.adcycle.com - download the lastest version of adcycle
# AdHtml.pm - some HTML subs
package AdHtml;
use strict;
sub new {
my $this = shift;
my $class = ref($this) || $this;
my $self = {};
bless $self, $class;
return $self;
}
sub header{
my($self,$master,$title)=@_;
my $images_url=$master->{config}->get_images_url;
my $cgi_bin_url=$master->{config}->get_cgi_bin_url;
my $dhmtl_menu=$master->{config}->get_dhtml_menu;
my $cid=$master->{query}->param('cid');
my $task=$master->{query}->param('task');
my $cache=$master->{env}->get_cache;
my $agent=$master->{env}->get_agent;
my $whoami=$master->{env}->get_whoami;
$master->{header}="yes";
if($master->{clear_cookie}>0){
my $impression_cookie = $master->{query}->cookie(-name=>"i$master->{clear_cookie}", #impression list
-value=>"",
-expires=>'+24h',
-path=>'/',
);
$impression_cookie = $master->{query}->unescape("$impression_cookie");
print "Set-Cookie: $impression_cookie\n";
my $click_cookie = $master->{query}->cookie(-name=>"c$master->{clear_cookie}", #impression list
-value=>"",
-expires=>'+7d',
-path=>'/',
);
$click_cookie = $master->{query}->unescape("$click_cookie");
print "Set-Cookie: $click_cookie\n";
}
print "Content-type: text/html\n\n";
print qq~
$title
~;
if($master->{hide_toolbar} ne "yes"){
if($master->{whoami} eq "ADMIN" && $dhmtl_menu ne "no"){
print qq~
~;
}}
print qq~
~;
print qq~ ~;# stick ad in here if you want one
print qq~
|
 |
| ~;
if($master->{hide_toolbar} ne "yes"){
if($master->{whoami} eq "ADMIN" && $dhmtl_menu eq "no"){
$master->{html}->output_toolbar($master);
}else{
if($master->{whoami} ne "ADMIN"){
$master->{html}->output_report_toolbar($master);
}
}
}
print qq~ |
|
~;
$master->{html}->message($master);
}
sub footer{
my($self,$master)=@_;
my $images_url=$master->{config}->get_images_url;
my $cgi_bin_url=$master->{config}->get_cgi_bin_url;
my $easycharts;
if($master->{charts} eq "yes"){
$easycharts=qq~ and Easycharts v2.5~;
}
print qq~
|
|

|
powered by adcycle v1.26 $easycharts
|
~;
}
sub question{
my($self,$question)=@_;
my $question=qq~[ ? ]~;
return $question;
}
sub message{
my($self,$master)=@_;
my $datestamp=$master->{env}->get_datestamp;
if(length($master->{message})>2){
print qq~$master->{message} at $datestamp
~;
}
if(length($master->{test})>2){
print qq~TEST: $master->{test} at $datestamp
~;
}
}
sub login{
my($self,$master)=@_;
my $images_url=$master->{config}->get_images_url;
my $cgi_bin_url=$master->{config}->get_cgi_bin_url;
my $cache=$master->{env}->get_cache;
# if not a direct login
my $login_cookie=$master->{query}->cookie('ADCYCLE_LOGIN');
my ($ck_login,$ck_id)=split(/\|/,$login_cookie);
$master->{hide_toolbar}="yes";
# print header
$master->{LINK}="campaigns";
$master->{html}->header($master,"AdCenter Login");
print qq~
~;
$master->{html}->footer($master);
}
sub output_toolbar{
my($self,$master)=@_;
my $images_url=$master->{config}->get_images_url;
my $cgi_bin_url=$master->{config}->get_cgi_bin_url;
my $cache=$master->{env}->get_cache;
# start javascript
print qq~
~;
#print qq~
~;
# javascript contents
for(my $k=1;$k<6;$k++){
if($link_display[$k]==0){
print qq~
~;
}else{
print qq~
~;
}
}
}
sub output_report_toolbar{
my($self,$master)=@_;
my $images_url=$master->{config}->get_images_url;
my $cgi_bin_url=$master->{config}->get_cgi_bin_url;
my $cache=$master->{env}->get_cache;
# start javascript
print qq~
~;
#print qq~
~;
# javascript contents
for(my $k=1;$k<3;$k++){
my $lb=1;
if($k==2){
$lb=5;
}
if($link_display[$k]==0){
print qq~
~;
}else{
print qq~
~;
}
}
}
sub front_panel{
my($self,@space)=@_;
my $master=$space[0];
my $enum=$space[1];
my $diff=$space[2];
my $ems=$space[3];
if($ems==1){
my $num=30-$diff;
$master->{image}=qq~Woops! Something is wrong.... ~;
$master->{query}->param(-name=>'task',-values=>"view_manager");
}
if($ems==2){
my $num=30-$diff;
$master->{image}=qq~30 Days have Expired, Please register AdCycle.~;
$master->{query}->param(-name=>'task',-values=>'view_manager');
}
if($diff<=30 && $ems==3){
my $num=30-$diff;
$master->{image}=qq~Evaluation Day $diff of 30. Please register AdCycle.~;
}
if($enum!=15 && $ems==4){
$master->{image}=qq~Please enter your registration key again.~;
$master->{query}->param(-name=>'task',-values=>'view_manager');
}
return $master
}
# Copyright (c) 2001 AdCycle.com All rights reserved.
# http://www.adcycle.com - download the lastest version of adcycle
1;