Jump to content

help on PHP-- saving value in Session and retrieving in popup window


Recommended Posts

hi all,

 

I got this code: This is for the calendar what i have made, it works fine...

the value of $i is the daycount (1..30 or 31),

 

What i did is when i saved the value of $i in $_SESSION['mydate']= $i;

It works fine, but what i need is when i mouse over the calendar day i need to pass the dayvalue to another pop up window from where i can fetch the data from the database for that day..

 

Is it possible to do this with Javascript and PHP (without using AJAX).

 

<?php echo "<td class=".$class_bg.">
         <table width=\"25\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\">
         <tr>
              <td> </td>
              <td align=\"right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips)\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td>
              <td  style=\"width:3px\">";
   $_SESSION['mydate']= $i;
      echo " </td>
     </tr>
           <tr>
           <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
              <tr>
               <td colspan=\"2\" style=\"height:8px\"></td>
              </tr>
             
           </table></td>
         </tr>
         </table>
        </td>";

?>

 

 

This code is copied from above.. altered the javascript On mouse over i am passing the variable for day... it did not work

 

<?php<tr>
              <td> </td>
              <td align=\"right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips+".$i.")\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td>
              <td  style=\"width:3px\">";
   $_SESSION['mydate']= $i;
      echo " </td>
     </tr>?>

 

thnks in advance...

<td align="right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips+".$i.")\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td>

 

i think u shud try it as,if ur passing $i as a seperate parameter to javascript fn.

<td align="right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips,".$i.")\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td>

 

IT shows error while doing that.. cause the javascript is like this

 

function doTooltip(e, msg) {
if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.clearTimer();
  var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
  if ( tip && tip.onmouseout == null ) {
      tip.onmouseout = Tooltip.tipOutCheck;
      tip.onmouseover = Tooltip.clearTimer;
  }
  Tooltip.show(e, msg);
}

so tat means javascript fn parameter-'msg' holds the value of $i.so ur code preferably shud b,

 

<td align="right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, \'".$i."\')\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td>

javascript function MEssage hold this value :

 

var msgTips = mytoday+'<font color="white"><strong>Reserved Time For </strong></font> <?php echo @$_SESSION['mycurrdate'];?><hr><?php 
$tbl=new Model;
$tbl->_table_name=RESERVATION_TABLE;
  
$sSqlQuery3="select * from ".RESERVATION_TABLE." WHERE 0=0";
$row3=$tbl->find_query_all($sSqlQuery3);
foreach($row3 as $res3){

echo "From:".$res3->user_reserve_time_start."  ";
echo "To:".$res3->user_reserve_time_end."   <hr>";
//echo "On:".$res3->user_reserve_date."<hr>";

}
?><br><hr><a href="#">Reserve Now</a>';

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.