chat on the fly with database

15
http://cs.unsyiah.ac.id/~ryanda/GK/tugas2/ RIZA FERYANDA - 1108107010014 JURUSAN INFORMATIKA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM UNIVERSITAS SYIAH KUALA LAPORAN GRAFIKA KOMPUTER – INFORMATIKA UNSYIAH

Upload: independent

Post on 22-Jan-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

http://cs.unsyiah.ac.id/~ryanda/GK/tugas2/ x

RIZA FERYANDA - 1108107010014

JURUSAN INFORMATIKA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM

UNIVERSITAS SYIAH KUALA

LAPORAN

GRAFIKA KOMPUTER – INFORMATIKA UNSYIAH

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 1

TUGAS 2

Pada tugas 2 ini, anda diminta untuk melakukan hal-hal sebagai berikut:

1. Buat sebuah database (DBMS MySQL) di mesin cs pada akun anda masing-masing untuk mengelola

data terkait masalah Sosial dan Kependudukan atau Ekonomi dan Perdagangan atau

masalah Pertanian dan Pertambangan. Data-data tersebut dapat diperoleh di situs Badan Pusat

Statistik. Rancang relational schema (tabel) untuk menampung dan mempopulasikan data-data yang

dipilih tersebut.

2. Buat sebuah script (php atau cgi) yang dapat membaca data dalam database menggunakan perintah

SQL yang valid dan benar. Selanjutnya, susun data yang diperoleh dari database dalam format yang

sesuai dan bangkitkan chart (dalam format jpg atau png) secara dinamis (on-the-fly) menggunakan

modul GD::Graph. Script untuk membangkitkan chart ditulis menggunakan Perl. Tampilkan

minimal 3 jenis chart yang berbeda, misalnya bar chart (vertical dan horizontal), pie chart,

dan line chart (untuk menampilkan trend) dalam sebuah halaman web yang dirancang khusus

untuk tugas 2 ini pada akun web anda masing-masing di mesin cs. Anda dapat menggunakan pop-

list untuk memudahkan user memilih jenis chart yang ingin ditampilkan. Buat pula formagar user

dapat menambah atau mengubah data dalam database sehingga terlihat nyata bahwa chart yang

dibangkitkan benar-benar on-the-fly.

Jenis Data

Data yang dipilih adalah data “Persentase Penduduk yang Pernah Mengakses Internet dalam 3 bulan

Terakhir Menurut Media/Lokasi, 2010 – 2012” yang ada pada sub bagian Komunikasi dalam data

Ekonomi dan Perdangan. Data ini diambil di situs resmi BPS ( Badan Pusat Statistik ) yang ada

pada URL :

http://www.bps.go.id/tab_sub/view.php?kat=2&tabel=1&daftar=1&id_subyek=02&notab=10

Data di atas akan disajikan dalam 4 bentuk chart yaitu Horizontal Bar, Vertical Bar, Pie Chart dan

Line Chart

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 2

A. Penjelasan Kode Progam

CGI use DBI; #Memanggil Class DBI yang digunakan untuk koneksi ke Database

use CGI; #Memanggil Class CGI agar progam dapat diakses via browser

use GD::Graph::hbars; #Memanggil Library GD Graph hbars

my $cgi = CGI->new(); #Membuat sebuah CGI

print $cgi->header('text/html');

my $db = "ryanda";

my $dbi = DBI->connect("dbi:mysql:$db:127.0.0.1","ryandausr","******")#Mencoba untuk

melakukan koneksi ke database dengan parameter seperti di atas

or print "Tidak dapat menghubungkan $! \n"; #Tindahkan mencetak Cannot Connect jika

gagal

#Deklarasi Array

my @tahun;

my @rumah;

my @warnet;

my @hp;

my @kantor;

my @sekolah;

my @lainnya;

my $i=0;

my $sql = "select * from grafika2"; #Melakukan listing dari table grafika2

my $sth = $dbi->prepare($sql) or exit(1);

