Jump to content
Sava

Hub Transfer Request v1.0

Recommended Posts

Hub Transfer Request v1.0

about:

phpVMS Module for pilots to submit a Hub Transfer request that is stored in a database and an option for staff to view all the requests through the admin panel and decide to reject/approve the request.

When the requests are submitted, both the users and the admin will get an email. Once the request is handled, a secon email is sent to the user.

You can change the pilot's hub from inside the addon.

Developed by:

Sava Markovic

http://www.airserbiavirtual.com

Developed on:

phpVMS v2.1.934 stable

php 5.3.1

mysql 5.0.5

apache 2.2.14

License:

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

Installation:

1. Download the zip package.

2. Unzip the package and place the files as structured in your phpVMS installation.

3. Use the hubtransfer.sql file to create the table necessary for the module to work. You can do this by using phpmyadmin.

Other Information:

To display a link to the LoA form for your pilots place this code where you want it:

<a href="<?php echo url('/loa'); ?>">Hub Transfer Request</a>

Screenshots:

http://i.imgur.com/5urXb.png

http://i.imgur.com/2OYBR.png

Download:

The addon can be found and downloaded here: https://github.com/savamarkovic/phpvms_hubtransfer

Thanks to user Connor1994 ( http://forum.phpvms.net/user/681-connor1994/ ) for the idea.

Enjoy the addon and leave feedback. :)

  • Like 7

Share this post


Link to post
Share on other sites

nono sorry this is old problem in my internal sql problem, now i have this problem

hi have a problem, i have send my first hub request transfer, i have accept my transfer request and re-send another transfer request but received this error:

You already have a hub transfere request submitted for your ID. We will notify you when the staff team reviews your request.

Share this post


Link to post
Share on other sites

Once you send the first request it is stored in the database until you delete it manually. Until then you can't submit another request. The last part of the error message was supposed to be deleted but stayed there from the initial version which handled requests differently. It is now fixed in the latest commit. Anyhow, the way I coded the addon is that all the requests stay in the databse thus preventing from submitting the request again (why would anyone change their hub twice?). If you would like to see an option for this also, I will be happy to add it in the morning.

To sum up, the addon is working as it should be.

It seems you edited your post some time so I hope I answered your question.

Share this post


Link to post
Share on other sites

yes yes the first problem is soved is my error in upload the file in ftp.......for this problem,how to delete the request after have accepted this

Share this post


Link to post
Share on other sites

Sorry, I edited the post to provide more info while you were writting. Anyhow, you can delete the request manually from phpmyadmin but if you want I can add the option to do that from the admin panel if you like.

I haven't added this option for the reason stated in the post above but it can easily be added.

Share this post


Link to post
Share on other sites

Added an option to delete the requests. Please get the latest version from the GitHub repository. The changed files are:

core/common/HubTransferData.class.php

admin/modules/HubTransfer/HubTransfer.php

admin/templates/hubtransfer/hubtransfer_admin_index.tpl

If you want, just get those three files as the rest are unchanged. Hope this helps. I would be glad to help you out if you have any further issues. :)

Share this post


Link to post
Share on other sites

For some reason, I do not get the hub options show up when someone tries to change hubs?! It is just blank in the drop down part where you would try to select the new hub :(

Share this post


Link to post
Share on other sites

I am not sure what could be the issue. No one including me has that. The method for getting the hub is extremely simple and there should be no issues with that. It just selects all the ICAOs from the phpvms_airports table where the column HUB has a value of '1' (true) and than lists them.

Share this post


Link to post
Share on other sites

My table is not phpvms_airports though....I have a different database beginning than the standard "phpvms_"

Would that be the issue?

Share this post


Link to post
Share on other sites

Yes, that is the issue. Please download the new core/common/HubTransferData.class.php file from the repository. It is the only one that needs changing.

Sorry for the inconvinience.

Share this post


Link to post
Share on other sites

Nope, still did not work. Do I have to put something in there referencing my prefix?

Like, when it says:

$query = "SELECT icao FROM ' . TABLE_PREFIX . 'airports WHERE hub='1' AND icao!= '$pilot_hub'";

Do I need to do anything else, or is the code supposed to work as is?!

Share this post


Link to post
Share on other sites

$query = "SELECT icao FROM " . TABLE_PREFIX . "airports WHERE hub='1' AND icao!= '$pilot_hub'";

I think that this is going to work.

  • Like 1

Share this post


Link to post
Share on other sites

Yes, servetas that could be the issue. I didn't notice it when I updated the git from the iPad in the afternoon.

I updated the core/common/HubTrasnferData.class.php file once more and hope that solves it. Download it and tell me if it helps.

I couldn't check if it works as I don't have access to my phpvms test site at the moment from the iPad.

Sorry for the trouble.

Share this post


Link to post
Share on other sites

When trying to delete the default LoA in the form.

Warning: mysql_query() [function.mysql-query]: Access denied for user 'julianac'@'localhost' (using password: NO) in /home/julianac/public_html/core/common/LoAData.class.php on line 60

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/julianac/public_html/core/common/LoAData.class.php on line 60

Warning: mysql_affected_rows() [function.mysql-affected-rows]: Access denied for user 'julianac'@'localhost' (using password: NO) in /home/julianac/public_html/core/common/LoAData.class.php on line 61

Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /home/julianac/public_html/core/common/LoAData.class.php on line 61

Warning: mysql_affected_rows() [function.mysql-affected-rows]: Access denied for user 'julianac'@'localhost' (using password: NO) in /home/julianac/public_html/admin/modules/LoA/LoA.php on line 63

Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /home/julianac/public_html/admin/modules/LoA/LoA.php on line 63

Share this post


Link to post
Share on other sites

it seems it has to do with you mysql not being setup correctly.

it is late here, i will check in the morning but i believe it's something on your side.

Share this post


Link to post
Share on other sites

I am such an idiot this is the wrong topic. this was meant to be in your LoA module. Please excuse my post. but if you have a solution it would be most helpful.

Edit***

I've tried your Hub Transfer Request Module now and receive an error quite similar. I'm going to look and see if I can find a problem somewhere in your code as the main site works. its just your modules that don't :(

Edit** Again** <_<

It seems that the both modules are assuming that my MySQL database has no password. or at least it isn't getting the MySQL data correctly from the local.config.php file.

Edited by Stealthbird97

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