Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    11
    Rep Power
    0

    date function


    this is code provided by a free calendar im just trying to modify it to work for our purpose,

    if i can render the query within the php block and somehow call the function it will pump out a list of all the reservations in the same format as the hard coded one but i think its the function thats the problem. as i think it should work but all that happends is calendar with no dynamic results only hard coded ones.
  2. #17
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,397
    Rep Power
    594
    Because you are not passing it the correct data. Try this:
    PHP Code:
    $thisCal->addEvent($checkindate,
                         
    "Holiday Let Reservation, Mill Wheel </br> Bob Johnson Family </br> 01933 526655",
                         
    "10:45 AM",
                         
    "Reservation for 5 days"); 
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #18
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    11
    Rep Power
    0

    wrong data


    Morning

    Yea i tried that with no joy, just tried doing it this way:

    PHP Code:
    $sqlCommand "SELECT * FROM reservations"
    $query mysqli_query($connection$sqlCommand) or die (mysqli_error());
    $reservationDisplay '';
    while (
    $row mysqli_fetch_array($query)) { 
        
    $reservationid $row["id"];
        
    $propertyname $row["propertyname"];
        
    $checkindate $row["checkindate"];
        
    $checkoutdate $row["checkoutdate"];
        
    $checkintime $row["checkintime"];
        
    $checkouttime $row["checkouttime"];
        
    $customerref $row["customerref"];
        
    $duration $row["duration"];
        
    $pets $row["pets"];
        
    $newcheckinDate preg_replace("/(\d+)\D+(\d+)\D+(\d+)/","$3-$2-$1",$checkindate);
        
    $reservationDisplay .='' .$thisCal'->addEvent(' .$newcheckinDate',
                         "Holiday Let Reservation, Mill Wheel </br> Bob Johnson Family </br> 01933 526655",
                         "10:45 AM",
                         "Reservation for 5 days");'
    ;

    mysqli_free_result($query); 
    But now i am actually getting an error so not sure if this is a step further so to speak or a step back.


    Catchable fatal error: Object of class myEventsCalendar could not be converted to string in /home/ourboaty/public_html/management/adminhome.php on line 58
  6. #19
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    11
    Rep Power
    0
    Thanks for your help guys I managed to get it to work with the following:

    [PHP:]

    $sqlCommand = "SELECT * FROM reservations";
    $query = mysqli_query($connection, $sqlCommand) or die (mysqli_error());
    $reservationDisplay = '';
    while ($row = mysqli_fetch_array($query)) {
    $reservationid = $row["id"];
    $propertyname = $row["propertyname"];
    $checkindate = $row["checkindate"];
    $checkoutdate = $row["checkoutdate"];
    $checkintime = $row["checkintime"];
    $checkouttime = $row["checkouttime"];
    $customerref = $row["customerref"];
    $duration = $row["duration"];
    $pets = $row["pets"];
    $newcheckinDate = preg_replace("/(\d+)\D+(\d+)\D+(\d+)/","$2-$1-$3",$checkindate);
    $reservationDisplay .='' .$thisCal->addEvent(date($newcheckinDate),
    "Holiday Let Reservation, Mill Wheel </br> Bob Johnson Family </br> 01933 526655",
    "10:45 AM",
    "Reservation for 5 days"). '';
    }
    mysqli_free_result($query);

    [/PHP]
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo