db643192527bdae42f179a3bbe4011deee6adf02
[infodrom.org/service.infodrom.org] / src / InfoCon / stempel / edit.wml
1 <?
2   if (!isset($_GET['id'])) {
3     header('Location: index.php');
4     exit(0);
5   }
6 ?>
7 #include <infocon.style>
8 #include "common.inc"
9
10 <page func=InfoCon title="Stempeluhr">
11
12 <?
13   $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
14          or die("Unable to connect to SQL server");
15
16   pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
17
18   $query = sprintf("SELECT start,stop,customer,time,task,status FROM stempel WHERE oid = %d", $_GET['id']);
19
20   $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
21
22   $row = pg_fetch_array ($sth, 0);
23 ?>
24
25 <style type="text/css">
26 label {
27   display: block;
28   font-weight: bold;
29   font-size: 12px;
30   width: 80px;
31   text-align: left;
32   padding-left: 5px;
33   padding-top: 0px;
34   padding-bottom: 0px;
35   background-color: #1aa2fe;
36   color: white;
37 }
38 input {
39   width: 400px;
40   margin-bottom: 10px;
41   border: 1px solid #1aa2fe;
42 }
43 input.radio {
44   width: auto;
45   margin: 0;
46   padding: 0;
47 }
48 div.radio {
49   width: 400px;
50   margin-bottom: 10px;
51   border: 1px solid #1aa2fe;
52   padding-top: 3px;
53   padding-bottom: 3px;
54 }
55 div.radio input.radio {
56   margin-left: 5px;
57 }
58 </style>
59
60 <?
61 printf('<h3 class="bar" align="center">- %s: %s</h3>', $row['customer'], $row['task']);
62 ?>
63
64 <form method=post action="update.php">
65 <input class=none type=hidden name=oid value="<? echo $_GET['id']; ?>">
66
67 <label for=start>Start</label>
68 <input id=start name=start size=40 maxlength=80 value="<? echo $row['start']; ?>">
69
70 <br class="none">
71 <label for=stop>Stop</label>
72 <input id=stop name=stop size=40 maxlength=80 value="<? echo $row['stop']; ?>">
73
74 <br class="none">
75 <label for=time>Time</label>
76 <input id=time name=time size=40 maxlength=80 value="<? echo min2hour($row['time']); ?>">
77
78 <br class="none">
79 <label for=task>Task</label>
80 <input id=task name=task size=40 maxlength=80 value="<? echo $row['task']; ?>">
81
82 <br class="none">
83 <label for=status>Status</label>
84 <div class="radio">
85 <?
86   if (!is_array($stati))
87     $stati = find_status();
88
89   foreach ($stati as $k=>$v)
90     printf('<input type="radio" class="radio" name="status" value="%s"%s>%s&nbsp;', $k, $row['status']==$k?' checked':'', $v);
91 ?>
92 </div>
93
94 <p><center>
95 <input class=button type=submit value="Update">
96 <input class=button type=submit name=delete value="Delete">
97 </center><p>
98 </form>
99
100 </page>
101
102 # Local variables:
103 # mode: text
104 # mode: auto-fill
105 # mode: iso-accents
106 # end: