Once I created, I am going to fetch the ofp. Directing to create but getting “Fatal Exception:Missing Parameters!” error.
I am not even sure if I can express my problem correctly with “coder” words
<!-- Dispatch to SimBrief -->
<script>
function dispatchToSimBrief() {
let userid = "{{ user.simbrief_id }}";
let static_id = "{{ user.static_id }}";
let origin = "{{ departure_airport.icao }}";
let destination = "{{ arrival_airport.icao }}";
let type = "{{ selected_aircraft.internal_id }}";
let fltnum = "{{ flight_number }}";
let callsign = "{{ callsign }}";
let api_key = MY_API_KEY;
let units = "KGS";
let airline = "INK";
console.log("DEBUG: Checking Parameters Before Dispatch");
console.log("UserID:", userid);
console.log("Static ID:", static_id);
console.log("Origin:", origin);
console.log("Destination:", destination);
console.log("Type (Internal ID):", type);
console.log("Flight Number:", fltnum);
console.log("Callsign:", callsign);
console.log("API Key:", api_key);
console.log("Airline:", airline);
if (!userid || !static_id || !origin || !destination || !type || !fltnum || !callsign) {
alert("Error: Missing required parameters. Please check your flight details.");
return;
}
let simbriefURL = `https://www.simbrief.com/ofp/ofp.loader.api.php?airline=${airline}&userid=${userid}&static_id=${static_id}&orig=${origin}&dest=${destination}&type=${type}&fltnum=${fltnum}&callsign=${callsign}&units=KGS`;
console.log("SimBrief Dispatch URL:", simbriefURL);
window.open(simbriefURL, "_blank");
}
</script>
<div class="center-align" style="margin-top: 20px;">
<button class="btn orange darken-2" onclick="dispatchToSimBrief();">
Dispatch to SimBrief
</button>
</div>
<!-- Dispatch to SimBrief Ended -->
Checked on console and URL, they are all correct. But not sure all are necessary. Actualy my concerns are: orig, dest, type, fltnum,callsign
Above codes may be nonsense, but this is how 50yrs old noob coding guy asks
Thanks for your help in advance.