Jump to content

Admin Panel Broken


WiltshireAirlines

Recommended Posts

Hello everyone,

So far, I've found phpVMS to be amazing. It's really well coded, except for one problem. The admin panel. Before I get started, let me say that the admin panel USED to work fine but no longer functions properly.

First, the navigation menu (on the left side) is all messed up. Things are everywhere. Here's a mini-screenshot:

http://tinypic.com/r/ojl655/8(go here if the image doesn't appear) http://tinypic.com/r/ojl655/8

Second, and probably most importantly, the pilot list is completely empty! Yes, I do have pilots, and PIREP's - none of them show in the admin panel. However, all pilots and pireps DO SHOW ON THE WEBSITE. I know the info is in the database - why is it not showing up on the admin panel?

ALSO: I get this error:

Open Flash Chart

JSON Parse Error [syntax Error]

Error at character 0, line 1:

0: <br />

I think that's the main culprit.

Thanks for all help in advance!

---

Bill

Link to comment
Share on other sites

I have some code that loads the stuff into the chart...if anybody could help me please :)

public function getpilotsjson()
{
 $page = $this->get->page; // get the requested page
 $limit = $this->get->rows; // get how many rows we want to have into the grid
 $sidx = $this->get->sidx; // get index row - i.e. user click to sort
 $sord = $this->get->sord; // get the direction
 if(!$sidx) $sidx =1;

 /* Do the search using jqGrid */
 $where = array();
 if($this->get->_search == 'true')
 {
  $searchstr = jqgrid::strip($this->get->filters);
  $where_string = jqgrid::constructWhere($searchstr);

  # Append to our search, add 1=1 since it comes with AND
  # from above
  $where[] = "1=1 {$where_string}";
 }

 Config::Set('PILOT_ORDER_BY', "{$sidx} {$sord}");

 # Do a search without the limits so we can find how many records
 $count = count(PilotData::findPilots($where));

 if($count > 0)
 {
  $total_pages = ceil($count/$limit);
 }
 else
 {
  $total_pages = 0;
 }

 if ($page > $total_pages)
 {
  $page = $total_pages;
 }

 $start = $limit * $page - $limit; // do not put $limit*($page - 1)
 if ($start < 0)
 {
  $start = 0;
 }

 # And finally do a search with the limits
 $allpilots = PilotData::findPilots($where, $limit, $start);
 if(!$allpilots)
 {
  $allpilots = array();
 }

 # Form the json header
 $json = array(
  'page' => $page,
  'total' => $total_pages,
  'records' => $count,
  'rows' => array()
 );

 # Add each row to the above array
 foreach($allpilots as $row)
 {
  $status = ($row->retired==0) ? 'Active' : 'Retired';
  $location = '<img src="'.Countries::getCountryImage($row->location).'" alt="'.$row->location.'" />';
  $edit = '<a href="'.adminurl('/pilotadmin/viewpilots?action=viewoptions&pilotid='.$row->pilotid).'">Edit</a>';

  $tmp = array(
   'id' => $row->id,
   'cell' => array(
 # Each column, in order
 $row->id,
 $row->firstname,
 $row->lastname,
 $row->email,
 $location,
 $status,
 $row->rank,
 $row->totalflights,
 $row->totalhours,
 $row->lastip,
 $edit,
   ),
  );

  $json['rows'][] = $tmp;
 }

 header("Content-type: text/x-json");
 echo json_encode($json);
}

Link to comment
Share on other sites

  • 4 weeks later...

Ok really that is not helpful Joeri, especially as a staff member. This is clearly a problem for a number of people and you obviously have a setup that is working. Would it not be possible for you and Wiltshire to compare your files and see where there are any differences.

Does the development team really have no idea what is causing the issue or how to resolve it?

If I had a working version myself, I would compare every file and try to zone in on the differences. I would also see if I could pack up my working files and pass them to others. I might even say what version of php i'm running with my working files.

Or I might just offer nothing but sarcasm, but why would anyone do that eh :P

Link to comment
Share on other sites

Hi Guys,

Can you let me know which phpVMS version are you downloading in ordee to install it on my server and check if there is any error?

Thanks in advance...

Hi, I downloaded the version from github that you posted in the link you provided. Not sure where to look for the version but is this right? Version v2.1.934-170-g5ca803a

I tried already using the download from the phpvms website which obviously didn't work so I downloaded the "master" version you suggested. The version of php on my hosting is 5.5 I think. They only just recently updated it.

As for Simpilot's 2 cents, if I am running the latest version of php and the version of phpvms is old, do I just lump it or is there any way to work around? This doesn't seem to be a new issue and goes back to early 2013 as far as I can see. Whilst it doesn't stop the actual site from working and pilots booking flights etc, it would be great to sort so admins can view stats otherwise not sure how else we keep up to date.

Thanks for the responses guys, I'm learning but I'm slow. (that sounded so much better in my head!)

Link to comment
Share on other sites

  • Administrators

The OFC package is third party. I do not know when/if they will be updating it to work with newer versions of PHP. As far as phpVMS is concerned, it was written when php 5.3 was the latest greatest thing and has not been adapted to the newer versions of PHP. I do not know if it will ever be re-written in whole. There are a lot of folks that have contributed minor fixes on the version on the GitHub account that address certain issues with using it with later versions of PHP that you can download from there instead of the official download.

Link to comment
Share on other sites

  • Administrators

As it is an open source project it can be up to the community to update it. Nabeel has in the past merged updates and fixes through pull requests into the beta version on GitHub. Anyone can create a pull request with their changes. Unfortunately open source projects more often than not end up in this situation, life happens and priorities change.

Link to comment
Share on other sites

Yes I get that, I run four gaming servers and a virtual airline, two businesses and somewhere in amongst that is my family! :P Still I would have thought phpvms was big enough to have a whole bunch of admins helping keep it up-to-date and error free. If I knew how to code I would happily lend a hand. :)

Whilst I think of it, the Open Flash issue I had has been resolved. It turns out, it's not to do with PHP version. Rather than explain, I'll link my other post which has a fix of sorts that worked for me.

http://forum.phpvms.net/topic/8192-solution-strict-standards-errornew-php/

Hope it's of some use to someone.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...