This topic is locked
[SOLVED]

 popup to update another table in database

12/10/2013 7:58:39 AM
PHPRunner General questions
Graphix author

Hi All,
been trying to do this for week now <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21724&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />

I have a database for recording Cooker Bromine levels, readings are entered on an hourly basis, what I am trying to do is flag any 'out of range readings',

for instance there are 11 tests with all different parameters so FMC3 should be less than 30 if it is higher I want to 'popup' another form with fields pre populated

form the calling form with an added 'Action Taken' free form text box once the user has inputted his/her action and the popup is closed for it to update the actions table and then

the user put back to where they were before the popup, can this be done?

I have created the 'action' data entry form but don't know how to get it to popup ( I don't want it on the menu, it needs to be automated)
does this make sense?
thank you <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21724&image=2&table=forumtopics' class='bbc_emoticon' alt=':)' />

Kevan

Sergey Kornilov admin 12/10/2013

If you need to open any page in a popup i.e. Add page of another table - here is the article that can help:

http://xlinesoft.com/blog/2013/04/25/displaying-a-page-in-a-popup-window/
To pre-poulate fields of that form you can use session variables. I.e. set default value to $_SESSION["somevar"] and assign a value to this session variable before opening a window in popup.

Graphix author 12/10/2013



If you need to open any page in a popup i.e. Add page of another table - here is the article that can help:

http://xlinesoft.com/blog/2013/04/25/displaying-a-page-in-a-popup-window/
To pre-poulate fields of that form you can use session variables. I.e. set default value to $_SESSION["somevar"] and assign a value to this session variable before opening a window in popup.


Hi Sergey thanks for this I had already seen this article, I should have made my question clearer, I want the 'popup' to appear (no buttons) if a value is above a certain number,

how do I call a form with code i.e. can I call a button function without an actual button being pressed with code?
kind regards

Kevan

Sergey Kornilov admin 12/10/2013

If there is no button - how do you know when to display the popup. There must be some sort of event that triggers it.

Graphix author 12/11/2013



If there is no button - how do you know when to display the popup. There must be some sort of event that triggers it.


this is my event

what I am trying to do is flag any 'out of range readings',

for instance there are 11 tests with all different parameters so with fields pre populated.
the values are strictly monitored by the HSE if any value is above or below certain levels a journal has to be created with the 'Actions' taken to remedy the issue.
im not very good with php code so here is the logic:
if FMC3.value <30 then show/load actionstaken.php,

FMC3.action = yes

save action

save FMC3.value

refresh

end if

continue with code.....
thank you

Kevan

Sergey Kornilov admin 12/11/2013

Kevan,
it doesn't shed any light. When this popup needs to be shown i.e. when some page is loaded, before record is saved etc?

Graphix author 12/11/2013



Kevan,
it doesn't shed any light. When this popup needs to be shown i.e. when some page is loaded, before record is saved etc?


Hi Sergey

sorry im not explaining my self properly, here is a mockup of what I want:


thank you

Kevan

Sergey Kornilov admin 12/11/2013

Okay, I got it. The event that triggers this popup is user's input.
Here is the example of doing something after value of field was changed:

http://xlinesoft.com/phprunner/docs/show_dropdown_list_of_us_states.htm

var ctrlFMC3 = Runner.getControl(pageid, 'FMC3');



ctrlFMC3.on('change', function(e){

if (Number(this.getValue())>30 ){

// do something here

}

});
Graphix author 12/11/2013



Okay, I got it. The event that triggers this popup is user's input.
Here is the example of doing something after value of field was changed:

http://xlinesoft.com/phprunner/docs/show_dropdown_list_of_us_states.htm

var ctrlFMC3 = Runner.getControl(pageid, 'FMC3');
ctrlFMC3.on('change', function(e){

if (Number(this.getValue())>30 ){

// do something here

}

});



thank you I can try and work with that.

Kevan <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=73244&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />