diff --git a/web/admin.php b/web/admin.php
new file mode 100644
index 0000000000000000000000000000000000000000..f03344f00f446633cff0c4ca4e17fa0cc05ff8bd
--- /dev/null
+++ b/web/admin.php
@@ -0,0 +1,188 @@
+<?php
+session_start();
+require_once("classes/SQL.php");
+include("include/_head.php");
+include("include/config.php");
+
+$loggedIn = false;
+$loginFailed = true;
+$logout = false;
+
+if (isset($_GET["action"])){
+	if ($_GET["action"] == "logout"){
+		session_destroy();
+		$logout = true;
+	}
+}
+
+if (isset($_POST["password"])){
+	$_SESSION["login"] = $_POST["password"];
+}else{
+	$loginFailed = false;
+}
+
+if (isset($_SESSION["login"]) && !$logout){
+	$login = $_SESSION["login"];
+
+	if ($login == "12345678"){
+		$loggedIn = true;
+		$loginFailed = false;
+	}
+}
+
+if ($loginFailed){
+	echo '<div class="alert alert-danger">
+  <strong>Error!</strong> Entered password was not correct.
+</div>';
+}
+
+
+if (!$loggedIn){
+	// Display form
+	echo '
+	 <form role="form" action="'.$_SERVER["PHP_SELF"].'" method="POST">
+	  <div class="form-group">
+	    <label for="password">Password:</label>
+	    <input type="password" class="form-control" name="password">
+	  </div>
+	  <button type="submit" class="btn btn-success">Login</button>
+	</form>
+';
+}else{
+	$sql = new SQL();
+	$link = $sql->getLink();
+	$exist = false;
+
+
+
+	if (isset($_GET["allow"])){
+		$allow = $_GET["allow"];
+		$query = "SELECT * FROM tbl_unregistered WHERE id = ".$allow;
+		$result = $link->query($query);
+	        while($row = $result->fetch_assoc()) {
+	        	$clientAddress = $row["clientAddress"];
+	        	$exist = true;
+	        }
+	    if ($exist){
+	    	$query = "INSERT INTO tbl_addresses(address) VALUES('".$clientAddress."')";
+		    $result = $link->query($query);
+
+		    $query = "DELETE FROM tbl_unregistered WHERE id = ".$allow;
+		    $result = $link->query($query);
+	    }
+	    
+
+	}elseif (isset($_GET["remove"])) {
+		$remove = $_GET["remove"];
+		$query = "SELECT * FROM tbl_addresses WHERE id = ".$remove;
+		$result = $link->query($query);
+	    while($row = $result->fetch_assoc()) {
+	    	$exist = true;
+	    }
+	    if ($exist){
+	    	$query = "DELETE FROM tbl_addresses WHERE id = ".$remove;
+	    	$result = $link->query($query);
+	    }
+		
+	}
+
+	?>
+
+	<!-- Page Header -->
+	        <div class="row">
+	            <div class="col-lg-12">
+	                <h1 class="page-header">Admin
+	                </h1>
+	            </div>
+	        </div>
+
+	         <div class="row">
+	            <div class="col-lg-12">
+	                <h3 class="page-header">Unknown Clients
+	                </h3>
+	            </div>
+	        </div>
+	        <div class="table-responsive">          
+	          <table class="table table-striped">
+	            <thead>
+	              <tr>
+	                <th class="col-md-6">Client Address</th>
+	                <th class="col-md-6">Action</th>
+	              </tr>
+	            </thead>
+	            <tbody>
+
+
+	<?php
+	$sql = new SQL();
+	$link = $sql->getLink();
+	$query = "SELECT * FROM tbl_unregistered";
+
+	        $result = $link->query($query);
+	        while($row = $result->fetch_assoc()) {
+	        echo '    
+	              <tr>
+	                <td class="col-md-6">'.$row["clientAddress"].'</td>
+	                <td class="col-md-6"> <a href="'.$_SERVER["PHP_SELF"].'?allow='.$row["id"].'" class="btn btn-success" role="button">Allow access</a></td>
+	              </tr>';
+	        }
+
+	        echo '
+	            </tbody>
+	          </table>
+	        </div>';
+
+	?>
+
+	         <div class="row">
+	            <div class="col-lg-12">
+	                <h3 class="page-header">Allowed Clients
+	                </h3>
+	            </div>
+	        </div>
+	        <div class="table-responsive">          
+	          <table class="table table-striped">
+	            <thead>
+	              <tr>
+	                <th class="col-md-6">Client Address</th>
+	                <th class="col-md-6">Action</th>
+	              </tr>
+	            </thead>
+	            <tbody>
+
+	<?php
+	$sql = new SQL();
+	$link = $sql->getLink();
+	$query = "SELECT * FROM tbl_addresses";
+
+	        $result = $link->query($query);
+	        while($row = $result->fetch_assoc()) {
+	        echo '    
+	              <tr>
+	                <td class="col-md-6">'.$row["address"].'</td>
+	                <td class="col-md-6"> <a href="'.$_SERVER["PHP_SELF"].'?remove='.$row["id"].'" class="btn btn-danger" role="button">Remove access</a></td>
+	              </tr>';
+	        }
+
+	        echo '
+	            </tbody>
+	          </table>
+	        </div>';
+
+	        echo '
+        <div class="row">
+            <div class="col-md-12 text-center">
+            <br><br><br>
+                <a href="'.$_SERVER["PHP_SELF"].'?action=logout" class="btn btn-warning" role="button">Logout</a>
+                <br><br>
+            </div>
+        </div>
+        ';
+}
+
+
+
+   
+
+include("include/_foot.php");
+?>
\ No newline at end of file
diff --git a/web/details.php b/web/details.php
index 65cbbce9d7a09f57cd3e8b67d536c31f5466e455..5066d5b94aa211a33c5cce12999e3ccc03b3a2ec 100644
--- a/web/details.php
+++ b/web/details.php
@@ -1,6 +1,7 @@
 <?php
 require_once("classes/SQL.php");
 include("include/_head.php");
