CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

passing a variable (php) does not work !

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related
View previous topic :: View next topic  
Author Message
pixeline



Joined: 28 Jun 2006
Posts: 5

PostPosted: Wed Jun 28, 2006 10:31 pm    Post subject: passing a variable (php) does not work ! Reply with quote

hello !

i'm trying to pass a variable to the agenda.php that generates the javascript. If i point my browser directly to it, it works, but not within the generated form.

here is my embed code (html generated with php):

<iframe style="width:176px;height:189px;margin:auto;margin-left:0" width=174 height=189 name="gToday:outlook:mb_getDates.php?event_id=3:gfFlat:plugins1.js" id="gToday:outlook:mb_getDates.php?event_id=3:gfFlat:plugins1.js" src="MultiPicker/iflateng.htm" scrolling="no" frameborder="0">
<a name="gfFlat_spacer"><img width=172 height=180></a>
</iframe>


So if i go directly to the mb_getDates.php?event_id=3 it shows the code, but from within the form, the calendar does not show any date.

if you need, here is the mb_getDates.php php code:

Code:

<?php
session_start();
header("Content-Type: text/javascript");
require_once('../../_lib/config.inc.php');
require_once('../../_lib/admin_functions.inc.php');
// start db
$d = new db(0);
$event_id = trim($_REQUEST['event_id']);
if ($event_id != '') {
    $sql = "SELECT YEAR(event_date) AS year, MONTH(event_date) AS month,DAYOFMONTH(event_date) AS day  FROM dates WHERE event_id='$event_id'";
    $dates = $d->fetch($sql);
    if ($dates === false) {
        echo "<h2>db fetch() failed!</h2>";
        echo $d->log;
        exit();
    }
    foreach($dates as $date) {
        $year = $date['year'];
        $month = $date['month'];
        $day = $date['day'];

        ?>
    fAddEvent(<?php echo $year?>,<?php echo $month?>,<?php echo $day?>,"<?php echo $msg?>","<?php echo $action?>","<?php echo $bgcolor?>","<?php echo $fgcolor?>","<?php echo $bgimg?>","<?php echo $boxit?>","<?php echo $html?>");
    <?php
    }
}

?>



And here is the generated javascript:
Code:

    fAddEvent(2006,7,10,"","","","","","","");
        fAddEvent(2006,7,11,"","","","","","","");
        fAddEvent(2006,7,12,"","","","","","","");
        fAddEvent(2006,7,13,"","","","","","","");
        fAddEvent(2006,7,14,"","","","","","","");
        fAddEvent(2006,7,15,"","","","","","","");
        fAddEvent(2006,7,16,"","","","","","","");
        fAddEvent(2006,7,17,"","","","","","","");
        fAddEvent(2006,7,18,"","","","","","","");
        fAddEvent(2006,7,19,"","","","","","","");
        fAddEvent(2006,7,20,"","","","","","","");
        fAddEvent(2006,7,21,"","","","","","","");
        fAddEvent(2006,7,22,"","","","","","","");
        fAddEvent(2006,7,23,"","","","","","","");
        fAddEvent(2006,7,24,"","","","","","","");
        fAddEvent(2006,7,25,"","","","","","","");
        fAddEvent(2006,7,26,"","","","","","","");
        fAddEvent(2006,7,27,"","","","","","","");
   


can you tell me what i am doing wrong?

thanks a lot,

Alexandre[/code]
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Wed Jun 28, 2006 10:45 pm    Post subject: Reply with quote

I think your code looks good, except there was nothing in database. Since all you generated events were empty, how would you know whether they were loaded or not?

To make it clear, please replace the
Code:
,"<?php echo $action?>",
in your code with
Code:
,null,
And you should now see the difference.
_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
pixeline



Joined: 28 Jun 2006
Posts: 5

PostPosted: Wed Jun 28, 2006 11:13 pm    Post subject: Reply with quote

Hello, thank you for the prompt reply!!

ok, if i do it, it strikes through the date. What i wish it do is that it became selected. What should it be? popup ? i tried passing the event title, but does not do anything...

what i would like to is that the previously selected dates be displayed as selected (i'm using the outlook theme, so the dates background color should be the same as the selection yellow color).

thank you,

alexandre
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Thu Jun 29, 2006 1:56 am    Post subject: Reply with quote

Are you sure you want them selected? I'm asking because you didn't seem to be using the multi-select plugin. If you just want the agendas show up with different background or color, just fill some values to your database fields instead of leaving them empty. Also, please make sure the gAgendaMask option in your outlook.js is all set to -1.

If you did mean for multiple selection, I guess you just missed the instructions in the MultiPicker demo.

Please check the bottom of MultiPickerDemo1.htm in your product package for details and replace your current fAddEvent() calls with fAddRange() calls. The fAddRange() is defined in the plugins.js.

Maybe the better way is to start working on the MultiPickerDemo first, and switch to outlook theme later once you got all functions working.

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
pixeline



Joined: 28 Jun 2006
Posts: 5

PostPosted: Thu Jun 29, 2006 12:28 pm    Post subject: Reply with quote

Hello again,

I'm sorry, i'm not doing too well integrating your calendar Multipicker version to my needs, even using the MultiPicker demo. It's not clear to me in which file i should get the dates from the server and generate the fAddRange calls.
Some code is on the main html page, some is on the plugins.js and others in the agenda.js (mb_getDates.php in my case). I'm no expert in javascript, sorry...
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Thu Jun 29, 2006 12:38 pm    Post subject: Reply with quote

Could you please summarize all your needs here? Maybe we can help to get it done.
_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
pixeline



Joined: 28 Jun 2006
Posts: 5

PostPosted: Thu Jun 29, 2006 12:45 pm    Post subject: Reply with quote

Thanks for bearing with me Smile

OK, so this is for an event agenda, where each event is associated to many dates. I add no issue integrating the calendar in the creation of these associations, but where i'm stuck is for editing these associations.

1. retrieve dates from mysql via php: ok
2. have the multipicker calendar show currently associated dates as already selected. User would then deselect the incorrect dates, and add new ones if needed. so far, KO.

UPDATE/ in my last version , i add the fAddRange in an fInitCalendar function on the main html, which fuction is called onload in the main html page and that works better. it seems that was the correct thing to do but i have to test...
Back to top
View user's profile Send private message
pixeline



Joined: 28 Jun 2006
Posts: 5

PostPosted: Thu Jun 29, 2006 1:35 pm    Post subject: Reply with quote

thank you for your help and patience. It's working fine now... Smile
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Thu Jun 29, 2006 3:09 pm    Post subject: Reply with quote

That's great!

Any other questions let us know please, we'd be glad to help.

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group