Thursday, November 29, 2018

TUGAS 4 (WEB PROGAMMING 1)

lingkaran_model.php

<?php
Class lingkaran_model extends CI_model {
//mendefinisikan konstanta untuk nilai PI
const PI = 3.14;

//atribut model
private $jarijari;

//metode untuk menentukan nilai $jarijari
public function set_jarijari($r){
$this->jarijari = $r;
}

//metode untuk mengambil nilai $jarijari
public function get_jarijari(){
return $this->jarijari;
 }

 //metode untuk menghitung luas lingkaran
public function hitung_luas() {
 return self ::PI * $this->jarijari * $this->jarijari;
 }

 //metode untuk menghitung keliling lingkaran
public function hitung_keliling(){
return 2 * self ::PI * $this->jarijari;

 }
}

lingkaran.php

<?php
Class lingkaran extends CI_Controller {
public function index( ) {

//meload model Lingkaran_model
$this->load->model ('lingkaran_model');

//menangkap model yang telah dimuat oleh controller
$model = $this->lingkaran_model;

//menentukan nilai jari jari
$model->set_jarijari(10);

//memuat view dan mengirimkan $model ke view
$this->load->view ('lingkaranview', array('model' => $model));

 }
}

lingkaranview.php

<html>
<head>
<title> Demo Model, View, Controller </title>
</head>
<body>
<h2> Model Lingkaran </h2>

<!-- memanggil metode get_jarijari( ) dari objel $model -->
Nilai Jari Jari : <?php echo $model->get_jarijari( ); ?> <br>

<!-- memanggil metode hitung_luas( ) dari objek $model -->
Luas Lingkaran : <?php echo $model->hitung_luas( ); ?> <br>
<!-- memanggil metode hitung_keliling( ) dari objek $model -->
Keliling Lingkaran : <?php echo $model->hitung_keliling( ); ?>
<br>
<h2> Nama  : Lukman Fajry </h2>
<h2> Nim   : 12165271 </h2>
<h2> Kelas : 12.5D.11 </h2>
</body>
</html>

Sunday, November 4, 2018

Kuis Membuat Web Perpustakaan dengan HTML dan CSS

1. Tampilan Index





<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/Style.css">
    <title>Belajar Design Dengan CSS</title>
</head>
<body>

<h1><marquee>Selamat Datang Di Perpustakaan Universitas Bina Sarana Informatika</marquee></h1>  
    <div id="container">
        <div class="header">Contoh Web Responsive Menggunakan CSS</div>
            <div class="main">
                <div class="left">
                    <h3 align="center">Menu</h3>
                    <ul>
                        <li><a href="login.php">Login</a></li>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Daftar Buku</a></li>
</ul>
</div>

<div class="middle">
<h3 align="center">Cerita/Komik/Buku Terbaru</h3>
<h2 align="center">Doraemon The Movie</h2><br>
<div align="center">
<img src="images/doraemon.jpg" width="320" >
</div>
<p><a href="#">Baca Selengkapnya >></a></p>
</div>

<div class="right">
<h3 align="center">BUKU TERPOPULER</h3>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Pemrograman</a></li>
<li><a href="#">Database</a></li>
</ul>
</div>
</div>
</div>

<div class="footer"><p align="center">Copyright © 2018 - Belajar CSS Responsive</a></p>
</div>
</div>
</body>
</html>


2. Membuat Form Login ( 2 File PHP)





-Login.php

<html>
<head>
<title>Login Member</title>
<link rel="stylesheet" type="text/css" href="css/login.css">
</head>
<body>
<form method="post" action="login_admin.php">

<div class="tampilan">
 <div class="kepala">
<div class="logo"></div>
<h2 class="judul">Login Member</h2>
</div>
<div class="artikel">

<div class="kesalahan">
<?php
        if(isset($_GET["login_error"])){
            echo "Username atau password salah";
        }
    ?>
</div>