+include("include/config.php");
 ?>
 
 <?php
@@ -56,9 +57,27 @@ if (isset($_GET["param"])){
             <tbody>
         ';
         
+        $query = "SELECT count(*) as amount FROM tbl_data WHERE tbl_data.fid_parameter = ".$_GET["param"];
+        $result = $link->query($query);
+        while($row = $result->fetch_assoc()) {
+            $amount = $row["amount"];
+        }
+
+        $seiten = ceil($amount/$TABLELINESPERPAGE);
+        if (isset($_GET["page"])){
+            $page = $_GET["page"];
+            if ($page > $seiten){
+                $page = $seiten;
+            }elseif ($page < 1){
+                $page = 1;
+            }
+        }else{
+            $page = 1;
+        }
         
 
-        $query = "SELECT tbl_data.id as id, tbl_parameter.param as param, tbl_data.value as value, DATE_FORMAT(tbl_data.timestamp, '%d.%m.%Y %H:%i:%s') as date FROM (tbl_register INNER JOIN tbl_parameter ON tbl_register.id = tbl_parameter.fid_register) INNER JOIN tbl_data ON tbl_parameter.id = tbl_data.fid_parameter WHERE tbl_data.fid_parameter = ".$_GET["param"]." ORDER BY tbl_data.id DESC";
+
+        $query = "SELECT tbl_data.id as id, tbl_parameter.param as param, tbl_data.value as value, DATE_FORMAT(tbl_data.timestamp, '%d.%m.%Y %H:%i:%s') as date FROM (tbl_register INNER JOIN tbl_parameter ON tbl_register.id = tbl_parameter.fid_register) INNER JOIN tbl_data ON tbl_parameter.id = tbl_data.fid_parameter WHERE tbl_data.fid_parameter = ".$_GET["param"]." ORDER BY tbl_data.id DESC LIMIT ".$TABLELINESPERPAGE." OFFSET ".(($page-1)*$TABLELINESPERPAGE);
 
         $result = $link->query($query);
         while($row = $result->fetch_assoc()) {
@@ -72,9 +91,38 @@ if (isset($_GET["param"])){
         echo '
             </tbody>
           </table>
-        </div>
+        </div>';
         
 
+        echo '
+        <!-- Pagination -->
+        <div class="row text-center">
+            <div class="col-lg-12">
+                <ul class="pagination">
+                    <li>
+                        <a href="'.$_SERVER["PHP_SELF"].'?param='.$_GET["param"].'&page='.($page-1).'">&laquo;</a>
+                    </li>
+                    ';
+                    for ($i = 1; $i<=$seiten; $i++){
+                        if ($i == $page){
+                            echo '<li class="active">';
+                        }else{
+                            echo '<li>';
+                        }
+                        echo '<a href="'.$_SERVER["PHP_SELF"].'?param='.$_GET["param"].'&page='.$i.'">'.$i.'</a>
+                        </li>';
+                    }
+                    echo '
+                    <li>
+                        <a href="'.$_SERVER["PHP_SELF"].'?param='.$_GET["param"].'&page='.($page+1).'">&raquo;</a>
+                    </li>
+                </ul>
+            </div>
+        </div>';
+
+
+
+        echo '
          <div class="row">
             <div class="col-md-12 text-center">
                 <a href="index.php" class="btn btn-success" role="button">back</a>
diff --git a/web/graph.php b/web/graph.php
index ef2418933d1755cbeba704b3a938845ea3298aed..492efafc544007d74714a7c2912feea4a899875d 100644
--- a/web/graph.php
+++ b/web/graph.php
@@ -104,11 +104,10 @@ if (isset($_GET["param"])){
 
 		if ($showDetails){
 			$graph->title->Set($name);
-			$graph->SetMargin(130,100,40,0);
+			$graph->SetMargin(130,100,40,100);
 			$graph->yaxis->HideTicks(false,false);
 			$graph->xgrid->SetLineStyle("solid");
 			$graph->img->SetAntiAliasing(true);
-			$p1->SetLegend($param);
 
 		}
 
diff --git a/web/include/_head.php b/web/include/_head.php
index 7e4bd04905dcd99fdc4f7d15ed74622afe5b9a0c..8dfb4f3a0cf43decf47a2a64c5e76db9c575c051 100644
--- a/web/include/_head.php
+++ b/web/include/_head.php
@@ -49,7 +49,7 @@
                         <a href="index.php">Dashboard</a>
                     </li>
                     <li>
-                        <a href="admin/" target="_blank">Admin</a>
+                        <a href="admin.php">Admin</a>
                     </li>
                 </ul>
             </div>
diff --git a/web/include/config.php b/web/include/config.php
index 9705821bcfbcb0ee80ea738a44eb67ac5678c478..cf028512751ab29b598523dd5389b54453192bb6 100644
--- a/web/include/config.php
+++ b/web/include/config.php
@@ -5,6 +5,7 @@ $TBL_REGISTER = "tbl_register";
 $TBL_DATA = "tbl_data";
 $GRAPHPOINTS = -50;
 $THUMBSIZE = 4; // 1 min, 12 max
+$TABLELINESPERPAGE = 50;
 
 // Wenn letzte Nachricht älter als X Stunden, wird das Gerät aus dem Dashboard entfernt
 $DEVICEOFFLINETIME =  10;
diff --git a/web/index.php b/web/index.php
index 687dff2d6e0a3c4217ae76e0eb051d31dc82d37e..45705ca7a4b3feab4ba80bc7b80b5763cf82c6db 100755
--- a/web/index.php
+++ b/web/index.php
@@ -17,7 +17,7 @@ $sql = new SQL();
 $link = $sql->getLink();
 $graphs = array();
 
-$query = "SELECT clientAddress, name, max(tbl_data.timestamp) as date, fid_register FROM (tbl_register INNER JOIN tbl_parameter ON tbl_register.id = tbl_parameter.fid_register) INNER JOIN tbl_data ON tbl_parameter.id = tbl_data.fid_parameter WHERE fid_register IN (SELECT max(id) FROM tbl_register group by clientAddress) AND tbl_data.timestamp > (NOW() - INTERVAL ".$DEVICEOFFLINETIME." MINUTE) group by fid_register";
+$query = "SELECT clientAddress, name, max(tbl_data.timestamp) as date, fid_register FROM tbl_addresses INNER JOIN ((tbl_register INNER JOIN tbl_parameter ON tbl_register.id = tbl_parameter.fid_register) INNER JOIN tbl_data ON tbl_parameter.id = tbl_data.fid_parameter) ON tbl_addresses.address = tbl_register.clientAddress WHERE fid_register IN (SELECT max(id) FROM tbl_register group by clientAddress) AND tbl_data.timestamp > (NOW() - INTERVAL ".$DEVICEOFFLINETIME." MINUTE) group by fid_register";