Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_GET['post']))
- {
- $cas = date("d.m.Y v H:i:s");
- $file = 'data.txt';
- if(!empty($_POST['ondra']))
- $text = "Ondra uklidil ".$cas." hodin<br>";
- if(!empty($_POST['honza']))
- $text = "Honza uklidil ".$cas." hodin<br>";
- if(!empty($_POST['kuba']))
- $text = "Kuba uklidil ".$cas." hodin<br>";
- if(!empty($text))
- file_put_contents($file, $text, FILE_APPEND | LOCK_EX);
- header("Location: index.php");
- }
- echo '<body bgcolor="black" text="lightblue">';
- $week = date("W");
- echo "Je $week. týden a to znamená, že uklizí ";
- if(($week % 3) == 2)
- echo '<b>Ondra</b> a příští týden Honza';
- elseif(($week % 3) == 1)
- echo '<b>Kuba</b> a příští týden Ondra';
- else
- echo '<b>Honza</b> a příští týden Kuba';
- echo '<form method="post" action="?post=rododendron">';
- echo '<input type="submit" name="ondra" value="Ondra - potvrdit úklid">';
- echo '<input type="submit" name="honza" value="Honza - potvrdit úklid">';
- echo '<input type="submit" name="kuba" value="Kuba - potvrdit úklid">';
- echo '</form>';
- require_once('data.txt');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement