Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to filter a Spry Dataset with a PHP variable?

Community Beginner ,
Dec 01, 2008 Dec 01, 2008
Hello,

I am really stuck on how to do this with spry.

I’ll describe the setup and what I’m trying to accomplish the best I can:

I’m putting together an appointment verification reminder calendar – the calendar displays the specific day with what appointments need to be verified. It would look something like this:

Date: Dec 12th 2008

8:00 am – Mr Smith – 555-555-1111
9:00 am – Mrs Jones – 555-555-2222
10:00 am – Ms Rogers – 555-555-3333

And so on.

The reason for spry is that I want to add, update, and delete records and have the data display instantly (well, within 10 milliseconds) without having to refresh the page manually or otherwise.

There is 1 single database table with all the information; date, time, name, number, id.

I have a php generated calendar that displays the entire month with a hyperlink to the day details page (daydetails.php).

I also have a dynamically generated xml files from that single database table (data.php).

I can connect to the data.php file, and all the information displays. The daydetails page also updates nearly instantaneously when I add, update, and delete records just like I had hoped.

What I now want to do, is when I click on the month calendar hyperlink, I want to filter the xml data to display only that specific day’s data on the daydetails.php page.

For instance, the hyperlink and url passed variable for December 12th would be “daydetails.php?date=12122008”, when the daydetails page opens, I’d like to just see Dec 12th, 2008’s data.

Right now, the way the sprydata set it connected to the data.xml file on the daydetails page, I get every day’s data in the file.

How do I filter day specific (or any variable specific) data from a dynamic xml file to a spry dataset?

Thanks for taking the time to read this, and any help would be greatly appreciated. I’ve struggled with this for quite and while and am at the point I knew a few more opinions on which way to go and get this accomplished.

Thanks
TOPICS
Server side applications
363
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Dec 02, 2008 Dec 02, 2008
After a night’s sleep and starting from scratch, I answer finally dawned on me - and it's a lot simpler than I was originally attempting. I simply echo the variable in the spry data source var.

For anyone that might happen to be struggling with the same issue, here's the final - and working - code I used:

<?php
$date=$_GET['date'];;
?>
<!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"...
Translate
Community Beginner ,
Dec 02, 2008 Dec 02, 2008
LATEST
After a night’s sleep and starting from scratch, I answer finally dawned on me - and it's a lot simpler than I was originally attempting. I simply echo the variable in the spry data source var.

For anyone that might happen to be struggling with the same issue, here's the final - and working - code I used:

<?php
$date=$_GET['date'];;
?>
<!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" xmlns:spry=" http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("data.php?date=<?php echo $date ?>", "date/remind", {useCache: false, loadInterval: 5});
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines