<?php require_once 'protect.php'; ?>
<form name="forma" method="post">
<input type="hidden" name="memberid" value="<?php echo $memberid ?>">
<input type="hidden" name="email" value="<?php echo $email ?>">
<input type="hidden" name="password" value="<?php echo $password ?>">
<input type="hidden" name="email1" value="<?php echo $email1 ?>">
<input type="hidden" name="password1" value="<?php echo $password1 ?>">
<input type="hidden" name="rowslog" value="<?php echo $rowslog ?>">

<!--transport -->
<?php 
$result7 = $mysqli->query("SELECT id FROM transport WHERE startprice!='0.00'");
$nrrowstr = mysqli_num_rows($result7);
?>
<?php if($nrrowstr>0) { ?>
<div class="margbottom10">
<?php echo $texttransportcost ?>
</div>
<div class="titles"> 
<?php echo $textdeliverycost ?> 
<select name="trid">
<?php
$result7 = $mysqli->query("SELECT * FROM transport WHERE publish='yes' ORDER BY priority, name");
while($row = $result7->fetch_array()) {	
$trid=$row['id'];
$destination=$row['name'];
$startcost=$row['startprice'];
$startweightprice=$row['startweightprice'];
$kgcost=$row['kgprice'];

if ($totalweight<=$siteweight && $startweightprice!='0.00') {
$startcost=$startweightprice;
}

$totalkgcost = $kgcost * ($totalweight-$siteweight);
if ($totalweight<$siteweight) { $totalkgcost=0; }
$totaltcost = $startcost + $totalkgcost + $pacprice;
$totaltcost = number_format($totaltcost,2);
?>
<option value="<?php echo $trid ?>"> 
<?php echo $destination ?> &raquo; <?php echo $totaltcost ?>  &#8364; 
</option>
<?php } ?>
</select>
</div>

<hr>
<?php } ?>
<!--transport -->

<!--order info --> 
<div class="titles"><?php echo $textorderinfo ?></div> 
<hr>
<div class="divfloat1">
<?php if($rowslog==0) { ?>
<div><input type="email" name="email" id="email" value="<?php echo $email1 ?>" placeholder="Email*" size="40" maxlength="60" required></div>
<div><input type="password" name="password" id="password" placeholder="Password*" size="40" maxlength="30" required></div>
<?php } ?>

<div><label for="name" class="hlabel"><?php echo $fieldname ?>*</label>
<input type="text" name="name" id="name" value="<?php echo $name ?>" placeholder="<?php echo $fieldname ?>*" size="40" maxlength="100" required></div>
<div><label for="profession" class="hlabel"><?php echo $fieldprof ?></label>
<input type="text" name="profession" id="profession" value="<?php echo $profession ?>" placeholder="<?php echo $fieldprof ?>" size="18" maxlength="100" class="inputauto">
<?php echo $textprivate ?>
<input type="radio" name="ritem" id="ritem" value="<?php echo $textprivate ?>" checked>
<?php echo $textdealer ?>
<input type="radio" name="ritem" id="ritem" value="<?php echo $textdealer ?>">
<?php echo $textother ?>
<input type="radio" name="ritem" id="ritem" value="<?php echo $textother ?>"></div>
<div><label for="tel" class="hlabel"><?php echo $fieldtel ?>*</label>
<input type="text" name="tel" id="tel" value="<?php echo $tel ?>" placeholder="<?php echo $fieldtel ?>*" size="40" maxlength="50" required></div>
<div><label for="fax" class="hlabel">Fax</label>
<input type="text" name="fax" id="fax" value="<?php echo $fax ?>" placeholder="Fax" size="40" maxlength="50"></div>
<div>
<span class="color3"><?php echo $textnewsletter ?> &raquo;</span> &nbsp;
<input type="hidden" name="newsletter" value="0" />
<?php if ($active==0) { ?>
<input type="checkbox" name="newsletter" value="1" />
<?php }else{?>
<input name="newsletter" type="checkbox" value="1" checked />
<?php } ?>
</div>
</div>

<div class="divfloat2">
<div><label for="address" class="hlabel"><?php echo $fieldaddress ?>*</label>
<input type="text" name="address" id="address" value="<?php echo $address ?>" placeholder="<?php echo $fieldaddress ?>*" size="40" maxlength="100" required></div>
<div><label for="region" class="hlabel"><?php echo $fieldregion ?>*</label>
<input type="text" name="region" id="region" value="<?php echo $region ?>" placeholder="<?php echo $fieldregion ?>*" size="40" maxlength="50" required></div>
<div>
<label for="city" class="hlabel"><?php echo $fieldcity ?>*</label>
<input type="text" name="city" id="city" value="<?php echo $city ?>" placeholder="<?php echo $fieldcity ?>*" size="20" maxlength="50" class="inputauto" required>
<label for="postcode" class="hlabel"><?php echo $fieldpostcode ?>*</label>
<input type="text" name="postcode" id="postcode" value="<?php echo $postcode ?>" placeholder="<?php echo $fieldpostcode ?>*" size="20" maxlength="25" class="inputauto" required>
</div>
<div><label for="country" class="hlabel"><?php echo $fieldcountry ?>*</label>
<input type="text" name="country" id="country" value="<?php echo $country ?>" placeholder="<?php echo $fieldcountry ?>*" size="40" maxlength="50" required></div>
<div>
<label for="taxnr" class="hlabel"><?php echo $fieldtaxnr ?></label>
<input type="text" name="taxnr" id="taxnr" value="<?php echo $taxnr ?>" placeholder="<?php echo $fieldtaxnr ?>" size="20" maxlength="30" class="inputauto">
<label for="taxoffice" class="hlabel"><?php echo $fieldtaxoffice ?></label>
<input type="text" name="taxoffice" id="taxoffice" value="<?php echo $taxoffice ?>" placeholder="<?php echo $fieldtaxoffice ?>" size="20" maxlength="30" class="inputauto">
</div>
<div><label for="receipt1"><?php echo $fieldreceipt ?></label>
<input type="radio" name="receipt" id="receipt1" value="<?php echo $fieldreceipt ?>" checked>
&nbsp; 
<label for="receipt2"><?php echo $fieldinvoice ?></label>
<input type="radio" name="receipt" id="receipt1" value="<?php echo $fieldinvoice ?>"></div>
</div>
<div class="cleared"></div>

