Jump to content


retrieving id's by current month

  • Please log in to reply
No replies to this topic

#1 whitehat

  • Members
  • PipPip
  • Member
  • 18 posts

Posted 11 October 2006 - 08:34 PM

Hello @all
i'm working on this project:
Currently only working in IE.
As you can see when click a date , it add it to the right basket.
However as you might seen it take a while before the page is loaded , this is couse it have to load 365 dates out of the db at once.
I'm looking for a solution to catch only the selected month''s dates out of the db instead of all 365.
This is the code i use for this page.
If anyone can solve my problem with this i would much apreciate:
if (!defined('MODULE_FILE')) {
	die ("You can't access this file directly...");

define('INDEX_FILE', true);

$module_name = basename(dirname(__FILE__));
global $db;

$myurl= 'modules.php?name=Fly_to_Basket&file=products'; // the links url is this page
$yearID=false; // GET variable for the year (set in Active Calendar Class), init false to display current year
$monthID=false; // GET variable for the month (set in Active Calendar Class), init false to display current month
$dayID=false; // GET variable for the day (set in Active Calendar Class), init false to display current day

$cal=new activeCalendar($yearID,$monthID,$dayID);

$eventID="event"; // sets the name of the generated HTML class on the event day (css layout)
$result = $db->sql_query("SELECT UNIX_TIMESTAMP(calendar_date) AS calendar_date, calendar_id, did FROM calendar");


while ($row = $db->sql_fetchrow($result, MYSQL_BOTH)){
$mysqlDay=date("j",$row["calendar_date"]); // makes a day out of the database date
$mysqlMonth=date("n",$row["calendar_date"]); // makes a month out of the database date
$mysqlYear=date("Y",$row["calendar_date"]); // makes a year out of the database date
$mysqlContent= $row["did"]; // gets the event content
$products_id = $row["calendar_id"];
//$mysqlLink=$row[$tblLink]; // gets the event link
$mysqlLink = "#\" onclick=\"addToBasket('$products_id','$calendar_name','$calendar_price');return false;"; // the name of your MySQL Table Link Field
$cal->setEvent($mysqlYear,$mysqlMonth,$mysqlDay,$eventID); // set the event, if you want the whole day to be an event
$cal->setEventContent($mysqlYear,$mysqlMonth,$mysqlDay,$mysqlContent,$mysqlLink); // set the event content and link

//here a 2 javascript files called


echo"<div id=\"slidingProduct_".$products_id."\"></div>";

echo $cal->showMonth();




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users