-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvw_general.php
More file actions
78 lines (59 loc) · 2.22 KB
/
Copy pathvw_general.php
File metadata and controls
78 lines (59 loc) · 2.22 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
global $wk;
$thisDate = new CDate(); // set date for displaying and timesheet_date
//check if user is on break
$sql = "SELECT timesheet_time_break_start from timesheet where user_id = $AppUI->user_id and timesheet_date = '" . $thisDate->format("%Y-%m-%d") . "'";
$column_list = db_loadColumn($sql);
list(, $on_break) = each($column_list);
if ($on_break == '00:00:00') $on_break = 0;
?>
<script language="Javascript" type="text/javascript">
function updateTime() {
var today = new Date();
var hours = fixTime(today.getHours());
var minutes = fixTime(today.getMinutes());
var seconds = fixTime(today.getSeconds());
var the_time = hours + ":" + minutes + ":" + seconds;
document.smallform.timer.value = the_time;
the_timeout= setTimeout('updateTime();',1000);
}
function fixTime(val) {
if (val < 10)
return "0" + val;
else
return val;
}
document.body.onload = updateTime;
function onload() {
updateTime();
}
</script>
<form action="./index.php?m=timesheet&a=dosql" method="post" name="smallform">
<table cellspacing="1" cellpadding="2" border="0" width="50%">
<tr>
<td><b>Date:</b> <?php echo $thisDate->format("%A %b %e, %Y") ?></td>
</tr>
<tr>
<td><b>Time:</b> <input type="text" name="timer" value="" readonly class="text" style="background-color: transparent; border: 0; margin: 0; padding: 0;"></td>
</tr>
<tr>
<td>
<input type="hidden" value="<?php echo $thisDate->format("%Y-%m-%d"); ?>" name="timesheet_date">
<input type="submit" value="Punch In" name="punchin" class="button">
<input type="submit" value="Punch Out" name="punchout" class="button">
<input type="submit" value="<?php echo ($on_break ? "Back for more Fun" : "Gimme a Break") ?>" name="break" class="button" <?php if ($on_break) echo 'style="background-color: red;"' ?> >
</td>
</tr>
<tr>
<td>
<a href="./index.php?m=timesheet&wk=<?php echo $wk + 1; ?>">previous week</a>
<?php if ( $wk != 0 ) {
echo "<a href=\"./index.php?m=timesheet&wk=0\">current week</a> \n";
}
if ( $wk > 0 ) {
echo "\t\t<a href=\"./index.php?m=timesheet&wk=", $wk - 1, "\">next week</a>  \n";
} ?>
</td>
</tr>
</table>
</form>