lukasc24 Posted June 17, 2020 Report Share Posted June 17, 2020 Hi, if I want to allow pilots to enter a custom amount of miles (if they have a multiplier or something) 1. would this work? $sql = 'SELECT SUM(distance) AS distance FROM '.TABLE_PREFIX.'pireps WHERE pilotid = '.$pilotid; $info = DB::get_row($sql); echo $info->distance; and 2. how could I get a PIREP field that would change the total miles for pilots thanks Quote Link to comment Share on other sites More sharing options...
PikoSim Posted June 17, 2020 Report Share Posted June 17, 2020 Hi lukas! Can explain briefly what you mean by custom miles? Is it based on searching ? Meaning pilots will put their miles input and use for searching? 2nd, if you want to get a total miles of a pirep field you need to do maths. Never disturb the current database. Quote Link to comment Share on other sites More sharing options...
lukasc24 Posted June 18, 2020 Author Report Share Posted June 18, 2020 Hello, What I mean by that is, right now, my CC is just using the standard distance calculations, meaning the mile you earn just com from how far the 2 airports are, I want pilots to be able to log flights with the exact amount of miles they flew (if their fpl added a couple hundred miles or if the flight has a multiplier like with an event or something like that) Thanks Quote Link to comment Share on other sites More sharing options...
PikoSim Posted June 18, 2020 Report Share Posted June 18, 2020 Multiplier is another database i suppose. You need to code the multiplier along with the pireps of the pilots. To assign if the schedule has a multiplier is another system. If you meant pilots adding the number of miles manually, just use insert sql or update. However, if you really want all those multiplier, and all it is better to build another system or module to handle the multiplier and miles Quote Link to comment Share on other sites More sharing options...
lukasc24 Posted June 18, 2020 Author Report Share Posted June 18, 2020 How can I insert sql or update, im new to all of this so sorry if this is an easy question to answer Quote Link to comment Share on other sites More sharing options...
PikoSim Posted June 18, 2020 Report Share Posted June 18, 2020 The insert sql stuff is done using code and push information into database. If you have difficulties doing you can either learn or ask someone to develop for you. The thing is i dont think this system is one or 2 lines of code 😜 Quote Link to comment Share on other sites More sharing options...
Strider Posted June 18, 2020 Report Share Posted June 18, 2020 It is a quite complicated system you want, as you would have to link the sum to the navdata table and get it to figure out the distance between waypoints and add them up together. You would also have to hope it doesn't get the wrong waypoint and give a wrong outcome. You would have to talk to the maker of simbrief how he has gotten it to work, this could be a fairly long piece of code at the end of the day. and if you are new to it, I would suggest staying with what you have at the moment, and learn more about it and code simpler modules first. Quote Link to comment Share on other sites More sharing options...
PikoSim Posted June 18, 2020 Report Share Posted June 18, 2020 Not really. You can actually dont use navdata. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.