bb027d2eeca77ed9e32a8acd4a328255abf7bdf4
[bdrem.git] / src / bdrem / Renderer / Html.php
1 <?php
2 namespace bdrem;
3
4 class Renderer_Html
5 {
6     public function render($arEvents)
7     {
8         $tr = new Renderer_HtmlTable();
9         $table = $tr->render($arEvents);
10         $s = <<<HTM
11 <?xml version="1.0" encoding="utf-8"?>
12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
13 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
14  <head>
15   <title>bdrem</title>
16   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
17   <style type="text/css">
18 table {
19     border: 1px solid black;
20     border-collapse: collapse;
21     margin-left: auto;
22     margin-right: auto;
23 }
24 td, th {
25     border: 1px solid grey;
26     border-left: 0px;
27     border-right: 0px;
28     padding: 0.1ex 1ex;
29 }
30
31 tr.prev td {
32     background-color: #C4DDF4;
33 }
34 tr.today td {
35     background-color: #FEDCBA;
36 }
37 tr.next td {
38     background-color: #DEFABC;
39 }
40 tr:hover td {
41     background-color: white;
42 }
43
44 .r {
45     text-align: right;
46 }
47
48 tr td.icon {
49     background-color: white;
50 }
51 tr.prev td.icon {
52     color: #00A;
53 }
54 tr.today td.icon {
55     color: black;
56     background-color: #FEDCBA;
57 }
58 tr.next td.icon {
59     color: #080;
60 }
61
62 tr.d-3 td.icon:before {
63     content: "\342\227\224"
64 }
65 tr.d-2 td.icon:before {
66     content: "\342\227\221"
67 }
68 tr.d-1 td.icon:before {
69     content: "\342\227\225"
70 }
71 tr.d0 td.icon:before {
72     content: "\342\230\205"
73 }
74 tr.d1 td.icon:before {
75     content: "\342\227\225"
76 }
77 tr.d2 td.icon:before {
78     content: "\342\227\221"
79 }
80 tr.d3 td.icon:before {
81     content: "\342\227\224"
82 }
83   </style>
84  </head>
85  <body>
86 $table
87  </body>
88 </html>
89 HTM;
90         return $s;
91     }
92 }
93 ?>