commit 622d7366a1b98e20e3e080048f641340e0646e61
parent 7ab93c428f0d7f903962f4568660a0f6bf0d26c3
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Wed,  5 Nov 2014 22:15:03 -0700
gen_svg: query the vendors in the database for colors
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gen_svg.pl b/gen_svg.pl
@@ -61,8 +61,9 @@ while (my ($part_num, $description) = $parts_sth->fetchrow_array()) {
 	$vendor_sth->execute($part_num);
 	while (my ($vendor) = $vendor_sth->fetchrow_array()) {
 		vprintf("\t$vendor: ");
-		# XXX: This should be read from DB
-		my $vendor_color = "#$cfg->{vendors}{$vendor}{color}";
+
+		$query = "select color from vendors where name = ?";
+		my ($vendor_color) = $dbh->selectrow_array($query, undef, $vendor);
 
 		my (@xs, @ys);
 		$point_sth->execute($part_num, $vendor);