29 if (!defined(
'NOREQUIREUSER')) define(
'NOREQUIREUSER',
'1');
31 if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
33 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK', 1);
34 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL', 1);
35 if (!defined(
'NOLOGIN')) define(
'NOLOGIN', 1);
36 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU', 1);
37 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML', 1);
39 require_once
'../main.inc.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
42 if (
GETPOST(
'lang',
'aZ09')) $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
45 $langs->loadLangs(array(
"main",
"agenda"));
47 $right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
48 $left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
56 print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'.
"\n";
61 print '<script type="text/javascript" src="'.DOL_URL_ROOT.
'/core/js/lib_head.js.php"></script>'.
"\n";
63 print '<title>'.$langs->trans(
"Calendar").
'</title>';
68 $langs->trans(
"January"),
69 $langs->trans(
"February"),
70 $langs->trans(
"March"),
71 $langs->trans(
"April"),
73 $langs->trans(
"June"),
74 $langs->trans(
"July"),
75 $langs->trans(
"August"),
76 $langs->trans(
"September"),
77 $langs->trans(
"October"),
78 $langs->trans(
"November"),
79 $langs->trans(
"December")
81 print '<script type="text/javascript">';
82 print
'var tradMonths = [';
83 foreach ($tradTemp as $val)
85 print
'"'.addslashes($val).
'",';
88 print
'</script>'.
"\n";
96 if (!isset($_GET[
"sd"])) $_GET[
"sd"] =
"00000000";
98 if (!isset($_GET[
"m"]) || !isset($_GET[
"y"])) $qualified =
false;
99 if (isset($_GET[
"m"]) && isset($_GET[
"y"]))
101 if ($_GET[
"m"] < 1 || $_GET[
"m"] > 12) $qualified =
false;
102 if ($_GET[
"y"] < 0 || $_GET[
"y"] > 9999) $qualified =
false;
115 print
'</body></html>'.
"\n";
125 $year = substr($mysqldate, 0, 4);
126 $month = substr($mysqldate, 4, 2);
127 $day = substr($mysqldate, 6, 2);
128 $unixtimestamp =
dol_mktime(12, 0, 0, $month, $day, $year);
129 return $unixtimestamp;
142 global $langs, $conf;
145 $thedate =
dol_mktime(12, 0, 0, $month, 1, $year);
149 if ($selectedDate !=
"00000000")
160 <td colspan=
"6" class=
"dpHead"><?php
163 echo $langs->trans(
"Month".$selectMonth).
", ".$selectYear;
166 <button
type=
"button" class=
"dpInvisibleButtons" id=
"DPCancel"
167 onClick=
"closeDPBox();">X</button>
171 <td
class=
"dpButtons"
172 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo $month?>','<?php echo $year - 1?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><<</td>
173 <td
class=
"dpButtons"
174 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 1) echo "12
"; else echo $month - 1?>','<?php if ($month == 1) echo $year - 1; else echo $year?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><</td>
175 <td colspan=
"3" class=
"dpButtons"
176 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo (int) dol_print_date($today, '%m')?>','<?php echo $todayArray["year
"]?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><?php echo
'-' ?></td>
177 <td
class=
"dpButtons"
178 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 12) echo "1
"; else echo $month + 1?>','<?php if ($month == 12) echo $year + 1; else echo $year; ?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')">></td>
179 <td
class=
"dpButtons"
180 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo $month?>','<?php echo $year + 1?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')">>></td>
182 <tr
class=
"dpDayNames">
184 $startday = isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1;
185 $day_names = array(
'ShortSunday',
'ShortMonday',
'ShortTuesday',
'ShortWednesday',
'ShortThursday',
'ShortFriday',
'ShortSaturday');
186 for ($i = 0; $i < 7; $i++)
188 echo
'<td width="', (int) (($i + 1) * 100 / 7) - (
int) ($i * 100 / 7),
'%">', $langs->trans($day_names[($i + $startday) % 7]),
'</td>',
"\n";
197 $stoploop = 0; $day = 1; $cols = 0;
201 if ($mydate < $firstdate)
203 echo
"<tr class=\"dpWeek\">";
206 for ($i = 0; $i < 7; $i++)
208 $w = ($i + $startday) % 7;
209 if ($w == $firstdate[
"wday"])
211 $mydate = $firstdate;
214 echo
"<td> </td>";
218 if ($mydate[
"wday"] == $startday)
220 echo
"<tr class=\"dpWeek\">";
226 if ($thedate == $selDate) $dayclass =
"dpSelected";
227 elseif ($thedate == $today) $dayclass =
"dpToday";
229 if ($langs->trans(
"FormatDateShortJavaInput") ==
"FormatDateShortJavaInput")
231 print
"ERROR FormatDateShortJavaInput not defined for language ".$langs->defaultlang;
236 echo
"<td class=\"".$dayclass.
"\"";
237 echo
" onMouseOver=\"dpHighlightDay(".$mydate[
"year"].
",parseInt('".
dol_print_date($thedate,
"%m").
"',10),".$mydate[
"mday"].
",tradMonths)\"";
238 echo
" onClick=\"dpClickDay(".$mydate[
"year"].
",parseInt('".
dol_print_date($thedate,
"%m").
"',10),".$mydate[
"mday"].
",'".$langs->trans(
"FormatDateShortJavaInput").
"')\"";
239 echo
">".sprintf(
"%02s", $mydate[
"mday"]).
"</td>";
242 if (($mydate[
"wday"] + 1) % 7 == $startday) echo
"</TR>\n";
246 $thedate =
dol_mktime(12, 0, 0, $month, $day, $year);
252 if ($firstdate[
"month"] != $mydate[
"month"]) $stoploop = 1;
258 for ($i = 6; $i >= $cols; $i--) echo
"<td> </td>";
263 <td
id=
"dpExp" class=
"dpExplanation" colspan=
"7"><?php
267 print $langs->trans(
"Month".$selectMonth).
" ";
268 print sprintf(
"%02s", $tempDate[
"mday"]);
269 print
", ".$selectYear;
271 print
"Click a Date";
xyzToUnixTimestamp($mysqldate)
Convert date to timestamp.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_get_first_day_week($day, $month, $year, $gm=false)
Return first day of week for a date.
dol_now($mode= 'auto')
Return date for now.
dol_getdate($timestamp, $fast=false, $forcetimezone= '')
Return an array with locale date info.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
displayBox($selectedDate, $month, $year)
Show box.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type