Checklist character encoding fixes.

Mon, 20 Jan 2020 20:19:08 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 20 Jan 2020 20:19:08 +0100
changeset 599
1460c92927b2
parent 598
890a532701e8
child 600
c136dd22f662

Checklist character encoding fixes.

www/prod_checklist.php file | annotate | diff | comparison | revisions
--- a/www/prod_checklist.php	Sat Jan 18 19:45:22 2020 +0100
+++ b/www/prod_checklist.php	Mon Jan 20 20:19:08 2020 +0100
@@ -342,16 +342,18 @@
 		$this->Checkheader('Gist enten');
 		$dry = 0;
 		foreach ($yeasts as $item) {
+			$name       = iconv('UTF-8','windows-1252',$item['y_name']);
+                        $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
 			if ($item['y_use'] == 0) { // primary
 				if ($item['y_form'] == 0) { // Liquid
-					$this->Checkline(($item['y_amount']*$factor).' pak '.$item['y_product_id'].', '.$item['y_name'].' gist');
+					$this->Checkline(($item['y_amount']*$factor).' pak '.$product_id.', '.$name.' gist');
 				} else if ($item['y_form'] == 1 || $item['y_form'] == 6) { // Dry
-					$s = sprintf("%.1f",$item['y_amount']*$factor*1000).' gram '.$item['y_product_id'].', '.$item['y_name'];
+					$s = sprintf("%.1f",$item['y_amount']*$factor*1000).' gram '.$product_id.', '.$name;
 					$s .= ' gist';
 					$dry += $item['y_amount']*$factor*10000;
 					$this->Checkline($s);
 				} else { // Slant/Culture/Frozen/Bottle
-					$s = sprintf("%.0f",$item['y_amount']*$factor*1000).' ml '.$item['y_product_id'].', '.$item['y_name'].' gist';
+					$s = sprintf("%.0f",$item['y_amount']*$factor*1000).' ml '.$product_id.', '.$name.' gist';
 					$this->Checkline($s);
 				}
 				if ($item['y_type'] == 6 && floatval($item['y_pitch_temperature']) > 0) {
@@ -445,14 +447,16 @@
                 }
 		foreach ($yeasts as $item4) {
                         if ($item4['y_use'] == 1) {
+				$name       = iconv('UTF-8','windows-1252',$item4['y_name']);
+                                $product_id = iconv('UTF-8','windows-1252',$item4['y_product_id']);
 				if ($item4['y_form'] == 0) { // Liquid
-                                        $this->Checkline(($item4['y_amount']*$factor).' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)');
+                                        $this->Checkline(($item4['y_amount']*$factor).' pak '.$product_id.', '.$name.' gist (eventueel met starter)');
                                 } else if ($item['y_form'] == 1) { // Dry
-                                        $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name'];
+                                        $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram '.$product_id.', '.$name;
                                         $s .= ' gist';
                                         $this->Checkline($s);
                                 } else { // Slant/Culture/Frozen/Bottle
-                                        $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)';
+                                        $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml '.$product_id.', '.$name.' gist (eventueel met starter)';
                                         $this->Checkline($s);
                                 }
 			}
@@ -512,13 +516,15 @@
                 }
 		foreach ($yeasts as $item4) {
                         if ($item4['y_use'] == 2) {
+				$name       = iconv('UTF-8','windows-1252',$item4['y_name']);
+                                $product_id = iconv('UTF-8','windows-1252',$item4['y_product_id']);
                                 if ($item4['y_form'] == 0) { // Liquid
-                                        $s = ($item4['y_amount']*$factor).' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)';
+                                        $s = ($item4['y_amount']*$factor).' pak '.$product_id.', '.$name.' gist (eventueel met starter)';
                                 } else if ($item4['y_form'] == 1) { // Dry
-                                        $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name'];
+                                        $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram '.$product_id.', '.$name;
                                         $s .= ' gist';
                                 } else { // Slant/Culture/Frozen/Bottle
-                                        $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name'];
+                                        $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml '.$product_id.', '.$name;
 					$s .= ' gist (eventueel met starter)';
                                 }
 				$this->Checkline($s);
@@ -581,12 +587,14 @@
                 }
 		foreach ($yeasts as $item4) {
                         if ($item4['y_use'] == 3) {
+				$name       = iconv('UTF-8','windows-1252',$item4['y_name']);
+                        	$product_id = iconv('UTF-8','windows-1252',$item4['y_product_id']);
                                 if ($item4['y_form'] == 0) { // Liquid
-                                        $s = '`'.$item4['y_product_id'].', '.$item4['y_name'];
+                                        $s = '`'.$product_id.', '.$name;
                                 } else if ($item4['y_form'] == 1) { // Dry
-                                        $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram `'.$item4['y_product_id'].', '.$item4['y_name'];
+                                        $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram `'.$product_id.', '.$name;
                                 } else { // Slant/Culture/Frozen/Bottle
-                                        $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml `'.$item4['y_product_id'].', '.$item4['y_name'];
+                                        $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml `'.$product_id.', '.$name;
                                 }
 				$s .= '` als bottelgist';
 				$this->Checkline($s);
@@ -622,7 +630,8 @@
 		$this->Cell(0,5,$prdate,0,1,'L');
 		$this->SetX(45);
 		$this->Cell(17,5,'Stijl:',0,0,'L');
-		$this->Cell(0,5,$row['st_name'],0,1,'L');
+		$st_name = iconv('UTF-8','windows-1252',$row['st_name']);
+		$this->Cell(0,5,$st_name,0,1,'L');
 		$this->SetX(45);
 		$this->Cell(17,5,'Fase:',0,0,'L');
 		$this->Cell(0,5,$stage[$row['stage']],0,1,'L');

mercurial