tektest Posted January 13, 2011 Share Posted January 13, 2011 Hello, This is my first post on this forum and hopefully someone will be able to help. Here is the deal: I m using Jumi and the below code to display which rooms are located on which floor. Room icon should change based on the floor in the url which look like this: /index.php/en/suite.html?floor=0&room=102 My problem is that when I change pages (rooms) the current room doesnt change and other rooms on the current floor do not get selected. This error seems to be happening only in Jumi. (If I run it via a wrapper everything works). The strange thing is that the floor indicator works fine and gets its floor id when floors are switched but the rooms stay on the bottom floor and do not react to floor switching. Hopefully some one can help with an advice. Thank you. <?php // Check correct floor if (isset($_GET['floor'])) { $floor = $_GET['floor']; } if (!isset($floor)) $floor = 0; if ($floor < 0 or $floor > 4) $floor = 0; // Check correct room if (isset($_GET['room'])) { $room = $_GET['room']; } if (!isset($room)) $room = 0; switch ($floor) { case 0: if (!($room >=101 and $room <=110)) $room = 101; break; case 1: if (!($room >=201 and $room <=205)) $room = 205; break; case 2: if (!($room >=306 and $room <=309)) $room = 308; break; case 3: if (!($room >=410 and $room <=414)) $room = 412; break; case 4: if (!($room >=516 and $room <=520)) $room = 518; break; } function show_room($room_current) { global $room, $floor; if ($room_current >= 201 and $room_current <= 205) { if ($room_current == $room) { return '<img src="images/buttons/c'.$room_current.'.png" width="40" height="28" border="0" class="btn">'; }elseif($floor==1){ return '<a href="index.php/en/suite.html?floor=1&room='.$room_current.'#photo"><img src="images/buttons/b'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; }else{ return '<a href="index.php/en/suite.html?floor=1&room='.$room_current.'#photo"><img src="images/buttons/a'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; } }elseif($room_current >= 306 and $room_current <= 309){ if ($room_current == $room) { return '<img src="images/buttons/c'.$room_current.'.png" width="40" height="28" border="0" class="btn">'; }elseif($floor==2){ return '<a href="index.php/en/suite.html?floor=2&room='.$room_current.'#photo"><img src="images/buttons/b'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; }else{ return '<a href="index.php/en/suite.html?floor=2&room='.$room_current.'#photo"><img src="images/buttons/a'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; } }elseif($room_current >= 410 and $room_current <= 414){ if ($room_current == $room) { return '<img src="images/buttons/c'.$room_current.'.png" width="40" height="28" border="0" class="btn">'; }elseif($floor==3){ return '<a href="index.php/en/suite.html?floor=3&room='.$room_current.'#photo"><img src="images/buttons/b'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; }else{ return '<a href="index.php/en/suite.html?floor=3&room='.$room_current.'#photo"><img src="images/buttons/a'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; } }elseif($room_current >= 516 and $room_current <= 520){ if ($room_current == $room) { return '<img src="images/buttons/c'.$room_current.'.png" width="40" height="28" border="0" class="btn">'; }elseif($floor==4){ return '<a href="index.php/en/suite.html?floor=4&room='.$room_current.'#photo"><img src="images/buttons/b'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; }else{ return '<a href="index.php/en/suite.html?floor=4&room='.$room_current.'#photo"><img src="images/buttons/a'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; } }elseif($room_current >= 101 and $room_current <= 110){ if ($room_current == $room) { return '<img src="images/buttons/c'.$room_current.'.png" width="40" height="28" border="0" class="btn">'; }elseif($floor==0){ return '<a href="index.php/en/suite.html?floor=0&room='.$room_current.'#photo"><img src="images/buttons/b'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; }else{ return '<a href="index.php/en/suite.html?floor=0&room='.$room_current.'#photo"><img src="images/buttons/a'.$room_current.'.png" width="40" height="28" border="0" class="btn"></a>'; } }else{ return '<img src="images/buttons/a'.$room_current.'.png" width="40" height="28" border="0" class="btn">'; } } ?> <div style="padding-top: 20px; padding-bottom: 20px;"> <?php echo show_room(201); ?> <?php echo show_room(202); ?> <?php echo show_room(203); ?> <?php echo show_room(204); ?> <?php echo show_room(205); ?> <?php echo show_room(306); ?> <?php echo show_room(309); ?> <?php echo show_room(410); ?> <?php echo show_room(414); ?> <?php echo show_room(516); ?> <?php echo show_room(518); ?> <?php echo show_room(519); ?> <?php echo show_room(520); ?> <?php echo show_room(103); ?> </div> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.