Advertisement
machalda

House cleaning planner

Jul 20th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <?php
  2. if(isset($_GET['post']))
  3. {
  4.     $cas = date("d.m.Y v H:i:s");  
  5.    
  6.     $file = 'data.txt';
  7.    
  8.     if(!empty($_POST['ondra']))
  9.         $text =  "Ondra uklidil ".$cas." hodin<br>";
  10.     if(!empty($_POST['honza']))
  11.         $text =  "Honza uklidil ".$cas." hodin<br>";   
  12.     if(!empty($_POST['kuba']))
  13.         $text =  "Kuba uklidil ".$cas." hodin<br>";
  14.     if(!empty($text))
  15.         file_put_contents($file, $text, FILE_APPEND | LOCK_EX);
  16.     header("Location: index.php");
  17. }
  18. echo '<body bgcolor="black" text="lightblue">';
  19. $week = date("W");
  20.  
  21. echo "Je $week. týden a to znamená, že uklizí ";
  22.  
  23. if(($week % 3) == 2)
  24.     echo '<b>Ondra</b> a příští týden Honza';
  25. elseif(($week % 3) == 1)
  26.     echo '<b>Kuba</b> a příští týden Ondra';
  27. else
  28.     echo '<b>Honza</b> a příští týden Kuba';
  29.    
  30. echo '<form method="post" action="?post=rododendron">';
  31. echo '<input type="submit" name="ondra" value="Ondra - potvrdit úklid">';
  32. echo '<input type="submit" name="honza" value="Honza - potvrdit úklid">';
  33. echo '<input type="submit" name="kuba" value="Kuba - potvrdit úklid">';
  34. echo '</form>';
  35. require_once('data.txt');
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement