www/rec_print.php

changeset 232
daf2d9d6fa18
parent 231
9881453a49b3
child 233
14a84d42031d
equal deleted inserted replaced
231:9881453a49b3 232:daf2d9d6fa18
250 $this->AddCol(18,'Product','L'); 250 $this->AddCol(18,'Product','L');
251 $this->AddCol($vul,'Gist','L'); 251 $this->AddCol($vul,'Gist','L');
252 $this->AddCol(20,'Gebruik','L'); 252 $this->AddCol(20,'Gebruik','L');
253 $this->AddCol(15,'Attn','R'); 253 $this->AddCol(15,'Attn','R');
254 $this->AddCol(22,'Vorm','L'); 254 $this->AddCol(22,'Vorm','L');
255 $this->AddCol(18,'Gram','R'); 255 $this->AddCol(18,'Hoeveel','R');
256 $this->AddCol(20,'Prijs','R'); 256 $this->AddCol(20,'Prijs','R');
257 257
258 $cMargin=$this->cMargin; 258 $cMargin=$this->cMargin;
259 $this->cMargin=2; 259 $this->cMargin=2;
260 $this->TableX=$this->lMargin; 260 $this->TableX=$this->lMargin;
267 $arr = json_decode($row['json_yeasts'], true); 267 $arr = json_decode($row['json_yeasts'], true);
268 foreach($arr as $item) { //foreach element in $arr 268 foreach($arr as $item) { //foreach element in $arr
269 $name = iconv('UTF-8','windows-1252',$item['y_name']); 269 $name = iconv('UTF-8','windows-1252',$item['y_name']);
270 $laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']); 270 $laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']);
271 $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']); 271 $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
272 $amount = floatval($item['y_amount']) * 1000;
273 $costg = floatval($item['y_cost']);
274 $attenuation = floatval($item['y_attenuation']); 272 $attenuation = floatval($item['y_attenuation']);
275 $cost = $amount * $costg; 273 $cost = floatval($item['y_amount']) * floatval($item['y_cost']);
276 $cost_yeasts += $cost; 274 $cost_yeasts += $cost;
277 275
278 if ($item['y_use'] == 0) // Primary 276 if ($item['y_use'] == 0) // Primary
279 $svg = $attenuation; 277 $svg = $attenuation;
280 278
279 if ($item['y_form'] == 0) // Liquid
280 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
281 else if ($item['y_form'] == 1) // Dry
282 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr";
283 else
284 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
281 $this->Cell(27,5,$laboratory,0,0,'L',true); 285 $this->Cell(27,5,$laboratory,0,0,'L',true);
282 $this->Cell(18,5,$product_id,0,0,'L',true); 286 $this->Cell(18,5,$product_id,0,0,'L',true);
283 $this->Cell($vul,5,$name,0,0,'L',true); 287 $this->Cell($vul,5,$name,0,0,'L',true);
284 $this->Cell(20,5,$yeastuse[$item['y_use']],0,0,'L',true); 288 $this->Cell(20,5,$yeastuse[$item['y_use']],0,0,'L',true);
285 $this->Cell(15,5,sprintf("%.1f%%",$attenuation),0,0,'R',true); 289 $this->Cell(15,5,sprintf("%.1f%%",$attenuation),0,0,'R',true);
286 $this->Cell(22,5,$yeastform[$item['y_form']],0,0,'L',true); 290 $this->Cell(22,5,$yeastform[$item['y_form']],0,0,'L',true);
287 $this->Cell(18,5,sprintf("%.1f",$amount),0,0,'R',true); 291 $this->Cell(18,5,$amount,0,0,'R',true);
288 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); 292 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
289 $this->Ln(); 293 $this->Ln();
290 } 294 }
291 295
292 $this->SetFillColor(210,245,255); 296 $this->SetFillColor(210,245,255);

mercurial