PDA

View Full Version : Tabbed Panels not working correctly!


Jeffrey06
07-10-2008, 09:29 PM
I cannot get my Tabbed Panels to show correctly. It shows all the content of each panel though the first one.

Any advice?

edbr
07-11-2008, 12:36 AM
post your code

Jeffrey06
07-14-2008, 12:42 PM
I'm posting in two different posts, to many characters for one.

<?php require_once('Connections/connDiesel.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO products (productName, price, `description`, inventory, vendorID, categoryID, image, onSale) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['productName'], "text"),
GetSQLValueString($_POST['price'], "double"),
GetSQLValueString($_POST['description'], "text"),
GetSQLValueString($_POST['inventory'], "text"),
GetSQLValueString($_POST['vendorID'], "int"),
GetSQLValueString($_POST['categoryID'], "int"),
GetSQLValueString($_POST['image'], "text"),
GetSQLValueString($_POST['onSale'], "int"));
mysql_select_db($database_connDiesel, $connDiesel);
$Result1 = mysql_query($insertSQL, $connDiesel) or die(mysql_error());
$insertGoTo = "admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO products (productName, price, `description`, inventory, vendorID, categoryID, image, onSale) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['productName'], "text"),
GetSQLValueString($_POST['price'], "double"),
GetSQLValueString($_POST['description'], "text"),
GetSQLValueString($_POST['inventory'], "text"),
GetSQLValueString($_POST['vendorID'], "int"),
GetSQLValueString($_POST['categoryID'], "int"),
GetSQLValueString($_POST['image'], "text"),
GetSQLValueString($_POST['onSale'], "int"));
mysql_select_db($database_connDiesel, $connDiesel);
$Result1 = mysql_query($insertSQL, $connDiesel) or die(mysql_error());
$insertGoTo = "admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO category (categoryName) VALUES (%s)",
GetSQLValueString($_POST['categoryName'], "text"));
mysql_select_db($database_connDiesel, $connDiesel);
$Result1 = mysql_query($insertSQL, $connDiesel) or die(mysql_error());
$insertGoTo = "admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form3")) {
$insertSQL = sprintf("INSERT INTO vendors (vendorName, vendorStreet, vendorCity, vendorState, vendorZip, vendorPhone) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['vendorName'], "text"),
GetSQLValueString($_POST['vendorStreet'], "text"),
GetSQLValueString($_POST['vendorCity'], "text"),
GetSQLValueString($_POST['vendorState'], "text"),
GetSQLValueString($_POST['vendorZip'], "text"),
GetSQLValueString($_POST['vendorPhone'], "text"));
mysql_select_db($database_connDiesel, $connDiesel);
$Result1 = mysql_query($insertSQL, $connDiesel) or die(mysql_error());
$insertGoTo = "admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_connDiesel, $connDiesel);
$query_rsProducts = "SELECT * FROM products ORDER BY productID DESC";
$rsProducts = mysql_query($query_rsProducts, $connDiesel) or die(mysql_error());
$row_rsProducts = mysql_fetch_assoc($rsProducts);
$totalRows_rsProducts = mysql_num_rows($rsProducts);
mysql_select_db($database_connDiesel, $connDiesel);
$query_rsVendors = "SELECT vendorID, vendorName FROM vendors ORDER BY vendorName DESC";
$rsVendors = mysql_query($query_rsVendors, $connDiesel) or die(mysql_error());
$row_rsVendors = mysql_fetch_assoc($rsVendors);
$totalRows_rsVendors = mysql_num_rows($rsVendors);
mysql_select_db($database_connDiesel, $connDiesel);
$query_rsCategories = "SELECT * FROM category ORDER BY categoryName DESC";
$rsCategories = mysql_query($query_rsCategories, $connDiesel) or die(mysql_error());
$row_rsCategories = mysql_fetch_assoc($rsCategories);
$totalRows_rsCategories = mysql_num_rows($rsCategories);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DieselHaulin.com Online Store</title>
<style type="text/css">
<!--
.style1 {
font-size: 16px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
#apDiv2 {
position:absolute;
left:375px;
top:21px;
width:511px;
height:91px;
z-index:2;
}
-->
</style>
<style type="text/css">
<!--
body {
background-color: #999999;
}
#apDiv1 {
position:absolute;
left:14px;
top:143px;
width:130px;
height:31px;
z-index:3;
}
#apDiv3 {
position:absolute;
left:14px;
top:123px;
width:420px;
height:56px;
z-index:3;
}
#apDiv4 {
position:absolute;
left:17px;
top:241px;
width:120px;
height:395px;
z-index:4;
border: thin solid #666666;
}
#apDiv5 {
position:absolute;
left:804px;
top:150px;
width:71px;
height:47px;
z-index:5;
}
#apDiv6 {
position:absolute;
left:12px;
top:196px;
width:899px;
height:17px;
z-index:6;
background-color: #666666;
}
#apDiv7 {
position:absolute;
left:210px;
top:224px;
width:651px;
height:94px;
z-index:7;
}
.style10 {font-size: 16px}
.style11 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 24px;
}
#apDiv8 {
position:absolute;
left:19px;
top:636px;
width:120px;
height:29px;
z-index:8;
}
#apDiv9 {
position:absolute;
left:14px;
top:150px;
width:613px;
height:36px;
z-index:9;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<style type="text/css">
<!--
#apDiv10 {
position:absolute;
left:222px;
top:584px;
width:647px;
height:41px;
z-index:10;
}
.style14 {font-family: garamond; font-size: 24px;}
#apDiv11 {
position:absolute;
left:15px;
top:254px;