my $res = $sth->execute or exit (1);

#Mengambil data dan memasukkannya ke array

while (my @row = $sth->fetchrow_array){

$tahun[$i] = $row[0];

$rumah[$i] = $row[1];

$warnet[$i] = $row[2];

$hp[$i] = $row[3];

$kantor[$i] = $row[4];

$sekolah[$i] = $row[5];

$lainnya[$i] = $row[6];

$i++;

}

$dbi->disconnect(); #Memutuskan jika proses sudah selesai

#Deklarasi penampung

my @data = ([@tahun], [@rumah], [@warnet], [@hp], [@kantor], [@sekolah], [@lainnya] );

PHP

koneksi..php <?php //SETTING KONEKSI KE MYSQL

$host = "127.0.0.1"; //HOST

$user = "ryandausr";//USERNAME MYSQL

$pass = "********"; //PASSWORD $dbName = "ryanda"; //NAMA DATABASE YANG DIPILIH

mysql_connect($host, $user, $pass); //MENYAMBUNG

mysql_select_db($dbName) //MEMILIH NAMA DATABASE

or die ("Sambungan gagal !! : ".mysql_error()); //JIKA GAGAL MENYAMBUNG

?>

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 3

index.php <?php

include 'koneksi.php'; //Memanggil koneksi CGI

$query = "SELECT * FROM grafika2"; //Mengambil semua data dari table grafika2

$result = mysql_query($query);

//Membuat tabel

echo "<center><table border='0' cellpadding='2' cellspacing='2'>";

echo "<tr bgcolor='orange' align='center'>

<td> <b> Tahun </b> </td>

<td> <b> Rumah </b> </td>

<td> <b> Warnet </b> </td>

<td> <b> Telepon Seluler </b> </td>

<td> <b> Kantor </b> </td>

<td> <b> Sekolah </b> </td>

<td> <b> Lainnya </b> </td>

<td> <b> Aksi </b> </td>

</tr>";

while ($data = mysql_fetch_array($result)) //mysql_fetch_array = get the query data

into array

{

echo "<tr align='center'>

<td>".$data['tahun']."</td>

<td>".$data['rumah']."</td>

<td>".$data['warnet']."</td>

<td>".$data['hp']."</td>

<td>".$data['kantor']."</td>

<td>".$data['sekolah']."</td>

<td>".$data['lainnya']."</td>

<td> <i> <a href='update.php?tahun=".$data['tahun']."'>Edit</a> //Untuk

mengedit data

</i></td>

</tr>";

}

echo "</table></center>";

?>

proses.php <?php

include 'koneksi.php'; //memanggil file koneksi.php

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

//mengambil nilai dari form di bawah

$tahun = $_POST['tahun'];

$rumah = $_POST['rumah'];

$warnet = $_POST['warnet'];

$hp = $_POST['hp'];

$kantor = $_POST['kantor'];

$sekolah = $_POST['sekolah'];

$lainnya = $_POST['lainnya'];

//query untuk update data di database

$query = "UPDATE grafika2 SET rumah = '$rumah', warnet = '$warnet',hp = '$hp',kantor =

'$kantor',sekolah = '$sekolah',lainnya = '$lainnya' WHERE tahun = '$tahun'" ;

$hasil = mysql_query($query);

//hasil

if ($hasil) {

include "index.php";

echo "<center><h4> Update data sukses </h4></center>";

}

else {

die($sql . " => " . mysql_error());

}

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 4

}

?>

update.php <?php

include 'koneksi.php'; //Memanggil file koneksi.php

$tahun = $_GET['tahun']; //mengambil tahun ( primary key )

$query = "SELECT * FROM grafika2 WHERE tahun = $tahun"; //menlistkan data table

berdsarkan kolum table

$hasil = mysql_query($query);

$data = mysql_fetch_array($hasil);

?>

<form method="post" action="proses.php">

<table width="500" border="0" cellpadding="2" cellspacing="2">

<tr bgcolor="orange">

<td height="21" colspan="3">

<strong>Form Update Data</strong>

</td>

<tr>

<td width="23%"> Tahun </td>

<td width="2%">:</td>

<td width="75%"> <input type="text" name="tahun" disabled='disable' value="<?php

echo $data['tahun']; ?>"> </td>

</tr>

<tr>

<td>Rumah</td>

<td>:</td>

<td> <input type="text" name="rumah" value="<?php echo $data['rumah']; ?>"> </td>

</tr>

B. URL Chart

http://cs.unsyiah.ac.id/~ryanda/GK/tugas2/

C. Snapshot Progam

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 5

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 6

D. Source Code t2hbar.cgi #!/usr/bin/perl -w

use DBI;

use CGI;

use GD::Graph::hbars;

my $cgi = CGI->new();

print $cgi->header('text/html');

my $db = "ryanda";

my $dbi = DBI->connect("dbi:mysql:$db:127.0.0.1","ryandausr","xxxx") or print "Tidak

dapat terhubung $! \n";

my @tahun;

my @rumah;

my @warnet;

my @hp;

my @kantor;

my @sekolah;

my @lainnya;

my $i=0;

my $sql = "select * from grafika2";

my $sth = $dbi->prepare($sql) or exit(1);

my $res = $sth->execute or exit (1);

while (my @row = $sth->fetchrow_array){

$tahun[$i] = $row[0];

$rumah[$i] = $row[1];

$warnet[$i] = $row[2];

$hp[$i] = $row[3];

$kantor[$i] = $row[4];

$sekolah[$i] = $row[5];

$lainnya[$i] = $row[6];

$i++;

}

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 7

$dbi->disconnect();

my @data = ([@tahun], [@rumah], [@warnet], [@hp], [@kantor], [@sekolah], [@lainnya] );

my $cgi = CGI->new;

my $hgraph =GD::Graph::hbars->new(700,500);

$hgraph->set(

x_label => 'Tahun',

y_label => 'Persentase',

title => 'Persentase Penduduk yang Pernah Mengakses Internet Menurut Media atau

Lokasi',

y_tick_number => 8,

y_label_skip => 2,

bar_spacing => 10,

shadow_depth => 3,

accent_treshold => 200,

transparent => 0

) or warn $hgraph->error;

$hgraph->set_legend('Rumah','Warnet', 'Telepon Seluler', 'Kantor', 'Sekolah',

'Lainnya');

$hgraph->plot(\@data) or die $hgraph->error;

open(HGRAPH, '> ../tmp/t2hbar.jpeg') or die ('gagal');

binmode HGRAPH;

print HGRAPH $hgraph->gd->jpeg(500);

close HGRAPH;

print"

<html>

<center>

<h3> Horizontal Bar Graph<h3>

</center>

<center>

<a href='http://cs.unsyiah.ac.id/~ryanda/GK/tugas2'><input type='button' value='Back to

Mainpage'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2vbar.cgi'><input type='button'

value='Vertical Bar Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2pie.cgi'><input type='button'

value='Pie Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2line.cgi'><input type='button'

value='Line Graph'>

<br>

<br>

</center>

<center>

<img src='http://cs.unsyiah.ac.id/~ryanda/tmp/t2hbar.jpeg' width='600px'

height='600px'><br>

</center>

</html>";

t2line.php

#!/usr/bin/perl -w

use DBI;

use CGI;

use GD::Graph::lines;

my $cgi = CGI->new();

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 8

print $cgi->header('text/html');

my $db = "ryanda";

my $dbi = DBI->connect("dbi:mysql:$db:127.0.0.1","ryandausr","*****") or print "Tidak

dapat terhubung $! \n";

my @tahun;

my @rumah;

my @warnet;

my @hp;

my @kantor;

my @sekolah;

my @lainnya;

my $i=0;

my $sql = "select * from grafika2";

my $sth = $dbi->prepare($sql) or exit(1);

