Help keeping track of my variables

Help keeping track of my variables

Hello,
      When a user login to my website his account is automatic displayed with column: name of sender, Time, Response. The last column:Response: have two buttons: accept and decline.
If the user click  accept a dialog box should come up.  I want when I click accept in row 1 then the sender appears in the dialog box. and if click"accept" the second row a new dialog box appears with sender name that is associate with this row.  result.php is where build table from my database. It is then display in the index.php.


 HTML result.php code:
<table width="100%" cellpadding="10" cellspacing="0" border="2" > 

<tr class="brownHeader" style="border:1px solid #cccccc">
           <td  width="110px">Sdudent</td>
                    <td  width="110px"> time</td>
     <td width="230px"> Response </td>
</tr>
                   <table id="mytable" width="100%"  >
                            <?php while($row=mysql_fetch_assoc($msg_query)) { ?>                   
                            <tr   >
                            
                                <td width="110px" ><?=  $row["sender_id"]; ?></td>
<td  width="110px"><? echo $row["hours"] ,":",$row["mins"]; ?></td>
                                <td  width="130px"> 
                                   <table id="table" width="100%"  >
                                      <tr>
                                          <td id="accept"> <input type="button"class="btnShowSimple" value="Accept " </td>                                        </tr>
                                      <tr>
                                          <td id="decline"> <input type="button" class="decline"value="Decline"/></td>
                                           </tr> 
                                   </table>
                              </td>
                         </tr>
                           
                            <?php }?>
                            
                            </table>
</table>


JQuery Section:

 <script src="scripts/jquery-1.4.3.min.js" type="text/javascript"></script>
    
        
 <script>
 $(document).ready(function(){
 $(".btnShowSimple").click(function (e)
            {
                ShowDialog(false);
// $('#checkdiv').show();
                e.preventDefault();
            });
 $("#btnClose").click(function (e)
         {
                HideDialog();
                e.preventDefault();
      });

   
});



function ShowDialog(modal)
        {
            $("#overlay").show();
            $("#dialog").fadeIn(300);

            if (modal)
            {
                $("#overlay").unbind("click");
            }
            else
            {
                $("#overlay").click(function (e)
                {
                    HideDialog();
                });
            }
        }

        function HideDialog()
        {
            $("#overlay").hide();
            $("#dialog").fadeOut(300);
        } 
</script>

HTML code for index.php:

<?php
session_start();
$username=$_SESSION['username'];
$myPHPvar = $_SESSION['myPHPvar'];
echo $username;
echo " here am I";
?>


