forked from bastianallgeier/gantti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
177 lines (121 loc) · 3.95 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
require('lib/gantti.php');
require('data.php');
date_default_timezone_set('UTC');
setlocale(LC_ALL, 'en_US');
$gantti = new Gantti($data, array(
'title' => 'Demo',
'cellwidth' => 25,
'cellheight' => 35,
'today' => true
));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Mahatma Gantti – A simple PHP Gantt Class</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="styles/css/screen.css" />
<link rel="stylesheet" href="styles/css/gantti.css" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<header>
<h1>Mahatma Gantti</h1>
<h2>A simple PHP Gantt Class</h2>
</header>
<?php echo $gantti ?>
<article>
<h2>Download</h2>
<p>
You can download the source for Gantti form Github:<br />
<a href="https://github.com/bastianallgeier/gantti"><strong>https://github.com/bastianallgeier/gantti</strong></a>
</p>
<h2>Features</h2>
<p>
<ul>
<li>Generates valid HTML5</li>
<li>Very easy to customize with SASS stylesheet</li>
<li>Works in all major browsers including IE7, IE8 and IE9</li>
<li>No javascript required</li>
</ul>
</p>
<h2>Usage</h2>
<p><pre><code><?php $code = "
<?php
require('lib/gantti.php');
date_default_timezone_set('UTC');
setlocale(LC_ALL, 'en_US');
\$data = array();
\$data[] = array(
'label' => 'Project 1',
'start' => '2012-04-20',
'end' => '2012-05-12'
);
\$data[] = array(
'label' => 'Project 2',
'start' => '2012-04-22',
'end' => '2012-05-22',
'class' => 'important',
);
\$data[] = array(
'label' => 'Project 3',
'start' => '2012-05-25',
'end' => '2012-06-20'
'class' => 'urgent',
);
\$gantti = new Gantti(\$data, array(
'title' => 'Demo',
'cellwidth' => 25,
'cellheight' => 35
));
echo \$gantti;
?>
";
echo htmlentities(trim($code)); ?>
</pre></code></p>
<h2>Data</h2>
<p>Data is defined as an associative array (see the example above).</p>
<p>
For each project you get the following options:
<ul>
<li>label: The label will be displayed in the sidebar</li>
<li>start: The start date. Must be in the following format: YYYY-MM-DD</li>
<li>end: The end date. Must be in the following format: YYYY-MM-DD</li>
<li>class: An optional class name. (available by default: important, urgent)</li>
</ul>
</p>
<h2>Options</h2>
<h3>title (optional, default: false)</h3>
<p>Set an optional title for your gantt diagram here. <br />It will be displayed in the upper left corner. </p>
<h3>cellwidth (optional, default: 40)</h3>
<p>Set the width of all cells. </p>
<h3>cellheight (optional, default: 40)</h3>
<p>Set the height of all cells. </p>
<h3>today (optional, default: true)</h3>
<p>Show or hide the today marker. It will be displayed by default.</p>
<h2>Styles</h2>
<p>
The default stylesheet is available as .scss (<a href="http://sass-lang.com/">SASS</a>)
It includes a set of predefined variables, which you can use to adjust the styles very easily.
</p>
<p>
You can check out the full SASS file over here:
<a href="https://github.com/bastianallgeier/gantti/blob/master/styles/scss/gantti.scss">https://github.com/bastianallgeier/gantti/blob/master/styles/scss/gantti.scss</a>
</p>
<h2>Colors</h2>
<p>The default color theme is an adaption of the wonderful <br /><a href="http://ethanschoonover.com/solarized">Solarized color theme by Ethan Schoonover</a></p>
<h2>Author</h2>
<p>
Bastian Allgeier<br />
<a href="http://bastianallgeier.com">http://bastianallgeier.com</a><br />
<a href="http://twitter.com/bastianallgeier">Follow me on Twitter</a>
</p>
<h2>License</h2>
MIT License – <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>
</article>
<a href="https://github.com/bastianallgeier/gantti"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
</body>
</html>