<div class="divrequired color2">* <?php echo $fieldrequired ?></div>
<hr>
<?php if ($inquiry==0) { ?>

<!--delivery info --> 
<div class="titles padtop20"><?php echo $textdelivery ?></div>
<?php echo $textdelivery2 ?>
<hr>
<div class="divfloat1">
<div><label for="send_name" class="hlabel"><?php echo $fieldname ?></label>
<input type="text" name="send_name" id="send_name" placeholder="<?php echo $fieldname ?>" size="40" maxlength="100"></div>
<div><label for="send_address" class="hlabel"><?php echo $fieldaddress ?></label>
<input type="text" name="send_address" id="send_address" placeholder="<?php echo $fieldaddress ?>" size="40" maxlength="100"></div> 
</div>

<div class="divfloat2">
<div>
<label for="send_city" class="hlabel"><?php echo $fieldcity ?></label>
<input type="text" name="send_city" id="send_city" placeholder="<?php echo $fieldcity ?>" size="20" maxlength="50" class="inputauto">
<label for="send_postcode" class="hlabel"><?php echo $fieldpostcode ?></label>
<input type="text" name="send_postcode" id="send_postcode" placeholder="<?php echo $fieldpostcode ?>" size="20" maxlength="25" class="inputauto">
</div>
<div><label for="send_region" class="hlabel"><?php echo $fieldregion ?></label>
<input type="text" name="send_region" id="send_region" placeholder="<?php echo $fieldregion ?>" size="17" maxlength="50">
<label class="hide">note<input type="text" name="notes" id="notes" size="1" maxlength="20" class="formsn"></label></div>
</div>
<div class="cleared"></div>
<hr>
<label for="comments" class="hlabel"><?php echo $fieldcomments ?></label>
<textarea name="comments" id="comments" placeholder="<?php echo $fieldcomments ?>" rows="5" cols="100"></textarea>
<hr>
<div class="titles padtop20"><?php echo $payway ?></div>
<hr>
<table class="tablew">
<tr>
<td class="titles"><?php echo $fieldname8 ?></td>
</tr>
<tr> 
<td>
<?php if ($payment==1 OR $payurl) { ?>
<label for="paytype1"><?php echo $paycard ?></label>  <input type="radio" name="paytype" id="paytype1" value="card" checked>
<hr>
<?php } ?>
<?php if ($paydelivery) { ?>
<label for="paytype2"><?php echo $paydelivery ?></label> <input type="radio" name="paytype" id="paytype2" value="<?php echo $paydelivery ?>"<?php if ($payment==0 AND $payurl==''){ echo " checked"; } ?>>
<hr>
<?php } ?>
<?php if ($paybank) { ?>
<label for="paytype3"><?php echo $paybank ?></label> <input type="radio" name="paytype" id="paytype3" value="<?php echo $paybank ?>"> 
<hr>
<?php } ?>
<?php if ($payagreement) { ?>
<label for="paytype3"><?php echo $payagreement ?></label> <input type="radio" name="paytype" id="paytype3" value="<?php echo $payagreement ?>">
<hr>
<?php } ?>
</td>
</tr>

<?php if ($textperiod AND $totalprice1>500.00) { ?>
<tr> 
<td>
<label for="period"><?php echo $textperiod ?></label>  
<select name="period" id="period" class="formperiod">
<option value="0">1</option>
<?php if ( $totalprice1 >500.00 ){?>
<option value="2">2</option>
<?php } ?>
<?php if ( $totalprice1 >1000.00 ){?>
<option value="4">4</option>
<?php } ?>
<?php if ( $totalprice1 >1500.00 ){?>
<option value="7">7</option>
<?php } ?>
<?php if ( $totalprice1 >2000.00 ){?>
<option value="10">10</option>
<?php } ?>
</select>
 </td>
</tr>
<?php } ?>
</table>
<?php } ?>

<input type="hidden" name="terms" value="1"> 
<?php if ($checkterms) { ?>
<input type="hidden" name="terms" value="0"> 
<input type="checkbox" name="terms" value="1" required>
<?php echo $checkterms ?>
<?php } ?>

<div class="text-center padtop20">
<button type="submit" name="submit" class="button buttonsubmit"><span class="icon fa-check"></span> <?php echo $buttonorder ?></button>
<a href="cart" class="button buttoncancel"><span class="icon fa-close"></span> <?php echo $buttoncancel ?></a>
</div>
</form>