title: PINCODE LOGIN PAGE
body: <p>Im stuck with a project. This is strictly for a company internal employee login page. Not public! For those that might question the security of this form. Although, I am open to hashing the pincode password (SHA-1). </p>
  
  <p>I've setup the code on my jsfiddle     <a href="https://jsfiddle.net/cptcrunchy/ezs7n4o8/16/" rel="nofollow">PINCODE LOGIN</a></p>
  
  <pre><code>&lt;body onLoad="emptyCode()" class="hold-transaction login-page"&gt;
      &lt;!-- Page Content --&gt;
    &lt;div class="login-box"&gt;
  &lt;div class="login-logo"&gt;
    &lt;a href="login.php"&gt;&lt;b&gt;PINCODE LOGIN&lt;/b&gt;&lt;/a&gt;
    &lt;p class="login-box-msg"&gt;Employee Sign-in&lt;/p&gt;
  &lt;/div&gt;
  &lt;!-- /.login-logo --&gt;
  &lt;div class="login-box-body"&gt;
    &lt;!--&lt;form action="" method="post"&gt;--&gt;
    &lt;div class="main_panel"&gt;
      &lt;form action="" method="post"&gt;
        &lt;div class="input-group"&gt;
          &lt;input type="text" name="code" maxlength="4" readonly="readonly" class="form-control" placeholder="Enter PIN..."&gt;
          &lt;span class="input-group-btn"&gt;
                  &lt;button class="btn btn-danger" type="reset" &gt;X&lt;/button&gt;
              &lt;/span&gt;
        &lt;/div&gt;
        &lt;!-- /input-group --&gt;
  
        &lt;table id="keypad" cellpadding="5" cellspacing="3"&gt;
          &lt;tbody&gt;
            &lt;tr&gt;
              &lt;td onclick="addCode('1');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;1&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
              &lt;td onclick="addCode('2');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;2&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
              &lt;td onclick="addCode('3');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;3&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td onclick="addCode('4');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;4&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
              &lt;td onclick="addCode('5');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;5&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
              &lt;td onclick="addCode('6');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;6&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td onclick="addCode('7');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;7&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
              &lt;td onclick="addCode('8');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;8&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
              &lt;td onclick="addCode('9');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;9&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;
              &lt;/td&gt;
              &lt;td onclick="addCode('0');"&gt;
                &lt;div class="button raised clickable"&gt;
                  &lt;input type="checkbox" class="toggle" /&gt;
                  &lt;div class="anim"&gt;&lt;/div&gt;&lt;span&gt;0&lt;/span&gt;
                &lt;/div&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
  
        &lt;p id="message"&gt;ACCESSIGN...&lt;/p&gt;
      &lt;/form&gt;
    &lt;/div&gt;
    &lt;!--&lt;/form&gt;--&gt;
    &lt;/div&gt;
    &lt;!-- /.login-box-body --&gt;
      &lt;/div&gt;
    &lt;!-- /.login-box --&gt; 
  &lt;/body&gt;
  </code></pre>
  
  <p>My goal for this is:</p>
  
  <ol>
  <li>Allow employees to login using a 4 digit pincode and verify
  against DB credentials</li>
  <li>BONUS: Hash password in DB</li>
  </ol>
  
  <p>Not sure if i would need a function such as " if(isset($_POST['code'])) {", as a separate file.</p>