Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- $servername = "localhost";
- $hostname = "localhost";
- $username = "root";
- $password = "";
- $dbname = "Matematikbiennalen";
- $dbhandle = mysql_connect($hostname, $username, $password)
- or die("Error 1");
- //select a database to work with
- $selected = mysql_select_db($dbname,$dbhandle)
- or die("Error 2");
- ?>
- <html>
- <head>
- <?php include "head.php"; ?>
- </head>
- <body>
- <?php include "header.php"; ?>
- <div class="container">
- <h1>Föreläsarindex</h1>
- <div class="row">
- <div class="col-lg-8">
- <div class="input-group">
- <input type="text" class="form-control" placeholder="Sök efter föreläsare">
- <span class="input-group-btn">
- <button class="btn btn-default" type="button">
- <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
- </button>
- </span>
- </div><!-- /input-group -->
- </div><!-- /.col-lg-6 -->
- </div><!-- /.row -->
- <div class="row">
- <div class="col-lg-8">
- <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" aria-expanded="false">
- <?php
- $x = 1;
- $query = "SELECT forelasare.*,forelasning.* FROM forelasare,forelasning WHERE forelasare.id=forelasning.forelasare";
- $q = mysql_query($query);
- while($row = mysql_fetch_array($q)) { // För varje rad i queryn så kommer detta loopas
- $x++;
- ?>
- <!-- For each lecturer -->
- <div class="panel panel-default">
- <div class="panel-heading" role="tab" id="headingOne">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#accordion" href="#collapse<?php echo $x;?>" aria-expanded="false" aria-controls="collapse<?php echo $x;?>">
- <!--lecturer Name -->
- <?php echo $row['fornamn'] . " " . $row['efternamn']; // RESULTAT FRÅN DB (fornamn och efternamn från tabell forelasare) ?>
- <!--/lecturer Name -->
- </a>
- </h4>
- </div>
- <div id="collapse<?php echo $x;?>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
- <div class="panel-body">
- <div class="list-group">
- <a href="#" class="list-group-item">
- <h4 class="list-group-item-heading"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></h4>
- <p class="list-group-item-text">
- <?php echo utf8_encode($row['lbeskrivning']); // RESULTAT FRÅN DB (lbeskrivning tabell forelasare) ?>
- </p>
- </a>
- </div>
- <div class="list-group">
- <a href="#" class="list-group-item">
- <h4 class="list-group-item-heading">
- <?php echo $row['forelasningid']; // RESULTAT FRÅN DB (forelasningid från tabell forelasning) ?>
- </h4>
- <p class="list-group-item-text">
- <?php echo utf8_encode($row['fbeskrivning']); // RESULTAT FRÅN DB(fbeskrivning från tabell forelasning) ?>
- </p>
- </a>
- </div>
- </div>
- </div>
- </div>
- <!-- /For each lecturer -->
- <?php } ?>
- </div>
- </div><!-- /.col-lg-6 -->
- </div><!-- /.row -->
- </div>
- <?php include "footer.php"; ?>
- <?php include "body.php"; ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement