forked from stamen/Productive-Birds
/
client.php
47 lines (40 loc) · 1.31 KB
/
client.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
<?php
require_once 'lib.php';
$dbh = mysql_connect('localhost', 'time', '');
mysql_select_db('timetracking', $dbh);
$client_days = client_days($dbh, $_GET['name']);
$client_people = client_people($dbh, $_GET['name']);
$client_info = client_info($dbh, $_GET['name']);
$client_name = $client_info ? $client_info['name'] : $_GET['name'];
mysql_close($dbh);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?= $client_name ?> Client Info</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script src="protovis-r3.2.js" type="text/javascript"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="all">
<script src="client.js" type="text/javascript"></script>
</head>
<body>
<h1><?= $client_name ?> ($<?= nice_int($client_info['budget']) ?>)</h1>
<p>
<script type="text/javascript">
<!--
var days = <?=json_encode($client_days)?>;
var people = <?=json_encode($client_people)?>;
var info = <?=json_encode($client_info)?>;
render_client(days, info);
//-->
</script>
</p>
<p>
<script type="text/javascript">
<!--
render_people(people, info);
//-->
</script>
</p>
</body>
</html>