my $res = $sth->execute or exit (1);

while (my @row = $sth->fetchrow_array){

$tahun[$i] = $row[0];

$rumah[$i] = $row[1];

$warnet[$i] = $row[2];

$hp[$i] = $row[3];

$kantor[$i] = $row[4];

$sekolah[$i] = $row[5];

$lainnya[$i] = $row[6];

$i++;

}

$dbi->disconnect();

my @data = ([@tahun], [@rumah], [@warnet], [@hp], [@kantor], [@sekolah], [@lainnya] );

my $cgi = CGI->new;

my $hgraph =GD::Graph::lines->new(700,500);

$hgraph->set(

x_label => 'Tahun',

y_label => 'Persentase',

title => 'Persentase Penduduk yang Pernah Mengakses Internet Menurut Media atau

Lokasi',

bar_spacing => 10,

) or warn $hgraph->error;

$hgraph->set_legend('Rumah','Warnet', 'Telepon Seluler', 'Kantor', 'Sekolah',

'Lainnya');

$hgraph->plot(\@data) or die $hgraph->error;

open(HGRAPH, '> ../tmp/t2line.jpeg') or die ('gagal');

binmode HGRAPH;

print HGRAPH $hgraph->gd->jpeg(500);

close HGRAPH;

print"

<html>

<center>

<h3> Line Graph <h3>

</center>

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 9

<center>

<a href='http://cs.unsyiah.ac.id/~ryanda/GK/tugas2'><input type='button' value='Back to

Mainpage'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2hbar.cgi'><input type='button'

value='Horizontal Bar Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2vbar.cgi'><input type='button'

value='Vertical Bar Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2pie.cgi'><input type='button'

value='Pie Graph'>

<br>

<br>

</center>

<center>

<img src='http://cs.unsyiah.ac.id/~ryanda/tmp/t2line.jpeg' width='500px'

height='500px'><br>

</center>

</html>";

t2pie.cgi

#!/usr/bin/perl -w

use DBI;

use CGI;

use GD::Graph::pie;

my $cgi = CGI->new();

print $cgi->header('text/html');

my $db = "ryanda";

my $dbi = DBI->connect("dbi:mysql:$db:127.0.0.1","ryandausr","****") or print "Cannot

Connect $! \n";

my @tahun;

my @rumah;

my @warnet;

my @hp;

my @kantor;

my @sekolah;

my @lainnya;

my $i=0;

my $sql = "select * from grafika2";

my $sth = $dbi->prepare($sql) or exit(1);

my $res = $sth->execute or exit (1);

while (my @row = $sth->fetchrow_array){

$tahun[$i] = $row[0];

$rumah[$i] = $row[1];

$warnet[$i] = $row[2];

$hp[$i] = $row[3];

$kantor[$i] = $row[4];

$sekolah[$i] = $row[5];

$lainnya[$i] = $row[6];

$i++;

}

$dbi->disconnect();

my @data = ([@tahun], [@rumah], [@warnet], [@hp], [@kantor], [@sekolah], [@lainnya] );

my $cgi = CGI->new;

my $graph =GD::Graph::pie->new(700,500);

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 10

$graph->set(

label => 'Tahun',

title => 'Persentase Penduduk yang Pernah Mengakses Internet Menurut Media atau

Lokasi',

pie_height => 36,

transparent => 0

) or warn $graph->error;

$graph->plot(\@data) or die $graph->error;

open(GRAPH, '> ../tmp/t2pie.jpeg') or die ('gagal');

binmode GRAPH;

print GRAPH $graph->gd->jpeg(500);

close GRAPH;

print"

<html>

<center>

<h3> Pie Bar Graph<h3>

</center>

<center>

<a href='http://cs.unsyiah.ac.id/~ryanda/GK/tugas2'><input type='button' value='Back to

Mainpage'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2hbar.cgi'><input type='button'

value='Horizontal Bar Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2hbar.cgi'><input type='button'

value='Vertical Bar Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2line.cgi'><input type='button'

