Location: PHPKode > projects > MyTodos > display-option-action.php
<?
###################################################
#Copyright (C) 2002 Lihua Gao (hide@address.com) 
#
#$Id: display-option-action.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>Save display options </h5></td>
	</tr>
   <!-- empty line -->
   <TR><TD>&nbsp;</TD></TR>
	<tr>
    	<td>

         <table>

            <TR><TD>

            <?

            /*echo "tdd_usr_id: ".$tds_usr_id."<br>";
            echo "tds_subject: ".$tds_subject."<br>";*/
         
            //if (isset($usr_email))
            {
               $sql = "UPDATE todos_display SET ";

               $sql .= "tdd_updatedate=curdate(), ";

               $sql .= "tdd_tds_id='y', ";

               if (isset($tds_createdate))
                  $sql .= "tdd_tds_createdate='y', ";
               else
                  $sql .= "tdd_tds_createdate='n', ";

               if (isset($tds_updatedate))
                  $sql .= "tdd_tds_updatedate='y', ";
               else
                  $sql .= "tdd_tds_updatedate='n', ";

               $sql .= "tdd_tds_usr_id='n', ";

               if (isset($tds_subject))
                  $sql .= "tdd_tds_subject='y', ";
               else
                  $sql .= "tdd_tds_subject='n', ";

               if (isset($tds_details))
                  $sql .= "tdd_tds_details='y', ";
               else
                  $sql .= "tdd_tds_details='n', ";

               if (isset($tds_startdate))
                  $sql .= "tdd_tds_startdate='y', ";
               else
                  $sql .= "tdd_tds_startdate='n', ";

               if (isset($tds_duration))
                  $sql .= "tdd_tds_duration='y', ";
               else
                  $sql .= "tdd_tds_duration='n', ";

               if (isset($tds_enddate))
                  $sql .= "tdd_tds_enddate='y', ";
               else
                  $sql .= "tdd_tds_enddate='n', ";

               if (isset($tds_datetype))
                  $sql .= "tdd_tds_datetype='y', ";
               else
                  $sql .= "tdd_tds_datetype='n', ";

               if (isset($tds_datestep))
                  $sql .= "tdd_tds_datestep='y', ";
               else
                  $sql .= "tdd_tds_datestep='n', ";

               if (isset($tds_alertahead))
                  $sql .= "tdd_tds_alertahead='y', ";
               else
                  $sql .= "tdd_tds_alertahead='n', ";

               if (isset($tds_lastalert))
                  $sql .= "tdd_tds_lastalert='y', ";
               else
                  $sql .= "tdd_tds_lastalert='n', ";

               if (isset($tds_state))
                  $sql .= "tdd_tds_state='y' ";
               else
                  $sql .= "tdd_tds_state='n' ";

               $sql .= " WHERE tdd_usr_id='".$_SESSION['userid']."'";

               //echo "sql: ".$sql."<br>";

               $result = mysql_query($sql);
               if ($result) {
                  echo "<P>Data was saved !</P>";
                  echo "<P>To see events please click <a href='show-events.php'>here</a>";
                  echo "<P>To show display options please click <a href='display-option.php'>here</a>";
               }
               else {

                  echo  mysql_error();
                  echo "<P><a href=\"javascript:history.go(-1)\">back</a>";

               }

            }

	            
            ?>

            </TD></TR>
         </table>
      </td>
	</tr>
</table>

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