Skip to content

Commit

Permalink
auth commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dwiadisa committed Jan 5, 2023
1 parent e63cbdc commit 8314d62
Show file tree
Hide file tree
Showing 118 changed files with 38,491 additions and 15 deletions.
2 changes: 1 addition & 1 deletion application/config/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
| $autoload['helper'] = array('url', 'file');
*/
// $autoload['helper'] = array('url', 'utility_helper');
$autoload['helper'] = array('url');
$autoload['helper'] = array('url', 'file');

/*
| -------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://localhost:8080/siakad_ma/';
$config['base_url'] = 'http://localhost/siakad-ma/';

/*
|--------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions application/config/routes.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');

/*
| -------------------------------------------------------------------------
Expand Down Expand Up @@ -49,6 +49,7 @@
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = 'welcome';
// $route['default_controller'] = 'welcome';
$route['default_controller'] = 'auth';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
37 changes: 34 additions & 3 deletions application/controllers/Auth.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Auth extends CI_Controller
{

class Auth extends CI_Controller {

public function __construct()
{

parent::__construct();
$this->load->model('Auth_model');
// $this->load->library('form_validation');
}

public function index()
{

$this->load->view('login_form');
// echo "test auth controller";
}


public function login_aksi()
{
$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
// digunakan untuk validasi dari inputan user dan dibuatkan session di tiap masing masing hak akses
// query di tiap tiap hak akses
if ($this->form_validation->run() != false) {
$username = $this->input->post('username');
$password = $this->input->post('password');
$where = array(
'username' => $username,
'password' => md5($password)
);
var_dump($where);
} else {
echo "gak ada data yang masuk";
}
}

public function logout()
{
}
}

Expand Down
25 changes: 25 additions & 0 deletions application/controllers/Dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Dashboard extends CI_Controller
{

public function __construct()
{
parent::__construct();
}

public function index()
{
// echo "ini untuk dashboard";
$this->load->view('templates/header');
// letak if else bagian partial dashboard disesuaikan masing masing level ex if siswa daftar siswa elseif guru dashboard guru dll.
$this->load->view('partials/admin/dashboard_admin');
$this->load->view('templates/footer');

// untuk siswa nanti if else lewat session level yang login lakukan dan sesuaikan dashboard tiap masing masing hak akses
}

}

/* End of file Dashboard.php and path \application\controllers\Dashboard.php */
17 changes: 17 additions & 0 deletions application/controllers/Test_session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Test_session extends CI_Controller {

public function __construct()
{
parent::__construct();
}

public function index()
{

}
}

/* End of file Test_session.php and path \application\controllers\Test_session.php */
11 changes: 9 additions & 2 deletions application/controllers/Welcome.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');

class Welcome extends CI_Controller {
class Welcome extends CI_Controller
{

/**
* Index Page for this controller.
Expand All @@ -22,4 +23,10 @@ public function index()
{
$this->load->view('welcome_message');
}


public function cok()
{
echo "hello cok";
}
}
10 changes: 10 additions & 0 deletions application/helpers/utility_helper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
// function is_login($redirect = false)
// {
// $ci = &get_instance();
// $status = $ci->session->userdata('status') == "telah_login" ? true : false;
// if ($redirect && $status === true) {
// redirect($redirect);
// }
// return $status;
// }
13 changes: 13 additions & 0 deletions application/models/Auth_model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Auth_model extends CI_Model
{
function cek_login($table, $where)
{
return $this->db->get_where($table, $where);
}
}


/* End of file Auth_model.php and path \application\models\Auth_model.php */
104 changes: 104 additions & 0 deletions application/views/login_form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>Login - SIAKAD MA HIDAYATULLAH - Bondowoso</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="https://i.postimg.cc/tCwYcSrj/IMG-20230103-WA0014-removebg-preview-4.png" />
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets_auth/') ?>vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets_auth/') ?>fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets_auth/') ?>vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets_auth/') ?>vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets_auth/') ?>vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets_auth/') ?>css/util.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets_auth/') ?>css/main.css">
<!--===============================================================================================-->
</head>

