<?php
    cylog ("index.php", "entering page...");
    ///////////////////////////////////////
    //  Page header
    echo (cyheader (get_cfg_var ("cyphp.title")));
?>
</head>
<body>
<div id="container" class="container">
  <div class="row">
    <div class="col-xs-1 col-sm-3">&nbsp;</div>
    <div class="col-xs-10 col-sm-6">
      <br>
      <center>
      <img src="/images/cyware_logo.png">
    </center>
      <h4 class="text-center">
          <?php echo (get_cfg_var ("cyphp.title")); ?>
      </h4>
      <div class="text-center">Version-<?php echo (get_cfg_var ("cyphp.version")); ?></div>
      <h4 class="text-danger text-center">
        <?php 
          //echo (REQUEST ('errormsg')); 
          var $session = REQUEST ('errormsg')
           if($session == "Your session has expired."){
              echo('Sorry we cannot process your request. Session is expired. Please login again.');
           } else
              echo($session);
        ?>
      </h4>
    </div>
    <div class="col-xs-1 col-sm-3">&nbsp;</div>
  </div>
  <div class="row">
    <div class="col-xs-1 col-sm-3">&nbsp;</div>
    <div class="col-xs-10 col-sm-6">
<?php
          echo (cyform (6,                  // space offset
                        "frmlogin",         // form name
                        "credentials.php",  // destination page
                        "post",             // submit method
                        "_top",             // target frame
                        ""));               // input css style
          echo (cyhidden (8, "test", "value"));
          echo (cyinput_label(8,                     // space offset
                              nocase (),          // alphabetic case
                              32,                    // maximum length
                              true,                  // required
                              false,                 // readonly
                              "username",            // input name
                              REQUEST("username"),   // form argument
                              "text",                // input type
                              "Username",            // label
                              "Enter your username", // input prompt
                              "^[a-zA-Z0-9-]+$",     // validation expression
                              ""));                  // input css style

          echo (cyinput_label(8, nocase (), 64, true, false, "password",
                              "", "password", "Password", "Enter your password",
                              "^[a-zA-Z0-9 -_=*^$#@!]+$", ""));
?>
      </form>
      <button type="submit" form="frmlogin" class="btn btn-primary btn-block">
      <span class="fa fa-ok"></span>
        Sign In
      </button>
    </div>
    <div class="col-xs-1 col-sm-3">&nbsp;</div>
  </div>
</div>
<script type="text/javascript">
  $( document ).ready(function() {
    $(function()  {
      $('#username').focus ();
    });
  });
</script>
</body>
</html>
