2 if (!isset($_GET['id'])) {
3 header('Location: index.php');
7 #include <infocon.style>
9 <page func=InfoCon title="Stempeluhr">
12 function min2hour($minutes)
14 return sprintf('%02d:%02d', $minutes/60, $minutes%60);
17 $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
18 or die("Unable to connect to SQL server");
20 pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
22 $query = sprintf("SELECT start,stop,customer,time,task,status FROM stempel WHERE oid = %d", $_GET['id']);
24 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
26 $row = pg_fetch_array ($sth, 0);
29 <style type="text/css">
39 background-color: #1aa2fe;
45 border: 1px solid #1aa2fe;
55 border: 1px solid #1aa2fe;
59 div.radio input.radio {
65 printf('<h3 class="bar" align="center">- %s: %s</h3>', $row['customer'], $row['task']);
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=statrt 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">