Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Group8/approve.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
require 'connect.php';

$IDcard = $_POST['IDcard'];
$Name = $_POST['Name'];
$Surname = $_POST['Surname'];
$Birthday = $_POST['Birthday'];
$Bank = $_POST['Bank'];
$Accountnumber = $_POST['Accountnumber'];
$Address = $_POST['Address'];
$Telephone = $_POST['Telephone'];
$Email = $_POST['Email'];
$Career = $_POST['Career'];
$Salary = $_POST['Salary'];
$Official = $_POST['Official'];
$Retire = $_POST['Retire'];
$Bureauerucy = $_POST['Bureauerucy'];
$Moneyrecieve = $_POST['Moneyrecieve'];
$Status = $_POST['submit'];
$Type = $_POST['Type'];

$sql = "update register set IDcard='".$IDcard."', Name='".$Name."', Surname='".$Surname."', Birthday='".$Birthday."', Bank='".$Bank."', Accountnumber='".$Accountnumber."', Address='".$Address."', Telephone='".$Telephone."', Email='".$Email."', Career='".$Career."', Salary='".$Salary."', Official='".$Official."', Retire='".$Retire."', Bureauerucy='".$Bureauerucy."', Moneyrecieve='".$Moneyrecieve."', Status='".$Status."', Type='".$Type."' where IDcard='".$IDcard."' ";
$result = mysqli_query($con,$sql);

if ($result) {
echo "<script> window.alert('Approve Success');</script>";
echo "<script> window.location.assign('main.php');</script>";
}else{
echo "<script> window.alert('Approve unsuccess');</script>";
echo "<script> window.location.assign('request.php?IDcard='".$IDcard."'');</script>";
}
?>
32 changes: 32 additions & 0 deletions Group8/approveBonus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
require 'connect.php';

$IDcard = $_POST['IDcard'];
$Name = $_POST['Name'];
$Surname = $_POST['Surname'];
$Birthday = $_POST['Birthday'];
$Bank = $_POST['Bank'];
$Accountnumber = $_POST['Accountnumber'];
$Address = $_POST['Address'];
$Telephone = $_POST['Telephone'];
$Email = $_POST['Email'];
$Career = $_POST['Career'];
$Salary = $_POST['Salary'];
$Official = $_POST['Official'];
$Retire = $_POST['Retire'];
$Bureauerucy = $_POST['Bureauerucy'];
$Moneyrecieve = $_POST['Moneyrecieve'];
$Status = $_POST['submit'];
$Type = $_POST['Type'];

$sql = "update register set IDcard='".$IDcard."', Name='".$Name."', Surname='".$Surname."', Birthday='".$Birthday."', Bank='".$Bank."', Accountnumber='".$Accountnumber."', Address='".$Address."', Telephone='".$Telephone."', Email='".$Email."', Career='".$Career."', Salary='".$Salary."', Official='".$Official."', Retire='".$Retire."', Bureauerucy='".$Bureauerucy."', Moneyrecieve='".$Moneyrecieve."', Status='".$Status."', Type='".$Type."' where IDcard='".$IDcard."' ";
$result = mysqli_query($con,$sql);

if ($result) {
echo "<script> window.alert('Approve Success');</script>";
echo "<script> window.location.assign('mainBonus.php');</script>";
}else{
echo "<script> window.alert('Approve unsuccess');</script>";
echo "<script> window.location.assign('requestBonus.php?IDcard='".$IDcard."'');</script>";
}
?>
32 changes: 32 additions & 0 deletions Group8/approvePension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
require 'connect.php';

$IDcard = $_POST['IDcard'];
$Name = $_POST['Name'];
$Surname = $_POST['Surname'];
$Birthday = $_POST['Birthday'];
$Bank = $_POST['Bank'];
$Accountnumber = $_POST['Accountnumber'];
$Address = $_POST['Address'];
$Telephone = $_POST['Telephone'];
$Email = $_POST['Email'];
$Career = $_POST['Career'];
$Salary = $_POST['Salary'];
$Official = $_POST['Official'];
$Retire = $_POST['Retire'];
$Bureauerucy = $_POST['Bureauerucy'];
$Moneyrecieve = $_POST['Moneyrecieve'];
$Status = $_POST['submit'];
$Type = $_POST['Type'];

$sql = "update register set IDcard='".$IDcard."', Name='".$Name."', Surname='".$Surname."', Birthday='".$Birthday."', Bank='".$Bank."', Accountnumber='".$Accountnumber."', Address='".$Address."', Telephone='".$Telephone."', Email='".$Email."', Career='".$Career."', Salary='".$Salary."', Official='".$Official."', Retire='".$Retire."', Bureauerucy='".$Bureauerucy."', Moneyrecieve='".$Moneyrecieve."', Status='".$Status."', Type='".$Type."' where IDcard='".$IDcard."' ";
$result = mysqli_query($con,$sql);

if ($result) {
echo "<script> window.alert('Approve Success');</script>";
echo "<script> window.location.assign('mainPension.php');</script>";
}else{
echo "<script> window.alert('Approve unsuccess');</script>";
echo "<script> window.location.assign('requestPension.php?IDcard='".$IDcard."'');</script>";
}
?>
42 changes: 42 additions & 0 deletions Group8/check_login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
session_start();

require_once("connect.php");

$strUsername = mysqli_real_escape_string($con,$_POST['txtUsername']);
$strPassword = mysqli_real_escape_string($con,$_POST['txtPassword']);

$strSQL = "SELECT * FROM memberAdmin WHERE Username = '".$strUsername."' and Password = '".$strPassword."'";
$objQuery = mysqli_query($con,$strSQL);
$objResult = mysqli_fetch_array($objQuery);
if(!$objResult)
{
echo "Username and Password Incorrect!";
exit();
echo "<meta http-equiv='refresh' content='2;url=logInAdmin.php'>";
}
else
{
if($objResult["LoginStatus"] == "1")
{
echo "'".$strUsername."' Exists login!";
exit();
echo "<meta http-equiv='refresh' content='2;url=logInAdmin.php'>";
}
else
{
//*** Update Status Login
$sql = "UPDATE memberAdmin SET LoginStatus = '1' , LastUpdate = NOW() WHERE UserID = '".$objResult["UserID"]."' ";
$query = mysqli_query($con,$sql);

//*** Session
$_SESSION["UserID"] = $objResult["UserID"];
session_write_close();

//*** Go to Main page
header("location:main.php");
}

}
mysqli_close($con);
?>
24 changes: 24 additions & 0 deletions Group8/connect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

ini_set('display_errors', 1);
error_reporting(~0);

$serverName = "localhost";
$userName = "ppn";
$userPassword = "1q1q";
$dbName = "test";

$con = mysqli_connect($serverName,$userName,$userPassword,$dbName);

if (mysqli_connect_errno())
{
echo "Database Connect Failed : " . mysqli_connect_error();
exit();
}

//*** Reject user not online
$intRejectTime = 5; // Minute
$sql = "UPDATE memberAdmin SET LoginStatus = '0', LastUpdate = '0000-00-00 00:00:00' WHERE 1 AND DATE_ADD(LastUpdate, INTERVAL $intRejectTime MINUTE) <= NOW() ";
$query = mysqli_query($con,$sql);

?>
Binary file added Group8/image/logo01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Group8/image/logo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Group8/image/logout.ico
Binary file not shown.
Binary file added Group8/image/wall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Group8/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="refresh" content="0; url=logInAdmin.php" />
</head>
<body>
<p><a href="logInAdmin.php">Redirect</a></p>
</body>
</html>
20 changes: 20 additions & 0 deletions Group8/logInAdmin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="logInAdmincss.css">
</head>
<body style="background-color: #FFDAB9">
<div class="login-card">
<h1>Log-in</h1><br>
<form name="form1" method="post" action="check_login.php">
<input type="text" name="txtUsername" placeholder="ชื่อผู้ใช้">
<input type="password" name="txtPassword" placeholder="รหัสผ่าน">
<input type="submit" name="login" class="login login-submit" value="เข้าสู่ระบบ">
</form>

</div>

</body>
</html>
105 changes: 105 additions & 0 deletions Group8/logInAdmincss.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
@import url(https://fonts.googleapis.com/css?family=Roboto:400,100);

body {
background: url(https://dl.dropboxusercontent.com/u/23299152/Wallpapers/wallpaper-22705.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: 'Roboto', sans-serif;
}

.login-card {
padding: 40px;
width: 274px;
background-color: #FA8072;
margin: 10% auto 10px auto;
border-radius: 2px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
overflow: hidden;
}

.login-card h1 {
font-weight: 100;
text-align: center;
font-size: 2.3em;
}

.login-card input[type=submit] {
width: 100%;
display: block;
margin-bottom: 10px;
position: relative;
}

.login-card input[type=text], input[type=password] {
height: 44px;
font-size: 16px;
width: 100%;
margin-bottom: 10px;
-webkit-appearance: none;
background: #fff;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
/* border-radius: 2px; */
padding: 0 8px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}

.login-card input[type=text]:hover, input[type=password]:hover {
border: 1px solid #b9b9b9;
border-top: 1px solid #a0a0a0;
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.login {
text-align: center;
font-size: 14px;
font-family: 'Arial', sans-serif;
font-weight: 700;
height: 36px;
padding: 0 8px;
/* border-radius: 3px; */
/* -webkit-user-select: none;
user-select: none; */
}

.login-submit {
/* border: 1px solid #3079ed; */
border: 0px;
color: #fff;
text-shadow: 0 1px rgba(0,0,0,0.1);
background-color: #4d90fe;
/* background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#4d90fe), to(#4787ed)); */
}

.login-submit:hover {
/* border: 1px solid #2f5bb7; */
border: 0px;
text-shadow: 0 1px rgba(0,0,0,0.3);
background-color: #357ae8;
/* background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#4d90fe), to(#357ae8)); */
}

.login-card a {
text-decoration: none;
color: #666;
font-weight: 400;
text-align: center;
display: inline-block;
opacity: 0.6;
transition: opacity ease 0.5s;
}

.login-card a:hover {
opacity: 1;
}

.login-help {
width: 100%;
text-align: center;
font-size: 12px;
}
12 changes: 12 additions & 0 deletions Group8/logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
session_start();

require_once("connect.php");

//*** Update Status
$sql = "UPDATE memberAdmin SET LoginStatus = '0', LastUpdate = '0000-00-00 00:00:00' WHERE UserID = '".$_SESSION["UserID"]."' ";
$query = mysqli_query($con,$sql);

session_destroy();
header("location:logInAdmin.php");
?>
Loading