value='Line Graph'>

<br>

<br>

</center>

<center>

<img src='http://cs.unsyiah.ac.id/~ryanda/tmp/t2pie.jpeg' width='500px'

height='500px'><br>

</center>

</html>";

t2vbar.cgi #!/usr/bin/perl -w

use DBI;

use CGI;

use GD::Graph::bars;

my $cgi = CGI->new();

print $cgi->header('text/html');

my $db = "ryanda";

my $dbi = DBI->connect("dbi:mysql:$db:127.0.0.1","ryandausr","xxxxx") or print "Cannot

Connect $! \n";

my @tahun;

my @rumah;

my @warnet;

my @hp;

my @kantor;

my @sekolah;

my @lainnya;

my $i=0;

my $sql = "select * from grafika2";

my $sth = $dbi->prepare($sql) or exit(1);

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 11

my $res = $sth->execute or exit (1);

while (my @row = $sth->fetchrow_array){

$tahun[$i] = $row[0];

$rumah[$i] = $row[1];

$warnet[$i] = $row[2];

$hp[$i] = $row[3];

$kantor[$i] = $row[4];

$sekolah[$i] = $row[5];

$lainnya[$i] = $row[6];

$i++;

}

$dbi->disconnect();

my @data = ([@tahun], [@rumah], [@warnet], [@hp], [@kantor], [@sekolah], [@lainnya] );

my $cgi = CGI->new;

my $graph =GD::Graph::bars->new(700,500);

$graph->set(

x_label => 'Tahun',

y_label => 'Persentase',

title => 'Persentase Penduduk yang Pernah Mengakses Internet Menurut Media atau

Lokasi',

y_tick_number => 8,

y_label_skip => 2,

bar_spacing => 10,

shadow_depth => 3,

accent_treshold => 200,

transparent => 0

) or warn $graph->error;

$graph->set_legend('Rumah','Warnet', 'Telepon Seluler', 'Kantor', 'Sekolah',

'Lainnya');

$graph->plot(\@data) or die $graph->error;

open(GRAPH, '> ../tmp/t2vbar.jpeg') or die ('gagal');

binmode GRAPH;

print GRAPH $graph->gd->jpeg(500);

close GRAPH;

print"

<html>

<center>

<h3> Vertical Bar Graph<h3>

</center>

<center>

<a href='http://cs.unsyiah.ac.id/~ryanda/GK/tugas2'><input type='button' value='Back to

Mainpage'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2hbar.cgi'><input type='button'

value='Horizontal Bar Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2pie.cgi'><input type='button'

value='Pie Graph'>

<a href='http://cs.unsyiah.ac.id/~ryanda/cgi-bin/t2line.cgi'><input type='button'

value='Line Graph'>

<br>

<br>

</center>

<center>

<img src='http://cs.unsyiah.ac.id/~ryanda/tmp/t2vbar.jpeg' width='600px'

height='600px'><br>

</center>

</html>";

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 12

koneksi.php

<?php //SETTING KONEKSI KE MYSQL

$host = "127.0.0.1"; //HOST

$user = "ryandausr";//USERNAME MYSQL

$pass = "****"; //PASSWORD DEFAULT XAMPP JIKA MENGGUNAKAN PASSWORD,SILAHKAN ISI

$dbName = "ryanda"; //NAMA DATABASE YANG DIPILIH

mysql_connect($host, $user, $pass); //MENYAMBUNG

mysql_select_db($dbName) //MEMILIH NAMA DATABASE

or die ("Sambungan gagal !! : ".mysql_error()); //JIKA GAGAL MENYAMBUNG

?>

proses.php

<?php

include 'koneksi.php';

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

//mengambil nilai dari form di bawah

$tahun = $_POST['tahun'];

$rumah = $_POST['rumah'];

$warnet = $_POST['warnet'];

$hp = $_POST['hp'];

$kantor = $_POST['kantor'];

$sekolah = $_POST['sekolah'];

