#!/usr/bin/perl ############################################################## # # # Ultimate Affiliate # # ***********TEXT EDITION********** # # By Steve Miles # # http://www.groundbreak.com # # # # Copyright 1999-2000 # # # # Selling or distributing this software or # # modifications of this software without # # permission is expressly forbidden. Permission # # to modify the script for personal use is granted. # # In all cases this header and copyright # # must remain intact. All violators will be # # PROSECUTED to the full extent. # # # ############################################################## require "config.cgi"; ###################################################################### # No need to edit below here ###################################################################### use Time::Local; use CGI qw (:standard); $q = new CGI; @stuff = $q->param; foreach $stuff (@stuff) {${$stuff} = $q->param($stuff);} $time = time(); @daysinmonth = (30,28,31,30,31,30,31,31,30,30,30,31); @monthnames = ("January","February","March","April","May","June","July","August","September","October","November","December"); @hournames = ("12am-1am","1am-2am","2am-3am","3am-4am","4am-5am","5am-6am","6am-7am","7am-8am","8am-9am","9am-10am","10am-11am","11am-12pm","12pm-1pm","1pm-2pm","2pm-3pm","3pm-4pm","4pm-5pm","5pm-6pm","6pm-7pm","7pm-8pm","8pm-9pm","9pm-10pm","10pm-11pm","11pm-12am"); @daynames = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); if($action =~ /Get Lost Password/i){ &emailpassword; exit; } if($action =~ /Did you lose your password\?/i){ &lostpasswordform; exit; } ###################################################################### # Verify User ###################################################################### open (FILE, "$datadir$userdata"); flock(FILE, 2); while () { @tempuserarray = split (/\|/, $_); if ($tempuserarray[5] eq $user) { $usergoahead = "OK"; if ($tempuserarray[6] eq $pass) { $passgoahead = "OK"; $clickfile = $tempuserarray[0]; } } } flock(FILE, 8); close (FILE); if ($user eq "") { &loginpage; exit; } if ($usergoahead ne "OK") { print_default('Username does not exist'); exit;} if ($passgoahead ne "OK") { print_default('Password is wrong'); exit;} if($action eq "Update Your Info"){ &changeinfoform; exit; } if($action eq "Top 100 Referral Sites"){ &getreferrers; exit; } if($action eq "Update User Info"){ &updateuser; exit; } if($action eq "Get Link Code"){ &bannercode; exit; } if($action eq "Last 24 hours"){ &create_month_hash; &create_month_stats; &last24hours; exit; } if($action eq "Year to date" || $action eq "View this year"){ &create_month_hash; &create_month_stats; &year_stats; exit; } if($action eq "In\-depth Commissions" || $action eq "View Commissions"){ &create_month_hash; &viewtransactions; exit; } if ($affiliate_program eq "twotier" || $affiliate_program eq "threetier" && $show_downline eq 1) { if($action eq "Level 1 Details"){ &level_one; exit; }} if ($affiliate_program eq "threetier" && $show_downline eq 1) { if($action eq "Level 2 Details"){ &level_two; exit; }} &create_month_hash; &create_month_stats; &statspage;exit; ###################################################################### # Show level one affiliates ###################################################################### sub level_one { print $q->header; open (FILE, "$datadir$userdata"); flock(FILE, 2); while () { ($date,$log_sponsor,$com1,$com2,$com3,$log_user,@rest)=split(/\|/, $_ ); $users{$log_user} = "$log_sponsor|$rest[2]|$rest[1]"; } flock(FILE, 8); close (FILE); print< EOF foreach $log_user (keys %users) { ($sponsor,$name,$email) = split (/\|/, $users{$log_user}); if ($sponsor eq $user) { $goahead = "OK"; print< EOF } } if ($goahead ne "OK") { print "
There are no tier 2 affiliates.
"; exit; } print< EOF } ###################################################################### # Show level two affiliates ###################################################################### sub level_two { print $q->header; open (FILE, "$datadir$userdata"); flock(FILE, 2); while () { ($date,$log_sponsor,$com1,$com2,$com3,$log_user,@rest)=split(/\|/, $_ ); $users{$log_user} = "$log_sponsor|$rest[2]|$rest[1]"; } flock(FILE, 8); close (FILE); print<
Affiliates signed up on your first tier.
$name$email
EOF foreach $log_user (keys %users) { ($sponsor,$name,$email) = split (/\|/, $users{$log_user}); if ($sponsor eq $user) { push (@tier1_affiliates, $log_user); } } foreach $person (@tier1_affiliates) { foreach $log_user (keys %users) { ($sponsor,$name,$email) = split (/\|/, $users{$log_user}); if ($sponsor eq $person) { $goahead = "OK"; print< EOF } }} if ($goahead ne "OK") { print "
There are no tier 2 affiliates.
"; exit; } print< EOF } ###################################################################### # Top Referring Sites for that user ###################################################################### sub getreferrers { open (FILE, "$datadir$user"); flock(FILE, 2); while () { chomp $_; ($t,$i,$p,$r) = split (/\|/, $_); if (exists $uniquetwo{$r}) { $uniquetwo{$r}++; } else { $uniquetwo{$r} = 1; } } flock(FILE, 8); close (FILE); foreach $k (keys %uniquetwo) { while (exists $newlist{$uniquetwo{$k}}) { $uniquetwo{$k}--; } $newlist{$uniquetwo{$k}} = $k; push (@newlistkeys, $uniquetwo{$k}); } @newlistkeys = sort {$a <=> $b} (@newlistkeys); $newlistkeynum = @newlistkeys; print $q->header; print<Top 100 Referring Sites
Affiliates signed up on your second tier.
$name$email
Top 100 Referring Sites
Based on total referrals with your affiliate ID.
(Urls truncated to 100 characters - click to go to the full url)
EOF while ($x < 101) { $k = pop @newlistkeys; if ($newlist{$k}) { if ($k < 1 ) { $refnumber = 1; } else { $refnumber = $k; } print "\n"; } $x++; } print<

Back to Main Stats Page

EOF exit; } ###################################################################### # View User Info ###################################################################### sub changeinfoform { open (FILE, "$datadir/$userdata"); flock(FILE, 2); while () { chomp $_; ($date,$sponsor,$com1,$com2,$com3,@rest) = split(/\|/, $_); if ($user eq $rest[0]) { foreach $field (@signupfields) { ${$field} = shift(@rest); } $real_sponsor = $sponsor; $neat_sponsor = $real_sponsor; $neat_sponsor =~ s/_/ /; $real_date = $date; } } &realdate($real_date); flock(FILE, 8); close (FILE); print $q->header; print<$user
EOF if ($action eq "Update User Info") { print "
User $user Updated Successfully
"; } print<
ReferralsFrom:
$refnumber"; $newlist{$k} = substr($newlist{$k},0,100); print "$newlist{$k}
Info for $user
EOF foreach $field (@signupfields) { if ($field eq "Username") { print ""; } else { print ""; } } print<
Joined:$mon/$day/$year
Sponsor:$neat_sponsor
$field:${$field}
$field:

Back to Main Stats Page

EOF } ###################################################################### # Update User ###################################################################### sub updateuser { open (FILE, "$datadir/$userdata"); flock(FILE, 2); while () { (@tempuserarray) = split(/\|/, $_); if ($user eq $tempuserarray[5]) { $record = "$tempuserarray[0]|$sponsor|$com1|$com2|$com3"; foreach $field (@signupfields) { ${$field} = $q->param($field); ${$field} = filter(${$field}); if ($Terms eq "YES") { $termcheck = "OK" } if ($field eq "Address2" || $field eq "Terms" || $field eq "Phone" || $field eq "Fax") {} else { if (${$field} eq "") { &print_default("The $field field is empty"); } } $record .= "\|${$field}"; } } else { push (@newlist, $_); } } flock(FILE, 8); close (FILE); if ($Username =~ /^[A-Za-z0-9]+$/) {} else {&print_default("Username must contain only letters with no spaces!"); exit;} if ($Email =~ /^[\w\-\.]+\@[\w\-]+\.[\w\-\.]+\w$/) {} else {&print_default("Not a valid email format!"); exit;} if ($Siteurl =~ m/:\/\// ) {} else {&print_default("Please use \"http://\" in url!"); exit;} if ($termcheck ne "OK") { &print_default('You did not agree on the terms!'); exit;} if ($SSNumber =~ /^[0-9]+$/) {} else {&print_default("Social Security number must be 9 numbers!"); exit;} open (FILE, ">$datadir/$userdata"); flock(FILE, 2); print FILE "$record\n"; foreach $item (@newlist) { print FILE $item; } flock(FILE, 8); close (FILE); &changeinfoform; exit; } ###################################################################### # Create Stats hashes for this month ###################################################################### sub create_month_stats { $time = time(); open (FILE, "$datadir$user"); flock(FILE, 2); while () { ($log_time,$log_id,$log_ip,$log_referrer) = split (/\|/, $_); ($sec, $min, $hour, $log_day, $log_month, $log_year, $dweek, $dyear, $daylight) = localtime($log_time); if ($mon eq $log_month && $year eq $log_year && $action ne "Last 24 hours") { $mon{$log_day}++; $log_day = "$log_day$user"; ${$log_day}{$log_ip} = 0; $whole_unique{$log_ip} = 0; } if ($year eq $log_year && $action eq "Year to date" || $action eq "View this year") { $month_data{$log_month}++; $month_unique = "$log_month$user\M"; ${$month_unique}{$log_ip} = 0; } if ($action eq "Last 24 hours") { $i = 1; $finish = $time - 3600; while ($i < 25) { if ($log_time > $finish && $log_time < $finish + 3600) { $hour{$i}++; } $i++; $finish = $finish - 3600; }} } flock(FILE, 8); close (FILE); if ($action ne "Last 24 hours") { open (FILE, "$datadir$user\_P"); flock(FILE, 2); while () { ($log_time,$log_tier,$log_status,$log_recur,$log_cookie,$log_payout,$log_referurl,$log_ip,$log_goods) = split (/\|/, $_); if ($log_cookie eq $user) { ($sec, $min, $hour, $log_day, $log_month, $log_year, $dweek, $dyear, $daylight) = localtime($log_time); if ($mon eq $log_month && $year eq $log_year) { if ($log_tier eq "TIER1") { $tier1 = "tier1$log_day"; ${$tier1}{$log_time} = $status; $tier1A = "tier1$log_day\A"; ${$tier1A} = ${$tier1A} + $log_payout; } if ($log_tier eq "TIER2") { $tier2 = "tier2$log_day"; ${$tier2}{$log_time} = $status; $tier2A = "tier2$log_day\A"; ${$tier2A} = ${$tier2A} + $log_payout; } if ($log_tier eq "TIER3") { $tier3 = "tier3$log_day"; ${$tier3}{$log_time} = $status; $tier3A = "tier3$log_day\A"; ${$tier3A} = ${$tier3A} + $log_payout; } $total = "total$log_day"; ${$total} = ${$total} + $log_payout; $whole_month_total = $whole_month_total + $log_payout; $sale_number++; } } if ($year eq $log_year) { $tier1 = "yearit$log_month"; $tier1T = "yearit$log_month\T"; ${$tier1T} = ${$tier1T} + $log_payout; ${$tier1}{$log_time} = $status; } } flock(FILE, 8); close (FILE); } if ($action eq "Last 24 hours") { $hour_max = 0; foreach $key (keys %hour) { if ($hour{$key} > $hour_max) { $hour_max = $hour{$key}; } }} if ($action ne "Year to date" || $action ne "Last 24 hours") { $mon_max = 0; foreach $key (keys %mon) { if ($mon{$key} > $mon_max) { $mon_max = $mon{$key}; } } $i = 1; while ($i < 32) { $tier1 = "tier1$i"; $t1 = keys %{$tier1}; $tier2 = "tier2$i"; $t2 = keys %{$tier2}; $tier2 = "tier2$i"; $t3 = keys %{$tier3}; $big_total = $t1 + $t2 + $t3; if ($mon_max < $big_total) {$mon_max = $big_total;} $i++; } } if ($action eq "Year to date" || $action eq "View this year") { $year_max = 0; foreach $key (keys %month_data) { if ($month_data{$key} > $year_max) { $year_max = $month_data{$key}; } } $i = 1; while ($i < 13) { $tier1 = "yearit$i"; $t1 = keys %{$tier1}; if ($year_max < $t1) {$year_max = $t1;} $i++; } } if ($affiliate_program eq "twotier" || $affiliate_program eq "threetier") { open (FILE, "$datadir$userdata"); flock(FILE, 2); while () { ($date,$log_sponsor,$com1,$com2,$com3,$log_user,@rest)=split(/\|/, $_ ); $users{$log_user} = $log_sponsor; } flock(FILE, 8); close (FILE); foreach $log_user (keys %users) { if ($users{$log_user} eq $user) { $tier_one_affiliates++; $total_affiliates++; push (@tier1_affiliates, $log_user); } } if ($affiliate_program eq "threetier") { foreach $person (@tier1_affiliates) { foreach $log_user (keys %users) { if ($users{$log_user} eq $person) { $tier_two_affiliates++; $total_affiliates++; } } }} } if ($tier_one_affiliates < 1) {$tier_one_affiliates=0;} if ($tier_two_affiliates < 1) {$tier_two_affiliates=0;} if ($total_affiliates < 1) {$total_affiliates=0;} $temp_num = keys %whole_unique; if ($sale_number eq 0 || $temp_num eq 0) {$sales_conversion = 0;} else { $sales_conversion = $sale_number/$temp_num; if ($sales_conversion < .01) { $sales_conversion = $sales_conversion *100000; } else { $sales_conversion = $sales_conversion *100; } $sales_conversion = int $sales_conversion; if ($sales_conversion > 100) {$sales_conversion = $sales_conversion/1000;} } if ($whole_month_total < .001) {$whole_month_total=0;} $days_in_the_month = @days_of_the_month; } ###################################################################### # Banner Code Page ###################################################################### sub bannercode { print $q->header; print<$user affiliate stats for $main_site_name
$main_site_name Control Panel
Banner and Hyperlink Code
All Promotional Tools (banners, text links, emails, etc.):
http://lessworkmoremoney.com/affil_pop.htm


Main Affiliate Url:
$url_to_cgi_directory/clickthru.cgi?id=$user


Graphic Link Example:
EOF foreach $banner (@url_to_banner) { print<
$main_site_name


<a href="$url_to_cgi_directory/clickthru.cgi?id=$user">
<img src="$banner" alt="$main_site_name" border="0"></a>

EOF } print< Text Link Example:

$main_site_name

<a href="$url_to_cgi_directory/clickthru.cgi?id=$user">
$main_site_name</a>

You can now link to any page in the $main_site_name website. Just add an additional variable to your link code called "page" with the FULL URL of the page you want to redirect to.

EXAMPLE:
$url_to_cgi_directory/clickthru.cgi
?id=$user&page=http://whateversite.com/newpage.html

Make sure the code above is all on one line.
It's split here to conserve space.

and the click will be forwarded to newpage.html.

Back to Main Stats Page

EOF } ###################################################################### # Lost Password Form Page ###################################################################### sub lostpasswordform { print $q->header; print<Lost Password?
Password Retrieval

 
Just type in your email address and your
login name and password will be emailed to you shortly.

EOF } ###################################################################### # Email lost password ###################################################################### sub emailpassword { open (FILE, "$datadir$userdata"); flock(FILE, 2); while () { ($date,$sponsor,$com1,$com2,$com3,@rest) = split(/\|/, $_ ); if ($rest[2] eq $email) { $subject = "Your $main_site_name Password"; open (MAIL, "|$mailprog $email") || die "Can't open $mailprog!\n"; print MAIL <<"HEADER"; To: $email Subject: $subject From: $admin_email Username: $rest[0] Password: $rest[1] HEADER close (MAIL); $foundit = "OK"; } } flock(FILE, 8); close (FILE); if ($foundit eq "OK") { &print_default("Your password has been sent to $email"); } else { &print_default("$email not found in database"); } exit; } ###################################################################### # View Commissions In Depth ###################################################################### sub viewtransactions { print $q->header; if (defined $view_year_com) {$current_year = $view_year_com;} else {$current_year = $real_year;} if (defined $view_month_com) {$current_month = $view_month_com;} else {$current_month = $mon;} open (FILE, "$datadir$user\_P"); flock(FILE, 2); while () { ($key,@rest) = split (/\|/, $_); ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($key); $year = $year + 1900; if ($year eq $current_year) { push (@{$month_hash_com{$mon}}, $_); } } flock(FILE, 8); close (FILE); print<
Transactions for $user
View 
Back to Main Stats Page EOF $i = $current_month; @list = sort {$a <=> $b} @{$month_hash_com{$i}}; @list = reverse @list; print< EOF foreach $list (@list) { ($key,$transaction,$status,$recur,$affiliate,$amount,$referer,$ip,$info) = split (/\|/, $list); $info = "\ \;$info"; &date($key); print< EOF } print< EOF } ###################################################################### # Last 24 Hours of hits ###################################################################### sub last24hours { print $q->header; print<$main_site_name\'s stats for the last 24 hours.
@monthnames[$i] $current_year
DATE LEVEL AMOUNT EXTRA INFO
$monthnames[$mon] $day, $year $transaction \$$amount $info
EOF $i = 1; while ($i < 25) { if ($hour{$i}) {} else {$hour{$i}=0;} if ($hour_max) {} else {$hour_max=200;} $height = $hour{$i} / $hour_max * 200; if ($height < 1) {$height = 1;} print "\n"; $i++; } print< EOF $i = 1; $time = time(); while ($i < 25) { ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time); $hour = $hour + 1; if ($hour > 12.5) {$hour = $hour - 12; $hours = "pm";} else { $hours = "am" } if ($i < 10) { $i = "$i
\ \;\ \;\ \;"; } print "\n"; $i++; $time = $time - (60*60); } print< EOF $i = 1; while ($i < 25) { if ($hour{$i}) {} else {$hour{$i}=0;} print "\n"; $i++; } print<hits
sent
Last 24 hours
(Number of Referrals per Hour)
 
$hour_max
0
$hour
$hours
scale
$hour{$i}
EOF exit; } ###################################################################### # Graph of the year ###################################################################### sub year_stats { $year = $year + 1900; print $q->header; print<$main_site_name\'s stats for the year
EOF $i = 0; while ($i < 12) { if ($month_data{$i}) {} else {$month_data{$i}=0;} if ($year_max) {} else {$year_max=100;} $temp = "$i$user\M"; $uniq_num = keys %{$temp}; $tier1 = "yearit$i"; $number = keys %{$tier1}; $height1 = $month_data{$i} / $year_max * 200; $height2 = $uniq_num / $year_max * 200; $height3 = $number / $year_max * 200; if ($height1 < 1) {$height1 = 1;} if ($height2 < 1) {$height2 = 1;} if ($height3 < 1) {$height3 = 1;} print "\n"; $i++; } print<$year_max EOF $i = 0; while ($i < 12) { $themonth = @monthnames[$i]; $themonth = substr($themonth,0,3); print "\n"; $i++; } print<scale EOF $i = 0; while ($i < 12) { if ($month_data{$i}) {} else {$month_data{$i}=0;} $temp = "$i$user\M"; $uniq_num = keys %{$temp}; $tier1 = "yearit$i"; $number = keys %{$tier1}; $height1 = $month_data{$i} / $year_max * 200; $height2 = $uniq_num / $year_max * 200; $height3 = $number / $year_max * 200; if ($height1 < 1) {$height1 = 1;} if ($height2 < 1) {$height2 = 1;} if ($height3 < 1) {$height3 = 1;} print "\n"; $i++; } print<  EOF $i = 0; while ($i < 12) { if ($month_data{$i}) {} else {$month_data{$i}=0;} $temp = "$i$user\M"; $uniq_num = keys %{$temp}; $tier1 = "yearit$i"; $number = keys %{$tier1}; $height1 = $month_data{$i} / $year_max * 200; $height2 = $uniq_num / $year_max * 200; $height3 = $number / $year_max * 200; if ($height1 < 1) {$height1 = 1;} if ($height2 < 1) {$height2 = 1;} if ($height3 < 1) {$height3 = 1;} print "\n"; $i++; } print<  EOF $i = 0; while ($i < 12) { if ($month_data{$i}) {} else {$month_data{$i}=0;} $temp = "$i$user\M"; $uniq_num = keys %{$temp}; $tier1 = "yearit$i"; $number = keys %{$tier1}; $height1 = $month_data{$i} / $year_max * 200; $height2 = $uniq_num / $year_max * 200; $height3 = $number / $year_max * 200; if ($height1 < 1) {$height1 = 1;} if ($height2 < 1) {$height2 = 1;} if ($height3 < 1) {$height3 = 1;} print "\n"; $i++; } print<  EOF $i = 0; while ($i < 12) { $tier1T = "yearit$i\T"; if (${$tier1T}) {} else {${$tier1T} = 0} print "\n"; $i++; } print< 
History for $year

 Total Referrals    Unique Referrals    Sales

 
0
 $themonth
 
Total
Referrals
$month_data{$i}
Unique
Referrals
$uniq_num
Sales$number
Commissions\$${$tier1T}

Back to Main Stats Page

EOF exit; } ###################################################################### # Main Affiliate Control Panel Page ###################################################################### sub statspage { print $q->header; print<$main_site_name Stats Page
AFFILIATE CONTROL PANEL
Referral and Commission Data for $user.


This affiliate tracker will be inactivated Friday Feb 4th. Login to the new affiliate center using your current pwd
and the new ID that was emailed to you on Feb 1st: http://wetrack.it/mikkema/affiliate . Check your email for the details.
Or email me at affil_support@lessworkmoremoney.com

   
 
   

EOF if ($affiliate_program eq "twotier" || $affiliate_program eq "threetier" && $show_downline eq 1) { print< EOF if ($affiliate_program eq "twotier" && $show_downline eq 1) { print "

"; } } if ($affiliate_program eq "threetier" && $show_downline eq 1) { print< EOF } print<

  EOF $i = 1999; while ($i < 2010) { if ($i eq $real_year) { $temp = "SELECTED"; } print "
EOF $i = 1; while ($i < 16) { print "\n"; $i++; } print< EOF $i = 1; while ($i < 16) { print "\n"; $i++; } print< EOF $i = 1; while ($i < 16) { $day = "$i$user"; $number = keys %{$day}; print "\n"; $i++; } print< EOF $i = 1; while ($i < 16) { $tier1 = "tier1$i"; $tier2 = "tier2$i"; $tier3 = "tier3$i"; $number1 = keys %{$tier1}; $number2 = keys %{$tier2}; $number3 = keys %{$tier3}; $number = $number1 + $number2 + $number3; print "\n"; $i++; } print< EOF $i = 1; while ($i < 16) { $num = "tier1$i\A"; if (${$num} > 0) {} else {${$num} = 0;} print "\n"; $i++; } if ($affiliate_program eq "twotier" || $affiliate_program eq "threetier") { print< EOF $i = 1; while ($i < 16) { $num = "tier2$i\A"; if (${$num} > 0) {} else {${$num} = 0;} print "\n"; $i++; } } if ($affiliate_program eq "threetier") { print< EOF $i = 1; while ($i < 16) { $num = "tier3$i\A"; if (${$num} > 0) {} else {${$num} = 0;} print "\n"; $i++; } } print< EOF $i = 1; while ($i < 16) { $num = "total$i"; if (${$num} > 0) {} else {${$num} = 0;} print "\n"; $i++; } print<
$monthnames[$mon] 1-15, $real_year$i
Total Clicks$mon{$i}
Unique Clicks$number
Sales$number
Tier 1 Commissions\$${$num}
Tier 2 Commissions\$${$num}
Tier 3 Commissions\$${$num}
Total Commissions\$${$num}
EOF $i = 16; while ($i < ($days_in_the_month+1)) { print "\n"; $i++; } print< EOF $i = 16; while ($i < ($days_in_the_month+1)) { print "\n"; $i++; } print< EOF $i = 16; while ($i < ($days_in_the_month+1)) { $day = "$i$user"; $number = keys %{$day}; print "\n"; $i++; } print< EOF $i = 16; while ($i < ($days_in_the_month+1)) { $tier1 = "tier1$i"; $number = keys %{$tier1}; print "\n"; $i++; } print< EOF $i = 16; while ($i < ($days_in_the_month+1)) { $num = "tier1$i\A"; if (${$num} > 0) {} else {${$num} = 0;} print ""; $i++; } if ($affiliate_program eq "twotier" || $affiliate_program eq "threetier") { print< EOF $i = 16; while ($i < ($days_in_the_month+1)) { $num = "tier2$i\A"; if (${$num} > 0) {} else {${$num} = 0;} print "\n"; $i++; } } if ($affiliate_program eq "threetier") { print< EOF $i = 16; while ($i < ($days_in_the_month+1)) { $num = "tier3$i\A"; if (${$num} > 0) {} else {${$num} = 0;} print "\n"; $i++; } } print< EOF $i = 16; while ($i < ($days_in_the_month+1)) { $num = "total$i"; if (${$num} > 0) {} else {${$num} = 0;} print "\n"; $i++; } print<
$monthnames[$mon] 16-$days_in_the_month, $real_year$i
Total Clicks$mon{$i}
Unique Clicks$number
Sales$number
Tier 1 Commissions\$${$num}
Tier 2 Commissions\$${$num}
Tier 3 Commissions\$${$num}
Total Commissions\$${$num}
EOF print<
Commissions due to you ($monthnames[$mon] $real_year) = \$$whole_month_total
Commissions / Unique IP Clicks = $sales_conversion% Sales Conversion
EOF if ($affiliate_program eq "twotier" || $affiliate_program eq "threetier") { print< Affiliates on your first level: $tier_one_affiliates
EOF if ($affiliate_program eq "threetier") { print<
EOF $i = 1; while ($i < ($days_in_the_month+1)) { if ($mon{$i}) {} else {$mon{$i}=0;} if ($mon_max) {} else {$mon_max=100;} $temp = "$i$user"; $uniq_num = keys %{$temp}; $tier1 = "tier1$i"; $tier2 = "tier2$i"; $tier3 = "tier3$i"; $number1 = keys %{$tier1}; $number2 = keys %{$tier2}; $number3 = keys %{$tier3}; $number = $number1 + $number2 + $number3; if ($sales_max) {} else {$sales_max=100;} $height1 = $mon{$i} / $mon_max * 100; $height2 = $uniq_num / $mon_max * 100; $height3 = $number / $mon_max * 100; if ($height1 eq 0) { $height1 = 1; } if ($height2 eq 0) { $height2 = 1; } if ($height3 eq 0) { $height3 = 1; } print "\n"; $i++; } print<$mon_max EOF $i = 1; while ($i < ($days_in_the_month+1)) { print "\n"; $i++; } print<scale
 Daily Trends for $monthnames[$mon] $real_year
 Total Referrals    Unique Referrals    Sales

 
 
0
 $i
Your link code:
$url_to_cgi_directory/clickthru.cgi?id=$user
EOF exit; } ###################################################################### # Print Out the Login Page ###################################################################### sub loginpage { print $q->header; print<Stats Login  

$main_site_name
A f f i l i a t e    C o n t r o l    P a n e l    L o g i n

This affiliate tracker will be inactivated Friday Feb 4th. Login to the new affiliate center using your current pwd and the new ID that was emailed to you on Feb 1st: http://wetrack.it/mikkema/affiliate . Check your email for the details. Or email me at affil_support@lessworkmoremoney.com

USERNAME:
PASSWORD:

Copyright © 1999 Steve Miles - www.groundbreak.com
$main_site_name
A f f i l i a t e    C o n t r o l    P a n e l    L o g i n
EOF exit; } ###################################################################### # Default Error HTML ###################################################################### sub print_default { print $q->header; print<Affiliate Program
$_[0]

HTML if ($action ne "Get Lost Password") { print "Go Back"; } print< HTML exit; } ###################################################################### # Filter pipes ("|") out of user submissions ###################################################################### sub filter{ $temp = $_[0]; $temp =~ s/\|//; return ($temp); } ###################################################################### # Date Subroutines ###################################################################### sub create_month_hash { if ($action eq "View" || $action eq "View this year") { $year = $view_year - 1900; $real_year = $year + 1900; $i = 0; foreach $name (@monthnames) { if ($name eq $view_month) { $mon = $i; } $i++; } $time = timelocal(0,0,1,15,$mon,$year); } else {$time = time();} ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time); $month = $mon; while ($month eq $mon) { $mon{$day} = 0; $time = $time - (60 * 60 * 24); ($sec, $min, $hour, $day, $month, $year, $dweek, $dyear, $daylight) = localtime($time); } if ($action eq "View" || $action eq "View this year") { $year = $view_year - 1900; $real_year = $year + 1900; $i = 0; foreach $name (@monthnames) { if ($name eq $view_month) { $mon = $i; } $i++; } $time = timelocal(0,0,1,15,$mon,$year); } else {$time = time();} ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time); $month = $mon; while ($month eq $mon) { $mon{$day} = 0; $time = $time + (60 * 60 * 24); ($sec, $min, $hour, $day, $month, $year, $dweek, $dyear, $daylight) = localtime($time); } @days_of_the_month = sort { $a <=> $b } (keys %mon); if ($mon >= 11) { $year = $year - 1; } $real_year = $year + 1900; } sub realdate { $time = time(); ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time); $mon = $mon; $real_year = $year + 1900; } sub date { ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($_[0]); $month = $mon; $year = $year + 1900; }