Bonjour a tous,
J'ai un petit probleme avec un calendrier et un lightbox. Le calendrier est le super calendrier ajax http://www.bmgadg.com/super_ajax_calendar.php . Le lightbox c'est ibox mais je ne crois pas que c'est le probleme pcq j'en ai essayer plusieur et jai le meme probleme. Le probleme est que j'ai un calendrier avec des evenement. J'ai modifier le calendrier pour que quand tu clique sur l'evenement, un lightbox ouvre. Tout fonctionne 1 fois sur 3. La premiere fois que tu ouvre la page et que tu cliques dessu, c'est la page html qui ouvre. Alors tu recule. Tu reclique dessu et la le lightbox ouvre avec la page. Je ne comprend pas pourquoi. J'ai placer le js partout.
Voici la page index

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php 
require_once 'include/application_top.php';

if ($_REQUEST['logout']==1) {
    session_unset();
    session_destroy();
    $_SESSION = array();

    header("Location: index.php");
}

?>
<!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"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" type="image/ico" href="images/favicon.ico" />
<link href="ma_styles.css" rel="stylesheet" type="text/css" />
<link href="components/styles/xcrollstyles.css" rel="stylesheet" type="text/css" />
<link href="components/styles/SprySlidingPanels.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="ie-only.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="/calendar/super_calendar_style.css" />
<script type="text/javascript" src="/calendar/super_calendar.js"></script>
<script type='text/javascript' src="components/scripts/xcroll.js"></script>
<script type="text/javascript" src="components/scripts/dom-drag.js"></script>
<script type="text/javascript" src="components/scripts/SprySlidingPanels.js"></script>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
<?php 
if (!isset($_SESSION['showPopup'])) {
    $_SESSION['showPopup']='no';
    
    $qry="SELECT userId, message FROM userMessage WHERE showCheckBox=1 ORDER BY userMessageDate DESC LIMIT 0,1;";
    $res=$db->query($qry);
    
    if ($row=$res->fetchRow()) {
        $userMsg=$row[1];
        $userMsg=preg_replace("/\"/", "'", $userMsg);
        //echo "alert(\"Message from {$row[0]}: {$row[1]}\");\n";
    
    }
}
?>

//-->
</script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="include/js/utils.js" type="text/javascript"></script>

<link href="maContent_styles.css" rel="stylesheet" type="text/css" />
</head>

<body onload="MM_preloadImages('images/promotions_btn_ovr.jpg','images/the_resort_btn_ovr.jpg','images/accommodations_btn_ovr.jpg','images/golf_btn_ovr.jpg','images/spa_btn_ovr.jpg','images/meetings_btn_ovr.jpg','images/wedding_btn_ovr.jpg','images/dining_btm_ovr.jpg','images/casa_elar_btn_ovr.jpg','images/green_promise_btn_ovr.jpg','images/arts_leisure_btn_ovr.gif','images/enewsletter_btn_ovr.gif','images/community_btn_ovr.gif','images/travel_agents_btn_ovr.gif','images/press_center_btn_ovr.gif','images/careers_btn_ovr.gif','images/site_search_btn_ovr.gif','images/sitemap_btn_ovr.gif','images/associate_site_btn_ovr.png')">
........
<div align="center">
<div id="HeaderContainer">
......
  <div id="topCenterPanel">
  <!--CALENDRIER ICI-->
        <div id="calback">

    <div id="calendar"></div>

</div> 
  </div>
......
<script type="text/javascript">navigate('','','');</script>
</body>
</html>
ici le calendrier
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<? 

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 

header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); 

header("Cache-Control: no-cache, must-revalidate" ); 

header("Pragma: no-cache" );

header("Content-Type: text/xml; charset=utf-8");



//////////////////////////////////////

// set these variables for your MySQL

$dbhost = 'localhost';    // usually localhost

$dbuser = 'tucasa_innAtAG';        // database username

$dbpass = 'inn95.6';        // database password

//////////////////////////////////////



$db = @mysql_connect($dbhost, $dbuser, $dbpass) or die ("<?xml version=\"1.0\" ?><response><content><![CDATA[<span class='error'>Database connection failed.</span>]]></content></response>");

mysql_select_db('tucasa_innAtAGlance');



$xml = '<?xml version="1.0" ?><response><content><![CDATA[';



