Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv8628 Modified Files: misc.inc.php mysql.inc.php pgsql.inc.php plate_edit.phtml user_edit.phtml user_list.phtml Log Message: Added db_date_never to deal with 0001-01-01 vs. 0000-00-00 Index: misc.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** misc.inc.php 5 Aug 2002 11:29:34 -0000 1.34 --- misc.inc.php 9 Sep 2002 06:39:01 -0000 1.35 *************** *** 25,28 **** --- 25,30 ---- // + require_once("db.inc.php"); + function html($txt, $nbsp = true) { *************** *** 46,52 **** function strtodate($txt) { ! if($txt == "") return "0000-00-00"; $t = @strtotime($txt); ! if($t < 0) return "0000-00-00"; return date("Y-m-d", $t); } --- 48,54 ---- function strtodate($txt) { ! if($txt == "") return db_date_never(); $t = @strtotime($txt); ! if($t < 0) return db_date_never(); return date("Y-m-d", $t); } *************** *** 54,60 **** function strtodatetime($txt) { ! if($txt == "") return "0000-00-00 00:00:00"; $t = @strtotime($txt); ! if($t < 0) return "0000-00-00 00:00:00"; return date("Y-m-d H:i:s", $t); } --- 56,62 ---- function strtodatetime($txt) { ! if($txt == "") return db_date_never()." 00:00:00"; $t = @strtotime($txt); ! if($t < 0) return db_date_never()." 00:00:00"; return date("Y-m-d H:i:s", $t); } *************** *** 62,66 **** function htmldate($txt, $nbsp = true) { ! if(substr($txt, 0, 10) == "0000-00-00") return ($nbsp ? "-" : ""); return $txt; --- 64,68 ---- function htmldate($txt, $nbsp = true) { ! if(substr($txt, 0, 10) == db_date_never()) return ($nbsp ? "-" : ""); return $txt; *************** *** 69,73 **** function htmldatetime($txt) { ! if(substr($txt, 0, 10) == "0000-00-00") return "-"; return substr($txt, 0, 16); --- 71,75 ---- function htmldatetime($txt) { ! if(substr($txt, 0, 10) == db_date_never()) return "-"; return substr($txt, 0, 16); Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mysql.inc.php 9 Sep 2002 06:29:34 -0000 1.10 --- mysql.inc.php 9 Sep 2002 06:39:01 -0000 1.11 *************** *** 270,272 **** --- 270,277 ---- } + function db_date_never() + { + return "0000-00-00"; + } + ?> Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pgsql.inc.php 9 Sep 2002 06:29:34 -0000 1.6 --- pgsql.inc.php 9 Sep 2002 06:39:01 -0000 1.7 *************** *** 334,336 **** --- 334,341 ---- } + function db_date_never() + { + return "0001-01-01"; + } + ?> Index: plate_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/plate_edit.phtml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** plate_edit.phtml 29 Aug 2002 16:51:34 -0000 1.26 --- plate_edit.phtml 9 Sep 2002 06:39:01 -0000 1.27 *************** *** 335,339 **** $protos = Protocol::getBriefer($e["protocolType"]); if(isset($events[$eid]["eventDate"]) && ! $events[$eid]["eventDate"] != "0000-00-00") $ed = $events[$eid]["eventDate"]; else $ed = ""; --- 335,339 ---- $protos = Protocol::getBriefer($e["protocolType"]); if(isset($events[$eid]["eventDate"]) && ! $events[$eid]["eventDate"] != db_date_never()) $ed = $events[$eid]["eventDate"]; else $ed = ""; Index: user_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_edit.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** user_edit.phtml 5 Aug 2002 11:29:35 -0000 1.13 --- user_edit.phtml 9 Sep 2002 06:39:01 -0000 1.14 *************** *** 183,187 **** { $nev = ""; ! if($actu == "0000-00-00") $actu = ""; } --- 183,187 ---- { $nev = ""; ! if($actu == db_date_never()) $actu = ""; } *************** *** 228,232 **** if($actu == "9999-12-31") $actu = "never"; ! else if($actu == "0000-00-00") $actu = "inactive account"; ?> --- 228,232 ---- if($actu == "9999-12-31") $actu = "never"; ! else if($actu == db_date_never()) $actu = "inactive account"; ?> Index: user_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_list.phtml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** user_list.phtml 29 Aug 2002 16:51:34 -0000 1.12 --- user_list.phtml 9 Sep 2002 06:39:01 -0000 1.13 *************** *** 120,124 **** if($date == "9999-12-31") return "<span class=active_0>forever</span>"; ! if($date == "0000-00-00") return "<span class=active_5>-</span>"; if($daysLeft > 30) --- 120,124 ---- if($date == "9999-12-31") return "<span class=active_0>forever</span>"; ! if($date == db_date_never()) return "<span class=active_5>-</span>"; if($daysLeft > 30) |