Public paste
V2
By: Xmoo | Date: Oct 29 2008 18:57 | Format: PHP | Expires: never | Size: 1.64 KB | Hits: 737

  1. <?php if($_GET['p'] == 'ziekmelden') { switch($_GET['a']) { case 'zoeken':
  2. echo "Hier kun je je ziek melden.<br><br>
  3. <form action='?p=ziekmelden&a=zoeken' method='post'>Personeel nummer: <input type='text' name='pid' id='pid' size='40'>
  4. <input type='submit' name='submit' value='Meld me ziek!'>
  5. </form>";
  6. if(isset($_POST['submit'])) {
  7. $sql = "SELECT pid,name FROM care_personell WHERE pid = '$pid'";
  8. echo "<b>Personeel nummer: - Naam:</b>";
  9. echo "$pid - $name <a href=?p=ziekenhuis&a=toevoegen&id=$pid><img src='images/plus.gif></a>'"; }
  10.                    break;
  11.   }
  12.  }
  13. ?>
  14. <?php if($_GET['p'] == 'ziekmelden') { switch($_GET['a']) { case 'toevoegen':
  15. $pid = $_GET['pid'];
  16.  
  17. if(isset($_POST['submit'])) {
  18.     $insert = "INSERT INTO ziekmelden (pid, name, ziek, opmerking)  
  19.                   values ('". $_POST["pid"] ."', '". $_POST["name"] ."', '". $_POST["ziek"] ."', '". $_POST["opmerking"] .")";
  20.         $query = mysql_query($insert)or die(mysql_error());
  21.         echo "<font face=verdana size=2 color=green>U ben met succes ziek gemeld. Beterschap!</font>";
  22.     }
  23.     else {  
  24.         echo "<form action='?p=ziekmelden&a=toevoegen' method='post'>";  
  25.         echo "<b>Personeel nummer</b>: <input type='text' name='pid' size='49' value='$pid' READONLY/><br>";
  26.         echo "<b>Naam: <input type='text' name='name' size='49' value='$name' READONLY/><br>";
  27.         echo "<b>Ziek: <input type='text' name='ziek' size='49' value=''/><br>";
  28.                 echo "<b>Opmerking</b>: <input type='text' name='opmerking' size='49' value=''/><br><br>";
  29.                 echo "<center><input type='submit' name='submit' value='Meld me ziek!'></center></form>";
  30.         }
  31.    break;
  32.  }
  33. }
  34. ?>