% include("/elements/header.html","Advertising source Listing" ) %>
Where a customer heard about your service. Tracked for informational purposes.
Add a new advertising source
<% include('/elements/table-grid.html') %>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
Advertising source |
% if ( $show_agentnums ) {
Agent |
% }
>Customers and Packages |
% for my $period ( keys %after ) {
<% $period %> |
% }
%foreach my $part_referral ( FS::part_referral->all_part_referral(1) ) {
%
% if ( $bgcolor eq $bgcolor1 ) {
% $bgcolor = $bgcolor2;
% } else {
% $bgcolor = $bgcolor1;
% }
%
% $a = 0;
% if ( $part_referral->agentnum || $curuser->access_right('Edit global advertising sources') ) {
% $a++;
%
% }
<% $part_referral->refnum %><% $a ? '' : '' %> |
% if ( $a ) {
% }
<% $part_referral->referral %><% $a ? '' : '' %> |
% if ( $show_agentnums ) {
<% $part_referral->agentnum ? $part_referral->agent->agent : '(global)' %> |
% }
% for my $period ( keys %after ) {
% my @param = ( $part_referral->refnum,
% $today-$after{$period},
% $today+$before{$period},
% );
% $cust_sth->execute(@param) or die $cust_sth->errstr;
% my $num_cust = $cust_sth->fetchrow_arrayref->[0];
% $pkg_sth->execute(@param) or die $pkg_sth->errstr;
% my $num_pkg = $pkg_sth->fetchrow_arrayref->[0];
<% $num_cust %> |
customers |
<% $num_pkg %> |
packages |
|
% }
% }
%
% $cust_statement =~ s/AND refnum = \?//;
% $cust_sth = dbh->prepare($cust_statement)
% or die dbh->errstr;
% $pkg_statement =~ s/AND h_pkg_referral\.refnum = \?//;
% $pkg_sth = dbh->prepare($pkg_statement)
% or die dbh->errstr;
Total |
% for my $period ( keys %after ) {
% my @param = ( $today-$after{$period},
% $today+$before{$period},
% );
% $cust_sth->execute( @param ) or die $cust_sth->errstr;
% my $num_cust = $cust_sth->fetchrow_arrayref->[0];
% $pkg_sth->execute(@param) or die $pkg_sth->errstr;
% my $num_pkg = $pkg_sth->fetchrow_arrayref->[0];
<% $num_cust %> |
customers |
<% $num_pkg %> |
packages |
|
% }