VEHICLE DETAIL SHEET
  Basic Detail
 
Stock No
Chassis Code -
Chassis No
Year & Month
Year of Manufacture
Model
Color (Exterior) [".$line['colorno']."]"; ?>
Color (Interior)
Doors
Seats
Transimission
Fuel
Displacement (cc)
Mileage 0 ) { echo $line['carkm1']; } else { echo "-"; } } else { if ( $line['carkm2'] > 0 ) { echo $line['carkm2']; } else { echo "-"; } } ?> km
Condition Points
Drive Train WD
Drive Type Hand Drive
Engine Model
Engine Number
Body Type
Net Weight kg
Gross Weight kg
Price 0 ) { $curr = strtoupper(substr($SCURR,4)); $ex_query = " SELECT rateyen , rategbp , rateeur , rateyenfixedstk from exrate WHERE exdate <= NOW() ORDER by exdate desc LIMIT 1 "; $ex_result = pg_query($db,$ex_query); $ex_line = pg_fetch_array($ex_result, null, PGSQL_ASSOC); $rateyen = ($ex_line['rateyenfixedstk']/100) ; $rateyenfixedstk = ($ex_line['rateyenfixedstk']/100) ; $rategbp = ($ex_line['rategbp']/10000) + 0.0170; $rateeur = ($ex_line['rateeur']/10000) + 0.0200; if($curr=='YEN') $rateyen15 = ($ex_line['rateyenfixedstk']/100); else $rateyen15 = ($ex_line['rateyen']/100) ; if( $line[showsw] == 0 ) print 'Not Set Yet'; else { if ( $ZAAAGENTDEF != "FOB" && $ZAAAGENTDEF != "STOCKMSC" && $ZAAAGENTDEF != "STOCKMOL" && $ZAAAGENTDEF != "STOCKHOEGH" && ( $line['place'] == "DB" || $line['place'] == "TG" || $line['place'] == "SG" ) ) { $agentdef = "STOCKUNIT"; } else { $agentdef = $ZAAAGENTDEF; } $sSQL = " SELECT * FROM freight WHERE fplace='$line[place]' AND shipcountry='$ZAACOUNTRY' AND shipportname='$ZAAPORTNAME' AND agentname='$agentdef'"; $result2 = pg_query($db,$sSQL); if ( $line2 = pg_fetch_array($result2, null, PGSQL_ASSOC) ) { $baseunder = $line2['baseunder']; $baseover = $line2['baseover']; $baf = $line2['baf']; $ea_freight = $line2['ea_freight'] + $line2['ea_add_freight']; $frprice_type = $line2['frprice_type']; } pg_free_result($result2); $freight = 0; if( $SCURR == 'rateyen') { if($line['ivcurr'] == 'JPY' && $line['ivsellprice']) $line['fobpriceyen'] = $line['ivsellprice']; elseif($line['ivcurr'] == 'USD' && $line['ivsellprice']) $line['fobpriceyen'] = $line['ivsellprice'] * $rateyenfixedstk ; elseif($line['fobpriceyen'] == 0 ) $line['fobpriceyen'] = $line['fobpriced'] * $rateyenfixedstk ; $fobpriced = ($line['fobpriceyen'] + $cpfixedamountup) ; $fobpriceyen = $fobpriced; } else { $ex_rate_adj = getExRateAdjust($line['biddingprice'] ,$line['place1'] == 'ZA' ? 'auction' : 'stock' , $exrate_slabs); $rate_yen_adj = $rateyen15 + $ex_rate_adj; if($line['ivcurr'] == 'JPY' && $line['ivsellprice']) $fobpriced = $line['ivsellprice']/$rate_yen_adj; elseif($line['ivcurr'] == 'USD' && $line['ivsellprice']) $fobpriced = $line['ivsellprice']; else $fobpriced = ($line['fobpriceyen'] + $cpfixedamountup)/$rate_yen_adj; $fobpriceyen = $fobpriced * $rateyen15; } $priceup_percent = getPriceUP($fobpriceyen , $ZAAUPTYPE , $ZAAPRICEUP , $ZAAPRICESLABS); if($line['ivsellprice'] && $line['ivcurr']) { if ( $priceup_percent != 0 ) { $fobpriced = round(($fobpriced * 100 / (100 + $priceup_percent))); } } if ( $priceup_percent != 0 ) { $fobpriced = round(((100 + $priceup_percent) * $fobpriced) / 5000) * 50; } $fobpriced2 = $fobpriced; if ( $ZAADISCOUNTTYPE == 1 && $ZAAPERCENTDISCOUNT > 0 ) { $fobpriced2 = round(((100 - $ZAAPERCENTDISCOUNT) * $fobpriced) / 5000) * 50; } if ( $ZAADISCOUNTTYPE == 2 && $ZAAPERUNITDISCOUNT > 0 ) { $fobpriced2 = $fobpriced - $ZAAPERUNITDISCOUNT; } $m3 = $line['carwidth'] /1000.0; $m3 *= $line['carlength'] /1000.0; $m3 *= $line['carheight'] /1000.0; if ( $agentdef == "STOCKMSC") { if ( $line['place'] == "DB" || $line['place'] == "TG" || $line['place'] == "SG" ) { if ( $line['bodytype'] == 1) { $freight = $baseunder/100.0 + $baf/100.0; } else { $freight = $baseover/100.0 + $baf/100.0; } } else { if ( $m3 >= 20.0 ) { $freight = $baseover/100.0 + $baf/100.0; } elseif ( $m3 > 0 ) { $freight = $baseunder/100.0 + $baf/100.0; } } } elseif ( $agentdef == "STOCKUNIT" || $agentdef == 'TOYOFUJI' ) { if ( $m3 >= 20.0 ) $freight = ($baseover/100.0 ) ; else $freight = ($baseunder/100.0 ) ; } elseif ( $agentdef != "FOB" ) { if($line['place1'] == "ED" || $line['place1'] == "EA" ) { $freight = $ea_freight; } elseif ( $m3 > 0.0 && ($baseunder > 0 || $baseover > 0 )) { if ( $m3 >= 20.0 ) $freight = ($baseover/100.0 ) * $m3 + $baf/100.0 ; else $freight = ($baseunder/100.0 ) * $m3 + $baf/100.0 ; } } $freight = round($freight/10.0) * 10; if($frprice_type == 1) { $freight = $freight / $rateyenfixedstk; } if( $SCURR == 'rateyen') $fobpriced = $fobpriced / $rateyen; if ( !($ZAAWITHOUTPRICE == 1) && $line['deletedate'] == null ) { if ( $freight > 0 ) { echo "C&F ";//"(USD) : "; $car_price = $fobpriced + $freight ; if ( $fobpriced2 < $fobpriced ) { $car_price = $fobpriced2 + $freight ; } } else { echo "FOB ";//(USD) :"; $car_price = $fobpriced ; if ( $fobpriced2 < $fobpriced ) { $car_price = $fobpriced2 ; } } } } } ?> 0) $car_price = " PKR ".number_format($line_price[estsale])." "; elseif($line_price[pkr_price] > 0) $car_price = " PKR ".number_format($line[pkr_price])." "; print $car_price; ?>
 
$value ) { if ( substr($line['accesories'],$icc,1) == "1" ) { $feature_list[] = $value; } $icc++; } $icc = 0; foreach($OPTIONS_CHECK as $key => $value ) { if ( substr($line['options'],$icc,1) == "1" ) { $feature_list[] = $value; } $icc++; } $icc = 0; foreach($BODY_CHECK as $key => $value ) { if ( substr($line['details'],$icc,1) == "1" ) { $feature_list[] = $value; } $icc++; } asort($feature_list); $k =0; foreach($feature_list as $f) { $k++; if($k%2) $bgcol = "#E5DEDB"; else $bgcol = "#eceaea"; echo ""; if($k%4 == 0) print ""; } $jcc = count($feature_list); while(($jcc)%4 != 0 ) { $jcc++; if($jcc%2 ) $bgcol = "#E5DEDB"; else $bgcol = "#eceaea"; echo ""; } ?>
".substr($f,0,30)."
$i) { ?>
"; } ?>
'); if($debug) { print $html; die(); } set_time_limit(0); require_once("dompdf/dompdf_config.inc.php"); $dompdf = new DOMPDF(); $dompdf->set_paper("A4", "portrait"); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream($stock_no.' Detail Sheet.pdf',array('Attachment'=>0) ); ?>