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
3 changes: 2 additions & 1 deletion application/controllers/mahasiswa.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ public function edit($id){
$this->load->view('template/header',$data);
$this->load->view('mahasiswa/edit',$data);
$this->load->view('template/footer');
echo "masuk";
}
else{
$this->mahasiswa_model->ubahdatamhs();
$this->session->set_flashdata('flash-data','diedit');
redirect('mahasiswa','refresh');

echo "keluar";
}

}
Expand Down
45 changes: 45 additions & 0 deletions application/controllers/usersiswa.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php


defined('BASEPATH') OR exit('No direct script access allowed');
class usersiswa extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->helper('url');
$this->load->helper('form');
$this->load->model('loginsiswa_model');
$this->load->model('siswa_model');
//$this->load->library('session');
if ($this->session->userdata('level') != 'siswa' ) {

redirect('loginsiswa','refresh');

}

}

public function index()
{
$data = array(
'title'=>'data siswa',
'siswa'=>$this->siswa_model->datatabels()
);
$this->load->view('template/header_datatabels_users',$data);
$this->load->view('siswa/user');
$this->load->view('template/footer_datatabels_users');
}

public function laporan_pdf()
{
$this->load->library('pdf');
$this->load->model('cetaksiswa_model');
$data['siswa']= $this->cetaksiswa_model->view();
$this->load->library('pdf');

$this->pdf->setPaper('A4','potrait');
$this->pdf->filename = "laporan-petanikode.pdf";
$this->pdf->load_view('siswa/laporan',$data);
}
}
?>
49 changes: 49 additions & 0 deletions application/views/loginsiswa/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?=
form_open('loginsiswa/proses_login');
?>

<div class ="container py-5">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-6 mx-auto">
<div class="card rouded-0">
<div class="card-header">
<h3 class="nb-0">Login</h3>
</div>

<div class="card-body">
<form class="form" action="loginsiswa/proses_login" role="foce" autocomplete="off" id="formLogin" novalidate="" method="POST">
<div class="form-group">
<label for="username">Username</label>
<input type="text" class="form-control form-control-lg rounded-g" name="username" id="username" require="">
<div class="invalid-feedback">Oops, You missed this one</div>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control form-control-lg rounded-g" name="password" id="password" require="" autocomplete="new-password">
<div class="invalid-feedback">Enter your password too!</div>
</div>

<button type="submit" class="btn btn-success btn-lg float-right" id="btnLogin">Login</button>
</form>
</div>
<div class="alert alert-info" role="alert">
<?php
if (isset($pesan)) {
echo $pesan;
}
else{
echo "Masukkan username dan password anda";
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?=
form_close();
?>
65 changes: 65 additions & 0 deletions application/views/mahasiswa/laporan.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<title>Report Table</title>
<style type="text/css">
#outtable{
padding: 20px;
border: 1px solid #e3e3e3;
width: 600px;
border-radius: 5px;
}
.short{
width: 50px;
}
.normal{
width: 150px;
}
table{
border-collapse: collapse;
font-family: arial;
color: #5E5B5C;
}
thead th{
text-align: left;
padding: 10px;
}
tbody td{
border-top: 1px solid #e3e3e3;
padding: 10px;
}
tbody tr:nth-child(even){
background: #F6F5FA;
}
tbody tr:hover{
background: #EAE9F5;
}
</style>
</head>
<body>
<div>
<table>
<thead>
<tr>
<th class="short">#</th>
<th class="normal">Nama</th>
<th class="normal">Email</th>
<th class="normal">Jurusan</th>
</tr>
</thead>
<tbody>
<?php $no=1; ?>
<?php foreach($mahasiswa AS $user): ?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $user->nama; ?></td>
<td><?php echo $user->email; ?></td>
<td><?php echo $user->jurusan; ?></td>
</tr>
<?php $no++; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</body>
</html>
65 changes: 65 additions & 0 deletions application/views/siswa/laporan.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<title>Report Table</title>
<style type="text/css">
#outtable{
padding: 20px;
border: 1px solid #e3e3e3;
width: 600px;
border-radius: 5px;
}
.short{
width: 50px;
}
.normal{
width: 150px;
}
table{
border-collapse: collapse;
font-family: arial;
color: #5E5B5C;
}
thead th{
text-align: left;
padding: 10px;
}
tbody td{
border-top: 1px solid #e3e3e3;
padding: 10px;
}
tbody tr:nth-child(even){
background: #F6F5FA;
}
tbody tr:hover{
background: #EAE9F5;
}
</style>
</head>
<body>
<div>
<table>
<thead>
<tr>
<th class="short">#</th>
<th class="normal">Nama</th>
<th class="normal">Alamat</th>
<th class="normal">NIM</th>
</tr>
</thead>
<tbody>
<?php $no=1; ?>
<?php foreach($siswa AS $user): ?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $user->nama; ?></td>
<td><?php echo $user->alamat; ?></td>
<td><?php echo $user->nim; ?></td>
</tr>
<?php $no++; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</body>
</html>