Jump to content

Letter of Absence Feature


freshJet

Recommended Posts

---This might be better as a module---

I have been working all night on a code that will do the following:

- Display the pilot's name and ID

- Ask the pilot for a start date

- Ask the pilot for an end date

- Ask for a reason

- Send an email with the details to my address upon clicking submit

Also, I was wondering id fit could be added in the Admin panel to display who is on leave and how long it is until they return, as well as displaying the same info on the pilot's profile.

May be a bit complex I know...

So:

Letter of Absence Page

--Terms and conditions of leave go here--

Pilot: FRX0123 John Smith (determined by php echo because they are logged in)

Absence Begins: DD/MM/YYYY

Absence Ends: DD/MM/YYY

[submit]

Admin Panel

The following people are on leave:

FRX0123 John Doe | Returns in 6 days (20/06/2011)

Email

Subject: LOA Filed

Pilot: FRX0123 John Smith

Absence Begins: 10/06/2011

Absence Ends: 20/06/2011

Absence Length: 10 day(s)

  • Like 1
Link to comment
Share on other sites

  • Moderators

First of all, let me give you a clear idea.....

You would need to create a Module, with all the functions, then you would need to create a Data.Class to do the SQL functions work, and then as always, template files.

Link to comment
Share on other sites

I've given up. Any help would be grateful. I tried making a standard contact form, but the phpVMS Admin Panel Page Editor (PAPPE lol) does not support the php echos.

Go to core/pages/ and then find the page you were editing through the phpVMS page editor. Use a WYSIWYG editor, or even notepad to edit the page. Then upload to the server. That way you can use php in the page, and the html editor in the phpVMS page editor won't strip it out.

EDIT: Just remember though, if you do this, that if you view the page in phpvms admin editor, it will strip out the php as soon as you do, so you need to remember when it comes to editing the page, to edit the page using another editor like notepad or dreamweaver or whatever editor you're using.

Link to comment
Share on other sites

First of all, let me give you a clear idea.....

You would need to create a Module, with all the functions, then you would need to create a Data.Class to do the SQL functions work, and then as always, template files.

This.

You can't create this functionality using standard phpVMS pages (which it sounds like you're trying/is being suggested).

You need:

- Module in core/modules (the form) basically needs two functions, one for displaying the form and one for submitting.

- Module in admin/modules (this is the admin page you talk about) just needs the one function

- Templates for each of the above modules in their respective locations

- Class in core/common to handle database functions

- Table in the database to store: loaid (A/I: for unique records), pilotid, startdate, enddate, reason

(Number of days can be calculated from those providing you can convert how you've stored the dates etc)

Link to comment
Share on other sites

This.

You can't create this functionality using standard phpVMS pages (which it sounds like you're trying/is being suggested).

You need:

- Module in core/modules (the form) basically needs two functions, one for displaying the form and one for submitting.

- Module in admin/modules (this is the admin page you talk about) just needs the one function

- Templates for each of the above modules in their respective locations

- Class in core/common to handle database functions

- Table in the database to store: loaid (A/I: for unique records), pilotid, startdate, enddate, reason

(Number of days can be calculated from those providing you can convert how you've stored the dates etc)

That's massive overkill for what the op essentially described was a html form, that would be emailed to him on completion. You can insert your own html form into the phpvms generated pages as I mentioned in my last post, and use then js and/or php validation/handling much easier that creating a whole new series of files for a new module.

Link to comment
Share on other sites

That's massive overkill for what the op essentially described was a html form, that would be emailed to him on completion. You can insert your own html form into the phpvms generated pages as I mentioned in my last post, and use then js and/or php validation/handling much easier that creating a whole new series of files for a new module.

Sure, but jotform etc just send you an email. There's no link to a logged in user, there's no integration with phpVMS and there's nothing in the admin panel - it's a below satisfactory solution IMO. It looks like there's a lot to do but it's only a 20 minute job really...

Link to comment
Share on other sites

I agree Tom however people have different levels of knowledge, what you may find easy others may find difficult. I am no expert when it comes to coding ect... Ideally a module that is intergrated with VMS would be ideal. Once admin select an option to recognise leave of absence it auto changes the pilots status and displays it in the admin. So until something like that has been written I will make do with what I have got and be gratful to the guys that have made all the other modules I use at the moment....Well done guys and thanks.

  • Like 1
Link to comment
Share on other sites

Unfortunately I will be unable to finish this project. I have managed to make the form and make it send the information to the MySQL database. But I am unable to make the MySQL database to delete the row after the absence dates has passed and make the information show in the admin panel and some other stuff.

Hopefully someone else who has a much greater knowledge of php and MySQL might have a go at making this module as it is too complicated for me.

I would love to have being able to have completed this but it was just too complicated, sorry guys :(

Regards,

James

jjsl83.png

2zdum88.png

This is what I got completely done:

  • Module in core/modules: one for displaying the form and one for submitting.
  • Table in the database to store: loaid (A/I: for unique records), pilotid, startdate, enddate, reason
  • .tpl files for the form and error messages

(I think it would be really good if someone could take the time out to make a file showing how to make modules for phpvms as the original documentation for making a module on the document page is too basic)

Link to comment
Share on other sites

Sometimes all it takes is a break for a day or three so wonderful things can happen when you get back.

Kind of like working on a car. Ever have trouble starting a bolt for 20 minutes then take a break and come back 30 minutes later and the bolt goes right in? ;)

Link to comment
Share on other sites

Sometimes all it takes is a break for a day or three so wonderful things can happen when you get back.

Kind of like working on a car. Ever have trouble starting a bolt for 20 minutes then take a break and come back 30 minutes later and the bolt goes right in? ;)

Thats 100% true

Link to comment
Share on other sites

  • 3 weeks later...

hey this not fair i was asking for an update from you james which was pending now from long ago and you are marking my comments negative or mr bird is doing it who so ever is it please stop doing that and if someone has water in him reply with the reason who is doing it......angry.gif

  • Like 2
Link to comment
Share on other sites

Maybe it's because you have both been impatient before when asking stuff, and other people don't like it? Just a guess though. I'm sure James will update here if he does have any news, and I'm also sure he has a lot of other stuff on his plate at the moment, like real world stuff and managing his VA.

And to make you guys feel better, I've given you both a thumbs up :lol:

EDIT: Also, instead of relying on others, why not have a go at learning some basic php and try and see if you can get anywhere with this yourselves? I'm not saying that to be arrogant or funny, but you could do it if you put some effort in, and you would probably find more people willing to help if you got stuck too. I didn't have a clue the first time I downloaded and installed phpVMS, but I'm slowly getting to grips with it, and it's great being able to figure stuff out myself.

  • Like 2
Link to comment
Share on other sites

i am not impatience my dear forum members i was just replying to the post and making it alive thought maybe james forgot to clear this up and i don't know why Mr Bird is replying after my reply always maybe many people are thinking i have some connection with him so let me clear this here NO Mr Bird or Waleed has asked me for partnership with his VA which first i accepted but after that i rejected when i saw his reputation in the forums i am very sincere member of this forum so it was bit odd for just asking an update regarding announced Module getting Negative Marks maybe someone is doing it intentionally otherwise i don't think so we cannot ask for an update well never mind i wont ask it again thanks.

Stuart Thanks for your suggestions mate i have tried this many times and failed no one is brilliant like you who learned Phpvms in such a short time.

Regards

Ahmad Al Shiekh

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