package IIf26cdbca874dd70b054248faf2c1683c; use strict 'vars'; use base qw/II720d6e18aa34327713eb014408fc9144/; use IIa7e18da9a1870a23e5d1573a274b9cd7; use II4212c07ddfb1652c969722f1a6817994; use II601fa70f090cadcaa1dcddfa68ea7567; BEGIN{*IIf26cdbca874dd70b054248faf2c1683c::lIIllIIIIlIIIIIl=\%{pack('H6','007e18')^'E0N'};*IIf26cdbca874dd70b054248faf2c1683c::IlllllIllllIlIlI=\&{pack('H24','2b2c595b790f41716027386e')^'FM05C52IWE@Z'};$IIf26cdbca874dd70b054248faf2c1683c::lIIlllIIIIIllIll=pack('H18','01170c1117181e1665')^'ICXAHPQE1';$IIf26cdbca874dd70b054248faf2c1683c::IIIlIlIIIlIIIIll=pack('H12','19087a06741a')^'SA4J=Y'};sub mnt_customize { my ($class, $C) = @_; my $in = $C->{INPUT}; my $package = II720d6e18aa34327713eb014408fc9144::IllIIIIlIIlllIll($II4212c07ddfb1652c969722f1a6817994::lllIlllIlllllIlI{$IIf26cdbca874dd70b054248faf2c1683c::lIIlllIIIIIllIll},33,$II4212c07ddfb1652c969722f1a6817994::lllIlllIlllllIlI{$II4212c07ddfb1652c969722f1a6817994::IllllIllIIllIlIl})->get($in->{pack_id}); II4212c07ddfb1652c969722f1a6817994::IlIIIllIlIlIIIIl($IIa7e18da9a1870a23e5d1573a274b9cd7::lllIIIlIlIIlllll{$II720d6e18aa34327713eb014408fc9144::lIIIIllIIllIIIlI},1005,$IIa7e18da9a1870a23e5d1573a274b9cd7::lllIIIlIlIIlllll{$II720d6e18aa34327713eb014408fc9144::lIIlllIllIlIllll})->true(($in->{pack_id} && $package && $package->stored), 'invalid link'); return unless $package->{aff_customtags}; my $dbc = II4212c07ddfb1652c969722f1a6817994::lIlIlIlIllIIIllI($II720d6e18aa34327713eb014408fc9144::IIllIllllIlllIIl{$IIf26cdbca874dd70b054248faf2c1683c::lIIlllIIIIIllIll},994,$II720d6e18aa34327713eb014408fc9144::IIllIllllIlllIIl{$IIf26cdbca874dd70b054248faf2c1683c::IIIlIlIIIlIIIIll})->get; my $aff_id = $C->{User}{id}; my @admin_tag = @{$package->getAffCustomTags}; my %admin_tag = map { $_->{id} => $_->{def_value} } @admin_tag; my %aff_tag = $dbc->getMap("select tag_id, tag_value from jin_customtag_aff where pack_id=$package->{id} and find_in_set(tag_id,'$package->{aff_customtags}') and aff_user_id=$aff_id"); if ($in->{save}) { $C->{just_saved} = 1; my %custom_tag =  map { my ($id) = $_ =~ /^tag(\d+)$/i; $id => $in->{"tag$id"}; } grep { /^tag\d+$/i } keys %{$in}; for my $id (keys %custom_tag) { if ($aff_tag{$id}) { $aff_tag{$id} = $custom_tag{$id} || $admin_tag{$id}; $dbc->do("update jin_customtag_aff set tag_value=? where pack_id=? and tag_id=? and aff_user_id=?", [$aff_tag{$id}, $package->{id}, $id, $aff_id]); } elsif ($custom_tag{$id}) { $aff_tag{$id} = $custom_tag{$id}; $dbc->do("insert into jin_customtag_aff set pack_id=?, tag_id=?, aff_user_id=?, tag_value=?", [$package->{id}, $id, $aff_id, $custom_tag{$id}]); } } } $C->{Package} = $package; $C->{Tags} = [map { $_->{def_value} = $aff_tag{$_->{id}} if $aff_tag{$_->{id}}; $_; } @admin_tag]; return; } 1; 