cdawg Posted May 28, 2014 Report Posted May 28, 2014 hello all, i have been searching for hours with no luck....can anybody tell me how i can change the flighttime_stamp from when a pirep is being submitted into the data base instead of reading as time it just reads as numbers....for example when its inserted into the database it reads 5:00....i would like for it to read just 5 so i need to know what file i need to change so that when its going into the database it just reads the number and what in the file do i need to change? thanks so much Quote
Administrators simpilot Posted May 28, 2014 Administrators Report Posted May 28, 2014 The database table is set up as a time field, so even if you submit a single number it is going to format it to the 00:00:00 format. The data is submitted in the SubmitPIREP function in the PIREPS.php module controller. You are starting to hack into core files that will be overwritten if you ever update though. I am assuming that you are trying to display only a number of hours and no minutes or seconds so possibly a better solution would be to just break up the data using an explode statement and then just displaying the hours piece. Something like; $hours = explode(':', $hoursvariable); echo $hours[0]; Quote
cdawg Posted May 28, 2014 Author Report Posted May 28, 2014 thanks for the response simpilot......i'm just a basic coding guy where would i put the code? Quote
Administrators simpilot Posted May 29, 2014 Administrators Report Posted May 29, 2014 Most desireable would be to do it in your controller and load the data into a new variable set and pass that to the template, but you can do it right in the template where you want it to display as well. It is not an actual database call at that point so the php functions being in the template is not a big deal at that point in my opinion. Quote
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.