Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('Connections/conn.php'); ?>
- <?php
- session_start();
- if(isset($_POST["s_username"]) && isset($_POST["s_password"])){
- $s_username = $_POST["s_username"];
- $s_password = $_POST["s_password"];
- echo "<script>window.alert('$s_username - $s_password');</script>";
- $sql= mysql_query("SELECT * FROM student WHERE studentNo = $s_username AND studentPswd = $s_password LIMIT 1");
- $sql2= mysql_query("SELECT * FROM clockin WHERE studentNo = '$s_username' AND status=0 LIMIT 1");
- $existCount = mysql_num_rows($sql);
- $s_status = "1";
- if($existCount==1){
- while($row = mysql_fetch_array($sql)){
- $s_no=$row['studentNo'];
- $s_name=$row['studentName'];
- }
- if($existCount2==1){
- while($row2 = mysql_fetch_array($sql2)){
- $s_status=$row2['status'];
- $s_clockid=$row2['clockID'];
- }}
- $_SESSION["s_no"]=$s_no;
- $_SESSION["MM_Username"]=$s_username;
- if($sql==true){
- echo "<script>window.alert('Login Success');</script>";
- </script>";
- if($s_status==1){
- header("refresh:1 ,url=beginSession.php ");
- exit();
- }
- else {
- echo "<script>window.alert('Sesi Lepas Belum Ditamatkan.');</script>";
- header("refresh:1 ,url=startedSession2.php?clockid=$s_clockid");
- exit();
- }
- }
- }
- else{
- echo "<script>window.alert('Login Failed.');</script>";
- header("refresh:1 ,url=login.php");
- exit();
- }
- }
- ?>
- <body>
- <div class="wrapper-page">
- <div class="panel panel-color panel-primary panel-pages">
- <div class="panel-heading bg-img">
- <div class="bg-overlay"></div>
- <h3 class="text-center m-t-10 text-white"><strong>Masuk ke</strong>
- <p><a href="#"><img src="img/logo2.png" alt="" title=""></a></p></h3>
- </div>
- <div class="panel-body">
- <form class="form-horizontal m-t-20" id="form1" method="post" action="login.php">
- <div class="form-group">
- <div class="col-xs-12">
- <input name="s_username" class="form-control input-lg" type="text" required="" placeholder="Username">
- </div>
- </div>
- <div class="form-group">
- <div class="col-xs-12">
- <input name="s_password" class="form-control input-lg" type="password" required="" placeholder="Password">
- </div>
- </div>
- <div class="form-group text-center m-t-40">
- <div class="col-xs-12"><label>
- <button class="btn btn-primary btn-lg w-lg waves-effect waves-light" type="submit" value="Log in">Log In</button></label>
- <label><a href="reg2.php" class="btn btn-primary btn-lg w-lg waves-effect waves-light">Daftar Baru</a></label>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </body>
Add Comment
Please, Sign In to add comment