damfer21 has asked for the wisdom of the Perl Monks concerning the following question:
I tried to add a parameter to the following code and it does not work. If you see the "$last240_flag" in the code, that one is the one that doesn't work. The others do as expected. Is there somewhere that I can find the definitions of the "_flag"? I am extremely new at this, and my admin retired so I cannot get any help. Apologies if this is a silly question.
# ******************************************************************** +********************* # camp_schedule.cgi # # ******************************************************************** +********************* # include Perl Modules use strict; use CGI; use empire; # get some objects to use later my $pms = empire->new; my $query = CGI->new; my $sth; my $sth2; my $sql; my $dbh; my $campaign_id = $query->param('campaign_id'); my $list_id; my $status; my $cname; my $schedule_date; my $shour; my $smin; my $max_emails; my $old_mid; my $old_dname; my $clast60; my $openflag; my $aolflag; my $yahoo_flag; my $yahoo_only_flag; my $yahoo_no_flag; my $yes_flag; my $no_flag; my $seven_flag; my $last90_flag; my $last120_flag; my $last240_flag; my $yes_open_flag; my $no_open_flag; my $aol_yes_flag; my $aol_no_flag; my $both_flag; my $light_table_bg = $pms->get_light_table_bg; my $images = $pms->get_images_url; my $list_members = 1; my $counter; # connect to the pms database $pms->db_connect(); $dbh = $pms->get_dbh; # check for login my $user_id = empire::check_security(); if ($user_id == 0) { print "Location: notloggedin.cgi\n\n"; $pms->clean_up(); exit(0); } # make sure this campaign has some valid member list or lists assigned + to it before # allowing the user to schedule it to be sent. $sql = "select list_id from campaign_list where campaign_id = $campaig +n_id"; $sth = $dbh->prepare($sql); $sth->execute(); while (($list_id) = $sth->fetchrow_array()) { $sql = "select member_cnt from list where list_id = $list_id and s +tatus = 'A'"; $sth2 = $dbh->prepare($sql); $sth2->execute(); ($counter) = $sth2->fetchrow_array(); $sth2->finish(); $list_members = $list_members + $counter; } $sth->finish(); if ($list_members == 0) { empire::logerror("Error, the campaign you selected does not have a +ny email member lists <br> assigned to it. You must assign at least one emai +l list that contains <br> some active members to this campaign before it can + be scheduled."); $pms->clean_up(); exit(0); } # print out the html page my $cdate; $sql = "select now()"; $sth = $dbh->prepare($sql); $sth->execute(); ($cdate)=$sth->fetchrow_array(); $sth->finish(); empire::header("Campaign Schedule"); $sql = "select status,curdate(),max_emails,last60_flag,aol_flag,open_f +lag,yahoo_flag,hour(schedule_time),minute(schedule_time),mid,redirect +_domain,campaign_name from campaign where campaign_id=$campaign_id"; $sth = $dbh->prepare($sql); $sth->execute(); ($status,$schedule_date,$max_emails,$clast60,$aolflag,$openflag,$yahoo +_flag,$shour,$smin,$old_mid,$old_dname,$cname) = $sth->fetchrow_array +(); print << "end_of_html"; </TD> </TR> <TR> <TD vAlign=top align=left bgColor=#999999> <TABLE cellSpacing=0 cellPadding=10 bgColor=#999999 border=0 width +="100%"> <TBODY> <TR> <TD vAlign=top align=left bgColor=#ffffff colSpan=10><!-- doing ct +-table-open --> <TABLE cellSpacing=0 cellPadding=0 width=660 bgColor=#ffffff b +order=0> <TBODY> <TR> <TD vAlign=center align=left><font face="verdana,arial,hel +vetica,sans serif" color="#509C10" size="3"><b>Schedule Your Campaign</b> +</font></TD> </TR> <TR> <TD><IMG height=3 src="$images/spacer.gif"></TD> </TR> </TBODY> </TABLE> <TABLE cellSpacing=0 cellPadding=0 width=660 bgColor=#ffffff b +order=0> <TBODY> <TR> <TD><FONT face="verdana,arial,helvetica,sans serif" color=#509 +C10 size=2> Set your Campaign status to either Draft or Scheduled. You +r Campaign will remain in Draft mode until you move it to Scheduled. +If you schedule your Campaign, it will be sent on the date specified beginning +around midnight. If you schedule your Campaign for today, it will begin goi +ng out in the next 5 minutes.<BR></FONT></TD> </TR> <TR> <TD><IMG height=5 src="$images/spacer.gif"></TD> </TR> </TBODY> </TABLE> <FORM action="camp_copy_schedule_save.cgi" method=post name="b +date"> <INPUT type=hidden name="campaign_id" value="$campaign_id"> <TABLE cellSpacing=0 cellPadding=0 width=760 bgColor=#ffffff b +order=0> <TBODY> <TR> <TD> <TABLE cellSpacing=0 cellPadding=5 width="100%" border=0> <TBODY> <TR> <TD align=middle> <TABLE cellSpacing=0 cellPadding=0 width=500 bgColor=$ +light_table_bg border=0> <TBODY> <TR align=top bgColor=#509C10 height=18> <TD vAlign=top align=left height=15><IMG src="$images/ +blue_tl.gif" border=0 width="7" height="7"></TD> <TD height=15><IMG height=1 src="$images/spacer.gif" w +idth=3 border=0></TD> <TD align=middle height=15> <TABLE cellSpacing=0 cellPadding=0 width="100%" bo +rder=0> <TBODY> <TR bgColor=#509C10 height=15> <TD align=middle width="100%" height=15> <FONT face=Verdana,Arial,Helvetica,sans-serif +color=white size=2> <B>Campaign Status</B> Current Date +time: $cdate </FONT> </TD> </TR> </TBODY> </TABLE> </TD> <TD height=15><IMG height=1 src="$images/spacer.gif" w +idth=3 border=0></TD> <TD vAlign=top align=right bgColor=#509C10 height=15> <IMG src="$images/blue_tr.gif" border=0 width="7" +height="7"></TD> </TR> <TR bgColor=$light_table_bg> <TD colSpan=5><IMG height=3 src="$images/spacer.gif" w +idth=1 border=0></TD> </TR> <TR bgColor=$light_table_bg> <TD><IMG height=3 src="$images/spacer.gif" width=3></T +D> <TD align=middle><IMG height=3 src="$images/spacer.gif +" width=3></TD> <TD align=middle> <TABLE cellSpacing=0 cellPadding=0 width="100%" bo +rder=0> <TBODY> <TR> <TD align=middle><IMG height=3 src="$images/spacer +.gif" width=3></TD> </TR> <tr> <TD vAlign=center align=left><FONT face="verdana,a +rial,helvetica,sans serif" color=#509C10 size=2>New Campaign Name: <input type=text name=cname value="$cname" siz +e=50></font></td> </tr> <TR> <TD vAlign=center align=left><FONT face="verdana,a +rial,helvetica,sans serif" color=#509C10 size=2> end_of_html # get schedule information for this campaign if ($old_dname eq "") { $old_dname="NONE"; } if ($status eq "D") { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localti +me(); $year = $year + 1900; $mon = $mon + 1; if ($mon < 10) { $mon = "0$mon"; } if ($mday < 10) { $mday = "0$mday"; } $schedule_date = "$mon/$mday/$year"; print<<"end_of_html"; <script language="JavaScript1.2" src="/CalendarPopup.js"></script> <SCRIPT LANGUAGE="JavaScript"> var cal = new CalendarPopup(); </SCRIPT> end_of_html print qq { <INPUT style="BACKGROUND: $light_table_bg" type=radio CHECKED +name=schedule value=D>Draft<BR> <INPUT style="BACKGROUND: $light_table_bg" type=radio name=sch +edule value=S>Scheduled for <INPUT type="text" name="sdate" size="10" value="$schedule_dat +e">\n }; print qq { <A HREF="#" onClick="cal.select(document.forms['bdate'].sdate +,'anchor1','MM/dd/yyyy'); return false;" NAME="anchor1" ID="anchor1"> +<img src="/images/calendar_Icon.jpg" border=0 width="27" height="25"> +</A> }; } else { $schedule_date = substr($schedule_date,5,2) . "/" . substr($schedu +le_date,8,2) . "/" . substr($schedule_date,0,4); print qq { <INPUT style="BACKGROUND: $light_table_bg" type=radio name=sch +edule value=D>Draft<BR> <INPUT style="BACKGROUND: $light_table_bg" type=radio CHECKED +name=schedule value="$status">Scheduled for <INPUT type="text" name="sdate" size="10" value="$schedule_dat +e"> \n }; print qq { <A HREF="#" onClick="cal.select(document.forms['bdate'].sdate +,'anchor1','MM/dd/yyyy'); return false;" NAME="anchor1" ID="anchor1"> +<img src="/images/calendar_Icon.jpg" border=0 width="27" height="25"> +</A> }; } $sth->finish(); my $i=0; print " Hour: <select name=shour>\n"; while ($i < 24) { if ($i == $shour) { print "<option selected value=$i>$i</option>"; } else { print "<option value=$i>$i</option>"; } $i++; } print "</select>"; my $i=0; print " Minute: <select name=smin>\n"; while ($i < 60) { if ($i == $smin) { print "<option selected value=$i>$i</option>"; } else { print "<option value=$i>$i</option>"; } $i++; } print "</select>"; if ($clast60 eq "Y") { $yes_flag="checked"; $no_flag = ""; $seven_flag = ""; $last90_flag = ""; $last120_flag = ""; $last240_flag = ""; } elsif ($clast60 eq "7") { $no_flag=""; $yes_flag = ""; $seven_flag = "checked"; $last90_flag = ""; $last120_flag = ""; $last240_flag = ""; } elsif ($clast60 eq "9") { $no_flag=""; $yes_flag = ""; $seven_flag = ""; $last90_flag = "checked"; $last120_flag = ""; $last240_flag = ""; } elsif ($clast60 eq "2") { $no_flag=""; $yes_flag = ""; $seven_flag = ""; $last90_flag = ""; $last120_flag = "checked"; $last240_flag = ""; } elsif ($clast60 eq "4") { $no_flag=""; $yes_flag = ""; $seven_flag = ""; $last90_flag = ""; $last120_flag = ""; $last240_flag = "checked";";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Object Identifier?
by LanX (Saint) on Oct 21, 2018 at 23:17 UTC | |
by damfer21 (Novice) on Oct 22, 2018 at 12:15 UTC | |
by haj (Vicar) on Oct 22, 2018 at 20:54 UTC | |
by damfer21 (Novice) on Oct 22, 2018 at 21:20 UTC | |
|
Re: Object Identifier? (red flags, more subs)
by Anonymous Monk on Oct 22, 2018 at 00:41 UTC | |
by damfer21 (Novice) on Oct 22, 2018 at 12:26 UTC | |
by Veltro (Hermit) on Oct 22, 2018 at 13:21 UTC | |
by damfer21 (Novice) on Oct 22, 2018 at 18:07 UTC | |
by LanX (Saint) on Oct 22, 2018 at 18:57 UTC | |
| |
|
Re: Object Identifier?
by Anonymous Monk on Oct 22, 2018 at 21:56 UTC | |
by damfer21 (Novice) on Oct 22, 2018 at 22:01 UTC | |
by Anonymous Monk on Oct 22, 2018 at 23:45 UTC | |
by damfer21 (Novice) on Oct 23, 2018 at 00:35 UTC | |
|
Re: Object Identifier?
by Anonymous Monk on Oct 22, 2018 at 22:50 UTC | |
by damfer21 (Novice) on Oct 22, 2018 at 23:25 UTC | |
by AnomalousMonk (Archbishop) on Oct 23, 2018 at 02:21 UTC | |
by damfer21 (Novice) on Oct 23, 2018 at 02:36 UTC |