This looks right but I'm having trouble seeing exactly how to implement it because of the way my files are set up. popups.php doesn't use the javascript:newWin thing to call this particular page because it happens on a form submission.
Here's the call:
PHP Code:
g_goto("popups.php?popupContent=addClient");
And here's the function:
Code:
function g_goto($page) {
if($_COOKIE[session_name()]) {
$tmp = "Location: $page";
} else {
if(strstr($page, "?"))
$tmp = "Location: $page&".session_name()."=".session_id();
else
$tmp = "Location: $page?".session_name()."=".session_id();
}
Header($tmp);
exit;
}//g_goto
Then popups.php just calls include files, like this:
PHP Code:
switch ($_GET['popupContent']) {
case "addClient":
$title = 'Add a New Client';
include_once(TEMPLATE_DIR."addClient.tpl.php");
break;
case "editClient":
$title = 'Edit an Existing Client';
include_once(TEMPLATE_DIR."popups/editClient.tpl.php");
break;
case "archiveClient":
$title = 'Archive One or More Existing Clients';
include_once(TEMPLATE_DIR."popups/archiveClient.tpl.php");
break;
}
addClient.tpl.php has the HTML header and footer then has includes for the templates for the 4 tabs (the second tab is what I'm trying to access to access):
HTML Code:
<ul class="tabsetTabs">
<li><a href="#tabAddClient1" class="active" onclick="return false">Demographics</a></li>
<li><a href="#tabAddClient2" id="insur" onclick="return false">Insurance</a></li>
<li><a href="#tabAddClient3" onclick="return false">Family Info</a></li>
<li><a href="#tabAddClient4" onclick="return false">Medications</a></li>
</ul>
<div id="tabAddClient1" class="tabsetContentNestedPopup">
<h2 class="tabset_label">Demographics</h2>
<?php include_once("addClientDemo.tpl.php"); ?>
</div> <!-- end tabAddClient1 -->
<div id="tabAddClient2" class="tabsetContentNestedPopup">
<h2 class="tabset_label">Insurance</h2>
<?php include_once("addClientInsurance.tpl.php"); ?>
</div> <!-- end tabAddClient2 -->
<div id="tabAddClient3" class="tabsetContentNestedPopup">
<h2 class="tabset_label">Family Info</h2>
<?php include_once("addClientFamily.tpl.php"); ?>
</div> <!-- end tabAddClient3 -->
<div id="tabAddClient4" class="tabsetContentNestedPopup">
<h2 class="tabset_label">Medication</h2>
<?php include_once("addClientMeds.tpl.php"); ?>
</div> <!-- end tabAddClient4 -->
I thought maybe I should change the function call like this:
PHP Code:
g_goto("popups.php?popupContent=addClient&openTab=insur");
But then I wasn't sure what to do when I got to popups.php. I'm not sure where to put the getElementById part. Help?
Bookmarks