<div class="kotak">
<p><input type="text" name="username" value="" placeholder="Masukan Username Anda"></p>
<p><input type="password" name="password" value="" placeholder="Masukan Password Anda"></p>
<p class="submit"><input type="submit" name="commit" value="Login"></p>
</form>
</div>
</div>

 </div>
</div>
</body>
</html


-Login_Admin

<?php
    
    ob_start();
    session_start();
    ob_end_clean();
    
    $username=$_POST["username"];
    $password=$_POST["password"];
    
    if($username=="admin" AND $password=="admin")
    {
        $_SESSION["username"]=$username;
        header("location:home.php");
    }else{
        header("location:login.php?login_error");
    }
?>


3. Tampilan Setelah Login



<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/Style.css">
<title>Perpustakaan Online</title>
</head>
<body>

<div id="container">   
<div class="header"><img src="doraemon.jpg" width="100" height="100"><h1>Perpustakaan Universitas BSI</h1>
</div>
<h4>Selamat Datang, Lukman</h4>

<div class="main">
<div class="left">
<h3 align="center">MENU</h3>
<ul>
<li><a href="http://localhost/perpus/index.php">Logout</a></li>
<li><a href="#">Home</a></li>
<li><a href="http://localhost/perpus/daftar_buku.php">Daftar Buku</a></li>
</ul>
</div>

<div class="middle">
<h3 align="center">Cerita/Komik/Buku Terbaru</h3>
<h2 align="center">Doraemon The Movie</h2><br>
<div align="center">
<img src="images/doraemon.jpg" width="320" >
</div>
<p><a href="#">Baca Selengkapnya >></a></p>
</div>

<div class="right">
<h3 align="center">BUKU TERPOPULER</h3>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Pemrograman</a></li>
<li><a href="#">Database</a></li>
</ul>
</div>

</div>
</div>
<div class="footer"><p align="center">Copyright © 2018 - Belajar CSS Responsive</a></p>
</div>
</div>
</body>
</html>



4. Tampilan Daftar Buku





<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/Style.css">
<title>Perpustakaan Online</title>
</head>
<body>

<div id="container">  
<div class="header"><img src="doraemon.jpg" width="100" height="100"><h1>Perpustakaan Universitas BSI</h1>
</div>
<h4>Selamat Datang, Lukman</h4>

<div class="main">
<div class="left">
<h3 align="center">MENU</h3>
<ul>
<li><a href="http://localhost/perpus/index.php">Logout</a></li>
<li><a href="#">Home</a></li>
<li><a href="http://localhost/perpus/daftar_buku.php">Daftar Buku</a></li>
</ul>
</div>


<div class="middle2">
<h2 align="center">DAFTAR BUKU</h2><br>
<div align="center">
</div>

<div class="buku">
<div class="foto">
<img src="images/comic1.jpg">
</div>
</div>

<div class="buku">
<div class="foto">
<img src="images/comic2.jpg">
</div>
</div>

<div class="buku">
<div class="foto">
<img src="images/comic3.jpg">
</div>
</div>

<div class="buku">
<div class="foto">
<img src="images/comic4.jpg">
</div>
</div>
</div>


<div class="middle2">
<div class="buku">
<div class="foto">
<img src="images/comic5.jpg">
</div>
</div>

<div class="buku">
<div class="foto">
<img src="images/comic6.jpg">
</div>
</div>

<div class="buku">
<div class="foto">
<img src="images/comic7.jpg">
</div>
</div>

<div class="buku">
<div class="foto">
<img src="images/comic8.jpg">
</div>
</div>




</div>
</div>
<div class="footer"><p align="center">Copyright © 2018 - Belajar CSS Responsive</a></p>
</div>
</div>
</body>
</html>

5. Tampilan Style

Style.css

*{
    padding :0 ;
    margin  :0 ;
}

body{
    width: 100%;
    font-family:Verdana, Geneva, Tahoma, sans-serif;
    background-color: #dedede;
}

.marquee{
    background-color: #ffffffd7;
    color: #0006ff
}

p{
    margin-bottom: 20px;
    line-height: 1.5em;
}

