<?php include('opendb.php'); 
session_start();

?>

<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  <title>PSN Telcon</title>
   	 <script type="text/javascript" src="scripts/jquery-latest.js"></script>
		<link type="text/css" href="includes/style.css" rel="stylesheet" />
		<link href="css/form.css" type="text/css" rel="stylesheet" media="screen" />
		
  


<meta charset="utf-8" />
    <title>jQuery UI Dialog - Modal message</title>
    <link rel="stylesheet" href="popup/jquery-ui.css" />
    <script src="popup/jquery-1.8.2.js"></script>
    <script src="popup/jquery.bgiframe-2.1.2.js"></script>
    <script src="popup/jquery-ui.js"></script>
    <link rel="stylesheet" href="popup/style.css" />
	<script src="datetimepicker_css.js"></script>
    <script>
    $(function() {
        $( "#dialog-message" ).dialog({
            modal: true,
            buttons: {
                Ok: function() {
                    $( this ).dialog( "close" );
                }
            }
        });
    });
    </script>
  

<style>
 #tbl{
   margin-top:150px;
     }
</style>
	

<body bgcolor="EEEECE">


<br>





<?
$br=mysqli_query($db,"select * from reminder where brcode='$brcode' and user='$user' and id='$id' ");

$res=mysqli_fetch_array($br);


?>

<input type="button" value="Close Window" 
onclick="window.close()" class="button green close">
<FORM ACTION='<?print $PHP_SELF?>' METHOD='POST'>

<table cellspacing=1 cellpadding=1  class='form' >
<tr ><td align=center>
<table>
<tr><td colspan=2 align=center bgcolor='green'><font color='ivory'> EDIT REMINDER </font></TD></TR>

<tr><td>Due Date:</td><td> <input type="Text" id="demo2" name = 'due_date' maxlength="25" size="18" VALUE='<? echo $res[due_date];?>' />
     <img src="images/cal.gif" onclick="javascript:NewCssCal ('demo2','yyyyMMdd','dropdown',true,'24',true)"  style="cursor:pointer"/></td></tr>

<tr><td>Message:</td><td> <textarea name="msg" rows="5" cols="25"><? echo $res[message]; ?></textarea></td></tr>
<TR ><TD COLSPAN=2 ALIGN=CENTER><input type='hidden' name='id1' value='<? echo $res[id];?>'><INPUT TYPE=SUBMIT NAME= 'submit' VALUE='  SAVE  ' ></TD></TR></table></td></tr></table>
</form>

<?
if($submit)
{



if($msg=="")
{
print "<script> alert('Please Enter Message'); history.back(1);  </script>";
     return;
}
else
{
 $edit="update reminder set message='$msg',due_date='$due_date' where id='$id1'";
mysqli_query($db,$edit);

print "<script> alert('Reminder Hasbeen Edited Successfully');parent.document.location='index2.php';window.close();</script>";
     return;
}
}
?>