Jeffrey06
07-14-2008, 12:43 PM
width:114px;
height:58px;
z-index:10;
}
#apDiv12 {
position:absolute;
left:210px;
top:341px;
width:652px;
height:113px;
z-index:10;
}
-->
</style>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="style11" id="apDiv4">
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','108','height ','46','src','button16','quality','high','pluginsp age','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','button16' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="108" height="46">
<param name="movie" value="button16.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="button16.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="108" height="46" bgcolor="#999999"></embed>
</object>
</noscript>
</p>
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height ','22','src','button31','quality','high','pluginsp age','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','button31' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button31.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="button31.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#999999"></embed>
</object>
</noscript>
</p>
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height ','22','src','button32','quality','high','pluginsp age','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','button32' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button32.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="button32.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#999999"></embed>
</object>
</noscript>
</p>
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height ','22','src','button18','quality','high','pluginsp age','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','button18' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button18.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="button18.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#999999"></embed>
</object>
</noscript>
</p>
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height ','22','src','button19','quality','high','pluginsp age','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','button19' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button19.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="button19.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#999999"></embed>
</object>
</noscript>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div id="apDiv5">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','108','height ','46','src','accountbut','quality','high','plugin spage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','accountbut' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="108" height="46">
<param name="movie" value="accountbut.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="accountbut.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="108" height="46" bgcolor="#999999"></embed>
</object>
</noscript>
</div>
<div id="apDiv6"></div>
<div id="apDiv7">
<p class="style14">Add Records</p>
<p class="style10">&nbsp;</p>
</div>
<div id="apDiv8">
<p>1.1</p>
</div>
<div id="apDiv9">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','108','height ','46','src','button1','quality','high','pluginspa ge','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','button1' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="108" height="46">
<param name="movie" value="button1.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="button1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="108" height="46" bgcolor="#999999"></embed>
</object>
</noscript>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','108','height ','46','src','button2','quality','high','pluginspa ge','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgco lor','#999999','movie','button2' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="108" height="46">
<param name="movie" value="button2.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#999999" />
<embed src="button2.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="108" height="46" bgcolor="#999999"></embed>
</object>
</noscript></div>
<div id="apDiv12">
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">Add Product</li>
<li class="TabbedPanelsTab" tabindex="0">Add Category</li>
<li class="TabbedPanelsTab" tabindex="0">Add Vendor</li>
</ul>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent">
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<input type="text" name="productName" value="" size="32" />
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Product Name:</td>
<td>&nbsp;</td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Price:</td>
<td><input type="text" name="price" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right" valign="top">Description:</td>
<td><textarea name="description" cols="50" rows="5"></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Inventory Status:</td>
<td valign="baseline"><table>
<tr>
<td><input type="radio" name="inventory" value="In Stock" />
In Stock</td>
</tr>
<tr>
<td><input type="radio" name="inventory" value="Back Order" />
Back Order</td>
</tr>
</table></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Vendor:</td>
<td><select name="vendorID">
<?php
do {
?>
<option value="<?php echo $row_rsVendors['vendorID']?>" ><?php echo $row_rsVendors['vendorName']?></option>
<?php
} while ($row_rsVendors = mysql_fetch_assoc($rsVendors));
?>
</select>
</td>
</tr>
<tr> </tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Category:</td>
<td><select name="categoryID">
<?php
do {
?>
<option value="<?php echo $row_rsCategories['categoryID']?>" ><?php echo $row_rsCategories['categoryName']?></option>
<?php
} while ($row_rsCategories = mysql_fetch_assoc($rsCategories));
?>
</select>
</td>
</tr>
<tr> </tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Image File:</td>
<td><input type="text" name="image" value="none.gif" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">On Sale:</td>
<td valign="baseline"><table>
<tr>
<td><input type="radio" name="onSale" value="1" />
Yes</td>
</tr>
<tr>
<td><input type="radio" name="onSale" value="0" />
No</td>
</tr>
</table></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">&nbsp;</td>
<td><input type="submit" value="Insert record" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="TabbedPanelsContent">
<p>&nbsp;</p>

<form action="<?php echo $editFormAction; ?>" method="post" name="form2" id="form2">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">CategoryName:</td>
<td><input type="text" name="categoryName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">&nbsp;</td>
<td><input type="submit" value="Insert record" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form2" />
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="TabbedPanelsContent">
<p>&nbsp;</p>

<form action="<?php echo $editFormAction; ?>" method="post" name="form3" id="form3">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">VendorName:</td>
<td><input type="text" name="vendorName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">VendorStreet:</td>
<td><input type="text" name="vendorStreet" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">VendorCity:</td>
<td><input type="text" name="vendorCity" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">VendorState:</td>
<td><input type="text" name="vendorState" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">VendorZip:</td>
<td><input type="text" name="vendorZip" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">VendorPhone:</td>
<td><input type="text" name="vendorPhone" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">&nbsp;</td>
<td><input type="submit" value="Insert record" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form3" />
</form>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
<span class="style10"><img src="completelogo.gif" alt="" width="351" height="119" /></span>
<div class="style1" id="apDiv2">
<p>DieselHaulin.com Exculsive Vendor Database!</p>
<p>&nbsp;</p>
</div>
<span class="style10"></span>
<script type="text/javascript">
<!--
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
//-->
</script>
</body>
</html>
<?php
mysql_free_result($rsProducts);
mysql_free_result($rsVendors);
mysql_free_result($rsCategories);
?>


This is probably a newbie mistake...

Thanks in advance for all your help...

Jeffrey06
07-28-2008, 09:19 PM
Any ideas?