2 if (!isset($_GET['id'])) {
3 header('Location: index.php');
7 #include <infocon.style>
10 <page func=InfoCon title="Stempeluhr">
13 $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
14 or die("Unable to connect to SQL server");
16 pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
18 $query = sprintf("SELECT start,stop,customer,time,task,status FROM stempel WHERE oid = %d", $_GET['id']);
20 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
22 $row = pg_fetch_array ($sth, 0);
25 <style type="text/css">
35 background-color: #1aa2fe;
41 border: 1px solid #1aa2fe;
51 border: 1px solid #1aa2fe;
55 div.radio input.radio {
61 $name = load_customers();
62 $cname = $name[$row['customer']];
63 if (!strlen($cname)) $cname = ucfirst($row['customer']);
65 printf('<h3 class="bar" align="center">%s: %s</h3>', $cname, substring($row['task'],0,80-strlen($cname)));
68 <form method=post action="update.php">
69 <input class=none type=hidden name=oid value="<? echo $_GET['id']; ?>">
71 <label for=start>Start</label>
72 <input id=start name=start size=40 maxlength=80 value="<? echo $row['start']; ?>">
75 <label for=stop>Stop</label>
76 <input id=stop name=stop size=40 maxlength=80 value="<? echo $row['stop']; ?>">
79 <label for=time>Time</label>
80 <input id=time name=time size=40 maxlength=80 value="<? echo min2hour($row['time']); ?>">
83 <label for=task>Task</label>
84 <input id=task name=task size=40 maxlength=80 value="<? echo $row['task']; ?>">
87 <label for=status>Status</label>
90 if (!is_array($stati))
91 $stati = find_status();
93 foreach ($stati as $k=>$v)
94 printf('<input type="radio" class="radio" name="status" value="%s"%s>%s ', $k, $row['status']==$k?' checked':'', $v);
99 <input class=button type=submit value="Update">
100 <input class=button type=submit name=delete value="Delete">