OK. will try updating now.
Below is my code. just getting a bunch of variables at the start......
Then the code is pretty standard.
Any help would be greatly appreciated! Thankyou.
<?php
$array = ($_GET ['hidden_second']);
foreach ($array as $details)
{
$contacts = explode(",", $details);
}
$contact_name = $contacts[0];
$contact_company = $contacts[1];
$contact_email = $contacts[2];
$contact_number = $contacts[3];
$contact_project = $contacts[4];
$input_array=($_GET['hidden']);
foreach ($input_array as $arrays)
{
$bits = explode(",", $arrays);
}
$type = $bits[0];
if ($type == 'Wall'){
$walllist = array("Timber Cladding on battens<img src='img/a.jpg'>","Ventilated Cavity<img src='img/b.jpg'>" );
$material = $bits[1];
$size = $bits[3];
$depth = "Stud";
if ($material == 'Brick') {
$mainimage = "<img src='img/wallbrick.jpg' alt='Brick Wall' />";
switch ($size) {
case "200mm":
$uvalue=0.17;
$csfh='Level 4';
break;
case "220mm":
$uvalue=0.16;
$csfh='Level 4';
break;
case "240mm":
$uvalue=0.15;
$csfh='Level 4';
break;
case "280mm":
$uvalue=0.13;
$csfh='Level 5';
break;
case "300mm":
$uvalue=0.12;
$csfh='Level 5';
break;
case "360mm":
$uvalue=0.11;
$csfh='Level 6';
break;
case "400mm":
$uvalue=0.10;
$csfh='Level 6';
break;
}
}else {
$mainimage = "<img src='img/walltimber.jpg' alt='Wall with Timber' />";
switch ($size) {
case "200mm":
$uvalue=0.19;
$csfh='Level 4';
break;
case "220mm":
$uvalue=0.17;
$csfh='Level 4';
break;
case "240mm":
$uvalue=0.16;
$csfh='Level 4';
break;
case "280mm":
$uvalue=0.14;
$csfh='Level 5';
break;
case "300mm":
$uvalue=0.13;
$csfh='Level 5';
break;
case "360mm":
$uvalue=0.11;
$csfh='Level 6';
break;
case "400mm":
$uvalue=0.10;
$csfh='Level 6';
break;
}
}
}
elseif ($type == 'Roof'){
$walllist = array("<p>Slates / Tyles</p><img src='img/a.jpg' alt='guide' />", "<p>Warmcel</p><img src='img/b.jpg' alt='guide' />", "<p>Services batten</p><img src='img/c.jpg' alt='guide' />", "<p>Plaster board</p><img src='img/d.jpg' alt='guide' />", "<p>Timber board (6mm)</p><img src='img/e.jpg' alt='guide' />", "<p>Vapour control layer</p><img src='img/f.jpg' alt='guide' />", "<p>Battens</p><img src='img/g.jpg' alt='guide' />", "<p>Rafters</p><img src='img/h.jpg' alt='guide' />", "<p>Counter battens (50mm) depth</p><img src='img/i.jpg' alt='guide' />", "<p>Roof tile / breather membrane <br />with small elongation value</p><img src='img/j.jpg' alt='guide' />" );
$size = $bits[1];
$mainimage = "<img src='img/roof.jpg' alt='roog image' />";
$depth = "Rafter";
switch ($size) {
case "200mm":
$uvalue=0.18;
$csfh='Level 4';
break;
case "220mm":
$uvalue=0.16;
$csfh='Level 4';
break;
case "240mm":
$uvalue=0.15;
$csfh='Level 4';
break;
case "280mm":
$uvalue=0.13;
$csfh='Level 5';
break;
case "300mm":
$uvalue=0.12;
$csfh='Level 5';
break;
case "360mm":
$uvalue=0.10;
$csfh='Level 6';
break;
case "400mm":
$uvalue=0.10;
$csfh='Level 6';
break;
}
}
else {
$walllist = array("<p>22mm Chipboard / Weyroc</p><img src='img/a.jpg' alt='guide' />", "<p>RB400 membrane</p><img src='img/b.jpg' alt='guide' />", "<p>I-Beam</p><img src='img/c.jpg' alt='guide' />", "<p>Warmcel</p><img src='img/d.jpg' alt='guide' />", "<p>Timberline</p><img src='img/e.jpg' alt='guide' />", "<p>Damp proof membrane</p><img src='img/f.jpg' alt='guide' />", "<p>Concrete</p><img src='img/g.jpg' alt='guide' />" );
$floortype = $bits[1];
$depth = "Joist";
if ($floortype == 'Ground') {
$mainimage = "<img src='img/floorconcrete.jpg' alt='Concrete Ground' / >";
$floorsize = $bits[4];
if ($floorsize == 'Floor Size: 7 x 7' || 'Floor Size: 8 x 8') {
$size = $bits[6];
switch ($size) {
case "200mm":
$uvalue=0.16;
$csfh='Level 4';
break;
case "220mm":
$uvalue=0.15;
$csfh='Level 4';
break;
case "240mm":
$uvalue=0.14;
$csfh='Level 4';
break;
case "280mm":
$uvalue=0.12;
$csfh='Level 5';
break;
case "300mm":
$uvalue=0.11;
$csfh='Level 5';
break;
case "360mm":
$uvalue=0.10;
$csfh='Level 6';
break;
}
}else if ($floorsize == 'Floor Size: 9 x 9' || 'Floor Size: 10 x 10') {
$size = $bits[6];
switch ($size) {
case "200mm":
$uvalue=0.15;
$csfh='Level 4';
break;
case "220mm":
$uvalue=0.14;
$csfh='Level 4';
break;
case "240mm":
$uvalue=0.13;
$csfh='Level 4';
break;
case "280mm":
$uvalue=0.12;
$csfh='Level 5';
break;
case "300mm":
$uvalue=0.11;
$csfh='Level 5';
break;
case "360mm":
$uvalue=0.10;
$csfh='Level 6';
break;
}
}
}else {
$mainimage = "<img src='img/floorsuspended.jpg' alt='Suspended Floor' />";
$floorsize = $bits[4];
if ($floorsize == 'Floor Size: 7 x 7' || 'Floor Size: 8 x 8') {
$size = $bits[6];
switch ($size) {
case "200mm":
$uvalue=0.16;
$csfh='Level 4';
break;
case "220mm":
$uvalue=0.15;
$csfh='Level 4';
break;
case "240mm":
$uvalue=0.14;
$csfh='Level 4';
break;
case "280mm":
$uvalue=0.12;
$csfh='Level 5';
break;
case "300mm":
$uvalue=0.11;
$csfh='Level 5';
break;
case "360mm":
$uvalue=0.10;
$csfh='Level 6';
break;
}
}else if ($floorsize == 'Floor Size: 9 x 9' || 'Floor Size: 10 x 10') {
$size = $bits[6];
switch ($size) {
case "200mm":
$uvalue=0.15;
$csfh='Level 4';
break;
case "220mm":
$uvalue=0.14;
$csfh='Level 4';
break;
case "240mm":
$uvalue=0.13;
$csfh='Level 4';
break;
case "280mm":
$uvalue=0.12;
$csfh='Level 5';
break;
case "300mm":
$uvalue=0.11;
$csfh='Level 5';
break;
case "360mm":
$uvalue=0.10;
$csfh='Level 6';
break;
}
}
}
}
?>
<?php
require_once("dompdf/dompdf_config.inc.php");
?>
<html>
<head>
<title>Tradis - Build your system</title>
</head>
<body>
<div class="left">
<table border="1">
<tr>
<th>Header</th>
</tr>
<tr>
<td rowspan="7"><img src="top.jpg"></td><td colspan="4"><?php print $contact_project; ?></td>
</tr>
<tr>
<td colspan="4"><?php print $contact_company; ?></td>
</tr>
<tr>
<td colspan="4">Name: <?php print $contact_name; ?></td>
</tr>
<tr>
<td colspan="2">Tel:<?php print $contact_number; ?></td><td colspan="2">Email: <?php print $contact_email;?></td>
</tr>
<tr>
<td>'U' Value</td><td>Can help to meet</td><td>Stud Depth</td><td>Overall wall depth</td>
</tr>
<tr>
<td>test</td><td>test</td><td>test</td><td>test</td>
</tr>
<tr>
<td>test</td><td>test</td><td>test</td><td>test</td>
</tr>
<tr>
<td>
<p>hello</p><img src="a.jpg"><br>
</td>
<td>
<p>hello</p><img src="a.jpg"><br>
</td>
<td id="mainimage" colspan="4">
</td>
</tr>
</table>
</html>
<?php
file_put_contents('newtest.html', ob_get_contents());
$dompdf = new DOMPDF();
$dompdf->load_html(file_get_contents('newtest.html'));
$dompdf->render();
$dompdf->stream("please.pdf");
?>