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 printf('<h3 class="bar" align="center">- %s: %s</h3>', $row['customer'], $row['task']);
64 <form method=post action="update.php">
65 <input class=none type=hidden name=oid value="<? echo $_GET['id']; ?>">
67 <label for=start>Start</label>
68 <input id=start name=start size=40 maxlength=80 value="<? echo $row['start']; ?>">
71 <label for=stop>Stop</label>
72 <input id=stop name=stop size=40 maxlength=80 value="<? echo $row['stop']; ?>">
75 <label for=time>Time</label>
76 <input id=time name=time size=40 maxlength=80 value="<? echo min2hour($row['time']); ?>">
79 <label for=task>Task</label>
80 <input id=task name=task size=40 maxlength=80 value="<? echo $row['task']; ?>">
83 <label for=status>Status</label>
86 if (!is_array($stati))
87 $stati = find_status();
89 foreach ($stati as $k=>$v)
90 printf('<input type="radio" class="radio" name="status" value="%s"%s>%s ', $k, $row['status']==$k?' checked':'', $v);
95 <input class=button type=submit value="Update">
96 <input class=button type=submit name=delete value="Delete">