From f8fbc9c0cf182963e92a176dd84c569b00ab42f5 Mon Sep 17 00:00:00 2001 From: cookie Date: Tue, 28 Nov 2006 10:09:05 +0000 Subject: [PATCH] UserCreateDate wird abgelegt und angezeigt git-svn-id: svn://svn.cccv.de/engel-system@180 29ba0400-6e00-0410-a75a-ca02368028f8 --- DB/Himmel.sql | 3 ++- DB/change_db_to_v180.sql | 3 +++ www-ssl/admin/user.php | 7 +++++-- www-ssl/makeuser.php | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 DB/change_db_to_v180.sql diff --git a/DB/Himmel.sql b/DB/Himmel.sql index 265ee9b2..0fe5a6e9 100755 --- a/DB/Himmel.sql +++ b/DB/Himmel.sql @@ -195,7 +195,8 @@ CREATE TABLE IF NOT EXISTS `User` ( `color` tinyint(4) default '1', `Sprache` char(2) default 'EN', `Avatar` int(11) default '0', - `lastLogIn` datetime default NULL, + `lastLogIn` datetime NOT NULL default '0000-00-00 00:00:00', + `CreateDate` datetime NOT NULL default '0000-00-00 00:00:00', `Art` varchar(30) default NULL, `kommentar` text, PRIMARY KEY (`UID`,`Nick`), diff --git a/DB/change_db_to_v180.sql b/DB/change_db_to_v180.sql new file mode 100644 index 00000000..d834fd2d --- /dev/null +++ b/DB/change_db_to_v180.sql @@ -0,0 +1,3 @@ +ALTER TABLE `User` ADD `CreateDate` DATETIME NULL AFTER `lastLogIn`; +ALTER TABLE `User` CHANGE `lastLogIn` `lastLogIn` DATETIME NOT NULL DEFAULT 'NOW()', +CHANGE `CreateDate` `CreateDate` DATETIME NOT NULL DEFAULT 'NOW()'; diff --git a/www-ssl/admin/user.php b/www-ssl/admin/user.php index 78701538..98495b99 100755 --- a/www-ssl/admin/user.php +++ b/www-ssl/admin/user.php @@ -26,7 +26,10 @@ if (!IsSet($_GET["enterUID"])) ?> - + @@ -55,7 +58,7 @@ if (!IsSet($_GET["enterUID"])) for ($n = 0 ; $n < $Zeilen ; $n++) { echo "\n"; - echo "\t\n"; + echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; diff --git a/www-ssl/makeuser.php b/www-ssl/makeuser.php index 6bf630de..b02f6923 100755 --- a/www-ssl/makeuser.php +++ b/www-ssl/makeuser.php @@ -53,7 +53,7 @@ if( isset($_POST["send"])) "`ICQ`, ". "`jabber`, ". "`Size`, ". "`Passwort`, ". "`Art` , ". "`kommentar`, ". - "`Hometown` ) ". + "`Hometown`,". "`CreateDate` ) ". "VALUES ( ". "'". $_POST["Nick"]. "', ". "'". $_POST["Name"]. "', ". "'". $_POST["Vorname"]. "', ". $_POST["Alter"]. ", ". @@ -62,7 +62,7 @@ if( isset($_POST["send"])) "'". $_POST["ICQ"]. "', ". "'". $_POST["jabber"]. "', ". "'". $_POST["Size"]. "', ". "'". $_POST["Passwort"]. "', ". "'". $_POST["Art"]. "', ". "'". $_POST["kommentar"]. "', ". - "'". $_POST["Hometown"]. "' );"; + "'". $_POST["Hometown"]. "',". "NOW());"; $Erg = mysql_query($SQL, $con); if ($Erg != 1)
?OrderBy=Nick">Nick + ?OrderBy=Nick">Nick | + ?OrderBy=CreateDate">CreateDate + ?OrderBy=Name">Name ?OrderBy=Vorname">Vorname ?OrderBy=Alter">Alter
".mysql_result($Erg, $n, "Nick"). "".mysql_result($Erg, $n, "Nick"). "
(Create: ". mysql_result($Erg, $n, "CreateDate"). ")
".mysql_result($Erg, $n, "Name")."".mysql_result($Erg, $n, "Vorname")."".mysql_result($Erg, $n, "Alter")."