Dear Forum Members and experts once again need little help for displaying my all schedules using javascript the option already implemented in PhpVms but in Admin section only i need it for pilots now so can anyone just explain me a bit how to work with it and display all of my schedules on schedules page.
here is the code for schedules pager in admin section need little tweaking i think to display schedules need some expert advise on this.
No Mark i wanted to show it on Main Website/Schedules Page for pilots in place of schedules_result.tpl i have copied all same code which is in ops_schedules.tpl file for admin section but now dont understand how to show my schedules in it how to fetch them from database?
Should i have to create another .tpl files or .php file or i can use schedules.php file for it?
as you can see here this is the working code of admin section of jgrid table in operations.php file this code of the part is for schedules adding or deleting or showing in admin section.
EDIT —> CODE Removed
We need to match the above code i think what you say?
i was getting ERROR while using this code in my schedules page
public function getSchedulesJSON()
{
echo json_encode((object)SchedulesData::GetSchedules());
}
ERRROR
[b]Parse error[/b]: syntax error, unexpected T_PUBLIC in [b]/home/ahmad/public_html/EmiratesVirtual/core/modules/Schedules/Schedules.php[/b] on line [b]244[/b]
i was getting ERROR while using this code in my schedules page
public function getSchedulesJSON()
{
echo json_encode((object)SchedulesData::GetSchedules());
}
ERRROR
Parse error: syntax error, unexpected T_PUBLIC in /home/ahmad/public_html/EmiratesVirtual/core/modules/Schedules/Schedules.php on line 244
What version are you currently using? Also your php specs?
[public] keyword is throwing an error which would maybe tell me the author has dis-abled them somehow(for your version of phpvms) or you are using an earlier version of php.
I also noted “jsonp” is incorrect, “json” is required in this case, both are valid but for different methods.
{note: might be 1 more typo, just got this new laptop and keyboard is driving me nuts, oh dear! }
YEP the error was resolved now there is no ERROR on the schedules page but no result showing empty tables?
Yep you need to create that table script or simply copy and paste from the admin one into wherever you are using the script, ie: schedules.tpl, correct?
Pkav i tried it wih no luck yet changed the URL but nothing showing in the table? no records to show coming there…
Ok I may have overlooked something regarding ‘jqgrid’, leave it with me.
As you can see from then only test schedule i have its returning correctly, building the grid is just something I will have to read up on as im not familiar with it
0 // This is the only index being returned which is true index[0]
Object { id="1", code="CAV", more...}
id
"1"
code
"CAV"
flightnum
"8783O"
depicao
"EIDW"
arricao
"KJFK"
route
""
route_details
""
aircraft
"B747-400"
flightlevel
"220"
distance
"2758.49"
deptime
"06:00"
arrtime
"12:00"
flighttime
"6"
daysofweek
"0"
price
"400"
flighttype
"P"
timesflown
"0"
notes
""
enabled
"1"
bidid
"0"
aircraftid
"1"
registration
"897UJKJ"
aircraft_minrank
"0"
aircraftlevel
"0"
depname
"Dublin Airport"
deplat
"53.4213"
deplng
"-6.27007"
arrname
"Kennedy International"
arrlat
"40.6398"
arrlng
"-73.7787"
Now the Current Update is i am able to show the data from database into jgrid table but now i wanted to add option like
Add to biid
Pilot brief
route
and the restriction for pilots to fly only those aircraft and schedule which they are assigned to fly according to the ranks set at backened… can some one help me in this now?