Skip to main content
January 23, 2011
Question

Dynamically linking page containing Spry Acdn Pnl!

  • January 23, 2011
  • 1 reply
  • 564 views

The page ought to look like this:

http://www.venture-wilderness.com/gulmarg_skiing.php

But when I use php to put it to together, the page looks like this:

http://localhost/trekking_site/sea_n_sky.php?ItineraryID=5

The complete Spry Accordion Panel gets gobbled up – marked by the question marks with black rhomboid background (this on the testing server).

Please note also the first one does not show the departure dates correctly as these are not being pulled up from the database.. I could put php in there on that page an then link it directly as above without the ItineraryID. But that does not comply to the uniformity of the process on the whole site.

There must be a way around!

Thanks for any ideas,

zabberwan

This topic has been closed for replies.

1 reply

BenPleysier
Community Expert
Community Expert
January 24, 2011

I guess the accordion gobbling page has been removed.

Gramps

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
January 24, 2011

Hi Gramps,

Thanks for looking it up..

I now remember that I had not inserted any information in the database when I created it. No wonder! it cannot show stuff that is not there. I did not know how to include the Spry Accordion Panel in the Database. So I had left it for later and for the time being just linked it directly (as a static page) as shown above.

Now, how would I go about it?

I could put content of the various tabs in the database in the description column along with the pictures. That is no problem at all, but can I also put the Accordion Panels in there too, knowing well that Spry is all server side???

Or would it in retrospect be better to put it in the if else loop  [ elseif($ItineraryID_rsItinerary ==5) ] like below (excerpt out of the main php file):

$currentPage = $_SERVER["PHP_SELF"];

if (isset($_GET['ItineraryID'])) {
  $ItineraryID_rsItinerary = $_GET['ItineraryID'];
}
else
   $ItineraryID_rsItinerary = 2;
mysql_select_db($database_vw, $vw);
$query_rsItinerary = sprintf("SELECT * FROM itinerary WHERE itinerary.ID = %s", GetSQLValueString($ItineraryID_rsItinerary, "int"));
$rsItinerary = mysql_query($query_rsItinerary, $vw) or die(mysql_error());
$row_rsItinerary = mysql_fetch_assoc($rsItinerary);
$totalRows_rsItinerary = mysql_num_rows($rsItinerary);
if($ItineraryID_rsItinerary==1 ||$ItineraryID_rsItinerary==2||$ItineraryID_rsItinerary==3 )
   $maxRows_rsEvent = 12;
elseif($ItineraryID_rsItinerary==11 || $ItineraryID_rsItinerary==10 || $ItineraryID_rsItinerary==7)
     $maxRows_rsEvent =10;
elseif($ItineraryID_rsItinerary ==4)
    $maxRows_rsEvent = 18;
else
   $maxRows_rsEvent = 13;
$pageNum_rsEvent = 0;
if (isset($_GET['pageNum_rsEvent'])) {
  $pageNum_rsEvent = $_GET['pageNum_rsEvent'];
}
$startRow_rsEvent = $pageNum_rsEvent * $maxRows_rsEvent;
if ($pageNum_rsEvent>0)
    $maxRows_rsEvent=30;

$ItineraryID_rsEvent = $ItineraryID_rsItinerary;
if (isset($ItineraryID_rsEvent)) {
  $ItineraryID_rsEvent = $ItineraryID_rsEvent;
}

...

What would the php look like in this case?

zabberwan

BenPleysier
Community Expert
Community Expert
January 24, 2011

Personally I would create an HTML table using the data from the database. Consequently create a SpryHTMLDataSet which can be used to populate the accordion as follows http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSample2.html

This might seem a long way round but the result is one call to the server with the manipulation of data being clientside.

Gramps

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!