summaryrefslogtreecommitdiffstats
path: root/public/day.php
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2010-04-11 20:54:06 +0300
committerFilipp Lepalaan <filipp@mac.com>2010-04-11 20:54:06 +0300
commit6f2e6899cc404f314648782920e343c8529885d3 (patch)
tree7d0129a6818f9554e76b60c913ce89a888b9f964 /public/day.php
downloadatwork-6f2e6899cc404f314648782920e343c8529885d3.tar.gz
atwork-6f2e6899cc404f314648782920e343c8529885d3.tar.bz2
atwork-6f2e6899cc404f314648782920e343c8529885d3.zip
First commit
Diffstat (limited to 'public/day.php')
-rw-r--r--public/day.php85
1 files changed, 85 insertions, 0 deletions
diff --git a/public/day.php b/public/day.php
new file mode 100644
index 0000000..1c21f1b
--- /dev/null
+++ b/public/day.php
@@ -0,0 +1,85 @@
+<?php
+
+ ////
+ // atwork/day.php
+
+ require_once '../system/init.php';
+
+ $sql = 'SELECT * FROM atwork WHERE user = ? AND start <= ? AND finish >= ?';
+ $stmt = $db->prepare($sql);
+ $stmt->execute(array($_SESSION['user'], $_POST['d'], $_POST['d']));
+// print_r($stmt->fetchAll());
+
+?>
+<form action="#" method="post" id="timeform">
+ <input type="hidden" id="date" name="date" value="<?= $_POST['d']; ?>"/>
+ <table>
+ <thead>
+ <tr>
+ <th style="width:150px">Saapuminen</th>
+ <th style="width:150px">Lähtö</th>
+ </tr>
+ </thead>
+ <tbody>
+
+<?php foreach(range(0, 4) as $r): ?>
+
+<tr>
+ <td>
+ <select name="start-h[<?= $r; ?>]" class="start_h">
+ <option>--</option>
+
+<?php foreach(range(8, 23) as $h): ?>
+
+ <option><?= sprintf('%02d', $h); ?></option>
+
+<?php endforeach ?>
+
+ </select>
+ :
+ <select name="start-m[<?= $r; ?>]" class="start_m">
+ <option>--</option>
+
+<?php foreach(range(0, 3) as $m): ?>
+
+ <option><?= sprintf('%02d', $m*15); ?></option>
+
+<?php endforeach ?>
+
+ </select>
+ </td>
+ <td>
+ <select name="finish-h[<?= $r; ?>]" class="finish_h">
+ <option>--</option>
+
+<?php foreach(range(8, 23) as $h): ?>
+
+ <option><?= sprintf('%02d', $h); ?></option>
+
+<?php endforeach ?>
+
+ </select>
+ :
+ <select name="finish-m[<?= $r; ?>]" class="finish_m">
+ <option>--</option>
+
+<?php foreach(range(0, 3) as $m): ?>
+
+ <option><?= sprintf('%02d', $m*15); ?></option>
+
+<?php endforeach ?>
+
+ </td>
+ </tr>
+
+<?php endforeach ?>
+
+ <tr>
+ <td colspan="2"><strong>Merkinnät</strong>
+ <br/>
+ <textarea name="notes" rows="8" cols="40"></textarea></td>
+ </tr>
+
+ </tbody>
+</table>
+</form> \ No newline at end of file