<?php
  /**
   * Index
   *
   * @package Advanced Login System
   * @author wojoscripts.com
   * @copyright 2010
   * @version $Id: index.php, v2.00 2011-07-10 10:12:05 gewa Exp $
   */
  define("_VALID_PHP", true);
  require_once("init.php");
  if ($user->logged_in)
      redirect_to("smart/index.php");
	  
	  
  if (isset($_POST['doLogin']))
      : $result = $user->login($_POST['username'], $_POST['password']);
  
  /* Login Successful */
  if ($result)
      : redirect_to("smart/index.php");
  endif;
  endif;

  ?>
	
  <?php include("header.php");?>
<div class="content">
<div id="msgholder2"><?php print Filter::$showMsg;?></div>
<form method="post" id="login_form" name="login_form" >
  <h3 class="form-title">Molimo Vas, prijavite se!</h3>
  <section>
    <div class="form-group">
      <label class="control-label visible-ie8 visible-ie9">Korisničko ime</label>
      <div class="input-icon">
        <i class="fa fa-user"></i>
          <input class="form-control placeholder-no-fix" type="text" name="username" placeholder="Korisničko ime" required>
      </div>
    </div>
  </section>
  <section>
    <div class="form-group">
      <label class="control-label visible-ie8 visible-ie9">Lozinka</label>
      <div class="input-icon">
        <i class="fa fa-lock"></i>
          <input class="form-control placeholder-no-fix" type="password"  name="password" placeholder="**********" required>
      </div>
    </div>
  </section>
  <footer>
    <div class="row">
      <div class="forget-password">
        <!--<button id="do-passreset" type="button" class="btn red-haze pull-left">Password Reset</button>-->

        <button class="btn green-haze pull-right" type="submit" name="dosubmit" >Prijava <i class="m-icon-swapright m-icon-white"></i></button>
        <?php if($core->reg_allowed):?>
        <a href="register.php" class="button button-secondary">Register Account</a>
        <?php endif;?>
      </div>
    </div>
  </footer>
  <input name="doLogin" type="hidden" value="1" />
</form>
<div id="show-passreset" style="display:none">
  <p class="pagetip"><i class="icon-lightbulb icon-3x pull-left"></i> Enter your username and email address below to reset your password. A verification token will be sent to your email address.<br />
    Once you have received the token, you will be able to choose a new password for your account</p>
  <form class="forget-form" id="admin_form" method="post">
    <header> Lost Password</header>
    <section>
      <div class="row">
        <div class="col col-3">
          <label>Username</label>
        </div>
        <div class="col col-9">
          <label class="input"> <i class="icon-prepend icon-user"></i> <i class="icon-append icon-asterisk"></i>
            <input  type="text" name="uname" placeholder="Username">
          </label>
        </div>
      </div>
    </section>
    <section>
      <div class="row">
        <div class="col col-3">
          <label>Email Address</label>
        </div>
        <div class="col col-9">
          <label class="input"> <i class="icon-prepend icon-envelope-alt"></i> <i class="icon-append icon-asterisk"></i>
            <input  type="text" name="email" placeholder="Email Address">
          </label>
        </div>
      </div>
    </section>
    <section>
      <div class="row">
        <div class="col col-3">
          <label>Captcha Code</label>
        </div>
        <div class="col col-9">
          <label class="input"> <img src="lib/captcha.php" alt="" class="captcha-append" /> <i class="icon-prepend icon-eye-open"></i>
            <input type="text" name="captcha" placeholder="Captcha Code">
          </label>
        </div>
      </div>
    </section>
    <footer>
      <button class="button" name="dosubmit" type="submit">Submit Request</button>
    </footer>
  </form>
</div>
</div>
<?php echo Core::doForm("passReset","ajax/user.php");?>
<?php include("footer.php");?>