<body>

<div class="limiter">
<div class="container-login100">
<div class="wrap-login100">
<div class="login100-pic js-tilt" data-tilt>
<img src="https://i.postimg.cc/tCwYcSrj/IMG-20230103-WA0014-removebg-preview-4.png" alt="IMG">
</div>

<form method="post" action="<?php echo base_url('index.php/Auth/login_aksi') ?>" class="login100-form validate-form">
<span class="login100-form-title">
Login SIAKAD
</span>

<div class="wrap-input100 validate-input" data-validate="Valid email is required: [email protected]">
<input class="input100" type="text" name="username" placeholder="Masukkan NIP/NIS">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-user" aria-hidden="true"></i>
</span>
</div>

<div class="wrap-input100 validate-input" data-validate="Password is required">
<input class="input100" type="password" name="password" placeholder="Masukkan Password">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-lock" aria-hidden="true"></i>
</span>
</div>

<div class="container-login100-form-btn">
<button class="login100-form-btn">
Login
</button>
</div>

<div class="text-center p-t-12">
<span class="txt1">
<!-- Forgot -->
</span>
<a class="txt2" href="#">
<!-- Username / Password? -->
</a>
</div>

<div class="text-center p-t-136">
<a class="txt2" href="#">
<!-- Create your Account -->
<!-- <i class="fa fa-long-arrow-right m-l-5" aria-hidden="true"></i> -->
</a>
</div>
</form>
</div>
</div>
</div>




<!--===============================================================================================-->
<script src="<?php echo base_url('assets_auth/') ?>vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="<?php echo base_url('assets_auth/') ?>vendor/bootstrap/js/popper.js"></script>
<script src="<?php echo base_url('assets_auth/') ?>vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="<?php echo base_url('assets_auth/') ?>vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="<?php echo base_url('assets_auth/') ?>vendor/tilt/tilt.jquery.min.js"></script>
<script>
$('.js-tilt').tilt({
scale: 1.1
})
</script>
<!--===============================================================================================-->
<script src="<?php echo base_url('assets_auth/') ?>js/main.js"></script>

</body>

</html>
2 changes: 1 addition & 1 deletion application/views/templates/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<footer class="sticky-footer bg-white">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Copyright &copy; Sistem Informasi Akademik Ma <?= date('Y') ?></span>
<span>Copyright &copy; Sistem Informasi Akademik MA Hidayatullah ,Tlogosari, Bondowoso <?= date('Y') ?></span>
</div>
</div>
</footer>
Expand Down
12 changes: 7 additions & 5 deletions application/views/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<title>Admin</title>

<!-- Custom fonts for this template-->
<link href="<?= base_url(); ?>assets/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url('assets/'); ?>vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

<!-- Custom styles for this template-->
<link href="<?= base_url(); ?>assets/css/sb-admin-2.min.css" rel="stylesheet">
<link href="<?php echo base_url('assets/'); ?>css/sb-admin-2.min.css" rel="stylesheet">

</head>

Expand All @@ -30,10 +30,12 @@

<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.html">
<div class="sidebar-brand-icon rotate-n-15">
<i class="fas fa-laugh-wink"></i>
<!-- <img src="https://static.vecteezy.com/system/resources/previews/002/206/174/original/school-building-icon-free-vector.jpg" class="img-fluid" sizes="max-width = 50px" alt="..."> -->
<div class="sidebar-brand-icon">
<img src="https://i.postimg.cc/tCwYcSrj/IMG-20230103-WA0014-removebg-preview-4.png" style="width: 50px;" alt="">
<!-- <i class="fas fa-laugh-wink"></i> -->
</div>
<div class="sidebar-brand-text mx-3">Admin <sup>2</sup></div>
<div class="sidebar-brand-text mx-3">SIAKAD</div>
</a>

<!-- Divider -->
Expand Down
Loading

0 comments on commit 8314d62

Please sign in to comment.