<?php session_start();
include("../config/config.php");
 $sql = "SELECT * FROM admin_master ";
   
    $myquery=$conn->query($sql);
  $mydara= $myquery->fetchAll()  ;
  
  $rows_found = $myquery->rowCount();
  foreach ($mydara as $key ) {
     $emailid= $key['emailid'];
     $full_name= $key['full_name'];
     $mobileno= $key['mobileno'];
     $city = $key['location_city'];
     $state= $key['location_state'];
     $country= $key['location_country'];
     $profile_pic = $key['profile_pic'];
     $company_name = $key['company_name'];
     $company_logo = $key['company_logo'];
     $copyright = $key['copyright'];
      $freshdesk_url  = $key['freshdesk_url'];
         
  }

?>
<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title> Welcome to coupon website - Coupons, Cashback, Offers and Promo Code</title>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <link id="favicon" rel="icon" type="image/x-icon" href="../images/web-images/logo/favicon.png">
      <meta name="robots" content="index, follow" />
      <meta name="author" content="Design Collection">
      <meta name="description" content="Login Now!- Get the latest and up-to-date coupons and offers">
      <meta name="keywords" content="iCouponWorld stores, products, coupon, coupon code, promo code, cashback, offer, promotion, deal">
      <link rel="canonical" href="login.php"/>
      <!-- Viewport configuration, scaling options -->
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
      <!-- Bootstrap CSS -->
      <link href="../css/icouponworld.css" rel="stylesheet">
      <!-- CSS Stylesheet -->
      <link href="../css/dashboard.css" rel="stylesheet">
      <!-- Font Awesome icon -->
      <link href="../fontawesome/css/fontawesome.css" rel="stylesheet" />
      <!-- Roboto font  -->
      <link rel="preconnect" href="https://fonts.googleapis.com">
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
      <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet">
       <!-- sweetalert.min.js Begin  -->
       <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
        <!-- sweetalert.min.js End  -->
         <!-- validation.css Begin  -->
        <link href="../css/validation.css" rel="stylesheet">
         <!-- validation.css End  -->
      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
      <![endif]-->
   </head>
   <body>
      <!--unique id begin -->
      <div id="s_mm">
    
         <div class="authentication">
            <!--authentication-form-box Begin-->
            <div class="authentication-form-box">
               <div class="align-items-center d-flex h-100">
                  <div class="card-body">
                     <!-- Logo -->
                     <div class="auth-brand text-center text-lg-start">
                        <a href="#">
                        <span>
                            <?php if($company_logo==''){ ?>

                   <span class="sidebar-brand-text mx-3">icouponworld</span>

                    <?php   }else{
                      
                      ?>  
                      <img src="../images/web-images/logo/<?=$company_logo?>" alt="logo" title="logo" class="img-fluid">
                         <?php   }
                      
                      ?>  
                    </span>
                        </a>
                     </div>
                     <!-- title-->
                     <h4 class="mt-5">Sign <span class="text-primary pe-2"> In</span><i class="fas fa-sign-in-alt text-primary"></i></h4>
                     <p class="mt-4 mb-4 text-muted">Enter your email address and password to access your dashboard account.</p>
                     <!-- form Begin-->
                     <?php