$lainnya = $_POST['lainnya'];

//query untuk update data di database

$query = "UPDATE grafika2 SET rumah = '$rumah', warnet = '$warnet',hp = '$hp',kantor =

'$kantor',sekolah = '$sekolah',lainnya = '$lainnya' WHERE tahun = '$tahun'" ;

$hasil = mysql_query($query);

//hasil

if ($hasil) {

include "index.php";

echo "<center><h4> Update data sukses </h4></center>";

}

else {

die($sql . " => " . mysql_error());

}

}

?>

index.php

?php

include 'koneksi.php';

$query = "SELECT * FROM grafika2"; //the query for get all data in tb_student

$result = mysql_query($query);

echo "<center><table border='0' cellpadding='2' cellspacing='2'>";

echo "<tr bgcolor='orange' align='center'>

<td> <b> Tahun </b> </td>

<td> <b> Rumah </b> </td>

<td> <b> Warnet </b> </td>

<td> <b> Telepon Seluler </b> </td>

<td> <b> Kantor </b> </td>

<td> <b> Sekolah </b> </td>

<td> <b> Lainnya </b> </td>

<td> <b> Aksi </b> </td>

</tr>";

while ($data = mysql_fetch_array($result)) //mysql_fetch_array = get the query data

into array

{

echo "<tr align='center'>

<td>".$data['tahun']."</td>

<td>".$data['rumah']."</td>

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 13

<td>".$data['warnet']."</td>

<td>".$data['hp']."</td>

<td>".$data['kantor']."</td>

<td>".$data['sekolah']."</td>

<td>".$data['lainnya']."</td>

<td> <i> <a href='update.php?tahun=".$data['tahun']."'>Edit</a> </i></td>

</tr>";

}

echo "</table></center>";

?>

update.php

<?php

include 'koneksi.php';

$tahun = $_GET['tahun']; //mengambil no / id

$query = "SELECT * FROM grafika2 WHERE tahun = $tahun"; //Memilih nama tabel dan

menyeleksi no

$hasil = mysql_query($query);

$data = mysql_fetch_array($hasil);

?>

<form method="post" action="proses.php">

<table width="500" border="0" cellpadding="2" cellspacing="2">

<tr bgcolor="orange">

<td height="21" colspan="3">

<strong>Form Update Data</strong>

</td>

<tr>

<td width="23%"> Tahun </td>

<td width="2%">:</td>

<td width="75%"> <input type="text" name="tahun" disabled='disable' value="<?php

echo $data['tahun']; ?>"> </td>

</tr>

<tr>

<td>Rumah</td>

<td>:</td>

<td> <input type="text" name="rumah" value="<?php echo $data['rumah']; ?>"> </td>

</tr>

<tr>

<td>Warnet</td>

<td>:</td>

<td> <input type="text" name="warnet" value="<?php echo $data['warnet']; ?>"> </td>

</tr>

<tr>

<td>Telepon Seluler</td>

<td>:</td>

<td> <input type="text" name="hp" value="<?php echo $data['hp']; ?>"> </td>

</tr>

<tr>

<td>Kantor</td>

<td>:</td>

<td> <input type="text" name="kantor" value="<?php echo $data['kantor']; ?>"> </td>

</tr>

<tr>

<td>Sekolah</td>

<td>:</td>

<td> <input type="text" name="sekolah" value="<?php echo $data['sekolah']; ?>">

</td>

</tr>

RIZA FERYANDA – 1108107010014 – INFORMATIKA UNSYIAH

tugas 2 – chart on the fly with database 14

<tr>

<td>Lainnya</td>

<td>:</td>

<td> <input type="text" name="lainnya" value="<?php echo $data['lainnya']; ?>">

</td>

</tr>

<tr>

<td></td> <td></td> <td> <input type="hidden" name="tahun" value="<?php echo

$data['tahun']; ?>">

<input type="SUBMIT" name="simpan" value="Save"></td>

</tr>

</table>

</form>