Add consultation module assets and libraries

This commit is contained in:
Power BI Dev
2026-05-02 10:11:07 +07:00
parent a52c2a8462
commit 5fb1151fea
1239 changed files with 392281 additions and 0 deletions

161
konsultasi/index.php Normal file
View File

@@ -0,0 +1,161 @@
<?php
session_start();
include 'conf/class.server.php';
$server = new Server();
$APIurl = $server->getAPIUrl();
if(isset($_SESSION['konsulDosen'])){
header("Location:./dosen/");
exit;
}
if(isset($_SESSION['konsulMahasiswa'])){
header("Location:./mahasiswa/");
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Informatika - Konsultasi Skripsi</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="assets/untan.svg" />
<link rel="stylesheet" href="libs/Fomantic-UI/semantic.css" type="text/css" charset="utf-8">
<link href="css/stylelogin.css" rel="stylesheet" type="text/css">
<script src="libs/jquery-3.3.1.js"></script>
<script src="libs/Fomantic-UI/semantic.min.js"></script>
</head>
<body>
<div>
<div id="login" class="webLogin bordered">
<div class="content">
<h2 class="ui icon header" style="width:100%">
<img src="assets/untan.svg" alt="Logo" class="ui image">
<div class="blueColor content">
Konsultasi Skripsi
<div class="sub header">Jurusan Informatika<br>Universitas Tanjungpura</div>
</div>
</h2>
<form class="ui form" style="margin-top:1rem">
<div class="field" id="usernameField">
<label class="blueColor">Username</label class="blueColor">
<input type="text" placeholder="Username" id="usernameData">
</div>
<div class="field" id="passwordField">
<label class="blueColor">Password</label>
<div class="ui icon input">
<input type="password" id="passwordData" placeholder="Password">
<i id="iconPassword" class="eye slash link icon" onClick="hideShowPassword()"></i>
</div>
</div>
<span class="ui grey text">* Login menggunakan akun <b>SPOTA</b></span>
<div class="ui hidden divider"></div>
<button class="ui blue fluid button" type="submit" id="btnLogin" onClick="login(event)">Login</button>
</form>
</div>
</div>
</body>
</html>
<script>
function setLevelActivity(){
const level = $('#userLevel').val();
if(level == "MAHASISWA"){
$('#passwordField').hide();
}else{
$('#passwordField').show();
}
}
function hideShowPassword() {
var x = document.getElementById("passwordData");
var y = document.getElementById("iconPassword");
if (x.type === "password") {
x.type = "text";
y.className = "ui eye link icon";
} else {
x.type = "password";
y.className = "ui eye slash link icon";
}
}
function login(event){
event.preventDefault();
const username = document.getElementById('usernameData');
const password = document.getElementById('passwordData');
const usernameField = document.getElementById('usernameField');
const passwordField = document.getElementById('passwordField');
const btnLogin = document.getElementById('btnLogin');
let lanjut = true;
if(username.value.trim() == ""){
usernameField.className = 'field error';
lanjut = false;
}else{
usernameField.className = 'field';
}
if(password.value.trim() == ""){
passwordField.className = 'field error';
lanjut = false;
}else{
passwordField.className = 'field';
}
if(!lanjut){
showToast('warning','Username dan password tidak boleh kosong');
return;
}
btnLogin.className += " loading";
let form_data = new FormData();
form_data.append("username",username.value);
form_data.append("password",password.value);
let request = $.ajax({
url: "<?php echo $APIurl; ?>/login.php",
type: "POST",
data: form_data,
processData: false,
contentType: false,
});
request.done(function(msg) {
btnLogin.classList.remove("loading");
let pesan = msg.msg;
if(msg.status == 1){
showToast('success',pesan);
let redir = msg.redir;
window.location.replace(redir);
}else{
showToast('warning',pesan);
}
});
request.fail(function(jqXHR, textStatus) {
showToast('warning', "Terjadi kesalahan teknis!!!")
btnLogin.classList.remove("loading");
});
}
function showToast(status, pesan){
$('body')
.toast({
class: status,
message: pesan
})
;
}
</script>