<?php 

require_once('vt.php');


session_start();
ob_start();
$_SESSION['kilit'] = 1;

if($_SESSION['musteri'] == ''){
    header("location: giris.php");
}
if(!empty($_POST)){
    $id = $_SESSION['musteri'];
    $sifre = $_POST['password'];

    $sorgu = $baglanti->prepare("SELECT * FROM admin WHERE id = '".$id."' AND password = '".$sifre."' ");
    $sorgu->execute();
    if($sorgu->rowCount()){
        foreach($sorgu as $sonuc){}

            $_SESSION['kilit'] = 0;

        header("location: ../index.php");
    }
    else {
        $hata = "* Girilen şifre hatalı";
    }
}

$ayarx = $dbh->query("SELECT * FROM general_settings WHERE id = 1 ", PDO::FETCH_ASSOC);
if ($ayarx->rowCount()) {
  foreach ($ayarx as $ayarx) {
  }
}


?>


<!DOCTYPE html>
<html lang="tr">

<head>
    <meta charset="utf-8" />
    <title>Oturum Kilitlendi</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 
    <meta content="" name="parstech" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <!-- App favicon -->
    <link rel="shortcut icon" href="assets/images/favicon.ico">

    <!-- App css -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="../assets/css/icons.min.css" rel="stylesheet" type="text/css" />
    <link href="../assets/css/app.min.css" rel="stylesheet" type="text/css" />

</head>

<body class="account-body accountbg">

    <!-- Lock screen page -->
    <div class="container">
        <div class="row vh-100 d-flex justify-content-center">
            <div class="col-12 align-self-center">
                <div class="row">
                    <div class="col-lg-5 mx-auto">
                        <div class="card">
                            <div class="card-body p-0 auth-header-box">
                                <div class="text-center p-3"> 
                                        <img src="../../img/<?=$ayarx['foto'];?>" height="50" alt="logo" class="auth-logo"> 
                                    <h4 class="mt-3 mb-1 font-weight-semibold text-white font-14">Merhaba <?= $_SESSION['musteriname'] ?>, </h4>   
                                    <p class="text-muted  mb-0">Devam etmek için lütfen oturum şifrenizi girin</p>  
                                </div>
                            </div>
                            <div class="card-body">
                                <form class="form-horizontal auth-form" method="post" action="">

                                    <div class="form-group mb-2">
                                        <label for="username">Oturum Şifresi</label>
                                        <div class="input-group mb-3">                                                                                         
                                            <input type="password" class="form-control" name="password" id="password" placeholder="*****">
                                        </div>                                    
                                    </div><!--end form-group--> 

                                    <div class="form-group mb-0 row">
                                        <div class="col-12">
                                            <button  type="submit" class="btn btn-primary btn-block waves-effect waves-light" type="button">Kilidi Aç <i class="fas fa-sign-in-alt ml-1"></i></button>
                                        </div><!--end col--> 
                                    </div> <!--end form-group-->                           
                                </form><!--end form-->
                                 
                            </div>
                            <div class="card-body bg-light-alt text-center">
                                <span class="text-muted d-none d-sm-inline-block"><?=$ayarx['copyright'];?></span>                                            
                            </div>
                        </div><!--end card-->
                    </div><!--end col-->
                </div><!--end row-->
            </div><!--end col-->
        </div><!--end row-->
    </div><!--end container-->
    <!-- End lock screen page -->




    <!-- jQuery  -->
    <script src="../assets/js/jquery.min.js"></script>
    <script src="../assets/js/bootstrap.bundle.min.js"></script>
    <script src="../assets/js/waves.js"></script>
    <script src="../assets/js/feather.min.js"></script>
    <script src="../assets/js/simplebar.min.js"></script>


</body>

</html>