Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en" dir="ltr">
- <head>
- <meta charset="utf-8">
- <title>Contact - MRL Simracing</title>
- <!--Import Google Icon Font-->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
- <!--Import materialize.css-->
- <link rel="stylesheet" href="/css/style.css">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
- <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $('.sidenav').sidenav();
- $('.collapsible').collapsible();
- });
- </script>
- <style media="screen">
- #myInput {
- border-box: box-sizing;
- background-image: url('searchicon.png');
- background-position: 14px 12px;
- background-repeat: no-repeat;
- font-size: 16px;
- padding: 14px 20px 12px 45px;
- border: none;
- border-bottom: 1px solid #ddd;
- }
- #myInput:focus {outline: 3px solid #ddd;}
- .dropdown2 {
- position: relative;
- display: inline-block;
- }
- .dropdown-content2 {
- display: none;
- position: absolute;
- background-color: #f6f6f6;
- min-width: 230px;
- overflow: auto;
- z-index: 1;
- }
- .dropdown-content3 {
- display: none;
- width: 600px;
- position: fixed;
- z-index: 1;
- }
- .dropdown-content2 a {
- color: black;
- text-decoration: none;
- display: block;
- }
- .dropdown2 a:hover {background-color: #ddd;}
- .show {display: block;}
- </style> <!--Let browser know website is optimized for mobile-->
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- </head>
- <body>
- <header>
- <div class="body navbar-fixed">
- <nav class="transparent z-depth-0">
- <div class="nav-wrapper">
- <a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
- <ul class="right hide-on-med-and-down">
- <li>
- <div class="dropdown2">
- <?php
- $erste = "878723847623876328767238";
- $zwei = "892389238923820009999900";
- $wertarray = explode("|",$_COOKIE["userid"]);
- if($erste != trim($wertarray[0])) { ?>
- <a onclick="myFunction2()" id="id3" class="waves-effect waves-light btn blue darken-3 white-text">Admin Login
- <i class="material-icons right">account_box</i>
- </a><?php
- } else {?>
- <a onclick="" id="id4" class="tooltipped waves-effect waves-light btn green darken-3 white-text" data-position="bottom" data-tooltip="Ausloggen">Eingeloggt
- <i class="material-icons right">account_box</i>
- </a><?php
- }
- ?>
- <div id="myDropdown2" class="dropdown-content3 row">
- <div class="col s12 m6">
- <div class="card blue-grey darken-1">
- <div class="card-content white-text">
- <form class="" action="" method="post">
- <input type="text" name="user" placeholder="Username" value="">
- <input type="password" name="pw" placeholder="Passwort" value="">
- <button onclick="" class="btn-small blue darken-3 waves-effect waves-light" type="submit" name="logins">Login</button>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- /* When the user clicks on the button,
- toggle between hiding and showing the dropdown content */
- function myFunction2() {
- document.getElementById("myDropdown2").classList.toggle("show");
- }
- function filterFunction2() {
- var input, filter, ul, li, a, i;
- input = document.getElementById("myInput");
- filter = input.value.toUpperCase();
- div = document.getElementById("myDropdown2");
- a = div.getElementsByTagName("a");
- for (i = 0; i < a.length; i++) {
- txtValue = a[i].textContent || a[i].innerText;
- if (txtValue.toUpperCase().indexOf(filter) > -1) {
- a[i].style.display = "";
- } else {
- a[i].style.display = "none";
- }
- }
- }
- </script>
- <?php
- if(isset($_POST['logins'])) {
- $user = $_POST['user'];
- $pw = $_POST['pw'];
- login($user, $pw);
- }
- function login($user, $pw) {
- include 'config.php';
- $sql = $conn->prepare("SELECT user2 FROM login");
- $sql->execute(array());
- while($row = $sql->fetch()) {
- if (strcmp(trim($user),trim($row['user2'])) == 0) {
- $sql1 = $conn->prepare("SELECT pass FROM login WHERE user2 = ?");
- $sql1->execute(array($user));
- $row1 = $sql1->fetch();
- if (strcmp(trim($pw),trim($row1[0])) == 0) {?> <script type="text/javascript">
- document.cookie = "userid=878723847623876328767238|892389238923820009999900";
- $('#id3').replaceWith('<a onclick="" id="id4" class="tooltipped waves-effect waves-light btn green darken-3 white-text" data-position="bottom" data-tooltip="Ausloggen">Eingeloggt');
- $( window ).load(function() {
- if (window.location.href.indexOf('reload')==-1) {
- window.location.replace(window.location.href+'?reload');
- }
- });</script><?php
- } else { ?><script type="text/javascript">
- M.toast({html: 'Flasches User oder Passwort, versuche es erneut!'})
- </script>
- <?php
- }
- }
- }
- }
- ?>
- </li>
- <li>
- <a href="/live.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;">Live!
- <i class="material-icons right">live_tv</i>
- </a>
- </li>
- <li>
- <a rel="tooltip" title="" data-placement="bottom" href="https://twitter.com/MulchianRL" target="_blank" data-original-title="Follow us on Twitter">
- <i class="fa fa-twitter socialicon"></i>
- </a>
- </li>
- <li>
- <a rel="tooltip" title="" data-placement="bottom" href="#" target="_blank" data-original-title="Like us on Facebook">
- <i class="fa fa-facebook-square socialicon"></i>
- </a>
- </li>
- </ul>
- <ul class="hide-on-med-and-down" style="">
- <li>
- <a href="/index.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;"> Home </a>
- </li>
- <li>
- <a href="/news.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;"> News </a>
- </li>
- <li>
- <a href="/team.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;"> Team </a>
- </li>
- <li>
- <a href="/sponsoring.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;"> Sponsoring </a>
- </li>
- <li>
- <a href="/contact.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;"> Contact </a>
- </li>
- </ul>
- </div>
- </nav>
- </div>
- <div class="nav-wrapper">
- <ul class="sidenav transparent z-depth-0" id="mobile-demo">
- <br><br>
- <li>
- <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/index.php" class="white-text"> Home </a>
- </li>
- <li>
- <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/news.php" class="white-text"> News </a>
- </li>
- <li>
- <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/team.php" class="white-text"> Team </a>
- </li>
- <li>
- <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/sponsoring.php" class="white-text"> Sponsoring </a>
- </li>
- <li>
- <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/contact.php" class="white-text"> Contact </a>
- </li>
- <br><br><br>
- <li>
- <a href="/live.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" class="white-text">Live!
- <i class="material-icons left white-text">live_tv</i>
- </a>
- </li>
- <li>
- <a rel="tooltip" title="" data-placement="bottom" href="https://twitter.com/MulchianRL" target="_blank" data-original-title="Follow us on Twitter">
- <i class="white-text fa fa-twitter socialicon"></i>
- </a>
- </li>
- <li>
- <a rel="tooltip" title="" data-placement="bottom" href="#" target="_blank" data-original-title="Like us on Facebook">
- <i class=" white-text fa fa-facebook-square socialicon"></i>
- </a>
- </li>
- <li>
- <a rel="tooltip" title="" data-placement="bottom" href="https://www.twitch.tv/mulchianracingleague" target="_blank" data-original-title="Follow us on Twitch">
- <i class=" white-text fa fa-twitch socialicon"></i>
- </a>
- </li>
- </ul>
- </div>
- </header>
- <main>
- <!-- First Kachel -->
- <div class="section transparent">
- <div class="row container ">
- <h1 style="font-family:'Lulo Clean Outline Bold';font-weight:normal; font-size: 40px;" class="header-font center white-text">Contact</h1>
- <!-- Admin -->
- <?php
- $erste = "878723847623876328767238";
- $zwei = "892389238923820009999900";
- $wertarray = explode("|",$_COOKIE["userid"]);
- if (in_array($erste, $wertarray) && in_array($zwei, $wertarray) == true) {?>
- <h1 style="font-family:'Lulo Clean Outline Bold';font-weight:normal; font-size: 12px;" class="header-font center white-text">Adminoberfläche</h1>
- <div id="switch" class="switch">
- <form method="post">
- <label style="">
- Off
- <input id="id1" type="checkbox" name="statusValue" onChange="this.form.submit(); " />
- <span class="lever"></span>
- On
- </label>
- </form>
- </div>
- <?php
- if (isset($_POST['statusValue'])) { ?> <script>document.getElementById("id1").checked = true;</script>
- <script type="text/javascript">
- if (!document.getElementById("id1").checked) {
- document.getElementById("id1").onChange = windows.location = "/contact.php";
- }
- </script> <?php
- $servername = "localhost";
- $username = "root";
- $password = "hr4you";
- $dbname = "mrlsim";
- $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $sql = $conn->prepare("SELECT * FROM contact");
- $sql->execute();
- while($row = $sql->fetch()) {
- echo '<ul class="collapsible">';
- echo '<li>';
- echo '<div class="collapsible-header grey-text text-darken-3"><i class="material-icons">email</i>Von: ' . $row['First'] . ' ' . $row['Last'] . ' Am: ' . $row['datum'] . '</div>';
- echo '<div class="collapsible-body white grey-text text-darken-3"><span>Name: ' . $row['First'] . ' ' . $row['Last'] . '<br>Email: ' . $row['Email'] . '<br>Betreff: ' . $row['Subject'] . '<br><br>Text: ' . $row['textcontact'] . '<br><br>Datum: ' . $row['datum'] . '</span>';
- echo "<br><br><a href='delete.php?id=".$row['First']."' class='blue darken-3 waves-effect waves-light btn-small'>Löschen</a></div>";
- echo '</li>';
- echo '</ul>';
- }
- }
- ?>
- <h1 style="font-family:'Lulo Clean Outline Bold';font-weight:normal; font-size: 12px;" class="header-font center white-text">Formular</h1>
- <?php
- }?>
- <!-- Formular -->
- <div class="row">
- <form method="post" class="col s12">
- <div class="row">
- <div class="input-field col s6">
- <input id="First" name="First" class="grey-text" type="text" class="validate">
- <label for="First">First Name</label>
- </div>
- <div class="input-field col s6">
- <input id="Last" name="Last" class="grey-text" type="text" class="validate">
- <label for="Last">Last Name</label>
- </div>
- </div>
- <div class="row">
- <div class="input-field col s12">
- <input id="Email" name="Email" class="grey-text" type="email" class="validate">
- <label for="Email">Email</label>
- </div>
- </div>
- <div class="row">
- <div class="input-field col s12">
- <input id="Subject" name="Subject" class="grey-text" type="text" class="validate">
- <label for="Subject">Subject</label>
- </div>
- </div>
- <div class="row">
- <div class="input-field col s12">
- <textarea id="textcontact" name="textcontact" rows="8" cols="80" class="grey-text" style="height: 400px;"></textarea>
- <label for="textcontact">Text</label>
- </div>
- </div>
- <div class="row">
- <div class="input-field col s12">
- <button onclick="" class="btn blue darken-3 waves-effect waves-light" type="submit" name="contactsend">Abschicken
- <i class="material-icons right">send</i>
- </button>
- </div>
- </div>
- </form>
- <?php
- if(isset($_POST['contactsend'])) {
- include 'config.php';
- $First = $_POST['First'];
- $Last = $_POST['Last'];
- $Email = $_POST['Email'];
- $Subject = $_POST['Subject'];
- $Text = $_POST['textcontact'];
- $dataTime = date("Y-m-d H:i:s");
- $sql = $conn->prepare("INSERT INTO contact (First, Last, Email, Subject, textcontact, datum) VALUES (?, ?, ?, ?, ?, ?)");
- $sql->execute(array($First, $Last, $Email, $Subject, $Text, $dataTime));
- if($sql) {?>
- <script type="text/javascript">
- M.toast({html: 'Your Message was succesfully sended!'})
- </script><?php
- } else {?>
- <script type="text/javascript">
- M.toast({html: 'There was a failure, pls try again!'})
- </script><?php
- }
- }
- ?>
- </div>
- </div>
- </div>
- </main>
- <footer>
- </footer>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement