You may use ajax and set a session variable for "On" and "Off" states. Add a condition in the other page to check the value of the session variable in such a way that :
if the session variable is set and is on
, show the button "Open". Otherwise show the button "Closed".
You may set session variable in the following way:
$this->session->data['show_button'] = 'the on/off button value';
In the other page's controller file, add a condition like:
if (isset($this->request->post['show_button']) && $this->request->post['show_button'])
{
$this->data['show_button'] = true;
}
else {
$this->data['show_button'] = false;
}
Also don't forget to unset the session variable (unset($this->session->data['show_button']);
) when its use is over.
Have a nice day !!