LapUKK23 - Tressa Anastasya
LapUKK23 - Tressa Anastasya
LapUKK23 - Tressa Anastasya
<div class="jumbotron">
<h1 class="display-4">Selamat Datang di Website Saya!
</h1>
<p class="lead">Halo, nama saya Tressa Anastasya
<hr class="my-4">
?>
</body>
</html>
2. Data
Tampilan Halaman Data
<style type="text/css">
.form-control{
width: 25%;
}
input[type=search]{
float: right;
border: 1px solid #0af;
margin-bottom: 10px;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-
light">
<a class="navbar-brand" href="#">SMK N 3
PARIAMAN</a>
<button class="navbar-toggler" type="button"
data-toggle="collapse" data-
target="#navbarSupportedContent" aria-
controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text
primary"> Data Taruna </h6>
</div>
<div class="ml-3 mt-3">
<a type="button" class="btn btn-primary"
href="tambah.php">Tambah Data Taruna</a>
<input type="search" class="form-control
light-table-filter" data-table="table-striped"
id="myTable" placeholder="Cari...">
</div>
<div class="card-body">
<table class="table table-striped"
id="myTable">
<?php
error_reporting(0);
$id = $_POST['id'];
$nama = $_POST['nama'];
$nisn = $_POST['nisn'];
$email = $_POST['email'];
$jurusan = $_POST['jurusan'];
include ("koneksi.php");
$sql = "INSERT INTO data (id, nama, nisn, email,
kom_kel) VALUES ('$id', '$nama','$nisn', '$email',
'$jurusan')";
if (mysqli_query($koneksi, $sql)) {
//echo "Data berhasil diinputkan";
}
else {
//echo "Data gagal diinputkan" . $sql . "<br>" .
mysqli_error($koneksi);
}
</tr>";
while ($baris = $hasil->fetch_assoc()) {
echo "<tr>
<td>".$baris['id']."</td>
<td>".$baris['nama']."</td>
<td>".$baris['nisn']."</td>
<td>".$baris['email']."</td>
<td>".$baris['kom_kel']."</td>
<td>
<a class='btn btn-
success btn-sm btn-block' role='button' title='Edit'
href='edit.php?target=edit&id=".$baris['id']."'>
<i class='fa fa-
edit'></i>Edit</a>
</tr>";
}
echo "</table>";
}
mysqli_close($koneksi);
?>
</div>
</div>
</body>
</html>
3. Tambah Data
Tampilan Halaman Tambah Data
<tbody>
<div class="box-body">
<div class="form-group">
<label>ID</label><br>
<input type="text"
name="id" class="form-control" placeholder="Masukkan ID"
required>
</div>
<div class="form-group">
<label>Nama</label><br>
<input type="text"
name="nama" class="form-control" placeholder="Masukkan
Nama" required>
</div>
<div class="form-group">
<label>NISN</label>
<input type="text"
name="nisn" class="form-control" placeholder="Masukkan
NISN" required>
</div>
<div class="form-group">
<label>Email</label><br>
<input type="text"
name="email" class="form-control" placeholder="Masukkan
Email" required>
</div>
<div class="form-group">
<label>Kompetensi
Keahlian</label><br>
<select class="form-
control" name="jurusan" class="form-control"
placeholder="jurusan" required>
<option value="">--
Pilih Kompetensi Keahlian--</option>
<option
value="Rekayasa Perangkat Lunak "> Rekayasa Perangkat
Lunak </option>
<option
value="Teknik Komputer dan Jaringan"> Teknik Komputer dan
Jaringan </option>
<option
value="Teknik Pendingin dan Tata Udara"> Teknik Pendingin
dan Tata Udara </option>
<option
value="Agrebisnis Perikanan Air Tawar"> Agrebisnis
Perikanan Air Tawar </option>
<option
value="Nautika Kapal Penangkap Ikan"> Nautika Kapal
Penangkap Ikan </option>
<option
value="Teknika Kapal Penangkap Ikan"> Teknika Kapal
Penangkap Ikan </option>
</select>
</div>
<div class="box-footer">
<button type="submit"
class="btn btn-primary" title="Simpan Data">
<i class="glyphicon
glyphicon-floppy-disk"></i> Simpan</button>
</div>
</div>
</form>
</tbody>
</table>
</div>
</div>
</body>
</html>
4. Edit
Tampilan Halaman Edit
<tbody>
<div class="box-body">
<div class="form-group">
<label>ID</label><br>
<input type="text"
name="id" class="form-control" placeholder="Masukkan ID"
required value="<?php echo $baris['id']; ?>">
</div>
<div class="form-group">
<label>Nama</label><br>
<input type="text"
name="nama" class="form-control" placeholder="Masukkan
Nama" required value="<?php echo $baris['nama']; ?>">
</div>
<div class="form-group">
<label>NISN</label>
<input type="text"
name="nisn" class="form-control" placeholder="Masukkan
NISN" required value="<?php echo $baris['nisn']; ?>">
</div>
<div class="form-group">
<label>Email</label><br>
<input type="text"
name="email" class="form-control" placeholder="Masukkan
Email" required value="<?php echo $baris['email']; ?>">
</div>
<div class="form-group">
<label>Kompetensi
Keahlian</label><br>
<select class="form-
control" name="jurusan" class="form-control"
placeholder="jurusan" required>
<option value="">--
Pilih Kompetensi Keahlian--</option>
<option
value="Rekayasa Perangkat Lunak "> Rekayasa Perangkat
Lunak </option>
<option
value="Teknik Komputer dan Jaringan"> Teknik Komputer dan
Jaringan </option>
<option
value="Teknik Pendingin dan Tata Udara"> Teknik Pendingin
dan Tata Udara </option>
<option
value="Agrebisnis Perikanan Air Tawar"> Agrebisnis
Perikanan Air Tawar </option>
<option
value="Nautika Kapal Penangkap Ikan"> Nautika Kapal
Penangkap Ikan </option>
<option
value="Teknika Kapal Penangkap Ikan"> Teknika Kapal
Penangkap Ikan </option>
</select>
</div>
<div class="box-footer">
<button type="submit"
class="btn btn-primary" title="Simpan Data">
<i class="glyphicon
glyphicon-floppy-disk"></i> Simpan</button>
</div>
</div>
</form>
</tbody>
</table>
</div>
</div>
</body>
</html>
$hasil=$koneksi->query($sql);
if ($koneksi->query($sql)== True ) {
echo "Data berhasil di update";
} else{
echo "Data gagal di update";
}
header("location:taruna.php");
?>
if ($query) {
echo "<script>alert('Data Berhasil Dihapus !!!');
window.location.href='home.php?target=hapus&id=".
$baris['id']."';</script>";
} else {
echo "<script>alert('Data Gagal Dihapus !!!');
window.location.href='home.php?target=hapus&id=".
$baris['id']."';</script>";
}
header("location:taruna.php");
?>
5. Detail
Tampilan Halaman Detail
<?php
include "koneksi.php";
$id = $_GET['id'];
$sql = "SELECT * FROM data WHERE id=$id";
$hasil = $koneksi->query($sql);
$baris = $hasil->fetch_assoc();
?>
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6> Detail Data Taruna </h6>
</div>
<div class="ml-3 mt-3"></div>
<div class="card-body">
<table class="table table-striped"
id="myTable">
<tbody>
<tr>
<td
width="30%"><label>Nama</label></td>
<td width="70%"><?=
$baris['nama']; ?></td>
</tr>
<tr>
<td
width="30%"><label>NISN</label></td>
<td width="70%"><?=
$baris['nisn']; ?></td>
</tr>
<tr>
<td
width="30%"><label>Email</label></td>
<td width="70%"><?=
$baris['email']; ?></td>
</tr>
<tr>
<td
width="30%"><label>Kompetensi Keahlian</label></td>
<td width="70%"><?=
$baris['kom_kel']; ?></td>
</tr>
<tr>
<td>
<a class="btn btn-
primary btn-sm btn-block" role="button" title="keluar"
href="taruna.php?target=taruna&id='.$baris['id'].'">
<i class="fa fa-
detail"></i>Kembali</a>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
6. Search
Tampilan Search
Code Search
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Halaman Taruna</title>
<script
src="http://localhost/PWPB/Pelatihan/asset/jquery/jquery.
min.js"></script>
<script
src="http://localhost/PWPB/Pelatihan/asset/js/bootstrap.m
in.js"></script>
<link rel="stylesheet" type="text/css"
href="http://localhost/PWPB/Pelatihan/asset/css/bootstrap
.css">
<script type="text/javascript"
src="search.js"></script>
<style type="text/css">
.form-control{
width: 25%;
}
input[type=search]{
float: right;
border: 1px solid #0af;
margin-bottom: 10px;
}
</style>
</head>
<body>
Button
<input type="search" class="form-control light-table-filter"
data-table="table-striped" id="myTable" placeholder="Cari...">
Search.js
(function(document) {
'use strict';
var _input;
function _onInputEvent(e) {
_input = e.target;
var tables =
document.getElementsByClassName(_input.getAttribute('data
-table'));
Arr.forEach.call(tables, function(table) {
Arr.forEach.call(table.tBodies, function(tbody) {
Arr.forEach.call(tbody.rows, _filter);
});
});
}
function _filter(row) {
var text = row.textContent.toLowerCase(), val =
_input.value.toLowerCase();
row.style.display = text.indexOf(val) === -1 ?
'none' : 'table-row';
}
return {
init: function() {
var inputs =
document.getElementsByClassName('light-table-filter');
Arr.forEach.call(inputs, function(input) {
input.oninput = _onInputEvent;
});
}
};
})(Array.prototype);
document.addEventListener('readystatechange',
function() {
if (document.readyState === 'complete') {
LightTableFilter.init();
}
});
})(document);
7. Detail
Tampilan Halaman Detail
<?php
include "koneksi.php";
$id = $_GET['id'];
$sql = "SELECT * FROM data WHERE id=$id";
$hasil = $koneksi->query($sql);
$baris = $hasil->fetch_assoc();
?>
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6> Detail Data Taruna </h6>
</div>
<div class="ml-3 mt-3"></div>
<div class="card-body">
<table class="table table-striped"
id="myTable">
<tbody>
<tr>
<td
width="30%"><label>Nama</label></td>
<td width="70%"><?=
$baris['nama']; ?></td>
</tr>
<tr>
<td
width="30%"><label>NISN</label></td>
<td width="70%"><?=
$baris['nisn']; ?></td>
</tr>
<tr>
<td
width="30%"><label>Email</label></td>
<td width="70%"><?=
$baris['email']; ?></td>
</tr>
<tr>
<td
width="30%"><label>Kompetensi Keahlian</label></td>
<td width="70%"><?=
$baris['kom_kel']; ?></td>
</tr>
<tr>
<td>
<a class="btn btn-
primary btn-sm btn-block" role="button" title="keluar"
href="taruna.php?target=taruna&id='.$baris['id'].'">
<i class="fa fa-
detail"></i>Kembali</a>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
8. About
Tampilan Halaman About
<div class="card-body">
<img src="foto.jpg" width="190" height="250">
<h5 class="card-title" style="font-family:'Times New
Roman', sans-serif; color: darkblue; font-size:
24px;">Tressa Anastasya</h5>
<Sekolah class="card-text" style="font-size: 16px;
font-family:'Times New Roman', sans-serif;"> Saya Tressa
Anastasya<br> Sekolah Di SMKN 3 Pariaman Jurusan Rekayasa
Perangkat Lunak <br>Saya Berasal Dari Padang Alai
Kecamatan V Koto Timur Kabupaten Padang Pariaman</p>
<br>  
;
<form>
<div class="text-center">
<h5>Sosial Media</h5>
<img src="email.png" width="30"
height="30"> [email protected]  
;
<img src="wa.jpg" width="30"
height="30"> 081365980803
<img src="ig.jpg" width="30"
height="30"> heii.asa
<img src="tele.png" width="30"
height="30"> @heyyoasa
</div>
</form>
</div>
</div>
</body>
</html>
9. Koneksi
Code Koneksi
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "taruna";
if ($koneksi->connect_error) {
die("Koneksi Gagal :" . $koneksi-
>connect_error);
}