0% found this document useful (0 votes)
120 views9 pages

Tugas Responsi Pemrograman Web: Teknik Informatika Institut Sains & Teknologi Akprind Yogyakarta

The document is source code for a web-based inventory management system. It includes style sheets for formatting, PHP code for login authentication and database connection, and PHP pages for the login page, admin page, and index page. The style sheet formats elements like headers, forms, and buttons. The login page authenticates users against the database. The admin page allows adding, editing, and viewing inventory records stored in the database. The index page provides login options for users and admins.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views9 pages

Tugas Responsi Pemrograman Web: Teknik Informatika Institut Sains & Teknologi Akprind Yogyakarta

The document is source code for a web-based inventory management system. It includes style sheets for formatting, PHP code for login authentication and database connection, and PHP pages for the login page, admin page, and index page. The style sheet formats elements like headers, forms, and buttons. The login page authenticates users against the database. The admin page allows adding, editing, and viewing inventory records stored in the database. The index page provides login options for users and admins.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

TUGAS RESPONSI

PEMROGRAMAN WEB

ZUL FAHMI HUSEIN


131051010
RB4

TEKNIK INFORMATIKA
INSTITUT SAINS & TEKNOLOGI AKPRIND
YOGYAKARTA

I.
Source Code
Style.css

body {
font-family:"maiandra GD";

}
#tabel{

margin:0;

max-width: 500px;

padding:0;

margin:100px auto;

background: #f9f9f9;

#header h1,

box-shadow: 0 0 10px #aaa;

h2,

#footer,

#login h3{

#header p {

text-align: center;

text-align: center;

padding: 20px 10px;

margin-left:2%;

background-color: #2b2f3e;

padding-right:2%;

color: #FFFFFF;

#active {

fieldset{

text-decoration:none;

margin: 0;

color:#000;

border: none;

#container {

form{

width:100%;

padding: 0;

overflow:hidden;

margin: 0;

background:#4F9EBA;

padding: 10px;

#col {

input[type='text'],

text-align: center;

input[type="password"]{

width:80%;

width: 90%;

position:relative;

padding: 1em;

left:10%;

margin-top: 0.2em;

overflow:hidden;

color: #888;

#login{

input[type="submit"],

max-width: 340px;

input[type="button"]{

margin:100px auto;

width: 146px;

background: #f9f9f9;

padding: 1em;

box-shadow: 0 0 10px #aaa;

margin: 1em 0;

color: #888;
background-color:#4F9EBA;
border:none;
color:#FFF;
border-bottom: 4px solid transparent;
}
input[type="submit"]:hover,
input[type="button"]:hover{
opacity: 0.8;
border-color: #00adb1;
}
form p{
text-align: center;
color: #888;
width: 30px;
margin: 10px auto 0;
background: #f9f9f9;
position: relative;
bottom: 20px;
}

Login.php

<!DOCTYPE html>
<head>

<title> Gudang Maya </title>


<link rel="stylesheet" href="style.css"
type="text/css">
</head>
<body id="active">

include "connect.php";
$pass=md5($_POST['password']);
$sql=mysql_query("SELECT nama_user,password,level
FROM user

<div id="header">

WHERE nama_user = '$_POST[username]'

<h1> GUDANG MAYA </h1>


</div>

AND password = '$_POST[password]'");


$data=mysql_fetch_array($sql);

<div id="container">
<div id="login">

$hasil=mysql_num_rows($sql);

<fieldset>
<form method="POST" action="ceklogin.php">
<input type="text" name="username"
placeholder="Username">
<input type="password" name="password"
placeholder="Password">
<input type="submit" name="submit"
value="LOGIN">
</form>
</fieldset>
</div>

if ($hasil > 0 )
{
header('location:admin.php');
}
else
{
echo "<p>Login gagal! username tidak terdaftar atau
password salah</p><p><a href=\"index.php\">Ulangi
Lagi</a></p>";
}

</div>

?>

<div id="footer">
<p> @Dibuat oleh Saya </p>
</div>

</body>

Ceklogin.php

Index.php

<?php

<!DOCTYPE html>

session_start(); // memulai session

<head>

<title> Gudang Maya </title>

<title> Gudang Maya </title>

<link rel="stylesheet" href="style.css"


type="text/css">

<link rel="stylesheet" href="style.css"


type="text/css">

</head>

</head>
<body id="active">

<div id="header">
<h1> GUDANG MAYA </h1>

<body id="active">
<?php
require_once "connect.php";

</div>

if(isset($_POST['jual'])){

<div id="container">

$sql="INSERT into barang (ID,Nama,Tahun,Harga)


values
('$_POST[id]','$_POST[nama]','$_POST[tahun]','$_POST[
harga]')";

<div id="login">
<fieldset>

$query=pg_query($sql);

<form action="">
<input type="submit" name="submit"
value="USER">
<input type="button" value="ADMIN"
onclick="window.location='login.php';">

if($query){
?><script
language="javascript">document.location.href='admin.php'
</script><?php
}

<div class="border-p"></div>

else{

</form>

echo "Terjadi kesalahan data gagal disimpan";

</fieldset>
}

</div>
}

</div>
<div id="footer">
<p> @Dibuat oleh Saya </p>

?>
<div id="header">
<h1> GUDANG MAYA </h1>

</div>
</div>

<div id="container">

</body>

<div id="tabel">
<fieldset>
<h2>Tabel Penjualan</h2>
<form method="POST" action="admin.php">
<input type="text" name="id" placeholder="ID
Barang">

Admin.php

<!DOCTYPE html>
<head>

<input type="text" name="nama"


placeholder="Nama Barang">
<input type="text" name="tahun"
placeholder="Tahun Beli">

<input type="text" name="harga"


placeholder="Harga(Rp)">

<?php
$server = "localhost";

<input type="submit" name="jual"


value="JUAL">

$username = "root";
$password = "";

<input type="button" name="ubah"


value="UBAH">

$database = "gudang";

<input type="button" name="hapus"


value="HAPUS">
<input type="button" name="lihat"
value="LIHAT SEMUA"
onclick="window.location='lihat.php'">
</form>
</fieldset>
</div>
</div>
<div id="footer">
<p> @Dibuat oleh Saya </p>
</div>
</body>

Connect.php
II.

BROWSER RUNNING

mysql_connect($server,$username,$password);
mysql_select_db($database);
?>

III.

IV.
V.

VI.

VII.

VIII.
IX.
X.
XI.
XII.
XIII.
XIV.
XV.
XVI.
XVII.
XVIII.
XIX.
XX.
XXI.
XXII.
XXIII.
XXIV.
XXV.

XXVI.
XXVII.

XXVIII.

PHPMYADMIN

XXIX.

XXX.
XXXI.
XXXII.
XXXIII.
XXXIV.
XXXV.

XXXVIII.

XXXVI.

XXXIX.

XXXVII.

You might also like