


<!DOCTYPE html>
<html lang="gu">
<head>
  <meta charset="UTF-8">
  <title>લૉગિન પેજ</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">

  <style>
    body {
      background: linear-gradient(135deg, #4e54c8, #8f94fb, #7efff5);
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: 'Segoe UI', sans-serif;
    }

    .login-box {
      background: white;
      padding: 30px 40px;
      border-radius: 15px;
      box-shadow: 0 0 10px rgba(0,0,0,0.2);
      width: 100%;
      max-width: 400px;
    }

    .form-control {
      border-radius: 10px;
    }

    .btn-primary {
      border-radius: 10px;
    }

    h2 {
      text-align: center;
      margin-bottom: 25px;
    }
  </style>
  <script type="text/javascript" src="custom_js/jquery.min.js"></script>
</head>
<body>

<div class="login-box">
  <h2>🧾 લૉગિન કરો</h2>
  <form action="login_process.php" method="post">
    <div class="mb-3">
      <label for="username" class="form-label">યુઝરનામ</label>
      <input type="text" class="form-control" id="username" name="username" required>
    </div>
    <div class="mb-3">
      <label for="password" class="form-label">પાસવર્ડ</label>
      <input type="password" class="form-control" id="password" name="password" required>
    </div>
    <div class="d-grid">
      <!--<button type="submit" class="btn btn-primary">લૉગિન</button>-->
      <button type="button" class="mt-1 mb-2 btn btn-primary" id="btn-login">Login</button>
                                                    
    </div>
  </form>
</div>

</body>

<script type="text/javascript">
        $(document).ready(function () {

            $("#username").blur(function () {
                if ($("#username").val() == "")
                {
                    $("#msg_username").fadeIn(1000);
                    $("#msg_username").html(" * Username is Empty").css({'color': 'red'});
                } else
                {
                    $("#msg_username").fadeOut(5000);
                }

            })

            $("#password").blur(function () {
                var pass1 = $("#password").val();
                if (pass1 == "")
                {
                    $("#msg_password").fadeIn(1000);
                    $("#msg_password").html("* Password Can't be Empty").css("color", "#F00");
                } else
                {
                    $("#msg_password").fadeOut(5000);
                }
            })

            $('#btn_print_bill').click(function () {
//                window.location.href = "http://localhost/E_Bill_Software_2021_Patel_Trading_2021_Patel_Trading/create_bil_print.php";
                // var url = "http://localhost/Vegbox_dairy_kasam/dairy_dashboard.php";
                window.open(url, '_blank');
            });

            $('#btn-login').click(function () {
//                alert('click login');
                    // window.location.href = "./user_dashboard.php";
//                var username = $('#username').val();
//                var password = $('#password').val();
//
//                if (username == '')
//                {
//                    $("#msg_username").html(" * Username is Empty").css({'color': 'red'});
//                } else if (password == '')
//                {
//                    $("#msg_password").html("* Password Can't be Empty").css("color", "#F00");
//                } else
//                {
////                    alert('success');
//                    var send = {'username': username, 'password': password};
//                    $.ajax({
//                        url: 'PHP_Code/login_action.php',
//                        type: 'POST',
//                        data: send,
//                        success: function (data)
//                        {
//                            debugger;
//                            // alert('data ' + data);
//                            var trimStr = $.trim(data);
//                            if (trimStr == 'Login Success .....')
//                            {
//                                debugger;
//
//                                    $("#msg_login").html(trimStr).css({'color': 'green'});
//                                    window.location.href = "./user_dashboard.php";
//
//                            } else
//                            {
//                                $("#msg_login").html(trimStr).css({'color': 'red'});
//                            }
//                        },
//                        error: function (err) {
//                            alert('error ' + err);
//                        }
//                    });
//                }
            });
        });


    </script>

</html>
