forked from stamen/Productive-Birds
/
index.php
120 lines (106 loc) · 3.23 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
<?php
require_once 'lib.php';
$dbh = mysql_connect('localhost', 'time', '');
mysql_select_db('timetracking', $dbh);
$current_byname = client_list($dbh, 'by-name', 'no');
$current_bydate = client_list($dbh, 'by-date', 'no');
$current_bysize = client_list($dbh, 'by-size', 'no');
$past_byname = client_list($dbh, 'by-name', 'yes');
$past_bydate = client_list($dbh, 'by-date', 'yes');
$past_bysize = client_list($dbh, 'by-size', 'yes');
mysql_close($dbh);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Stamen Clients</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="style.css" type="text/css" media="all">
<script src="protovis-r3.2.js" type="text/javascript"></script>
<script src="client.js" type="text/javascript"></script>
<style type="text/css" title="text/css">
<!--
div.listing
{
float: left;
width: 16em;
}
h2 { clear: left; }
-->
</style>
</head>
<body>
<h2>Current Projects</h2>
<div class="listing">
<h3>By Name:</h3>
<ul>
<? foreach($current_byname as $info) { ?>
<li>
<a href="client.php?name=<?= urlencode($info['name']) ?>"><?= $info['name'] ?></a>
</li>
<? } ?>
</ul>
</div>
<div class="listing">
<h3>By End Date:</h3>
<ul>
<? foreach($current_bydate as $info) { ?>
<li>
<a href="client.php?name=<?= urlencode($info['name']) ?>"><?= $info['name'] ?></a>
<br>
<?= nice_relative_date($info['time']) ?>.
</li>
<? } ?>
</ul>
</div>
<div class="listing">
<h3>By Size:</h3>
<ul>
<? foreach($current_bysize as $info) { ?>
<li>
<a href="client.php?name=<?= urlencode($info['name']) ?>"><?= $info['name'] ?></a>
<br>
$<?= nice_int($info['budget']) ?>,
<?= nice_days($info['days']) ?> days.
</li>
<? } ?>
</ul>
</div>
<h2>Past Projects</h2>
<div class="listing">
<h3>By Name:</h3>
<ul>
<? foreach($past_byname as $info) { ?>
<li>
<a href="client.php?name=<?= urlencode($info['name']) ?>"><?= $info['name'] ?></a>
</li>
<? } ?>
</ul>
</div>
<div class="listing">
<h3>By End Date:</h3>
<ul>
<? foreach($past_bydate as $info) { ?>
<li>
<a href="client.php?name=<?= urlencode($info['name']) ?>"><?= $info['name'] ?></a>
<br>
<?= nice_relative_date($info['time']) ?>.
</li>
<? } ?>
</ul>
</div>
<div class="listing">
<h3>By Size:</h3>
<ul>
<? foreach($past_bysize as $info) { ?>
<li>
<a href="client.php?name=<?= urlencode($info['name']) ?>"><?= $info['name'] ?></a>
<br>
$<?= nice_int($info['budget']) ?>,
<?= nice_days($info['days']) ?> days.
</li>
<? } ?>
</ul>
</div>
</body>
</html>