Location: PHPKode > projects > MyTodos > edit-todo.php
<?
###################################################
#Copyright (C) 2002 Lihua Gao (hide@address.com) 
#
#$Id: edit-todo.php,v 1.1 2002/12/05 10:03:33 gaolihua Exp $
#
#This file is part of myTodos.
#
#myTodos is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#myTodos is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with myTodos; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#####################################################
?>
<?
session_start();
include("constants.php");
require_once("config.php");
include("header.php");
?>

<script type="text/javascript" language="JavaScript">
function showCalendar(form,field)
{
	var calenderWin=window.open("calendar.php?m=11&dj=2002&form="+form+"&field="+field, "","width=210,height=210");
	calenderWin.focus();
}
</script>

<table cellspacing="0" class="table3">
	<tr class="rowtitle">
		<td><h5>Edit event with id: <?=$tds_id?> </h5></td>
	</tr>
   <!-- empty line -->
   <TR><TD>&nbsp;</TD></TR>
	<tr>
    	<td>


      <? 

      $sql = "SELECT * FROM todos where tds_id=$tds_id";
      $result = mysql_query($sql, $conn);
      $cnt_rows = mysql_num_rows($result);


      $row = mysql_fetch_array($result, MYSQL_BOTH);

      ?>


      <FORM  action="edit-todo-action.php" method="POST" name="edit_todo_action" enctype="multipart/form-data" title="TITLE">

		<input type="hidden" name="tds_id" value="<?=$tds_id?>">

      <table>
      <TR>
         <TD> tds_subject </TD>   <TD> <INPUT TYPE="TEXT" value="<?echo $row['tds_subject']?>" name="tds_subject"> </TD>
      </TR>
      <TR>
         <TD> tds_details </TD>   <TD> <INPUT TYPE="TEXT" value="<?echo $row['tds_details']?>" name="tds_details"> </TD>
      </TR>
      <TR>
         <TD> tds_startdate </TD>   <TD> <INPUT TYPE="TEXT" value="<?echo substr($row['tds_startdate'],0,10) ?>" name="tds_startdate"> <a href="javascript:showCalendar('edit_todo_action','tds_startdate')"><img src="images/arrow.bmp" alt="show calender" width="16" height="14" border="0"></a> </TD> 
         <TD> time </TD> <TD> <INPUT TYPE="TEXT" value="<?echo substr($row['tds_startdate'],11,8) ?>" name="time"> </TD> 
      </TR>
      <TR>
         <TD> tds_duration </TD>   <TD> <INPUT TYPE="TEXT" value="<?echo $row['tds_duration']?>" name="tds_duration"> </TD> <TD> minute(s)</TD>
      </TR>
      <TR>
         <TD> tds_enddate </TD>   <TD> <INPUT TYPE="TEXT" value="<?echo substr($row['tds_enddate'],0,10) ?>" name="tds_enddate"> <a href="javascript:showCalendar('edit_todo_action','tds_enddate')"><img src="images/arrow.bmp" alt="show calender" width="16" height="14" border="0"></a> </TD>
      </TR>
      <TR>
         <TD> tds_datetype </TD>   
         <TD> <!--INPUT TYPE="TEXT" value="<?echo $row['tds_datetype']?>" name="tds_datetype"--> 

            <SELECT NAME="datetypes">
               <?
               for ($i=0; $i<sizeof($_DATETYPES); $i++)
               {
                  if (substr($_DATETYPES[$i],0,1)==$row['tds_datetype'])
                     $selected="selected";
                  else
                     $selected="";
               ?>
                  <OPTION <?=$selected?> value="<?=$_DATETYPES[$i]?>"> <?=$_DATETYPES[$i]?>
               <?
               }
               ?>
            </SELECT>

         </TD>
      </TR>
      <TR>
         <TD> tds_datestep </TD>   <TD> <INPUT TYPE="TEXT" value="<?echo $row['tds_datestep']?>" name="tds_datestep"> </TD> 
         <TD> every _ day/week/month(s)</TD>
      </TR>
      <TR>
         <TD> tds_alertahead </TD>   <TD> <INPUT TYPE="TEXT" value="<?echo $row['tds_alertahead']?>" name="tds_alertahead"> </TD>
      </TR>

      <TR><TD> &nbsp;</TD></TR>

      </table>

      <INPUT TYPE="SUBMIT"  name="submit" value="update event">

      </FORM>


      </td>
	</tr>
</table>


<?
include("footer.php");
?>
Return current item: MyTodos