<?php
use App\Models\User;
use App\Models\Settings;
$setting = Settings::first();
?>
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">

    <title>ERP | Dashboard</title>

    <meta name="description" content="ERP | Dashboard">
    <meta name="author" content="pixelcave">
    <meta name="robots" content="index, follow">

    <!-- Open Graph Meta -->
    <meta property="og:title" content="ERP | Dashboard">
    <meta property="og:site_name" content="ERP | Dashboard">
    <meta property="og:description" content="ERP | Dashboard">
    <meta property="og:type" content="website">
    <meta property="og:url" content="">
    <meta property="og:image" content="">

    <!-- Icons -->
    <!-- The following icons can be replaced with your own, they are used by desktop and mobile browsers -->
    <link rel="shortcut icon" href="<?php echo e(asset('assets/media/favicons/favicon.png')); ?>">
    <link rel="icon" type="image/png" sizes="192x192" href="<?php echo e(asset('assets/media/favicons/favicon-192x192.png')); ?>">
    <link rel="apple-touch-icon" sizes="180x180" href="<?php echo e(asset('assets/media/favicons/apple-touch-icon-180x180.png')); ?>">
    <!-- END Icons -->

    <!-- Stylesheets -->
    <!-- Dashmix framework -->
    <link rel="stylesheet" id="css-main" href="<?php echo e(asset('assets/css/dashmix.min.css')); ?>">

<style>
    .login-logo{
        width:350px;
    }
    @media only screen and (max-width: 600px) {
  .login-logo{
        width:200px;
    }
}
</style>
  </head>

  <body>
   
    <div id="page-container">

      <!-- Main Container -->
      <main id="main-container">
        <!-- Page Content -->
        <div class="bg-image" style="background-image: url('<?php echo e(asset('assets/media/photos/photo22@2x.jpg')); ?>');">
          <div class="row g-0 bg-primary-op">
            <!-- Main Section -->