if($_GET['event'] != '') {

    $fields = explode("-",$_GET['event']);

    $result = mysql_query("SELECT *,DATE_FORMAT(`date`,'%b %e, %Y at %l:%i%p') as thedate,DATE_FORMAT(`date`,'%c') as themonth,DATE_FORMAT(`date`,'%Y') as theyear FROM `events` WHERE YEAR(`date`) = ".$fields[0]." AND MONTH(`date`) = ".$fields[1]." AND DAYOFMONTH(`date`) = ".$fields[2]." ORDER BY `num` ASC");

    

    $i = 0;

    while($row = mysql_fetch_array($result)) {

        $xml .= "<div id='event'";

        if($i < (mysql_num_rows($result)-1)) $xml .= " style='border-bottom:none'";

        $xml .= "><div class='heading'><div class='title'>".$row['heading']."</div><div class='posted'>".$row['thedate']."</div>";

        if($i == 0) $xml .= "<div class='back'><a href='javascript:navigate(".$row['themonth'].",".$row['theyear'].",\"\")'>Return to calendar</a></div>";

        $xml .= "</div><div class='line'>".$row['body']."</div><br /></div><br />";

        $i++;

    }

    

} else {

    $month = $_GET['month'];

    $year = $_GET['year'];

    

    if($month == '' && $year == '') { 

        $time = time();

        $month = date('n',$time);

        $year = date('Y',$time);

    }

    

    $date = getdate(mktime(0,0,0,$month,1,$year));

    $today = getdate();

    $hours = $today['hours'];

    $mins = $today['minutes'];

    $secs = $today['seconds'];

    

    if(strlen($hours)<2) $hours="0".$hours;

    if(strlen($mins)<2) $mins="0".$mins;

    if(strlen($secs)<2) $secs="0".$secs;

    

    $days=date("t",mktime(0,0,0,$month,1,$year));

    $start = $date['wday']+1;

    $name = $date['month'];

    $year2 = $date['year'];

    $offset = $days + $start - 1;

     

    if($month==12) { 

        $next=1; 

        $nexty=$year + 1; 

    } else { 

        $next=$month + 1; 

        $nexty=$year; 

    }

    

    if($month==1) { 

        $prev=12; 

        $prevy=$year - 1; 

    } else { 

        $prev=$month - 1; 

        $prevy=$year; 

    }

    

    if($offset <= 28) $weeks=28; 

    elseif($offset > 35) $weeks = 42; 

    else $weeks = 35; 

    

    $xml .= "
<table class='cal' cellpadding='0' cellspacing='1'>

            <tr>

                <td colspan='7' class='calhead'>

                    <table>

                    <tr>

                        <td>

                            <a href='javascript:navigate($prev,$prevy,\"\")' style='border:none'><img src='/calendar/images/calLeft.gif' alt='prev' /></a> <a href='javascript:navigate(\"\",\"\",\"\")' style='border:none'><img src='/calendar/images/calCenter.gif' alt='current' /></a> <a href='javascript:navigate($next,$nexty,\"\")' style='border:none'><img src='/calendar/images/calRight.gif' alt='next' /></a> <a href='javascript:void(0)' onClick='showJump(this)' style='border:none'><img src='/calendar/images/calDown.gif' alt='jump' /></a> 

                        </td>

                        <td align='right'>What's Happening -

                            $name $year2

                        </td>

                    </tr>

                    </table>

                </td>

            </tr>

            <tr class='dayhead'>

                <td>Sun</td>

                <td>Mon</td>

                <td>Tue</td>

                <td>Wed</td>

                <td>Thu</td>

                <td>Fri</td>

                <td>Sat</td>

            </tr>";

    

    $col=1;

    $cur=1;

    $next=0;

    

    for($i=1;$i<=$weeks;$i++) { 

        if($next==3) $next=0;

        if($col==1) $xml.="\n<tr class='dayrow'>"; 

          

        $xml.="\t<td valign='top' onMouseOver=\"this.className='dayover'\" onMouseOut=\"this.className='dayout'\">";

    

        if($i <= ($days+($start-1)) && $i >= $start) {

            $xml.="<div class='day'><b";

    

            if(($cur==$today[mday]) && ($name==$today[month]) && ($year2==$today[year])) $xml.=" style='color:#C00'";

    

            $xml.=">$cur</b></div>";

            

            $result = mysql_query("SELECT DATE_FORMAT(`date`,'%Y-%m-%e') FROM `events` WHERE MONTHNAME(`date`)='$name' AND DAYOFMONTH(`date`)=$cur AND YEAR(`date`)=$year2");

            if(mysql_num_rows($result) > 0) {

                $row = mysql_fetch_row($result);
//ICI le JAVASCRIPT//
                $xml.="<script src=\"/js/ibox.js\" type=\"text/javascript\"></script>
        <script type=\"text/javascript\">
iBox.setPath(\"/js/\");
iBox.padding = 50;
iBox.fade_in_speed = 5;
</script><div class='calevent'><a href='calendar/test.php?event=".$year."-".$month."-".$cur."' rel='ibox'>Event</a></div>";            

            }

            

            $xml.="\n\t</td>\n";

    

            $cur++; 

            $col++; 

            

        } else { 

            $xml.="&nbsp;\n\t</td>\n"; 

            $col++; 

        }  

            

        if($col==8) { 

            $xml.="\n</tr>\n"; 

            $col=1; 

        }

    }

    

    $xml.="</table>";

      

}

    

$xml .= "]]></content></response>";

echo $xml;



?>
Merci de votre aide