h2{
    font-size: 17px;
    font-weight: 600;
}

h3{
    font : #fff;
    font-size: 17px;
    padding-bottom: 10px;
    border-bottom: 4px solid #fff;
}

h4{
    font : white;
    padding-top: 10px;
    text-align: left;
    font-size: 15px;
}

/*Halaman Buku*/

.buku {
    padding: 0 6px;
    margin-right: 10px;
    float: left;
    border:1px solid #dedede;
    width: 23%;
}

.gallery:hover {
}

.foto img {
    padding:5px 0 5px 0;
    width: 100%;
    height: 250px;
}

.judul {
    font-size: 13px;
    font-weight: 600;
    padding:0 0 3px 0;
    text-align: left;
}

.penulis{
    font-size:10px;
    padding-bottom: 5px;
}

* {
    box-sizing: border-box;
}

a{
    text-decoration: none;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-style: inherit;
    font-size: 20px;
    color: #d4d2db;
}

a:hover{
    color: #000;
}

#container{
    max-width: 1140px;
    text-align: : center;
    background: #fff;
    overflow: hidden;
    border:0px solid #d9d9d9;
    margin : 0px 90px;
    padding:20px 20px 20px 20px;
}

.header{
    border-radius: 10px 10px 0 0 ;
    padding: 10px 0 0 10px;
    text-align : center;
    background-image: url(../images/header.jpg);
}

.header h1{
    font-size: 40px;
    color:#fff;
    padding-bottom: 10px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    text-align:center;
}

/* main */

.left{
    width: 280px;
    color:#fff;
    border: 1px solid #dedede;
    padding: 10px;
    margin: 10px 10px 10px 0px;
    float: left;
    background-color: #281e5a;
}

.left ul{
    list-style-type: none;
}

.left ul li{
    display: block;
}

.left ul li a{
    display: block;
    font-size: 17px;
    border-bottom: 1px dotted #d4d2db;
    margin-bottom: 10px;
    padding: 10px 5px;
    font:  #64bed4;
}

.left ul li a:hover{
    color: #ca1414 ;
}

.middle{
    width: 500px;
    border: 1px solid #dedede;
    padding: 5px;
    margin: 10px;
    float: left;
}

.middle img{
    background-image: img src="images/..vizta.jpg";
    max-width: 100%;
    height: auto;
}

.middle a{
    font-weight: bold;
}

.middle2{
    width: 790px;
    height:100%;
    padding: 5px;
    margin: 10px;
    float: left;
}

.middle2 a{
    font-weight: bold;
}

.right{
    width: 280px;
    color: #fff;
    border: 1px solid #dedede;
    padding: 10px;
    margin: 10px 0 10px 10px;
    float: right;
    background-color: #281e5a;
}

.right ul{
    list-style-type: none;
}

.right ul li{
    display: block;
}

.right ul li a{
    display: block;
    font-size: 17px;
    border-bottom: 1px dotted #d4d2db;
    margin-bottom: 10px;
    padding: 10px 5px;
}

.right ul li a:hover{
    color: #ca1414;
}

#footer{
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    font-size: 20px;
    color: #6813c9;
    clear: both;
    border: 1px solid #dedede;
    padding: 15px;
}

@media screen and(max-width:995px){
    #container{
        width: 100%;
    }
    #left-columm{
        width: 70%;
    }
    #right-columm{
        width: 30%;
    }
    img{
        width: 100%;
    }
}

/* MEDIA QUIRIES (Responsive)***********/

@media screen and (max-width:1140px){
    .container{
        width: 100%;
    }
    .left{
        width: 25%;
        background: #0c7575d7;
    }
    .middle{
        width: 68%;
        float: right;
    }
     .middle2{
        width: 90%;
        float: right;
    }



    .right{
        clear: both;
        padding: 1% 4%;
        width: auto;
        float: none;
        background: #0c7575d7;  
    }
}

/* Untuk ukuran layar 700px kebawah  */

@media screen and (max-width:780px){
    .header,
    .footer{
        text-align: center;
    }
    .left{
        width: auto;
        float: none;
    }

    .middle{
        width: auto;
        float:  none;
    }

    .right{
        width: auto;
        float: none;
    }
}


Login.CSS

e.cssCSS

*{
    padding: 0;
    margin: 0;

}

body{
    background-image: url(../images/login.jpg);
    font-family: verdana;
}

.tampilan{
 background: #fff;
    width: 400px;
    margin: 100px auto 0;
    border-radius: 16px;
    min-height: 256px;
    overflow: hidden;
}
.kepala{
    background: #281e5a;
    padding: 10px 22px;
    height: 60px;
}

.logo{
    background-image: url(../images/logo.png);
    background-position: center;
    background-size: 60px;
    width: 60px;
    height: 60px;
    float: left;
    margin-right: 20px;
}

.kepala h2.judul{
    color: #fff;
    font-size: 25px;
    font-weight: normal;
    text-align: left;
    line-height: 20px;
}

.kesalahan{
 font-size:20px;
 color: #ff0000;
 padding: 10px 0 0 0;
 text-align: center;
}

.artikel{
    padding:10px 22px 0;
    color: #808080;
}

.artikel div.kotak{
    margin: 16px 0;
}

.kotak input[type="text"],
.kotak input[type="password"]{
    font-size: 15px;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    background: #eeeeee;
    border:none;
    color: #808080;
}

.kotak input[type="submit"]{
    background: #ff5555;
    font-size:18px;
    margin: 0 0 0 130px;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;

}

mohon maaf bila terdapat kekurangan
SEKIAN DAN TERIMA KASIH

Thursday, October 11, 2018

TUGAS 01



<html>
<head>
</head>
<body>
<table border=1>
<h1 >Membuat Tabel Produk</h1>
<tr>
<th colspan='3' bgcolor='#00CCFF' ><font size='5px'> DAFTAR PRODUK</font></th>
</tr>
<tr>
<th style='padding:50px 20px 50px 20px' rowspan='6' bgcolor='BLUE'> <img src='iphone.jpg'> </th>
</tr>
<tr p align='left'>
<th width='90px' bgcolor='99FF99'
>Nama<br/>
Produk<br/>
</th>
<th width='480px' bgcolor='#FFFFCC'>Apple iPhone X</th>
</tr>
<tr p align='left' >
<th bgcolor='#99FF99'>Harga</th> <th bgcolor='#FFFFCC'>Rp 18.000.000</th>
</tr>
<tr p align='left'>
<th bgcolor='#99FF99'>Spesifikasi<br/> Produk<br/>
</th>
<th bgcolor='#FFFFCC'>
<ul>
<li>Jaringan GSM / CDMA / HSPA / EVDO / LTE</li>
<li>Layar Super AMOLED 5.8 inci, Resolusi 1125 x 2436 Piksel</li>
<li>Prosesor A12 Bionic Hexa Core</li>
<li>Ram 4 GB / Internal 512 GB</li>
<li>Kamera Belakang Dual 12 MP + 12 MP / Depan 7 MP </li>
<li>Baterai 2658 mAh</li>
</ul>
</th>
</tr>
</table>
</body>
</html>

Wednesday, October 10, 2018

TUGAS 3 (Web Progamming)

tampilaninput01.php

<html>
<head>
<title>Tampilan Input</title>

<table>
<form id="form1" name="form1" method="post" action="tampilanoutput02.php">
<h1>TOKO CAT GUNA BANGUN JAYA</h1>
</head>
<HR WIDTH=60% ALIGN="left" SIZE=10 NOSHADE /><br><br>

<tr>
<td> Nama Customer</td>
<td>:</td>
<td><input name="nama" type="text" id="nama"></td>
</tr>

<tr>
<td> Alamat</td>
<td>:</td>
<td><input name="alamat" type="text" id="alamat"></td>
</tr>

<tr>
<td> Jenis Cat</td>
<td>:</td>
<td><Select name="jeniscat" id="jeniscat">
<option>Mowlex</option>
<option>Dana Paint</option>
<option>Catylac</option>
</select>
</td>
<tr/>