if($_SESSION['forgot_pass']!=''){

?>
<script> swal("link!", "Reset Link set on your email", "success");  </script>

<?php
unset($_SESSION['forgot_pass']);
}
?>
<?php
if($_SESSION['reset_pass']!=''){

?>
<script> swal("link!", "Your password is changed successfully", "success");  </script>

<?php
unset($_SESSION['reset_pass']);
}
?>
                     <form action="./backend/validatedadminlogin.php" method="post">
                        <div class="mb-3">
                           <label for="email" class="fw-bold form-label">Email Address: <span class="text-danger ps-1">*</span></label>
                           <input class="form-control" name="logUserName" maxlength="40" type="text" id="email" required="" placeholder="Enter your email">
                        </div>
                        <div class="mb-3">
                           <a href="forgot-password.php" class="text-muted float-end"><small>Forgot your password?</small></a>
                           <label for="password" class="fw-bold form-label">Password: <span class="text-danger ps-1">*</span></label>
                           <input type="password" id="txtPassword" maxlength="15" value="admin1234" class="form-control masked"  name="logUserPassword" placeholder="Enter your password">
                           <span id="toggle_pwd" class="fa fa-fw cursor-pointer field-icon fa-eye"></span>
                        </div>
                        <div class="mb-3">
                           <div class="mb-3">
                              <div class="form-check">
                                 <input type="checkbox" class="form-check-input" id="exampleCheck1" required>
                                 <label class="form-check-label" for="exampleCheck1"><small>I Acknowledge <a href="../terms-condition.php">Terms Of Service</a> And <a href="../privacy-policy.php">Privacy Policy*</a></small></label>
                              </div>
                           </div>
                        </div>
                        <div class="d-grid mb-0 text-center">
                           <button type="submit" class="btn btn-primary br-4"> Log In <i class="fas fa-long-arrow-alt-right ms-1"></i></button>
                        </div>
                     </form>
                         <?php

        if($_SESSION[ADD_TAG.'_unvalidate']=='12'){
      echo ' <div style="padding-top:10px;">
      <div class="form-group nomargin">
          <div class="input-group">
            <div class="alert alert-danger">
              <strong>Warning!</strong> Invaid Username Found!!
            </div>
          </div>
      </div>
      </div>';
      unset($_SESSION[ADD_TAG.'_unvalidate']);
      }
     if($_SESSION[ADD_TAG.'_unvalidate']=='14'){
      echo ' <div style="padding-top:10px;">
      <div class="form-group nomargin">
          <div class="input-group">
            <div class="alert alert-warning">
                 <strong>Warning!</strong> Invalid Password found!!!
            </div>
          </div>
      </div>
      </div>'; 
       unset($_SESSION[ADD_TAG.'_unvalidate']);
      }
    ?>
                     <!-- form End-->
                     <!-- Footer-->
                     <footer class="footer-alt">
                        <div class="container">
                           <div class="row align-items-center">
                              <div class="col-lg-12 col-sm-12">
                                 <small class="text-center p-0 m-0 text-muted"><?=$copyright?> </small>
                              </div>
                           </div>
                        </div>
                     </footer>
                  </div>
               </div>
            </div>
            <!--authentication-form-box Begin-->
            <!-- authentication-right Begin -->
            <div class="authentication-right text-center">
               <div class="auth-user-testimonial">
                  <div class="bg-white br-4 p-4 mx-auto">
                     <h2 class="mb-3 text-primary text-inherit">Explore Several of</h2>
                     <p class="lead text-primary">" Coupons, Discounts, Promo Codes "
                     </p>
                  </div>
               </div>
            </div>
            <!-- authentication-right End -->
         </div>
         <!-- Jquery Script Begin-->
         <script src="../js/jquery-3.4.1.min.js"></script>
         <!-- Jquery Script End-->
         <!-- Bootstrap Script Begin-->
         <script src="../js/bootstrap.bundle.min.js"></script>
         <!-- Bootstrap Script End-->
         <!-- dashboard-icouponworld.js Begin -->
         <script src="../js/dashboard-icouponworld.js"></script>
          <!-- dashboard-icouponworld.js End -->
           <!-- jquery.validationEngine-en.js Begin -->
          <script src="../js/jquery.validationEngine-en.js" type="text/javascript"></script>
           <!-- jquery.validationEngine-en.js End -->
            <!-- jquery.validationEngine.js Begin -->
 <script src="../js/jquery.validationEngine.js" type="text/javascript" > </script>
  <!-- jquery.validationEngine.js End -->
   <!-- validationEngine Script Begin -->
 <script>
  jQuery(document).ready(function() {
    jQuery("form").validationEngine(); 
  });
</script> 
 <!-- validationEngine Script End -->
      </div>
      <!--unique id End -->
   </body>
</html>
