• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

modules/dateplaner/includes/inc.freetime.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                                                                                       |
00005         |       Dateplaner Modul                                                                                                                  |                                                                                                     
00006         +-----------------------------------------------------------------------------+
00007         | Copyright (c) 2004 ILIAS open source & University of Applied Sciences Bremen|
00008         |                                                                             |
00009         | This program is free software; you can redistribute it and/or               |
00010         | modify it under the terms of the GNU General Public License                 |
00011         | as published by the Free Software Foundation; either version 2              |
00012         | of the License, or (at your option) any later version.                      |
00013         |                                                                             |
00014         | This program is distributed in the hope that it will be useful,             |
00015         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00016         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00017         | GNU General Public License for more details.                                |
00018         |                                                                             |
00019         | You should have received a copy of the GNU General Public License           |
00020         | along with this program; if not, write to the Free Software                 |
00021         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00022         +-----------------------------------------------------------------------------+
00023 */
00024 
00044 function str2date($in){
00045 
00046         $t = split("/",$in);
00047         if (count($t)!=3) $t = split("-",$in);
00048         if (count($t)!=3) $t = split(" ",$in);
00049 
00050         if (count($t)!=3) return -4;
00051 
00052         if (!is_numeric($t[0])) return -1;
00053         if (!is_numeric($t[1])) return -2;
00054         if (!is_numeric($t[2])) return -3;
00055         if ($t[2]<1902 || $t[2]>2037) return -3;
00056         if (!checkdate( $t[1], $t[0], $t[2] )) return -5;
00057 
00058         return mktime (0,0,0, $t[1], $t[0], $t[2]);
00059 }// end func
00060 
00068 function setDateInTblHead($timestamp)
00069 {
00070 
00071         $ttd = new TimestampToDate;
00072 
00073         $ttd->ttd($timestamp);
00074         $S_Datum[week]                          = $ttd->weeknumber;
00075         $ttd->ttd($timestamp);
00076         $S_Datum[monday_full]           = $ttd->extrashorttime ;
00077 
00078         $ttd->ttd(strtotime ("+1 day" , $timestamp));
00079         $S_Datum[tuesday_full]          = $ttd->extrashorttime ;
00080 
00081         $ttd->ttd(strtotime ("+2 day" , $timestamp));
00082         $S_Datum[wednesday_full]        = $ttd->extrashorttime ;
00083 
00084         $ttd->ttd(strtotime ("+3 day" , $timestamp));
00085         $S_Datum[thursday_full]         = $ttd->extrashorttime ;
00086 
00087         $ttd->ttd(strtotime ("+4 day" , $timestamp));
00088         $S_Datum[friday_full]           = $ttd->extrashorttime ;
00089 
00090         $ttd->ttd(strtotime ("+5 day" , $timestamp));
00091         $S_Datum[saturday_full]         = $ttd->extrashorttime ;
00092 
00093         $ttd->ttd(strtotime ("+6 day" , $timestamp));
00094         $S_Datum[sunday_full]           = $ttd->extrashorttime ;
00095 
00096         Return $S_Datum;
00097 } // end func
00098 ?>

Generated on Fri Dec 13 2013 09:06:37 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1