use strict;return sub{my $this = shift;my $C = $this->{C};$this->out("");{my $G = (ref $this)->get("/headfoot/inner_header.html", $this->{param}) or die "no skel /headfoot/inner_header.html";my $ctx = $this->{C};my $out = $G->execute($ctx);$this->out(@$out) if $out;}$this->out("\n<div style=\"padding: 10\">\n\n");$C->{Packages} = Zen::PerlHandler->get(II982446f8950cc3dc59e487adba22df54::IIlllIlIIllIIlll($II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIlIIllllIIIlI{$IIb39071a48a82a07eeb9256f406abebc5::IllIlIIllIlIIIll},33,$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIlIIllllIIIlI{$II982446f8950cc3dc59e487adba22df54::IllIIIlIllllIlll}).'->search')->do(ORDER => 'title', WHERE => 'find_in_set(type,\''.$C->{UserObj}->availableTypes.'\')');$_ = $_->getView for @{ $C->{Packages} };$this->out("\n\n<select onChange=\"document.location=\'?\' + this.options[this.selectedIndex].value\">\n<option value=\"\"> Select a package...\n");my $in = $C->{Packages};my $loop = ref($in) eq "ARRAY" ? $in : ref($in) eq "CODE" ? &{$in} : [];$C->{ITERATION}{p} = -1;for my $f (@$loop) {$C->{ITERATION}{p}++;$C->{p} = $f;$this->out("");$C->{selected} = $C->{p}{ID} eq $C->{INPUT}{pack_id} ? 'selected' : '';$this->out("<option value=\"pack_id=$C->{p}{ID}&signature=$C->{p}{signature}\" $C->{selected}> $C->{p}{title} (#$C->{p}{ID})\n");}$this->out("</select>\n\n");if ( $C->{INPUT}{pack_id} ) {$this->out("&nbsp;&nbsp;\n<input type=\"button\" value=\"Set generated materials\" onClick=\"if (confirm(\'Are you sure you want to replace the existing promo materials for this package with the newly generated?\')) document.location=\'$C->{SYS}{URL}/action/Jin/Promogen/package.html?pack_id=$C->{INPUT}{pack_id}&signature=$C->{INPUT}{signature}\'\">\n");}$this->out("\n<hr>\n\n<center>\n<br><br>\n\n");if ( $C->{INPUT}{pack_id} ) {$this->out("");{my $G = (ref $this)->get("/package/promo.html", $this->{param}) or die "no skel /package/promo.html";my $ctx = $this->{C};my $out = $G->execute($ctx);$this->out(@$out) if $out;}$this->out("");} else {$this->out("	When you select a Package, its Promo materials will be displayed in this area.<br>\n	Then you can review it and decide if you want to replace it with the newly generated material.\n");}$this->out("\n</center>\n\n</div>\n\n");{my $G = (ref $this)->get("/headfoot/inner_footer.html", $this->{param}) or die "no skel /headfoot/inner_footer.html";my $ctx = $this->{C};my $out = $G->execute($ctx);$this->out(@$out) if $out;}$this->out("");}