summaryrefslogtreecommitdiff
path: root/httemplate/edit/part_referral.cgi
blob: dce1e63949aafa70b56235ae43aab95a6c4bd188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<%

my $part_referral;
if ( $cgi->param('error') ) {
  $part_referral = new FS::part_referral ( {
    map { $_, scalar($cgi->param($_)) } fields('part_referral')
  } );
} elsif ( $cgi->keywords ) {
  my($query) = $cgi->keywords;
  $query =~ /^(\d+)$/;
  $part_referral = qsearchs( 'part_referral', { 'refnum' => $1 } );
} else { #adding
  $part_referral = new FS::part_referral {};
}
my $action = $part_referral->refnum ? 'Edit' : 'Add';
my $hashref = $part_referral->hashref;

my $p1 = popurl(1);

%><%= include('/elements/header.html', "$action Advertising source", menubar(
  'Main Menu' => popurl(2),
  'View all advertising sources' => popurl(2). "browse/part_referral.cgi",
)) %>

<% if ( $cgi->param('error') ) { %>
  <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
<% } %>

<FORM ACTION="<%= $p1 %>process/part_referral.cgi" METHOD=POST>

<INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $hashref->{refnum} %>">

<%
#print "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)";
%>

Advertising source <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="<%= $hashref->{referral} %>">

<BR>
<INPUT TYPE="submit" VALUE="<%= $hashref->{refnum} ? "Apply changes" : "Add advertising source" %>">

</FORM>

<%= include('/elements/footer.html') %>