<?
###################################################
#Copyright (C) 2002 Lihua Gao (hide@address.com)
#
#$Id: display-option.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();
require_once("config.php");
include("header.php");
?>
<table cellspacing="0" class="table3">
<tr class="rowtitle">
<td><h5>Display options of events list</h5></td>
</tr>
<!-- empty line -->
<TR><TD> </TD></TR>
<tr>
<td>
<?
$sql = "SELECT * FROM todos_display WHERE tdd_usr_id='".$_SESSION['userid']."'";
$result = mysql_query($sql);
$tdd_row = mysql_fetch_array($result, MYSQL_ASSOC);
$sql = "SELECT todos.* FROM todos, users where tds_usr_id=usr_id AND usr_email='".$_SESSION['login']."'";
$result = mysql_query($sql);
$cnt_fields = mysql_num_fields($result);
$cnt_rows = mysql_num_rows($result);
?>
<FORM action="display-option-action.php" method="POST" name="display-option-action" enctype="multipart/form-data">
<TABLE >
<?
$i=0;
while ($i < $cnt_fields) {
$name = mysql_field_name($result, $i);
$checked=$tdd_row["tdd_".$name];
if ($checked=="y") $checked="checked";
else $checked="";
if ($name=="tds_id") $disabled="disabled";
else if ($name=="tds_usr_id") $disabled="disabled";
else $disabled="";
echo "<TR>";
echo "<TD> $name </TD> <TD> <INPUT ".$disabled." TYPE='CHECKBOX' ".$checked." name='$name'> </TD> ";
echo "</TR>";
$i++;
}
?>
<!-- empty line -->
<TR><TD> </TD></TR>
</TABLE>
<INPUT TYPE="SUBMIT" name="submit" value="change options">
</FORM>
</td>
</tr>
<!-- empty line -->
<TR><TD> </TD></TR>
</table>
<?
include("footer.php");
?>