Advertisement
Guest User

Untitled

a guest
May 16th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en" dir="ltr">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Contact - MRL Simracing</title>
  6. <!--Import Google Icon Font-->
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
  8. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  9. <!--Import materialize.css-->
  10. <link rel="stylesheet" href="/css/style.css">
  11. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
  12. <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  13. <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
  14.  
  15. <script type="text/javascript">
  16. $(document).ready(function(){
  17. $('.sidenav').sidenav();
  18. $('.collapsible').collapsible();
  19. });
  20. </script>
  21.  
  22. <style media="screen">
  23.  
  24. #myInput {
  25. border-box: box-sizing;
  26. background-image: url('searchicon.png');
  27. background-position: 14px 12px;
  28. background-repeat: no-repeat;
  29. font-size: 16px;
  30. padding: 14px 20px 12px 45px;
  31. border: none;
  32. border-bottom: 1px solid #ddd;
  33. }
  34.  
  35. #myInput:focus {outline: 3px solid #ddd;}
  36.  
  37. .dropdown2 {
  38. position: relative;
  39. display: inline-block;
  40. }
  41.  
  42. .dropdown-content2 {
  43. display: none;
  44. position: absolute;
  45. background-color: #f6f6f6;
  46. min-width: 230px;
  47. overflow: auto;
  48. z-index: 1;
  49. }
  50.  
  51. .dropdown-content3 {
  52. display: none;
  53. width: 600px;
  54. position: fixed;
  55. z-index: 1;
  56. }
  57.  
  58. .dropdown-content2 a {
  59. color: black;
  60. text-decoration: none;
  61. display: block;
  62. }
  63.  
  64. .dropdown2 a:hover {background-color: #ddd;}
  65.  
  66. .show {display: block;}
  67. </style> <!--Let browser know website is optimized for mobile-->
  68. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  69. </head>
  70. <body>
  71. <header>
  72. <div class="body navbar-fixed">
  73. <nav class="transparent z-depth-0">
  74. <div class="nav-wrapper">
  75. <a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
  76. <ul class="right hide-on-med-and-down">
  77. <li>
  78. <div class="dropdown2">
  79. <?php
  80. $erste = "878723847623876328767238";
  81. $zwei = "892389238923820009999900";
  82. $wertarray = explode("|",$_COOKIE["userid"]);
  83. if($erste != trim($wertarray[0])) { ?>
  84. <a onclick="myFunction2()" id="id3" class="waves-effect waves-light btn blue darken-3 white-text">Admin Login
  85. <i class="material-icons right">account_box</i>
  86. </a><?php
  87. } else {?>
  88. <a onclick="" id="id4" class="tooltipped waves-effect waves-light btn green darken-3 white-text" data-position="bottom" data-tooltip="Ausloggen">Eingeloggt
  89. <i class="material-icons right">account_box</i>
  90. </a><?php
  91. }
  92. ?>
  93. <div id="myDropdown2" class="dropdown-content3 row">
  94. <div class="col s12 m6">
  95. <div class="card blue-grey darken-1">
  96. <div class="card-content white-text">
  97. <form class="" action="" method="post">
  98. <input type="text" name="user" placeholder="Username" value="">
  99. <input type="password" name="pw" placeholder="Passwort" value="">
  100. <button onclick="" class="btn-small blue darken-3 waves-effect waves-light" type="submit" name="logins">Login</button>
  101. </form>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <script>
  108. /* When the user clicks on the button,
  109. toggle between hiding and showing the dropdown content */
  110. function myFunction2() {
  111. document.getElementById("myDropdown2").classList.toggle("show");
  112. }
  113.  
  114. function filterFunction2() {
  115. var input, filter, ul, li, a, i;
  116. input = document.getElementById("myInput");
  117. filter = input.value.toUpperCase();
  118. div = document.getElementById("myDropdown2");
  119. a = div.getElementsByTagName("a");
  120. for (i = 0; i < a.length; i++) {
  121. txtValue = a[i].textContent || a[i].innerText;
  122. if (txtValue.toUpperCase().indexOf(filter) > -1) {
  123. a[i].style.display = "";
  124. } else {
  125. a[i].style.display = "none";
  126. }
  127. }
  128. }
  129. </script>
  130.  
  131. <?php
  132. if(isset($_POST['logins'])) {
  133. $user = $_POST['user'];
  134. $pw = $_POST['pw'];
  135. login($user, $pw);
  136. }
  137.  
  138. function login($user, $pw) {
  139. include 'config.php';
  140. $sql = $conn->prepare("SELECT user2 FROM login");
  141. $sql->execute(array());
  142. while($row = $sql->fetch()) {
  143. if (strcmp(trim($user),trim($row['user2'])) == 0) {
  144. $sql1 = $conn->prepare("SELECT pass FROM login WHERE user2 = ?");
  145. $sql1->execute(array($user));
  146. $row1 = $sql1->fetch();
  147. if (strcmp(trim($pw),trim($row1[0])) == 0) {?> <script type="text/javascript">
  148. document.cookie = "userid=878723847623876328767238|892389238923820009999900";
  149. $('#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');
  150. $( window ).load(function() {
  151. if (window.location.href.indexOf('reload')==-1) {
  152. window.location.replace(window.location.href+'?reload');
  153. }
  154. });</script><?php
  155.  
  156. } else { ?><script type="text/javascript">
  157. M.toast({html: 'Flasches User oder Passwort, versuche es erneut!'})
  158. </script>
  159. <?php
  160. }
  161. }
  162. }
  163.  
  164. }
  165. ?>
  166.  
  167.  
  168.  
  169.  
  170. </li>
  171. <li>
  172. <a href="/live.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;">Live!
  173. <i class="material-icons right">live_tv</i>
  174. </a>
  175. </li>
  176. <li>
  177. <a rel="tooltip" title="" data-placement="bottom" href="https://twitter.com/MulchianRL" target="_blank" data-original-title="Follow us on Twitter">
  178. <i class="fa fa-twitter socialicon"></i>
  179. </a>
  180. </li>
  181. <li>
  182. <a rel="tooltip" title="" data-placement="bottom" href="#" target="_blank" data-original-title="Like us on Facebook">
  183. <i class="fa fa-facebook-square socialicon"></i>
  184. </a>
  185. </li>
  186. </ul>
  187. <ul class="hide-on-med-and-down" style="">
  188. <li>
  189. <a href="/index.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;">&nbsp;&nbsp;Home&nbsp;&nbsp;</a>
  190. </li>
  191. <li>
  192. <a href="/news.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;">&nbsp;&nbsp;News&nbsp;&nbsp;</a>
  193. </li>
  194. <li>
  195. <a href="/team.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;">&nbsp;&nbsp;Team&nbsp;&nbsp;</a>
  196. </li>
  197. <li>
  198. <a href="/sponsoring.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;">&nbsp;&nbsp;Sponsoring&nbsp;&nbsp;</a>
  199. </li>
  200. <li>
  201. <a href="/contact.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;">&nbsp;&nbsp;Contact&nbsp;&nbsp;</a>
  202. </li>
  203. </ul>
  204.  
  205. </div>
  206. </nav>
  207. </div>
  208. <div class="nav-wrapper">
  209. <ul class="sidenav transparent z-depth-0" id="mobile-demo">
  210. <br><br>
  211. <li>
  212. <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/index.php" class="white-text">&nbsp;&nbsp;Home&nbsp;&nbsp;</a>
  213. </li>
  214. <li>
  215. <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/news.php" class="white-text">&nbsp;&nbsp;News&nbsp;&nbsp;</a>
  216. </li>
  217. <li>
  218. <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/team.php" class="white-text">&nbsp;&nbsp;Team&nbsp;&nbsp;</a>
  219. </li>
  220. <li>
  221. <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/sponsoring.php" class="white-text">&nbsp;&nbsp;Sponsoring&nbsp;&nbsp;</a>
  222. </li>
  223. <li>
  224. <a style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" href="/contact.php" class="white-text">&nbsp;&nbsp;Contact&nbsp;&nbsp;</a>
  225. </li>
  226. <br><br><br>
  227. <li>
  228. <a href="/live.php" style="font-family:'Lulo Clean Outline Bold'; font-size: 12px; font-style: normal; font-weight: bold;" class="white-text">Live!
  229. <i class="material-icons left white-text">live_tv</i>
  230. </a>
  231. </li>
  232. <li>
  233. <a rel="tooltip" title="" data-placement="bottom" href="https://twitter.com/MulchianRL" target="_blank" data-original-title="Follow us on Twitter">
  234. <i class="white-text fa fa-twitter socialicon"></i>
  235. </a>
  236. </li>
  237. <li>
  238. <a rel="tooltip" title="" data-placement="bottom" href="#" target="_blank" data-original-title="Like us on Facebook">
  239. <i class=" white-text fa fa-facebook-square socialicon"></i>
  240. </a>
  241. </li>
  242. <li>
  243. <a rel="tooltip" title="" data-placement="bottom" href="https://www.twitch.tv/mulchianracingleague" target="_blank" data-original-title="Follow us on Twitch">
  244. <i class=" white-text fa fa-twitch socialicon"></i>
  245. </a>
  246. </li>
  247. </ul>
  248. </div>
  249. </header>
  250. <main>
  251. <!-- First Kachel -->
  252. <div class="section transparent">
  253. <div class="row container ">
  254.  
  255.  
  256. <h1 style="font-family:'Lulo Clean Outline Bold';font-weight:normal; font-size: 40px;" class="header-font center white-text">Contact</h1>
  257. <!-- Admin -->
  258. <?php
  259. $erste = "878723847623876328767238";
  260. $zwei = "892389238923820009999900";
  261. $wertarray = explode("|",$_COOKIE["userid"]);
  262. if (in_array($erste, $wertarray) && in_array($zwei, $wertarray) == true) {?>
  263. <h1 style="font-family:'Lulo Clean Outline Bold';font-weight:normal; font-size: 12px;" class="header-font center white-text">Adminoberfläche</h1>
  264. <div id="switch" class="switch">
  265. <form method="post">
  266. <label style="">
  267. Off
  268. <input id="id1" type="checkbox" name="statusValue" onChange="this.form.submit(); " />
  269. <span class="lever"></span>
  270. On
  271. </label>
  272. </form>
  273. </div>
  274. <?php
  275. if (isset($_POST['statusValue'])) { ?> <script>document.getElementById("id1").checked = true;</script>
  276. <script type="text/javascript">
  277. if (!document.getElementById("id1").checked) {
  278. document.getElementById("id1").onChange = windows.location = "/contact.php";
  279. }
  280.  
  281. </script> <?php
  282. $servername = "localhost";
  283. $username = "root";
  284. $password = "hr4you";
  285. $dbname = "mrlsim";
  286. $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  287. $sql = $conn->prepare("SELECT * FROM contact");
  288. $sql->execute();
  289.  
  290.  
  291. while($row = $sql->fetch()) {
  292. echo '<ul class="collapsible">';
  293. echo '<li>';
  294. 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>';
  295. 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>';
  296. echo "<br><br><a href='delete.php?id=".$row['First']."' class='blue darken-3 waves-effect waves-light btn-small'>Löschen</a></div>";
  297. echo '</li>';
  298. echo '</ul>';
  299. }
  300. }
  301. ?>
  302. <h1 style="font-family:'Lulo Clean Outline Bold';font-weight:normal; font-size: 12px;" class="header-font center white-text">Formular</h1>
  303. <?php
  304. }?>
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314. <!-- Formular -->
  315. <div class="row">
  316. <form method="post" class="col s12">
  317. <div class="row">
  318. <div class="input-field col s6">
  319. <input id="First" name="First" class="grey-text" type="text" class="validate">
  320. <label for="First">First Name</label>
  321. </div>
  322. <div class="input-field col s6">
  323. <input id="Last" name="Last" class="grey-text" type="text" class="validate">
  324. <label for="Last">Last Name</label>
  325. </div>
  326. </div>
  327. <div class="row">
  328. <div class="input-field col s12">
  329. <input id="Email" name="Email" class="grey-text" type="email" class="validate">
  330. <label for="Email">Email</label>
  331. </div>
  332. </div>
  333. <div class="row">
  334. <div class="input-field col s12">
  335. <input id="Subject" name="Subject" class="grey-text" type="text" class="validate">
  336. <label for="Subject">Subject</label>
  337. </div>
  338. </div>
  339. <div class="row">
  340. <div class="input-field col s12">
  341. <textarea id="textcontact" name="textcontact" rows="8" cols="80" class="grey-text" style="height: 400px;"></textarea>
  342. <label for="textcontact">Text</label>
  343. </div>
  344. </div>
  345. <div class="row">
  346. <div class="input-field col s12">
  347. <button onclick="" class="btn blue darken-3 waves-effect waves-light" type="submit" name="contactsend">Abschicken
  348. <i class="material-icons right">send</i>
  349. </button>
  350. </div>
  351. </div>
  352. </form>
  353. <?php
  354. if(isset($_POST['contactsend'])) {
  355. include 'config.php';
  356. $First = $_POST['First'];
  357. $Last = $_POST['Last'];
  358. $Email = $_POST['Email'];
  359. $Subject = $_POST['Subject'];
  360. $Text = $_POST['textcontact'];
  361. $dataTime = date("Y-m-d H:i:s");
  362. $sql = $conn->prepare("INSERT INTO contact (First, Last, Email, Subject, textcontact, datum) VALUES (?, ?, ?, ?, ?, ?)");
  363. $sql->execute(array($First, $Last, $Email, $Subject, $Text, $dataTime));
  364. if($sql) {?>
  365. <script type="text/javascript">
  366. M.toast({html: 'Your Message was succesfully sended!'})
  367. </script><?php
  368. } else {?>
  369. <script type="text/javascript">
  370. M.toast({html: 'There was a failure, pls try again!'})
  371. </script><?php
  372. }
  373. }
  374. ?>
  375.  
  376. </div>
  377. </div>
  378. </div>
  379. </main>
  380. <footer>
  381. </footer>
  382.  
  383. </body>
  384. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement