ganti css

This commit is contained in:
Yustina 2025-11-24 15:04:39 +07:00
parent 3bf544feac
commit eaa0f0542f
2 changed files with 47 additions and 83 deletions

View File

@ -1,13 +1,5 @@
body { body
<<<<<<< HEAD {
font-family: Arial, sans-serif;
background: #1e90ff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
=======
font-family: Poppins, Arial, sans-serif; font-family: Poppins, Arial, sans-serif;
background: linear-gradient(135deg, #d9a7ff, #fbc2eb, #a1c4fd); background: linear-gradient(135deg, #d9a7ff, #fbc2eb, #a1c4fd);
min-height: 100vh; min-height: 100vh;
@ -15,7 +7,6 @@ body {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
>>>>>>> 149dc47c4d90a64a3fe437ba26e7cf4d1cbbbf50
} }
/* Background animation circles */ /* Background animation circles */
@ -75,22 +66,34 @@ body {
justify-content: center; justify-content: center;
margin-bottom: 25px; margin-bottom: 25px;
} }
.icon-circle { .icon-circle {
background: linear-gradient(135deg, #7928ff, #ff0080); background: linear-gradient(135deg, #7928ff, #ff0080);
padding: 22px; padding: 22px;
border-radius: 50%; border-radius: 50%;
box-shadow: 0 6px 20px rgba(255,0,128,0.4); box-shadow: 0 6px 20px rgba(255,0,128,0.4);
} }
.login-icon { width: 45px; height: 45px; }
.login-icon {
width: 45px;
height: 45px;
}
/* Header Text */ /* Header Text */
.header-text { text-align: center; margin-bottom: 20px; } .header-text {
text-align: center;
margin-bottom: 20px;
}
.header-text h2 { .header-text h2 {
background: linear-gradient(45deg, #7928ff, #ff0080); background: linear-gradient(45deg, #7928ff, #ff0080);
-webkit-background-clip: text;
background-clip: text;
color: transparent; color: transparent;
font-weight: 700; font-weight: 700;
font-size: 28px; font-size: 28px;
} }
.header-text p { .header-text p {
color: #333; color: #333;
font-size: 14px; font-size: 14px;

View File

@ -1,50 +1,39 @@
<?php <?php
<<<<<<< HEAD
session_start();
//untuk halaman login //untuk halaman login
include "koneksi.php"; include "koneksi.php";
if (isset($_POST['username']))
$username = isset($_POST['username']) ? $_POST['username'] : ''; {
$password = isset($_POST['password']) ? $_POST['password'] : ''; $username=$_POST['username'];
}
// Pastikan kedua field terisi else $username ='';
if ($username != '' && $password != '') { if (isset($_POST['password']))
{
$password=$_POST['password'];
}
else $password ='';
if ($username!='' || $password!='')
{
$stmt = mysqli_prepare($conn,"select * from user where username=? and password=?"); $stmt = mysqli_prepare($conn,"select * from user where username=? and password=?");
$enc=md5($password); $enc=md5($password);
mysqli_stmt_bind_param($stmt,"ss", $username,$enc); mysqli_stmt_bind_param($stmt,"ss", $username,$enc);
mysqli_stmt_execute($stmt); mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt); $result = mysqli_stmt_get_result($stmt);
if ($row = mysqli_fetch_assoc($result)) { if ($row=mysqli_fetch_assoc($result))
// Simpan session dengan nama yang benar {
$_SESSION['firstname'] = $row['firstname']; echo "Login sukses";
$_SESSION['lastname'] = $row['lastname']; $_session['firstname'] = $row['firstname']; //simpan session firstname
$_session['lastname'] = $row['lastname'];
header("Location:dashboard.php"); //untuk pindah ke halaman dashboard.php
// Jika request AJAX, kembalikan JSON, jika bukan, redirect ke dashboard echo "firstname:".$row['firstname']."<br>";//kalo di file yang sama
$isAjax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'; echo "lastname:".$row['lastname']."<br>";
if ($isAjax) {
header('Content-Type: application/json');
echo json_encode(['success' => true, 'message' => 'Login sukses']);
exit;
} else {
header("Location: dashboard.php");
exit;
}
} else {
$isAjax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
if ($isAjax) {
header('Content-Type: application/json');
echo json_encode(['success' => false, 'message' => 'Username/password salah']);
exit;
} else {
echo "Username/password salah";
}
} }
else echo "Username/password salah";
} }
?> ?>
<!doctype html>
<html> <html>
<body> <body>
<form method="POST"> <form method="POST">
@ -54,31 +43,3 @@ if ($username != '' && $password != '') {
</form> </form>
</body> </body>
</html> </html>
=======
include "koneksi.php";
$username = $_POST['username'];
$password = $_POST['password'];
$query = mysqli_query($conn, "SELECT * FROM users WHERE username='$username'");
$user = mysqli_fetch_assoc($query);
if (!$user) {
echo json_encode(["status" => "error", "msg" => "Username tidak ditemukan"]);
exit;
}
if ($user["password"] !== $password) {
echo json_encode(["status" => "error", "msg" => "Password salah"]);
exit;
}
echo json_encode([
"status" => "success",
"id" => $user["id"],
"username" => $user["username"],
"email" => $user["email"],
"role" => $user["role"]
]);
?>
>>>>>>> 034e71546358d1709edc3df62da8342c7a9fa647