<tr>
<td> Warna Cat</td>
<td>:</td>
<td><input name="Warnacat" type="radio" value="Merah"/>Merah
<input name="Warnacat" type="radio" value="Biru"/>Biru
<input name="Warnacat" type="radio" value="Kuning"/>Kuning
<input name="Warnacat" type="radio" value="Hijau"/>Hijau
</td>
</tr>

<tr>
<td> Jumlah Beli</td>
<td>:</td>
<td><input name="Jumlahbeli" type="text" id="Jumlahbeli"<td/>
</td>
</tr>

<tr>
<td><input type="submit" name="Submit" value="Hitung" />
<input type="reset" name="Submit2" value="Batal" /></td>
</tr>

</form>
</table>
</html>
______________________________________________________________________________
tampilanoutput02.php

<html>
<head>
<title>Tampilan Output</title>
<h1>TOKO CAT GUNA BANGUN JAYA</h1>
</head>
<HR WIDTH=60% ALIGN="left" SIZE=10 NOSHADE /><br><br>

<body>
<form id="form1" name="form1" method="post" action="">

<?php
$nama=$_POST['nama'];
$alamat=$_POST['alamat'];
$jeniscat=$_POST['jeniscat'];
$Jumlahbeli=$_POST['Jumlahbeli'];
$Warnacat=$_POST['Warnacat'];


if($jeniscat=="Catylac")
{$a=40000;}
else if ($jeniscat=="Dana Paint")
{$a=30000;}
else if ($jeniscat=="Mowlex")
{$a=20000;}
$total=$a*$Jumlahbeli;


if ($Jumlahbeli>=5)
{$b=$total* 5/100;}
else if ($Jumlahbeli>=10)
{$b=$total* 10/100;}
else {$b=0;}
$totbay=$total-$b;
?>
 
<table>
<tr>
<td colspan="20">---------------------------------------------------------------</td>
</tr>

<tr>
<td> Nama Costumer</td>
<td>:</td>
<td> <?php echo $nama ?></td>
</tr>

<tr>
<td>Alamat</td>
<td>:</td>
<td><?php echo $alamat ?></td>
</tr>

<tr>
<td>Jenis Cat </td>
<td>:</td>
<td><?php echo $jeniscat ?></td>
</tr>

<tr>
<td>Warna Cat</td>
<td>:</td>
<td><?php echo $Warnacat ?></td>
</tr>
 
<tr>
<td>Harga</td>
<td>:</td>
<td>Rp.<?php echo $a ?></td>
</tr>

<tr>
<td>Jumlah Beli </td>
<td>:</td>
<td><?php echo $Jumlahbeli ?></td>
</tr>
 
<tr>
<td colspan="4">----------------------------------------------------------------(*)</td>
</tr>
 
<tr>
<td>Total Harga </td>
<td>:</td>
<td>Rp.<?php echo $total ?>&nbsp;</td>
</tr>

<tr>
<td>Diskon</td>
<td>:</td>
<td>Rp.<?php echo $b ?>&nbsp;</td>
</tr>

<tr>
<td colspan="4">----------------------------------------------------------------(-)</td>
</tr>

<tr>
<td>Total Bayar </td>
<td>:</td>
<td>Rp.<?php echo $totbay ?></td>
</tr>

<tr>
<td colspan="4">------------------------------------------------------------------------------</td>
</tr>
<tr>
<td colspan="4"><a href="tampilaninput01.php">Kembali</a></td>
</tr>
</table>
</form>
</body>

</html>

hasil input dan output





Thursday, October 4, 2018

Tugas 02

ad>
<title>Latihan Operator</title>
</head>
<?php
$teks1 = " Belajar Menghitung Volume Kubus";
$teks2 = " Panjang sisi kubus = 15";
$teks3 = " Volume kubus - 3375cm3";
echo "$teks1<br>";
echo "$teks2<br>";
echo "$teks3"
?>