does anyone here knows how to implement reject/approve button before inserting to database?
i have created online leave form. when a users applied for a online leave. I want the notification will sent via email to the HR manager. but I want to have approve/reject button when the hr receives the notification.
helo
Moderator: General Moderators
Re: helo
There's not such button that can perform the magic you are looking for.
However, what you can do is this:
1. Store user submitted records in a temporary table
2. Generate email to HR
3. When HR logs in, present leave request for approval
4. Update affected database table(s)
5. Generate email to user informing of HR decision
Makes sense?
However, what you can do is this:
1. Store user submitted records in a temporary table
2. Generate email to HR
3. When HR logs in, present leave request for approval
4. Update affected database table(s)
5. Generate email to user informing of HR decision
Makes sense?
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: helo
I'm no expert on temporary tables but wouldn't a temporary table be dropped when the connection is closed by the person submitting the query? Just curious What is a SQL Server Temporary Table?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: helo
No, I didn't mean "temporary" in a volatile sense, but a table to host records that require approval from HR. Once HR has a say on the request, then move the record to whatever table is used for storing requests.
Another approach, that wouldn't require a temporary table, would be to have a "status" field on the requests table, then manage the logic based on the content of this field. For example, when the user creates the request, then the status becomes PENDING, when HR logs into the system the PENDING records are presented for approval, then the status changes to APPROVED or REJECTED.
Another approach, that wouldn't require a temporary table, would be to have a "status" field on the requests table, then manage the logic based on the content of this field. For example, when the user creates the request, then the status becomes PENDING, when HR logs into the system the PENDING records are presented for approval, then the status changes to APPROVED or REJECTED.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: helo
Ah ok, yeah the status option is possibly your (OP) best option here
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: helo
No, I don't have a script that can work with your system, nobody does, as only you know your database schema and PHP code.
I prefer my 2nd option: add a STATUS field to your "leave request" table as I indicated in a previous post. It will take some MYSQL and PHP knowledge to achieve the end result though. There's no generic script that will accomplish that for you.
Good luck!
I prefer my 2nd option: add a STATUS field to your "leave request" table as I indicated in a previous post. It will take some MYSQL and PHP knowledge to achieve the end result though. There's no generic script that will accomplish that for you.
Good luck!