2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2011 IntegralEMR LLC <kevin.y@integralemr.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // Author: Kevin Yeh <kevin.y@integralemr.com>
25 // +------------------------------------------------------------------------------+
27 $DOMClass="DOMDocument";
28 if (!class_exists($DOMClass)) {
29 error_log("Creation of month drop down failed:".PHP_EOL
."Do you have php-xml installed?");
35 $divMonths= $DOM->createElement("DIV");
36 $divMonths->setAttribute("ID", "monthPicker");
37 $divMonths->setAttribute("style", "display:none;position: absolute; top: 15px;");
38 $DOM->appendChild($divMonths);
39 $tblMonths=$DOM->createElement("TABLE");
40 $divMonths->appendChild($tblMonths);
41 $tbodyMonths=$DOM->createElement("TBODY");
42 $tblMonths->appendChild($tbodyMonths);
46 $tdClasses = "tdDatePicker tdMonthName-small";
47 for ($idx=0; $idx<13; $idx++
) {
55 while (! checkdate($pMonth, $pDay, $pYear)) {
59 $pDate = sprintf("%d%02d%02d", $pYear, $pMonth, $pDay);
60 $trMonth=$DOM->createElement("TR");
61 $tdMonth=$DOM->createElement("TD", xl(date("F", strtotime($pDate)))." ".$pYear);
62 $tdMonth->setAttribute("ID", $pDate);
63 $tdMonth->setAttribute("CLASS", $tdClasses);
64 $trMonth->appendChild($tdMonth);
65 $tbodyMonths->appendChild($trMonth);
66 $pMonth = $pMonth +
1;
69 echo $DOM->saveXML($divMonths);