Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Haagse Hogeschool</title>
- <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
- </head>
- <body>
- <div id="container">
- <div id="header">
- <img src="images/header.jpg" />
- </div>
- <div id="menu-links">
- <ul>
- <li><a href="" class="menu-link">Link 1</a></li>
- <li><a href="" class="menu-link">Link 2</a></li>
- </ul>
- </div>
- <div id="content">
- <form name="search" method="post" action="zoek.php">
- Zoek naar: <input type="text" name="find" /> in
- <Select NAME="field">
- <Option VALUE="studentnummer">Studentnummer</option>
- <Option VALUE="voornaam">Voornaam</option>
- <Option VALUE="achternaam">Achternaam</option>
- <Option VALUE="slb">Slb-er</option>
- </Select>
- <input type="hidden" name="searching" value="yes" />
- <input type="submit" name="zoek" value="Zoek"/><br />
- <center><a href ="allesweergeven.php" method="get" action="allesweergeven.php">alles weergeven</a></center>
- </form>
- <?php
- /************************************
- * verbinding maken met de database *
- * *
- ************************************/
- $server = "localhost";
- $username = "root";
- $password = "";
- mysql_connect($server, $username, $password) or die(mysql_error());
- $dbname = "hogeschool";
- mysql_select_db($dbname) or die(mysql_error());
- $tbl_name="student";
- if ($find == "" && $searching)
- {
- echo "Voer uw zoekopdracht in";
- exit;
- }
- if ($find != ""){
- $gezochtNaar = $find;
- $find = strtoupper($find);
- $find = strip_tags($find);
- $find = trim ($find);
- $find = "WHERE upper(".$field.") LIKE '%".$find."%'";
- } else {
- $find = "";
- }
- $zoekresult = mysql_query("SELECT * FROM student ".$find);
- if ($zoekresult && mysql_num_rows($zoekresult) > 0){
- echo "<br>";
- echo "Resultaten van: $gezochtNaar";
- echo "<br>";
- echo "<br>";
- echo "<table>";
- echo "<tr>";
- echo "<th>Studentnr.</th>";
- echo "<th>Voornaam</th>";
- echo "<th>Achternaam</th>";
- echo "<th>Geboortedatum</th>";
- echo "<th>Slb-er</th>";
- echo "</tr>";
- while($result = mysql_fetch_array($zoekresult))
- {
- echo "<tr>";
- ?>
- <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['studentnummer']; ?>"></td>
- <?
- echo "<td>".$result['studentnummer']."</td>";
- echo "<td>".$result['voornaam']."</td>";
- echo "<td>".$result['achternaam']."</td>";
- echo "<td>".$result['geboortedatum']."</td>";
- echo "<td>".$result['slb']."</td>";
- }}
- else {
- echo "geen resultaten";
- }
- echo "</tr>";
- ?>
- <tr>
- <tr>
- <td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td>
- </tr>
- </table>
- <?
- // Check if delete button active, start this
- if($delete){
- for($i=0;$i<$count;$i++){
- $del_id = $checkbox[$i];
- $sql = "DELETE FROM $tbl_name WHERE studentnummer='$del_id'";
- $result = mysql_query($sql);
- }
- if($result){
- echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
- }
- }
- mysql_close();
- ?>
- </div>
- <div id="footer">
- Intranet HHS
- </div>
- </div>
- </body>
- </html>
- <html>
- <head>
- <title>Haagse Hogeschool</title>
- <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
- </head>
- <body>
- <div id="container">
- <div id="header">
- <img src="images/header.jpg" />
- </div>
- <div id="menu-links">
- <ul>
- <li><a href="" class="menu-link">Link 1</a></li>
- <li><a href="" class="menu-link">Link 2</a></li>
- </ul>
- </div>
- <div id="content">
- <form name="search" method="post" action="zoek.php">
- Zoek naar: <input type="text" name="find" /> in
- <Select NAME="field">
- <Option VALUE="studentnummer">Studentnummer</option>
- <Option VALUE="voornaam">Voornaam</option>
- <Option VALUE="achternaam">Achternaam</option>
- <Option VALUE="slb">Slb-er</option>
- </Select>
- <input type="hidden" name="searching" value="yes" />
- <input type="submit" name="zoek" value="Zoek"/><br />
- <center><a href ="allesweergeven.php" method="get" action="allesweergeven.php">alles weergeven</a></center>
- </form>
- <?php
- /************************************
- * verbinding maken met de database *
- * *
- ************************************/
- require_once('connection.inc.php');
- $sql="SELECT * FROM $tbl_name";
- $result=mysql_query($sql);
- $count=mysql_num_rows($result);
- ?>
- <table width="400" border="0" cellspacing="1" cellpadding="0">
- <tr>
- <td><form name="form1" method="post" action="">
- <tr>
- <td align="center" bgcolor="#FFFFFF">#</td>
- <td align="center" bgcolor="#FFFFFF"><strong>Studentnr</strong></td>
- <td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td>
- <td align="center" bgcolor="#FFFFFF"><strong>Lastname</strong></td>
- </tr>
- <?php
- while($rows=mysql_fetch_array($result)){
- ?>
- <tr>
- <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['studentnummer']; ?>"></td>
- <td bgcolor="#FFFFFF"><? echo $rows['studentnummer']; ?></td>
- <td bgcolor="#FFFFFF"><? echo $rows['voornaam']; ?></td>
- <td bgcolor="#FFFFFF"><? echo $rows['achternaam']; ?></td>
- <td bgcolor="#FFFFFF"><? echo $rows['geboortedatum']; ?></td>
- <td bgcolor="#FFFFFF"><? echo $rows['slb']; ?></td>
- </tr>
- <?php
- }
- ?>
- <tr>
- <td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td>
- </tr>
- <?
- // Check if delete button active, start this
- if($delete){
- for($i=0;$i<$count;$i++){
- $del_id = $checkbox[$i];
- $sql = "DELETE FROM $tbl_name WHERE studentnummer='$del_id'";
- $result = mysql_query($sql);
- }
- if($result){
- echo "<meta http-equiv=\"refresh\" content=\"0;URL=allesweergeven.php\">";
- }
- }
- mysql_close();
- ?>
- </div>
- <div id="footer">
- Intranet HHS
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement