Jump to content

problem with accept / reject or add comment in admin


alyousufi

Recommended Posts

Hello 

i am doing some change in VA by design and program a new admin skin 

i have problem which is i can't add/see pireps comment or do any action like reject / accept / delete the flight 

as well as i can't accept or reject any pending pilot . 

 

 

it was work fine without problem i am not sure this is because or .js file or jquery 

 

img1.png

 

 

when i click for example Log or comment it should open in box but i got this result  as shown 

 

 

b2.png

 

even accept or reject button dose not work >>

 

 

 

Link to comment
Share on other sites

7 minutes ago, servetas said:

What's on line 337 on your PIREPData.class.php file? Share with us line 337 plus a few lines before and after to understand what it is trying to parse.

Hi here from line

here from line 308 to 362

337 start with    $row->rawdata = unserialize($row->rawdata);

 

 

/**
	 * Get the number of reports for the last x  number of days
	 * Returns 1 row for every day, with the total number of
	 * reports per day
	 */
	public static function getCountsForDays($days = 7)
	{
		$sql = 'SELECT DISTINCT(DATE(submitdate)) AS submitdate,
					(SELECT COUNT(*) FROM '.TABLE_PREFIX.'pireps WHERE DATE(submitdate)=DATE(p.submitdate)) AS count
				FROM '.TABLE_PREFIX.'pireps p WHERE DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= p.submitdate';

		return DB::get_results($sql);
	}

	/**
	 * Get all of the details for a PIREP, including lat/long of the airports
	 */
	public static function getReportDetails($pirepid)
	{
		$sql = 'SELECT p.*, s.*, s.id AS scheduleid, p.route, p.route_details,
					u.pilotid, u.firstname, u.lastname, u.email, u.rank,
					dep.name as depname, dep.lat AS deplat, dep.lng AS deplng,
					arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng,
				    p.code, p.flightnum, p.depicao, p.arricao,  p.price AS price,
				    a.id as aircraftid, a.name as aircraft, a.registration, p.flighttime,
				    p.distance, UNIX_TIMESTAMP(p.submitdate) as submitdate, p.accepted, p.log
				FROM '.TABLE_PREFIX.'pilots u, '.TABLE_PREFIX.'pireps p
					LEFT JOIN '.TABLE_PREFIX.'airports AS dep ON dep.icao = p.depicao
					LEFT JOIN '.TABLE_PREFIX.'airports AS arr ON arr.icao = p.arricao
					LEFT JOIN '.TABLE_PREFIX.'aircraft a ON a.id = p.aircraft
					LEFT JOIN '.TABLE_PREFIX.'schedules s ON s.code = p.code AND s.flightnum = p.flightnum
				WHERE p.pilotid=u.pilotid AND p.pirepid='.$pirepid;

		$row = DB::get_row($sql);
		$row->rawdata = unserialize($row->rawdata);
	
		/* Do any specific replacements here */
		if($row)
		{
			/* If it's FSFlightKeeper, process the `rawdata` column, which contains
				array()'d copied of extra data that was sent by the ACARS. Run that
				through some templates which we've got. This can probably be generic-ized
				but it's fine now for FSFK. This can probably move through an outside 
				function, but seems OK to stay in getReportDetails() for now, since this
				is semi-intensive code here (the most expensive is populating the templates,
				and I wouldn't want to run it for EVERY PIREP which is called by the system.
			*/
			if($row->source == 'fsfk')
			{
				/* Do data stuff in the logs */
				$data = $row->rawdata;
				
				/* Process flight data */
				if(isset($data['FLIGHTDATA']))
				{
					Template::Set('data', $data['FLIGHTDATA']);
					$flightdata = Template::Get('fsfk_log_flightdata.tpl', true, true, true);
					$row->log.=$flightdata;
					unset($flightdata);
				}

 

Link to comment
Share on other sites

  • Moderators

Feel's like you are passing the pirepid or even the pilotid when we are talking about pilot's management through the url (get request) and not through a post request. Because of that, the pirepid is not parsed correctly. There should be something wrong with your javascript running on the admin center.

Link to comment
Share on other sites

1 minute ago, servetas said:

Feel's like you are passing the pirepid or even the pilotid when we are talking about pilot's management through the url (get request) and not through a post request. Because of that, the pirepid is not parsed correctly. There should be something wrong with your javascript running on the admin center.

 

 

i don't know maybe the problem with JAVA as u said

do you know any way that i can solve this problem .

 

i am using old db for my VA just for test in localhost.

once everything is fine i upload it to the host .

 

 

Link to comment
Share on other sites

  • Administrators

phpVMS 2.1.x works well with PHP up to version5.4

You will encounter errors with PHP 5.5 and above.

 

MySQL 6.35? Never heard of that version. phpVMS 2.1.x, phpVMS 5.5.2 will work with MySQL 5.6 and MariaDB 10.1 - issues reported with versions newer than that.

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...