<!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" />
<title>Untitled Document</title>



 <style>
      #branded-page-body-container {
      background-color: #590404;
      background-repeat: repeat-y;
      background-position: center top;
  }
  div.ui-selected{ border:medium solid green; background-color:lightgreen }
  
  div.ui-selecting{ border:medium solid green }
  
  td { color:#008; }
 td.sogreen { color:green; font-weight: bolder; }
 web_dialog_overlay
{
   position: fixed;
   top: 0;
   right: 0;
   bottom: 0;
   left: 0;
   height: 100%;
   width: 100%;
   margin: 0;
   padding: 0;
   background: #000000;
   opacity: .15;
   filter: alpha(opacity=15);
   -moz-opacity: .15;
   z-index: 101;
   display: none;
}

.web_dialog
{
   display: none;
   position: fixed;
   width: 500px;
   height: 350px;
   top: 50%;
   left: 50%;
   margin-left: -190px;
   margin-top: -100px;
   background-color: #ffffff;
   border: 2px solid #336699;
   padding: 0px;
   z-index: 102;
   font-family: Verdana;
   font-size: 10pt;
}


.dialog_overlay
{
   position: fixed;
   top: 0;
   right: 0;
   bottom: 0;
   left: 0;
   height: 100%;
   width: 100%;
   margin: 0;
   padding: 0;
   background: #000000;
   opacity: .15;
   filter: alpha(opacity=15);
   -moz-opacity: .15;
   z-index: 101;
   display: none;
}

.dialog_box
{
   display: none;
   position: fixed;
   width: 500px;
   height: 350px;
   top: 50%;
   left: 50%;
   margin-left: -190px;
   margin-top: -100px;
   background-color: #ffffff;
   border: 2px solid #336699;
   padding: 0px;
   z-index: 102;
   font-family: Verdana;
   font-size: 10pt;
}


.blank{
display:none;
}

.web_dialog_title
{
   border-bottom: solid 2px #336699;
   background-color: #336699;
   padding: 4px;
   color: White;
   font-weight:bold;
}
.web_dialog_title a
{
   color: White;
   text-decoration: none;
}
.align_right
{
   text-align: right;
}

    </style>
      
</head>

<body>


<div id="load_tweets"> </div>
             
                        <!--div id="checkdiv">
<div id="output"></div-->
                      <div id="overlay" class="web_dialog_overlay"></div>

<div id="dialog" class="web_dialog">
<table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
                            
  <tr>
      <td class="web_dialog_title">Online Survey</td>
      <td class="web_dialog_title align_right">
        <a href="#" id="btnClose">Close</a>
    </td>
  </tr>
 
  <tr>
     <td colspan="2" style="padding-left: 15px;">
         <b>Choose your favorite mobile brand? </b>
    </td>
  </tr>
<tr>
    <td>&nbsp;</td>
      <td>&nbsp;</td>
  </tr>
   

                               
 
<?php $hrs=$_POST['hours']; $min=$_POST['mins'];?>
       
           <!-- BEGIN .box-side -->
      <form  method="post" id="popform"  class="timeform " >
                                     
                                     <tr>
    <td colspan="2" style="padding-left: 15px;">
                    <input type="hidden" style="width:125px" class="tutor_name"  name="usrname" value="<?php echo $username;?>" id="usrname"  /><br/>
      <div  id='sub-links'>
     
                    
<p id='promotion-link'>
        <a href="javascript:void(0);" onclick="$(&#x27;#promotion-form&#x27;).removeClass(&#x27;blank&#x27;); $(&#x27;#promotion-link&#x27;).hide();" rel="nofollow">Change Tutoring time</a></p>
                        <!--a href="#" id="get_tutoringtime">Change Tutoring time </a>
                                    
                                   <div id="get_tutoringtimee"> <a href="#" >Change Tutoring time </a></div>
                                    <input type="button" id="get_tutoringtime" value="Change Tutoring time" />
                            <!--div id="promotion-link">Some Content  $(&#x27;#change&#x27;).val(&#x27;"YES"&#x27;);</div--> 
<div class='blank' id='promotion-form'>
                                
                <input type="text" style="width:50px" class="tbox2Smaller"  name="hr" value="hrs" id="hr"  />
                                
              <input type="text" style="width:50px" class="tbox2Smaller1"  name="mn" value="mins" id="mn"  />
                
          </div> <!--end promotion-link-->
                  <input type="hidden" style="width:50px"  name="change_id" value="NO" id="Change_id"  />
                                                     <input type="text" name="get_sender1"class="btnShowSimple" value="<? echo $myPHPvar ?> " />
                <br/> <br/>
                             
          </div>
                                       
                                         </td> 
     
  </tr>
  <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" style="text-align: center;">
        <input type="button"  name="action" id="accept" value="Accept ">
                                <!--input type="submit"  name="action" value="Submi"-->
                         <input type="button" name="action" id="decline" value="Decline"/>
      </td>
  </tr>
                        </form>
  </table>
  </div><!-- web_dialog-->
                 
                 
         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> 
    
    <script src="../../scripts/jquery-1.4.3.min.js" type="text/javascript"></script>

<script type="text/javascript">    
$(document).ready(function(){
$('#load_tweets').load('result.php').fadeIn("slow");
 
/* ("#get_tutoringtime").click(function(){
  
  alert('i am here');
  ('.blank').show();
  
  return e.preventDefault();
  
});*/
 var auto_refresh = setInterval(
function ()
{
$('#load_tweets').load('result.php').fadeIn("slow");
}, 10000); // refresh every 10000 milliseconds
 
 
 
});
function ShowDialog(modal)
   {
      $("#overlay").show();
      $("#dialog").fadeIn(300);
 // $("#dialog_box").fadeIn(300);

      if (modal)
      {
         $("#overlay").unbind("click");
      }
      else
      {
         $("#overlay").click(function (e)
         {
            HideDialog();
         });
      }
   }
   
   
   

   function HideDialog()
   {
      $("#overlay").hide();
      $("#dialog").fadeOut(300);
$("#cboxOverlay").hide();
 $("#colorbox").fadeOut(300);
   } 
   

</script>         
                 
</body>
</html>