%PDF- %PDF-
Direktori : /mnt/tnb2/los/backend/ |
Current File : //mnt/tnb2/los/backend/index.php |
<!DOCTYPE html> <html lang="cs"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="apple-mobile-web-app-title" content="Správa závodů LOS" /> <meta name="application-name" content="Správa závodů LOS" /> <meta name="msapplication-TileColor" content="#da532c" /> <meta name="theme-color" content="#ffffff" /> <meta name="color-scheme" content="dark light" /> <title>Správa závodů LOS</title> <link rel="canonical" href="https://loslex.cz/backend/" /> <link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png" /> <link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png" /> <link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png" /> <link rel="manifest" href="../site.webmanifest" /> <!-- css --> <link rel="stylesheet" href="css/bootstrap.min.css" /> <link rel="stylesheet" href="css/table-style.css" /> <link rel="stylesheet" href="css/dashboard.css" /> <style> body {background-image: url('https://picsum.photos/1920/1068/?random'); background-size: auto;} </style> </head> <body> <!-- login --> <div class="container"> <div class="row d-flex justify-content-center text-center"> <div class="col-lg-3 col-md-6 mt-5"> <div class="card"> <h6 class="text-center fs-4 fw-bold mt-3">LEX z. s.</h6> <div class="text-center">Správa závodů LOS</div> <form class="card-body mx-2" method="POST"> <div class="text-center"> <img src="../images/LOS_short.jpg" class="img-fluid profile-image-pic img-thumbnail border-0 mb-4" width="120px" alt="profile"> </div> <div class="mb-3"> <input type="text" name="uzivatel" class="form-control form-control-sm" id="uzivatel" placeholder="Uživatelské jméno"> </div> <div class="mb-3"> <input type="password" name="heslo" class="form-control form-control-sm" id="heslo" placeholder="Heslo"> </div> <div class="text-center"><button type="submit" name="prihlasit" class="btn btn-sm btn-dark px-3 mb-3 w-50">Přihlásit</div> <!--<div class="text-center"><button type="submit" name="login" class="btn btn-sm btn-dark px-3 mb-3 w-50">Přihlásit</button></div>--> <div class="form-text text-center"><a href="/">Zpět na stránky LOS</a> </div> </form> </div> </div> </div> </div> <?php session_start(); ini_set( "session.gc_maxlifetime", 86400 ); include('../sql.php'); if (isset($_POST["prihlasit"])){ $mysqli = new mysqli(pc,user,pass,data); $jmeno=$_POST["uzivatel"]; $heslo=$_POST["heslo"]; $dotaz="SELECT count(uzivatel) AS pocet FROM registrace where uzivatel='".$jmeno."'"; $test=mysqli_fetch_assoc($mysqli->query($dotaz)); $jmenook=$test["pocet"]; if ($jmenook>0) { $dotaz="SELECT heslo,poradatel,uzivatel,id,admin FROM registrace where uzivatel='".$jmeno."'"; $test=mysqli_fetch_assoc($mysqli->query($dotaz)); if ($test["poradatel"]==0) {echo '<script>alert("Uživatel není uveden jako pořadatel. Použijte jiný účet.")</script>';} else { if (($test["heslo"])==md5($heslo)){ $_SESSION["poradatel"]=$test["uzivatel"]; $_SESSION["poradatel_id"]=$test["id"]; $_SESSION["admin"]=$test["admin"]; echo '<script>window.location.href="main.php"</script>'; } else {echo '<script>alert("Špatné heslo!")</script>';} } } else {echo '<script>alert("Špatné uživatelské jméno nebo nebylo nalezeno.")</script>';} } ?> <!-- footer --> <footer class="footer mt-auto py-3" style="background-color: unset;color: #f1f1f1;"> <div class="container"> <p class="text-center copyright">2023 | mickey & strasidlo | created for defens shooting</p> </div> </footer> </body> </html>