Jump to content
Sava

Hub Transfer Request v1.0

Recommended Posts

You did something wrong check in core/modules folder is there a folder named LOA ? if not then the installation is not correct

Share this post


Link to post
Share on other sites

the LOA module is installed...the HubTranfer module is installed in the correct directory but it doesn't works....

after 3 installations it worked!!!

<_< <_< <_<

SOLVED

Share this post


Link to post
Share on other sites

Hi,

I have those codes on front page :

Deprecated: mysql_query(): The mysql extension is deprecated and will
be removed in the future: use mysqli or PDO instead in
/home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php
on line 9

Warning: mysql_query(): Access denied for user
'pilotomeraslan'@'localhost' (using password: NO) in
/home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php
on line 9

Warning: mysql_query(): A link to the server could not be established
in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php
on line 9

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean
given in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php
on line 10

and on admin page

Deprecated: mysql_affected_rows(): The mysql extension is deprecated
and will be removed in the future: use mysqli or PDO instead in
/home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php
on line 86

Warning: mysql_affected_rows(): Access denied for user
'pilotomeraslan'@'localhost' (using password: NO) in
/home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php
on line 86

Warning: mysql_affected_rows(): A link to the server could not be
established in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php
on line 86

Deprecated: mysql_affected_rows(): The mysql extension is deprecated
and will be removed in the future: use mysqli or PDO instead in
/home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php
on line 90

Warning: mysql_affected_rows(): Access denied for user
'pilotomeraslan'@'localhost' (using password: NO) in
/home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php
on line 90

Warning: mysql_affected_rows(): A link to the server could not be
established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php
on line 90

please help thanks.

Share this post


Link to post
Share on other sites
On 1/7/2014 at 1:00 PM, joeri said:

to all with the error try the following in your commen change the husstransfer class the part for the get all requests to the following $sql = "SELECT h.pilotid, p.firstname, p.lastname, p.email, p.hub, h.hub_initial, h.hub_req, h.date_submitted, h.reason, h.status FROM ".TABLE_PREFIX."hubtransfer h LEFT JOIN ".TABLE_PREFIX."pilots p ON p.pilotid = h.pilotid";

$ret = DB::get_results($sql);

return $ret;

this fixzd mine thanks to the help of manuel from crazy creatives

This an option still?

Share this post


Link to post
Share on other sites
On 12/17/2016 at 1:26 PM, OmerAslan said:

Deprecated: mysql_affected_rows():

 

On 12/17/2016 at 1:26 PM, OmerAslan said:

Deprecated: mysql_query(): The mysql extension is deprecated

That is the explanation. Those functions are garbage now. They are useless. Have ti step up to sqli or PDO one of the two.

If the last post I quoted don't fix this, the module file needs rewritten as was done for the LoA module that had the exact same issue.

Share this post


Link to post
Share on other sites
On 12/17/2016 at 1:26 PM, OmerAslan said:

Deprecated: mysql_affected_rows():

 

On 12/17/2016 at 1:26 PM, OmerAslan said:

Deprecated: mysql_query(): The mysql extension is deprecated

That is the explanation. Those functions are garbage now. They are useless. Have ti step up to sqli or PDO one of the two.

If the last post I quoted don't fix this, the module file needs rewritten as was done for the LoA module that had the exact same issue.

 

On second thought, that last fix will not work. it is the same identical code that is in the file direct from github. I'm gonna get back on the side and wait for Sava. My skills are not that great and I don't want to stear anyone in the wrong direction.

Share this post


Link to post
Share on other sites
1 hour ago, TAV1702 said:

 

That is the explanation. Those functions are garbage now. They are useless. Have ti step up to sqli or PDO one of the two.

If the last post I quoted don't fix this, the module file needs rewritten as was done for the LoA module that had the exact same issue.

 

On second thought, that last fix will not work. it is the same identical code that is in the file direct from github. I'm gonna get back on the side and wait for Sava. My skills are not that great and I don't want to stear anyone in the wrong direction.

So if i understand you correctly, we have to wait for a while right?

Share this post


Link to post
Share on other sites

Probably will.

I am right now as we speak looking in to it. I got all errors fixed but one. I am trying to figure out how Sava fixed it in the LoA Module. I am real close. Just not close enough to say here is a fix. My php skills kind of suck so if I even remotely come close to getting it working, that was a win  lol. Now if I fix this last error and it all works, I'm going to celebrate with a beer!

Share this post


Link to post
Share on other sites

I think I might have it. I am final testing now.

**EDIT**

Please understand,m i am NOT a php expert. I don't pretend to be and not sure if my changes are safe to use live. I don't know php Security very much. With that said, I am willing to share my code changes that made this module work. I STRONGLY urge you to have someone look in to the changes to make sure they are safe to use. With that said, this module now works 100% A-ok on my website.

Admin/modules/HubTransfer/HubTransfer.php

Find:

public function delete()
        {
            $id = $this->get->id;
            $get_msg   = HubTransferData::delete($id);
            if (mysql_affected_rows() == -1)
                {
                $requests = HubTransferData::GetAllRequests(array());
                $this->set('all', $requests);
                $this->set('msg', 'Request wasn\'t de;eted. Please use the phpVMS forums to get support.');
                $this->render('hubtransfer/hubtransfer_admin_index.tpl');

                }else
                {
                $requests = HubTransferData::GetAllRequests(array());
                $this->set('all', $requests);
                $this->set('msg', 'Request successfuly deleted.');
                $this->render('hubtransfer/hubtransfer_admin_index.tpl');
                 }
        }

Change To:

public function delete()
        {
            $id = $this->get->id;
            $get_msg   = HubTransferData::delete($id);
                $this->set('msg', 'Request was de;eted.');
                $this->render('hubtransfer/hubtransfer_admin_index.php');
        }

Save File!

Open Core/Common/HubTransferDataClass.php

Find:

$query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$pilotid'";
		$sql = mysql_query($query);
		$count = mysql_num_rows($sql);
		return $count;

Change To:

$query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$pilotid'";
		$count = DB::num_rows(DB::get_results($query)); 
		return $count;

Find:

public static function delete($id)
	{
		$sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$id'";
		$query = DB::query($sql);
		return mysql_affected_rows();
	}

Change To:

public static function delete($id)
	{
		$sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$id'";
		$query = DB::query($sql);
		return $count;
	}

Save File!

And I believe that will get you in the game. All my functions work as they should including pending, delete and approve and all email functions.

 

Use at your own risk! If someone comes along who actually knows what they are talking about, please feel free to correct me. This was just a honest try is all. if i am wrong I apologize.

Edited by TAV1702
Added Info

Share this post


Link to post
Share on other sites

Just confirming that those errors are mainly to do with the core/common/HubTransferData.class.php

Delete function should look like this now

public static function delete($id) {
  $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$id'";
  DB::query($sql);
}

And the new CheckRequest function

public static function CheckRequest($pilotid)  {
  $pilotid = intval($pilotid);
  $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$pilotid'";
  $count = DB::num_rows(DB::get_results($query));
  return $count;
}

Or if that last function doesn't work, try swapping out the DB::get_results for DB::get_row as I can't tell whether it is being used to get one or more results.

Edited by web541

Share this post


Link to post
Share on other sites

Ah ya ninja posted me  lol. I just edited my post with the fixes I had to do to make it work. please feel free to look at my post and tell me how wrong it is  lol but it actually works.

Share this post


Link to post
Share on other sites
24 minutes ago, web541 said:

Just confirming that those errors are mainly to do with the core/common/HubTransferData.class.php

Delete function should look like this now


public static function delete($id) {
  $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$id'";
  DB::query($sql);
}

And the new CheckRequest function


public static function CheckRequest($pilotid)  {
  $pilotid = intval($pilotid);
  $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$pilotid'";
  $count = DB::num_rows(DB::get_results($query));
  return $count;
}

Or if that last function doesn't work, try swapping out the DB::get_results for DB::get_row as I can't tell whether it is being used to get one or more results.

yes it works. only i get this code on admin page but not important at all... Thanks a lot.

Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

 

Edited by OmerAslan

Share this post


Link to post
Share on other sites
27 minutes ago, TAV1702 said:

Ah ya ninja posted me  lol. I just edited my post with the fixes I had to do to make it work. please feel free to look at my post and tell me how wrong it is  lol but it actually works.

No, not a problem at all, everyone has a right to contribute and coding can be done in many different ways, some cleaner than others, some not so clean, but in the end it still works and that's what counts! I have also made my revisions on my Github account if you want to take a look.

17 minutes ago, OmerAslan said:

yes it works. only i get this code on admin page but not important at all... Thanks a lot.


Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

 

Feel free to change out your admin/modules/HubTransfer/HubTransfer.php file for mine here and that should fix the problem above.

I have just removed the mysql_affected_rows check as you really don't need to know whether it has been deleted or not, because in the end it will show up (or not if it has just been deleted) in the AllRequests list anyway.

Edited by web541
  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, web541 said:

Just confirming that those errors are mainly to do with the core/common/HubTransferData.class.php

Delete function should look like this now


public static function delete($id) {
  $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$id'";
  DB::query($sql);
}

And the new CheckRequest function


public static function CheckRequest($pilotid)  {
  $pilotid = intval($pilotid);
  $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$pilotid'";
  $count = DB::num_rows(DB::get_results($query));
  return $count;
}

Or if that last function doesn't work, try swapping out the DB::get_results for DB::get_row as I can't tell whether it is being used to get one or more results.

yes it works. only i get this code on admin page but not important at all...

Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90

woow totally fixed. Thanks.

Share this post


Link to post
Share on other sites
On 11/19/2017 at 1:14 PM, flyalaska said:

Anyone have this file. The download link is broken.

I found this link by searching on GitHub, not sure who it is by or if it works. I downloaded it and will run on test server to see!

 

https://github.com/elfrost/phpvms_hubtransfer

Apparently Sava was also elffrost :)

Edited by jnascar

Share this post


Link to post
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...