-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
214 lines (170 loc) · 6.41 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Swim Times Converter</title>
<meta name="author" content="Brian Stanback" />
<meta name="copyright" content="Brian Stanback" />
<!-- // Begin Swim Conversion CSS -->
<style type="text/css" media="all">
body {
margin: 0;
padding: 1px 0 0 0;
background: #625F57;
color: #fff;
font-family: sans-serif;
}
p {
line-height: 1.3em;
font-size: 0.9em;
padding: 0;
margin: 0 0 2em 0;
}
div.demo {
background: #5E84A4;
padding: 20px 50px;
margin-bottom: 2px;
}
div.demo h1 {
font-size: 1.5em;
font-weight: bold;
text-align: center;
margin: 1em 0 1.5em 0;
padding: 0;
}
div.demo p.swim-convert-error {
text-align: center;
}
div.demo p.swim-convert-time {
margin: 0 auto 1em auto;
padding: 25px;
width: 275px;
border: 4px solid #7ea4c4;
border-radius: 22px;
font-size: 1.1em;
}
div.demo form {
margin: 0 auto 2em auto;
padding: 25px;
width: 275px;
border: 4px solid #7ea4c4;
border-radius: 22px;
}
div.demo form fieldset {
border: none;
margin: 0 0 1em 0;
padding: 0;
}
div.demo form fieldset:last-child {
margin: 0;
}
div.demo form label, div.demo form div.label {
display: block;
padding: 0;
margin: 0 0 12px 0;
}
div.demo form input, div.demo form select {
color: #fff;
background: #7ea4c4;
font-size: 1em;
border: 1px solid #4E7494;
padding: 2px 3px;
}
div.demo form input[type=submit] {
border-radius: 15px;
font-weight: bold;
padding: 4px 18px;
color: #eee;
background: linear-gradient(to bottom, #72aad8 0%, #527db2 100%);
cursor: pointer;
}
div.demo form input[type=submit]:hover {
background: linear-gradient(to bottom, #72aad8 0%, #628dc2 100%);
}
div.demo form input[type=submit]:active {
background: linear-gradient(to bottom, #527db2 0%, #72aad8 100%);
}
div.download {
background: #748081;
padding: 20px 50px;
margin-bottom: 2px;
}
div.download h2 {
font-size: 1.4em;
font-weight: normal;
margin: 1em 0;
padding: 0;
}
div.download ul {
margin-bottom: 2em;
}
div.download a {
color: #c4d0d1;
}
div.help {
background: #9FB3AC;
padding: 20px 50px;
}
div.help h2 {
font-size: 1.4em;
font-weight: normal;
margin: 1em 0;
padding: 0;
}
div.help a {
color: #dff3ec;
}
div#footer {
padding: 2em 50px 0 50px;
text-align: center;
}
</style>
<!-- // End Swim Conversion CSS -->
</head>
<body>
<div class="demo">
<h1>Swim Times Converter Demo</h1>
<!-- // Begin Swim Conversion Form -->
<?php
//
// Include the class for handling the time conversion functions
//
require_once('swimconvert.class.php');
// Instantiate the swim conversions class using the Colorado Swimming conversion factors
$swim_convert = new SwimConvert('CO');
// Get post data (if the user submitted the form)
$swim_convert->get_post_data();
// Calculate and display the converted time (if the user submitted the form)
echo $swim_convert->get_converted_time();
// Display the conversion form
echo $swim_convert->get_form();
?>
<!-- // End Swim Conversion Form -->
</div>
<div class="download">
<h2>Download</h2>
<p>The source code is available below (version 3.0.0, last modified on 1/1/2013):</p>
<ul>
<li><a href="https://github.com/Stanback/php-swim-time-conversion/blob/master/index.php">Form code (PHP)</a></li>
<li><a href="https://github.com/Stanback/php-swim-time-conversion/blob/master/swimconvert.class.php">Swim conversion class (PHP)</a></li>
</ul>
<p>The code is a recent refactoring and should be considered to be a beta version.</p>
<h2>GitHub</h2>
<p>The project is <a href="http://github.com/Stanback/php-swim-time-conversion">available on GitHub</a>.</p>
<h2>Terms of Use</h2>
<p>This script is licensed under the <a href="http://www.gnu.org/licenses/gpl.html">GPLv3</a> license. If you use this script, I'd appreciate a link back to my personal website at the following URL: <a href="http://www.brianstanback.com/">http://www.brianstanback.com/</a>.</p>
</div>
<div class="help">
<h2>Support</h2>
<p>You may style the form's HTML and CSS any way you want, eventually I may incorporate support for templates or add additional methods so that users can avoid making changes to the PHP class file.</p>
<p><a href="mailto:[email protected]">Drop me a line</a> or <a href="http://github.com/Stanback/php-swim-time-conversion/issues">open an issue</a> you have bug reports, issues setting up the script, or if you have any recommendations. I will consider any requests to port this to other languags or package it into a plugin for Wordpress, Drupal, etc.</p>
<p>If you make any significant changes to the script, please <a href="http://help.github.com/articles/creating-a-pull-request">create a pull request</a> on <a href="http://github.com/Stanback/php-swim-time-conversion">GitHub</a> and I will consider incorporating the changes into the master release.</p>
<h2>Credits</h2>
<p>The conversion factors were sourced from the <a href="http://www.csi.org/conversions.aspx">Colorado Swimming</a> website.</p>
</div>
<div id="footer">
<p>Copyright © 2013 Brian Stanback</p>
</div>
</body>
</html>