<?php

$sEngines = '<section class="add-edit-subgroup engines" data-groupname="engines">';

	$sEngines .= '<div class="article-form">';
	
		
		$sEngines .= '<div class="engines-container" id="boat-engine-has-engine-container">			
			<div class="multiple">
				<label for="set-boat-engine-has-engine" class="switch">
					<input name="set-boat-engine-has-engine" class="checkboxinput" id="set-boat-engine-has-engine" type="checkbox" '.(!empty($oMijnOVIS->parsedDetails->boatEngineHasEngine) ? ' checked="checked"' : false).'>
					<span class="slider"></span>
				</label>	
			</div>
		</div>';
		
		$sEngines .= '<div class="select-radio-container engines-container'.(!empty($oMijnOVIS->parsedDetails->numberOfEngines) ? ' active' : false).'" id="engines-boat-container" data-field="engines-boat">			
			<div class="engines" id="sale-engines-boat-container">
				<label class="label-sub">Aantal motoren</label>
				<span class="open-sub'.(!empty($oMijnOVIS->parsedDetails->numberOfEngines) ? ' active' : false).'" id="open-sub-engines-boat" data-group="engines" data-field="engines-boat" data-title="motoren" data-default="Aantal motoren">'.(!empty($oMijnOVIS->parsedDetails->numberOfEngines) ? $oMijnOVIS->parsedDetails->numberOfEngines . ($oMijnOVIS->parsedDetails->numberOfEngines == '1' ? ' motor' : ' motoren') : 'Aantal motoren').'</span>';

				$sEngines .= '<div class="sub-container" id="sub-engines-boat">';
					
					for($i=1; $i<=2; $i++){
						$sEngines .= '<label for="set-engines-boat-'.strtolower($i).'">'.$i.($i == 1 ? ' motor' : ' motoren').'</label>';
						$sEngines .= '<input class="select-radio engines-boat-radio" type="checkbox" name="set-engines-boat" id="set-engines-boat-'.strtolower($i).'" value="'.strtolower($i).'"'.(strtolower($oMijnOVIS->parsedDetails->numberOfEngines) == strtolower($i) ? ' checked="checked"' : false).'>';						
					}
					
				$sEngines .= '</div>';					
						
			$sEngines .= '</div>
		</div>';
				
		$sEngines .= '<div class="select-radio-container engines-container'.(!empty($oMijnOVIS->parsedDetails->boatEngineFuel) ? ' active' : false).'" id="boat-engine-fuel-container"data-field="boat-engine-fuel">			
			<div class="engines" id="sale-boat-engine-fuel-container">
				<label class="label-sub">Brandstof</label>
				<span class="open-sub'.(!empty($oMijnOVIS->parsedDetails->boatEngineFuel) ? ' active' : false).'" id="open-sub-boat-engine-fuel" data-group="engines" data-field="boat-engine-fuel" data-title="brandstof" data-default="Brandstof">'.(!empty($oMijnOVIS->parsedDetails->boatEngineFuel) ? $oMijnOVIS->parsedDetails->boatEngineFuel : 'Brandstof').'</span>';

				$sEngines .= '<div class="sub-container" id="sub-boat-engine-fuel">';
										
					$aFuels = array('Diesel','Benzine','LPG','Elektrisch','Hybride');
					
					foreach($aFuels as $sFuel){
						$sEngines .= '<label for="set-boat-engine-fuel-'.strtolower($sFuel).'">'.$sFuel.'</label>';
						$sEngines .= '<input class="select-radio boat-engine-fuel-radio" type="checkbox" name="set-boat-engine-fuel" id="set-boat-engine-fuel-'.strtolower($sFuel).'" value="'.strtolower($sFuel).'"'.(strtolower($oMijnOVIS->parsedDetails->boatEngineFuel) == strtolower($sFuel) ? ' checked="checked"' : false).'>';						
					}
					
				$sEngines .= '</div>';					
						
			$sEngines .= '</div>
		</div>';
				
		$sEngines .= '<div class="select-radio-container engines-container'.(!empty($oMijnOVIS->parsedDetails->boatEngineType) ? ' active' : false).'" id="boat-engine-type-container" data-field="boat-engine-type">			
			<div class="engines" id="sale-boat-engine-type-container">
				<label class="label-sub">Motortype</label>
				<span class="open-sub'.(!empty($oMijnOVIS->parsedDetails->boatEngineType) ? ' active' : false).'" id="open-sub-boat-engine-type" data-group="engines" data-field="boat-engine-type" data-title="Motortype" data-default="Type">'.(!empty($oMijnOVIS->parsedDetails->boatEngineType) ? ucfirst($oMijnOVIS->parsedDetails->boatEngineType) : 'Type').'</span>';

				$sEngines .= '<div class="sub-container" id="sub-boat-engine-type">';
										
					$aEngineTypes = array('Binnenboord','Buitenboord');
					
					foreach($aEngineTypes as $sEngineType){
						$sEngines .= '<label for="set-boat-engine-type-'.strtolower($sEngineType).'">'.$sEngineType.'</label>';
						$sEngines .= '<input class="select-radio boat-engine-type-radio" type="checkbox" name="set-boat-engine-type" id="set-boat-engine-type-'.strtolower($sEngineType).'" value="'.strtolower($sEngineType).'"'.(strtolower($oMijnOVIS->parsedDetails->boatEngineType) == strtolower($sEngineType) ? ' checked="checked"' : false).'>';						
					}
					
				$sEngines .= '</div>';					
						
			$sEngines .= '</div>
		</div>';
				
		$sEngines .= '<div class="select-radio-container engines-container'.(!empty($oMijnOVIS->parsedDetails->boatEngineStartsystem) ? ' active' : false).'" id="boat-engine-startsystem-container" data-field="boat-engine-startsystem">			
			<div class="engines" id="sale-boat-engine-startsystem-container">
				<label class="label-sub">startsysteem</label>
				<span class="open-sub'.(!empty($oMijnOVIS->parsedDetails->boatEngineStartsystem) ? ' active' : false).'" id="open-sub-boat-engine-startsystem" data-group="engines" data-field="boat-engine-startsystem" data-title="startsysteem" data-default="Startsysteem">'.(!empty($oMijnOVIS->parsedDetails->boatEngineStartsystem) ? ucfirst($oMijnOVIS->parsedDetails->boatEngineStartsystem) : 'Startsysteem').'</span>';

				$sEngines .= '<div class="sub-container" id="sub-boat-engine-startsystem">';
										
					$aEngineTypes = array('Elektrisch','Handmatig','Handmatig en elektrisch');
					
					foreach($aEngineTypes as $sEngineType){
						$sEngines .= '<label for="set-boat-engine-startsystem-'.strtolower($sEngineType).'">'.$sEngineType.'</label>';
						$sEngines .= '<input class="select-radio boat-engine-startsystem-radio" type="checkbox" name="set-boat-engine-startsystem" id="set-boat-engine-startsystem-'.strtolower($sEngineType).'" value="'.strtolower($sEngineType).'"'.(strtolower($oMijnOVIS->parsedDetails->boatEngineStartsystem) == strtolower($sEngineType) ? ' checked="checked"' : false).'>';						
					}
					
				$sEngines .= '</div>';					
						
			$sEngines .= '</div>
		</div>';
		
		//if($_SERVER['REMOTE_ADDR'] == '95.170.68.38'){
			$sEngines .= '<div class="select-radio-container engines-container'.(!empty($oMijnOVIS->parsedDetails->boatEngineBrand) ? ' active' : false).'" id="boat-engine-brand-container" data-field="boat-engine-brand">			
				<div class="engines" id="sale-boat-engine-brand-container">
					<label class="label-sub">Merk</label>
					<span class="open-sub'.(!empty($oMijnOVIS->parsedDetails->boatEngineBrand) ? ' active' : false).'" id="open-sub-boat-engine-brand" data-group="engines" data-field="boat-engine-brand" data-title="Motormerk" data-default="Merk">'.(!empty($oMijnOVIS->parsedDetails->boatEngineBrand) ? ucfirst($oMijnOVIS->parsedDetails->boatEngineBrand) : 'Merk').'</span>';

					$sEngines .= '<div class="sub-container" id="sub-boat-engine-brand">';
					
						$sEngines .= '<div id="engine-brand-search" class="engine-brand-search"><input autocomplete="false" type="text" name="engine-brand-search-input" id="engine-brand-search-input" value="" placeholder="Zoek in merken"></div>';
							
						$aEngineBrands = array('Archimedes','Beta Marine','Bukh','Caterpillar','Chrysler','Craftsman','Cummins','Diemmax','Elco','ePropulsion','ETM-TEC','Evinrude','Felor','Fischer Panda','Fladen Marine','FNM Marine','Force','Haswing','Hidea','Honda','Johnson','Kawasaki','Lehr','Lombardini Marine','Mariner','Mercruiser','Mercury','Minn Kota','Motorguide','Nanni','Nimarine','Onbekend','PARSUN','Perkins','Quicksilver','Rhino','Rinker','Rotax','SABB','Selva','Sevylor','Sole','Suzuki','Talamex','TEMO','Tohatsu','Tomking','Tomos','Torqeedo','Vetus','Volvo','Volvo Penta','Watersnake','West Bend','Westerbeke','Yamaha','Yanmar','Zarro Excellent');
						
						foreach($aEngineBrands as $sEngineBrand){
							$sEngines .= '<label class="engine-brand-label" for="set-boat-engine-brand-'.strtolower($sEngineBrand).'">'.$sEngineBrand.'</label>';
							$sEngines .= '<input class="select-radio boat-engine-brand-radio" type="checkbox" name="set-boat-engine-brand" id="set-boat-engine-brand-'.strtolower($sEngineBrand).'" value="'.strtolower($sEngineBrand).'"'.(strtolower($oMijnOVIS->parsedDetails->boatEngineBrand) == strtolower($sEngineBrand) ? ' checked="checked"' : false).'>';						
						}
						
					$sEngines .= '</div>';					
							
				$sEngines .= '</div>
			</div>';	
		/*} else {
		
			$sEngines .= '<div class="engines-container" id="boat-engine-brand-container">			
				<div class="engines" id="sale-boat-engine-brand-container">
					<label for="set-boat-engine-brand">Merk</label>
					<input autocomplete="false" class="text-input auto-save" type="text" name="set-boat-engine-brand" id="set-boat-engine-brand" value="'.($oMijnOVIS->parsedDetails->boatEngineBrand).'">			
				</div>
			</div>';
		}*/
		
		$sEngines .= '<div class="engines-container" id="boat-engine-model-container">			
			<div class="engines" id="sale-boat-engine-model-container">
				<label for="set-boat-engine-model">Model</label>
				<input autocomplete="false" class="text-input auto-save" type="text" name="set-boat-engine-model" id="set-boat-engine-model" value="'.($oMijnOVIS->parsedDetails->boatEngineModel).'">			
			</div>
		</div>';
		
		$sEngines .= '<div class="engines-container" id="boat-engine-power-container">			
			<div class="engines" id="sale-boat-engine-power-container">
				<label for="set-boat-engine-power">Vermogen (pk)</label>
				<input autocomplete="false" class="text-input auto-save" type="number" name="set-boat-engine-power" inputmode="decimal" maxlength="10" id="set-boat-engine-power" value="'.($oMijnOVIS->parsedDetails->boatEnginePower).'">			
			</div>
		</div>';
		
		$sEngines .= '<div class="engines-container" id="boat-engine-accu-container">			
			<div class="engines" id="sale-boat-engine-accu-container">
				<label for="set-boat-engine-accu">Accu (V)</label>
				<input autocomplete="false" class="text-input auto-save" type="text" name="set-boat-engine-accu" maxlength="10" id="set-boat-engine-accu" value="'.($oMijnOVIS->parsedDetails->boatEngineAccu).'">			
			</div>
		</div>';
		
		$sEngines .= '<div class="engines-container" id="boat-engine-hours-container">			
			<div class="engines" id="sale-boat-engine-hours-container">
				<label for="set-boat-engine-hours">Draaiuren</label>
				<input autocomplete="false" class="text-input number-input auto-save" type="tel" name="set-boat-engine-hours" inputmode="numeric" maxlength="10" id="set-boat-engine-hours" value="'.($oMijnOVIS->parsedDetails->boatEngineHours).'">			
			</div>
		</div>';
		
		$sEngines .= '<div class="engines-container" id="boat-engine-cruising-speed-container">			
			<div class="engines" id="sale-boat-engine-cruising-speed-container">
				<label for="set-boat-engine-cruising-speed">Kruissnelheid (knp)</label>
				<input autocomplete="false" class="text-input number-input auto-save" type="tel" name="set-boat-engine-cruising-speed" inputmode="numeric" maxlength="10" id="set-boat-engine-cruising-speed" value="'.(isset($oMijnOVIS->parsedDetails->boatEngineCruisingSpeed) ? $oMijnOVIS->parsedDetails->boatEngineCruisingSpeed : '').'">			
			</div>
		</div>';
		
		$sEngines .= '<div class="engines-container" id="boat-engine-tank-capacity-container">			
			<div class="engines" id="sale-boat-engine-tank-capacity-container">
				<label for="set-boat-engine-tank-capacity">Tankinhoud (liter)</label>
				<input autocomplete="false" class="text-input number-input auto-save" type="tel" name="set-boat-engine-tank-capacity" inputmode="numeric" maxlength="10" id="set-boat-engine-tank-capacity" value="'.($oMijnOVIS->parsedDetails->boatEngineTankCapacity).'">			
			</div>
		</div>';
		
		$sEngines .= '<div class="engines-container" id="boat-engine-fastsailing-container">			
			<div class="multiple">
				<label for="set-boat-engine-fastsailing" class="switch">
					<input name="set-boat-engine-fastsailing" class="checkboxinput" id="set-boat-engine-fastsailing" type="checkbox" '.(!empty($oMijnOVIS->parsedDetails->boatEngineFastSailing) ? ' checked="checked"' : false).'>
					<span class="slider"></span>
				</label>	
			</div>
		</div>';				
		
	$sEngines .= '</div>';

$sEngines .= '</section>';

return $sEngines;