<div class='row' id='get_product'>
	<div class='form-group col-12 col-lg-6'>
		<label class='form-label border-start border-5 border-primary ps-1'>Product ( Equipment / System )</label>
		<select name='productid' class='form-select form-select-sm select2' id='productid'>
			<option value=''>-- Choose one --</option>
<?php													
	foreach ($products as $data) {
		$qproductid = $data['productid'];
		$qproductname = $data['productname'];
		$qproductnumber = $data['productnumber'];
		$qproductlocationenddate = $data['locationenddate'];
		$qproductactive = $data['active'];
		if($qproductlocationenddate == NULL){
			if($productid == $qproductid) { echo "<option value='$qproductid' selected>$qproductname ( SN# $qproductnumber )</option>"; }
			else {
				if ($qproductactive == 2) {
					echo "<option value='$qproductid' disabled>$qproductname ( SN# $qproductnumber )</option>";
				} else {
					echo "<option value='$qproductid'>$qproductname ( SN# $qproductnumber )</option>";
				}
			}
		}
	}
?>

		</select>
	</div>
	<div class='form-group col-12 col-lg-6' id='software_version'>
		<label class='form-label border-start border-5 border-primary ps-1'>Software Version</label>
		<input type='text' class='form-control form-control-sm' name='swversion' value='<?=$swversion;?>' />
	</div>
</div>
<script>
$('#productid').on('change', function (e) {
	var optionSelected = $("option:selected", this);
	var valueSelected = this.value;
	console.log(valueSelected);
	$('.dest').val('P|'+valueSelected).change();
});
</script>