use strict;
return sub
{
	my $dbh = shift;

	
	my $sth = $dbh->prepare("select id,aweber_data from jin_package where aweber_data!='' and aweber_data like '%Order.orderLink%'");
	$sth->execute;
	
	while (my $row = $sth->fetchrow_hashref)
	{
		for ($row->{aweber_data})
		{
			s!#\{Order.orderLink\}!#{Sale.thankLink}!g;
		}
		
		$dbh->do("update jin_package SET aweber_data=".$dbh->quote($row->{aweber_data})." where id=$row->{id}");

	}


	my $items_css = 'table.items
{
	background-color: #555555;
}

th.items
{
	font: bold 14px Verdana, Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	background-color: #555555;
}

td.items
{
	font: normal 12px Verdana, Arial, Helvetica, sans-serif;
	background-color: #FFFFFF;
	padding: 3px;
}
';
	
	my $sth = $dbh->prepare("select id, template from jin_template where name='css_supl'");
	$sth->execute;
	
	while (my $row = $sth->fetchrow_hashref)
	{
		for ($row->{template})
		{
			s!(.jinOrderSectionTitle\r?\n\{\r?\n)!${1}\tfont-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;\r\n!s;
			
			s!(input\.jinOrderButton\s*\{[^\}]+\})!$1\r\n\r\n$items_css!s
				unless /td\.items/;
		}
		
		$dbh->do("UPDATE jin_template SET template=".$dbh->quote($row->{template})." WHERE id=$row->{id}");

	}

	return;
};