I need a message on DB entry
Moderator: General Moderators
-
MichaelMcCulley
- Forum Newbie
- Posts: 6
- Joined: Tue Oct 04, 2005 10:55 am
I need a message on DB entry
I have an application where user1 is logged into his security groups section of the site, and user2 (user1's subordinate) is logged into his.
User2 makes an entry for an appointment into a table.
When User2 submits his entry, I want a popup to show on User1's computer so that he can confirm or reschedule the appointment.
User2 makes an entry for an appointment into a table.
When User2 submits his entry, I want a popup to show on User1's computer so that he can confirm or reschedule the appointment.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Congratulations. You didn't ask a question.
I'm going to guess you want to know how to make the popup happen. The answer depends on how you want it to work. If by just sitting on the page the popup happens: XMLHTTP is pretty much the only way (iframes can do it too). If by navigating to a new page the popup should happen, then it's a "basic" trigger that you can set in the database, for instance.
#1 is more elegant, but difficult while #2 is fairly easy. I'd highly suggest not actually popping a window however, due to popup blocker restrictions some browsers have. Instead, I'd go with a floating div.
I'm going to guess you want to know how to make the popup happen. The answer depends on how you want it to work. If by just sitting on the page the popup happens: XMLHTTP is pretty much the only way (iframes can do it too). If by navigating to a new page the popup should happen, then it's a "basic" trigger that you can set in the database, for instance.
#1 is more elegant, but difficult while #2 is fairly easy. I'd highly suggest not actually popping a window however, due to popup blocker restrictions some browsers have. Instead, I'd go with a floating div.
-
MichaelMcCulley
- Forum Newbie
- Posts: 6
- Joined: Tue Oct 04, 2005 10:55 am
I'll take door #1 Bob
Sounds great. So lets say I want to go with option 1 and use iframes. How would that get the message across that an entry has been made into the database, AND give them the ability to confirm the entry ( which will change a field in the same record)
I kind of like the sound of the floating div, but a submission there might take them out of the page they are on( and I can't do that ).
the problem I face is not how to display the message, but the triggering process. Not sure if I want to do an auto refresh, because of the traffic involved (DB mostly, and this site has the potential for 1000's of users). I know there has to be a simple solution but I can't see it.
I kind of like the sound of the floating div, but a submission there might take them out of the page they are on( and I can't do that ).
the problem I face is not how to display the message, but the triggering process. Not sure if I want to do an auto refresh, because of the traffic involved (DB mostly, and this site has the potential for 1000's of users). I know there has to be a simple solution but I can't see it.
-
MichaelMcCulley
- Forum Newbie
- Posts: 6
- Joined: Tue Oct 04, 2005 10:55 am
Event Queue?
How, what, Is this a db table, text file, server variable?
-
MichaelMcCulley
- Forum Newbie
- Posts: 6
- Joined: Tue Oct 04, 2005 10:55 am
Ok, so just for my own clarity,
I create a table for the event queue.
when the user does an update to one table, he also creates an entry in the queue for the other indiviual. Done with him.
The other user is crusing the site or camping on one page. All pages have a query for the event queue. If there is an entry....?
How would the iframe work? Javascript? Can I force them to click something that would do the confimation part, or what?
Sorry if I seem slow on the uptake. Thanks you for your help so far BTW.
I create a table for the event queue.
when the user does an update to one table, he also creates an entry in the queue for the other indiviual. Done with him.
The other user is crusing the site or camping on one page. All pages have a query for the event queue. If there is an entry....?
How would the iframe work? Javascript? Can I force them to click something that would do the confimation part, or what?
Sorry if I seem slow on the uptake. Thanks you for your help so far BTW.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
yep, you've got the idea. I'd set the iframe to simply auto-refresh. When an entry is there for the user, you can pop a confirm dialog box. Clicking okay (returns true) would reload the page telling the server to confirm the update or whatever you are wanting to do and the process starts all over again. I'd try to keep the iframe's code as small as possible..
-
MichaelMcCulley
- Forum Newbie
- Posts: 6
- Joined: Tue Oct 04, 2005 10:55 am
-
MichaelMcCulley
- Forum Newbie
- Posts: 6
- Joined: Tue Oct 04, 2005 10:55 am
Will this handle multiple alerts?
I am assuming that I will have to delete the event record after confirmation in order to avoid duplicate notification. But what if I have 2 or more users make the same data entries that create the alert? If one comes in before the other is confirmed and the iframe refreshes won't it cause a train wreck?
I am assuming that I will have to delete the event record after confirmation in order to avoid duplicate notification. But what if I have 2 or more users make the same data entries that create the alert? If one comes in before the other is confirmed and the iframe refreshes won't it cause a train wreck?