<?php  if(User::where("user_role", '1')->exists()){ ?>
            <div class="hero-static col-md-6 d-flex align-items-center bg-body-extra-light">
              <div class="p-3 w-100">
                <div class="mb-3 text-center">
                  <?php if($setting && $setting->logo != null){ ?> 
                    <a class="link-fx fw-bold fs-1" href="<?php echo e(url('admin')); ?>">
                     <img class="login-logo"   src="<?php echo e(asset('db_files/other/'.$setting->logo.'')); ?>" alt="">
                  </a>
                  <?php } ?>
                  <p class="text-uppercase fw-bold fs-sm text-muted">Sign In</p>
                
                </div>

                <div class="row g-0 justify-content-center">
                  <div class="col-sm-8 col-xl-6">
                  <?php if(Session::has('success')): ?> <div class="alert alert-success mt-2 mb-2"><?php echo e(Session::get('success')); ?></div><?php endif; ?>
                  <?php if(Session::has('fail')): ?> <div class="alert alert-danger mt-2 mb-2"><?php echo e(Session::get('fail')); ?></div><?php endif; ?>
                  <form  action="" method="post">
                  <?php echo csrf_field(); ?>
                      <div class="py-3">
                        <div class="mb-4">
                          <input type="email" class="form-control form-control-lg form-control-alt" id="email" name="email" placeholder="Email">
                          <?php if($errors->has("email")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('email')); ?></div><?php endif; ?>
                        </div>
                        <div class="mb-4">
                          <input type="password" class="form-control form-control-lg form-control-alt" id="password" name="password" placeholder="Password">
                          <?php if($errors->has("password")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('password')); ?></div><?php endif; ?>
                        </div>
                      </div>
                      <div class="mb-4">
                        <button type="submit" class="btn w-100 btn-lg btn-hero btn-primary">
                          <i class="fa fa-fw fa-sign-in-alt opacity-50 me-1"></i> Sign In
                        </button>
                        <p class="mt-3 mb-0 d-lg-flex justify-content-lg-between">
                        </p>
                      </div>
                    </form>
                  </div>
                </div>

              </div>
            </div>

<?php } else{ ?>
  <div class="hero-static col-md-6 d-flex align-items-center bg-body-extra-light">
              <div class="p-3 w-100">
                <div class="mb-3 text-center">
                  <?php if($setting && $setting->logo != null){ ?> 
                    <a class="link-fx fw-bold fs-1" href="<?php echo e(url('admin')); ?>">
                     <img class="login-logo"   src="<?php echo e(asset('db_files/other/'.$setting->logo.'')); ?>" alt="">
                  </a>
                  <?php } ?>
                  
                  <p class="text-uppercase fw-bold fs-sm text-muted">Lets Create Your Account</p>
                
                </div>

                <div class="row g-0 justify-content-center">
                  <div class="col-sm-10 col-xl-10">
                  <?php if(Session::has('success')): ?> <div class="alert alert-success mt-2 mb-2"><?php echo e(Session::get('success')); ?></div><?php endif; ?>
                  <?php if(Session::has('fail')): ?> <div class="alert alert-danger mt-2 mb-2"><?php echo e(Session::get('fail')); ?></div><?php endif; ?>
                  <form  action="<?php echo e(url('admin/create-account')); ?>" method="post" enctype="multipart/form-data">
                  <?php echo csrf_field(); ?>
                  <div class="row ">
                  <div class="col-md-12 ">
                  <h2 class="content-heading">Basic Details</h2>
                  </div>
                        <div class="col-md-6 mb-4">
                          <input type="text" class="form-control form-control-lg form-control-alt" id="name" name="name" placeholder="Name">
                          <?php if($errors->has("name")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('name')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <input type="text" class="form-control form-control-lg form-control-alt" id="phone" name="phone" placeholder="Phone Number">
                          <?php if($errors->has("phone")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('phone')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <input type="text" class="form-control form-control-lg form-control-alt" id="company_phone" name="company_phone" placeholder="Company Phone Number">
                          <?php if($errors->has("company_phone")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_phone')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <input type="text" class="form-control form-control-lg form-control-alt" id="company_name" name="company_name" placeholder="Company Name">
                          <?php if($errors->has("company_name")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_name')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <input type="email" class="form-control form-control-lg form-control-alt" id="company_email" name="company_email" placeholder="Company Email">
                          <?php if($errors->has("company_email")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_email')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <input type="text" class="form-control form-control-lg form-control-alt" id="address" name="address" placeholder="Address">
                          <?php if($errors->has("address")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('address')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <label class="form-label" for="example-file-input">Company Logo</label>
                          <input class="form-control" type="file" id="example-file-input" name="company_logo">
                          <div class="valid-feedback d-block">You can use this site to compress image size if needed <a href="https://tinypng.com/" target="_blank">https://tinypng.com/</a></div>
                          <?php if($errors->has("company_logo")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_logo')); ?></div><?php endif; ?>
                        </div>
                  <div class="col-md-12 ">
                  <h2 class="content-heading">Login Details</h2>
                  </div>
                        <div class="col-md-6 mb-4">
                          <input type="email" class="form-control form-control-lg form-control-alt" id="email" name="email" placeholder="Email">
                          <?php if($errors->has("email")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('email')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <input type="password" class="form-control form-control-lg form-control-alt" id="password" name="password" placeholder="Password">
                          <?php if($errors->has("password")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('password')); ?></div><?php endif; ?>
                        </div>
                        <div class="col-md-6 mb-4">
                          <input type="password" class="form-control form-control-lg form-control-alt" id="password_confirmation" name="password_confirmation" placeholder="Confirm Password">
                          <?php if($errors->has("password_confirmation")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('password_confirmation')); ?></div><?php endif; ?>
                        </div>
                      <div class="mb-4">
                        <button type="submit" class="btn w-100 btn-lg btn-hero btn-primary">
                          <i class="fa fa-fw fa-sign-in-alt opacity-50 me-1"></i>Create Account
                        </button>
                        <p class="mt-3 mb-0 d-lg-flex justify-content-lg-between">
                        </p>

                      </div>
                    </div>
                    </form>
                  </div>
                </div>

              </div>
            </div>

<?php } ?>

            <!-- Meta Info Section -->
            <div class="hero-static col-md-6 d-none d-md-flex align-items-md-center justify-content-md-center text-md-center">
              <div class="p-3">
                <p class="display-4 fw-bold text-white mb-3">
                  Welcome to the future
                </p>
                <p class="fs-lg fw-semibold text-white-75 mb-0">
                  Copyright &copy; <span data-toggle="year-copy"></span>
                </p>
              </div>
            </div>
            <!-- END Meta Info Section -->
          </div>
        </div>
        <!-- END Page Content -->
      </main>
      <!-- END Main Container -->
    </div>
    <!-- END Page Container -->

    <!--
      Dashmix JS

      Core libraries and functionality
      webpack is putting everything together at assets/_js/main/app.js
    -->
    <script src="assets/js/dashmix.app.min.js"></script>

    <!-- jQuery (required for jQuery Validation plugin) -->
    <script src="assets/js/lib/jquery.min.js"></script>

    <!-- Page JS Plugins -->
    <script src="assets/js/plugins/jquery-validation/jquery.validate.min.js"></script>

    <!-- Page JS Code -->
    <script src="assets/js/pages/op_auth_signin.min.js"></script>
  </body>
</html>
<?php /**PATH D:\Part Time Work\erp-napaskitchen\Modules/Admin\resources/views/user/login.blade.php ENDPATH**/ ?>