pop up window based on php input value
===

i have a edit_ticket_check.php page like this


    <form name="frm"  action="edit_ticket_asso.php" method="post" onSubmit="return validt(frm)" > 

    <table frame=box align=center bgcolor="9966FF">
    <b><h2>Enter Ticket Information</h2></b> 
    </table>

then some boxes like this

    <tr><td><font color="BLACK">Ticket Status:</font></td>
    <td>
 	<?php 
    		echo "<select name=\"ticket_status\">";  
  		echo "<option size =15 selected>Select</option>"; 
    		if(mysql_num_rows($result4))  
  			{  
  		  	while($row = mysql_fetch_assoc($result4))  
   		 		{  
  		  		echo "<option>$row[ticket_status]</option>";  
   		 		}  
  
   		 	}  
   		 else { 
   		 	echo "<option>No Status Present</option>";   
    			}  
	
  	?> 
     </td>	

the input values goes to second page edit_ticket.php page. where it enters the value in mysql database.

    if($_POST['submit']=="Insert")
	{
	$ticket_no=$_POST['ticket_no'];
	if ( @$_SESSION[username] == 'admin')
		{
		$assigned_to=$_POST['emp_name'];
		}
	else
		$assigned_to = @$_SESSION[userid][0];

       	$reassigned_to_team=$_POST['reassigned_to_team'];
	$ticket_status=$_POST['ticket_status'];
   	$comment=$_POST['comment'];
       if($ticket_no!=NULL&&$assigned_to!=NULL&&$comment!=NULL)
     	{
	
	$query1=mysql_query("select count(ticket_no) as total from ticket where ticket_no='$ticket_no';");

	$row = mysql_fetch_array($query1);
	if ($row["total"]>"0")
	 	{ 
		$query2="UPDATE ticket SET ticket.assigned_to='$assigned_to', ticket.reassigned_to_team='$reassigned_to_team', ticket.ticket_status='$ticket_status', ticket.comment='$comment' WHERE  ticket.ticket_no='$ticket_no'";
	    	
	        $result1=mysql_query("$query2");    
	        

now after this i want that if ticket status = 'pending' then a new pop up window will come up and take a time value and then update the time value of ticket by the ndewly entered time.

for pop up window i got this code


    <html>
    <body>

    <p>Click the button to add resolution time with pending ticket.</p>

    <button onclick="myFunction()">Pending</button>

     <p id="demo"></p>

    <script type="text/javascript">
    function myFunction()
    {
    var x;
    
    var name=prompt("Please enter Resolution Time","2099-12-31 23:59:59");
    
    if (name!=null)
      {
      x="Hello " + name + "! How are you today?";
      document.getElementById("demo").innerHTML=x;
      }
    }
    </script>

now i cant connect this two pages and also unable to pass the values from new pop up window to old window.

how can i do this?

since php is a server side language so it cant be dyanamic like javascript which is client side language... any better idea to do this other way round?
please help me... 

thank you..