Senin, 14 Desember 2009

--------------------------------------
File boxxccc isi .php!!!
--------------------------------------

~td>
~select name="cmbbus" id="cmbbus">
~?php

mysql_select_db("java_trans",$koneksi);
$cari = "select * from bus order by kode_bus";
$query_bus = mysql_query($cari);
$jumlah = mysql_num_rows($query_bus);

for($i=1;$i~=$jumlah;$i++)
{
$data=mysql_fetch_array($query_bus);
echo"~option value = $data[kode_bus]>$data[kode_bus]~/option>";

}
?>
~/select>
~/td>

--------------------------------
File TGL.php
--------------------------------
~tr>
~td width="20%">Tanggal Berangkat~/td>
~td>:~/td>
~td width="43%">~select name="cbotanggal" id="cbotanggal">
~?php
for ($tanggal = 1; $tanggal ~=31; $tanggal++)
{
echo "~option value = $tanggal>$tanggal~/option>";
}
?>
~/select>
/
~select name="cbobulan" id="cbobulan">
~?php
for ($bulan = 1; $bulan ~=12; $bulan++)
if ($bulan==1)
{
$data = "Januari";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==2)
{
$data = "Pebruari";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==3)
{
$data = "Maret";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==4)
{
$data = "April";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==5)
{
$data = "Mei";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==6)
{
$data = "Juni";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==7)
{
$data = "Juli";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==8)
{
$data = "Agustus";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==9)
{
$data = "September";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==10)
{
$data = "Oktober";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==11)
{
$data = "Nopember";
echo "~option value = $bulan>$data~/option>";
}
else
if ($bulan==12)
{
$data = "Desember";
echo "~option value = $bulan>$data~/option>";
}
?>
~/select>
/
~select name="cbotahun" id="cbotahun">
~?php
for ($tahun = 2009; $tahun ~=2020; $tahun++)
{
echo "~option value = $tahun>$tahun~/option>";
}
?>
~/select>
~/td>
~/tr>

Jumat, 27 November 2009

File belum Sempurna (contoh)
-----------------------------------
File uubb.php
-----------------------------------
!html>
!head>
!title>Data bank!/title>
!/head>

!body>
!form name ="formeditdatabank" METHOD="POST" FORM action ="uubb2.php">
!table border ="0">
!tr>
!td colspan = "2" align ="center" height ="1" size ="6">!b>CARI KODE BANK!/b>!/td>
!/tr>
!tr>
!td>!b> kode bank !/b>!/td>
!td> !input type ="text"name="textkode"size="5" maxlength="5">!/td>
!/tr>

!tr>
!td>!/td> !td>
!input type ="submit" value ="cari kode">
!input type ="reset" value ="batal">
!/td>
!/tr>
!/table>
!/body>
!/html>
----------------------------------
File uubb2.php
----------------------------------
~html>
~head>
~title>uubb2 BANK ~/title>
~/head>

~?php
include ("koneksi.php");

mysql_select_db("java_trans");
$query= mysql_query("select * from bank where kode_bank='$_POST[textkode]'") or die(mysql_error());
$data = mysql_fetch_array($query);

?>
~body>
~form name="formeditbank" METHOD="POST" FORM action ="uubbxx.php">
~table border ="0">
~tr>
~td colspan = "2" align ="center" height ="1" size ="6">~b>UPDATE DATA BANK~/b>~/td>
~/tr>
~tr>
~td>~b> kode bank :~/b>~/td>
~td>
~input type = "text" name="textkode" size="5" value=
~?
print "$data[kode_bank]";
?>>
~/td>
~/tr>
~td>Nama Bank :~/td>
~td>
~input type = "text" name="textnama_bank" size="20" value =
~?php
echo "$data[nama_bank]";
?>>
~/td>
~/tr>
~/tr>
~td>Nomor Rekening :~/td>
~td>
~input type = "text" name="textno_rek" size="20" value =
~?php
echo"$data[no_rek]";
?>>
~/td>
~/tr>
~/tr>
~td>Nama Rekening :~/td>
~td>
~input type = "text" name="textnama_rek" size="20" value =
~?php
echo"$data[nama_rek]";
?>>
~/td>
~/tr>
~/tr>
~td>Alamat Bank :~/td>
~td>
~input type="text" name="textalamat_bank" size="30" value =
~?php
echo"$data[alamat_bank]";
?>>

~/td>
~/tr>
~/tr>
~td>Nomor Telephone :~/td>
~td>
~input type = "text" name="textno_telp" size="15" value =
~?php
echo"$data[no_telp]";
?>>
~/td>
~/tr>
~/tr>
~td>Nomor Fax :~/td>
~td>
~input type = "text" name="textno_fax" size="15" value =
~?php
echo"$data[no_fax]";
?>>
~/td>
~/tr>
~/tr>
~td>Email :~/td>
~td>
~input type = "text" name="textemail" size="20" value =
~?php
echo"$data[email]";
?>>
~/td>
~/tr>
~tr>
~td>~/td> ~td> ~input type ="submit" value ="Update Data">
~input type ="reset" value ="batal">
~input type ="button" value ="keluar" OnClick="">
~/td>
~/tr>
~/table>
~/body>
~/html>
---------------------------------
File uubbxx.php
---------------------------------
~?php
$kb=$_POST["textkode"];
$nb=$_POST["textnama_bank"];
$rek=$_POST["textno_rek"];
$nrek=$_POST["textnama_rek"];
$al=$_POST["textalamat_bank"];
$tp=$_POST["textno_telp"];
$tf=$_POST["textno_fax"];
$em=$_POST["textemail"];
?>

~?php
include ("koneksi.php");

mysql_select_db("java_trans");

$masuk="UPDATE bank SET kode_bank='$kb',nama_bank='$nb',no_rek='$rek',nama_rek='$nrek',alamat_bank='$al',no_telp='$tp',no_fax='$tf',email='$em' where kode_bank ='$kb'";
$hasil=mysql_query($masuk);

if (!mysql_query($masuk,$koneksi))
{
die('Error: '.mysql_error());
}

echo "Data BANK BERHASIL di Update";
mysql_close($koneksi);
echo '~a href = "entribank.php"> Kembali ke Entri Data ~/a>';
echo '~/form>';
--------------------------------------------------
Contoh tentang lggt, sama dengan uubb hanya ada
--------------------------------------------------
File lggt.php
--------------------
~?php
$kb=$_POST["textkode"];

?>

~?php
include ("koneksi.php");

mysql_select_db("java_trans");

$masuk="DELETE from bank where kode_bank='$kb'";
$hasil=mysql_query($masuk);

if (!mysql_query($masuk,$koneksi))
{
die('Error: '.mysql_error());
}

echo "Data BANK BERHASIL di HAPUS!!";
mysql_close($koneksi);
echo '~a href = "hapusdatabank.php"> Hapus Data Lagi~/a>';
echo '~/form>';

?>

Senin, 19 Oktober 2009

Praktikum WEB ke-6 Lanjutan

File judul.php
--------------------

?html>
?head>
?style type ="text/css">
body,center{
color: #000;
font-family: verdana,arial;
font-size: 8px;
background: blue; repeat top;
margin: 0 auto;
}
?/style>
?/head>
?body bgcolor = 'white'>
?center>
?font color = 'white'>
?h2>KLINIK DUTA?/h2>
?h3>?i>Siap Melayani Masyarakat Sepenuh Hati?/i>?/h3>

?font color = 'lime'>
?/font>
?/center>
?/body>
?/html>
------------------
File plk.php

?html>
?head>
?title>coba?/title>
?/head>
?body>
?a href ="http://www.yahoo.com" target="frame_isi">?h4> Link data yahoo ?/h4> ?/a> ?marquee behavior =scroll direction =up >?i>?h3>Yahoo Can Be Fun!!!!?/i>?/h3>?/marquee>

?/body>
?/html>
------------------
File profil.php

?html>
?head>
?title>coba?/title>
?/head>
?body>
?h3>KLINIK DUTA?/h3>
?/body>
?/html>
------------------
File menu.php

?html>
?head>
?meta http-equiv='content-type' content='text/html; charset=UTF-8' />
?title>Menu Utama?/title>
?meta name="outhor" content="root"/>
?meta name="language" content="english"/>

?/head>
?body>
?div id='main'>
?h1>fnfCreator?/h1>
?ul id='menu'>
?li>?a href= "entripasien.php" target="frame_isi">Entri Data Pasien?/a>?/li>
?li>?a href= "lihatpasien.php" target="frame_isi">Lihat Data Pasien?/a>?/li>
?/ul>
?br>?br>
?br>?/div>
?div class='box'>
?h2>copyright@2009?/h2>
?p>be a creative?/p>
?/div>
?br>
?/body>
?/html>
--------------------
File index.php

??php
echo '?head>';
echo '?meta http-equiv="refresh" name="keywords" content="STMIK Kharisma">';
echo '?title>Pelatihan Pemrograman WEB,STMIK Kharisma Karawang?/title>';
echo '?frameset rows="20%,*" border= "1">';

echo '?frame name="frame_judul" src= "judul.php" scrolling = "no">';

echo '?frameset cols="25%,60%,15%" border= "1" scrolling ="no">';
echo '?frame name="frame_menu" src= "menu.php" scrolling = "no">';
echo '?frame name="frame_isi" src= "profil.php" scrolling = "yes">';
echo '?frame name="frame_plk" src= "plk.php" scrolling = "yes">';
echo '?/frameset>';
echo '?/frameset>';
echo '?/head>';
?>
------------------

Selasa, 13 Oktober 2009

Praktikum WEB ke-6 (javascript+php)

File gaya_tabelku.css
------------------------
?style type ="text/css">

table { border-collapse: collapse; border: 1px solid #C0C0C0; }
th { border: 1px solid #C0C0C0; text-align: left; font-size: 12px; background:orange; }
td {border: 1px solid #C0C0C0; text-align: center; font-size: 11px; }
font { size: 2px; }
?/style>
-----------------------
File entripasien.php

?html>
?head>
?title>Entri Data Pasien?/title>
?meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
?script language="JavaScript">


function trim(str)
{
return str.replace(/^\s+|\s+$/g,'');
}

function validasilogin()
{
var cpasien,cnama,calamat,cgol_darah,ckelamin,ctempat,ctanggal,ctelp,;
with(window.document.formpasien)
{
cpasien = textpasien;
cnama = textnama;
calamat = textalamat;
cgol_darah = combodarah;
ckelamin = combojk;
ctempat = texttempat;
ctanggal = texttgl_lahir;
ctelp = texttelp;
}

if(trim(cpasien.value) == '')
{
alert('Silahkan isi dulu nama dengan lengkap');
cpasien.focus();
return false;
}
else
if(trim(cnama.value) == '')
{
alert('Silahkan isi dulu nama dengan lengkap');
cnama.focus();
return false;
}
else
if(trim(calamat.value)== '')
{
alert('Alamat jangan kosong!!');
calamat.focus();
return false;
}
else
if(trim(cgol_darah.value) == '')
{
alert('Isi dulu golongan darah pasien');
cgol_darah.focus();
return false;
}
else
if(trim(ckelamin.value) == '')
{
alert('Silahkan isi dulu jenis kelamin');
ckelamin.focus();
return false;
}
else
if(trim(ctempat.value) == '')
{
alert('Silahkan isi dulu tempat lahir pasien');
ctempat.focus();
return false;
}
else
if(trim(ctanggal.value) == '')
{
alert('Silahkan isi tanggal lahir pasien');
ctanggal.focus();
return false;
}
else
if(trim(ctelp.value) == '')
{
alert('Silahkan isi dulu nomor telephon !!');
ctelp.focus();
return false;
}
else
{
cpasien.value = trim(cpasien.value);
cnama.value = trim(cnama.value);
calamat.value = trim(calamat.value);
cgol_darah.value = trim(cgol_darah.value);
ckelamin.value = trim(ckelamin.value);
ctempat.value = trim(ctempat.value);
ctanggal.value = trim(ctanggal.value);
ctelp.value = trim(ctelp.value);
return true;
}

}
?/script>
?/head>

?body>
?FORM action = "simpanpasien.php" onsubmit = "return validasilogin();"
METHOD = "POST" name="formpasien" ENCTYPE="MULTIPART/FORM-DATA">

?font color="blue">?h3>ENTRI DATA PASIEN ?/h3>
?HR>
?table>
?tr>?td align="right"> Kode Pasien : ?/td>
?td>?input id="textpasien" name="textpasien"
type ="text" maxlength="8" size="8">
?/td>
?/tr>

?tr>?td align="right"> Nama Pasien : ?/td>
?td>?input id="textnama" name="textnama"
type ="text" maxlength="25" size="15">
?/td>
?/tr>

?tr>?td align="right"> Alamat : ?/td>
?td>?input id="textalamat" name="textalamat"
type ="text" maxlength="40" size="20">
?/td>
?/tr>

?tr>?td align="right">Golongan Darah : ?/td>
?td>
?select id="combodarah" name="combodarah">
?option value="A" selected>A?/option>
?option value="B">B?/option>
?option value="AB">AB?/option>
?option value="O">O?/option>
?/select>
?/td>
?/tr>

?tr>?td align="right">Jenis Kelamin : ?/td>
?td>
?select id="combojk" name="combojk">
?option value="L" selected>L?/option>
?option value="P">P?/option>
?/select>
?/td>
?/tr>

?tr>?td align="right">
?font size="2"color="blue">Tempat lahir :?/font>
?/td>
?td>
?input id="texttempat" name="texttempat" type="text" maxlength="15" size="15">
?/td>
?/tr>

?tr>?td align="right">
?font size="2"color="blue">Tanggal lahir :?/font>
?/td>
?td>
?input id="texttgl_lahir" name="texttgl_lahir" type="text" maxlength="15" size="15">
?/td>
?/tr>

?tr>?td align="right">
?font size="2"color="blue">Nomor Telepon :?/font>
?/td>
?td>
?input id="texttelp" name="texttelp" type="text" maxlength="15" size="15">
?/td>
?/tr>

?/table>
?hr>
?input name="tombolsimpan" type="submit" value="Simpan">
?hr>

?/form>
?/body>
?/html>
--------------------
File koneksi.php

??php
$namaserver="localhost";
$username="root";
$password="";

$koneksi=mysql_connect($namaserver,$username,$password);
if (!koneksi)
{
die('Koneksi Gagal !!:'.mysql_error());
}
?>
------------------------
File simpanpasien.php

??php
include ("koneksi.php");

mysql_select_db("db_klinikduta", $koneksi);
$cari="select*from pasien where kode_pasien='$_POST[textpasien]'";
$query=mysql_query($cari);
$periksa_data = mysql_num_rows($query);

if ($periksa_data != 0)
{
echo "Data sudah ada, silakan periksa lagi";
echo '?a href ="entripasien.php"> kembali ke Form Entri Data ?/a>';
return;
}

$sql="INSERT INTO pasien (kode_pasien,nama_pasien,alamat_p,gol_darah,jen_kel,tem_lahir,tgl_lahir,no_tlp)
VALUES ('$_POST[textpasien]','$_POST[textnama]','$_POST[textalamat]','$_POST[combodarah]','$_POST[combojk]',
'$_POST[texttempat]','$_POST[texttgl_lahir]','$_POST[texttelp]')";

if (!mysql_query($sql,$koneksi))
{
die('Error:'.mysql_error());
}

echo "satu record/data BERHASIL ditambahkan ke dalam tabel";
mysql_close($koneksi);
echo '?a href = "entripasien.php"> Kembali ke Entri Data ?/a>';
echo '?/form>';
?>
---------------------------
File lihatpasien.php

??php

include("gaya_tabelku.css");
include("koneksi.php");
mysql_select_db("db_klinikduta");
$query = mysql_query("select * from pasien") or die(mysql_error());

echo "?tr>";
echo "?td width=950 valign=top>?h3 align=center>DATA PASIEN?/h3>";

$jmlpasien = mysql_num_rows($query);

echo "?table border=1 align=center>";
echo "?tr bgcolor=grenn align=center>";
echo "?th>?b>Nomor?/font>?/b>";
echo "?th>?b>Kode Pasien?/font>?/b>";
echo "?th>?b>Nama Pasien?/font>?/b>";
echo "?th>?b>Alamat?/font>?/b>";
echo "?th>?b>Golongan darah?/font>?/b>";
echo "?th>?b>Jenis Kelamin?/font>?/b>";
echo "?th>?b>Tempat Lahir?/font>?/b>";
echo "?th>?b>Tanggal Lahir?/font>?/b>";
echo "?th>?b>Nomor Telp.?/font>?/b>";
echo "?/tr>";

for ($i = 1; $i ?= $jmlpasien; $i++)
{
$baris_data = mysql_fetch_array($query);

echo "?tr>";
echo "?td>?font color=blue size=2>".$i. ".?/td>";
echo "?td> $baris_data[kode_pasien]?/td>";
echo "?td> $baris_data[nama_pasien]?/td>";
echo "?td> $baris_data[alamat_p]?/td>";
echo "?td> $baris_data[gol_darah]?/td>";
echo "?td> $baris_data[jen_kel]?/td>";
echo "?td> $baris_data[tem_lahir]?/td>";
echo "?td> $baris_data[tgl_lahir]?/td>";
echo "?td> $baris_data[no_tlp]?/td>";
echo "?/tr>";
}

echo "?/table>";
echo "?br>";

echo "?table>";
echo "?tr align=center>";
echo "?td bgcolor=white colspan=3> Jumlah Total Pasien = ?/font>" ;

$total = $jmlpasien;
echo "?td bgcolor=white width=20 align=left> $total ?/td>";

echo '?a href ="entripasien.php">?font size=2>Kembali Ke Form Entri Data?/font> ?/a>';
echo "?/table>";
echo "?br >";
echo"?form>";
echo "?input type ='button' value='Cetak Pasien' onClick='window.print()'>";
echo "?/form>";

?>
---------------------------------

Jumat, 11 September 2009

CSS

File efek.css
-----------------
h1 {color:green;
background:white;
font-family:arial;
text-decoration:blink;
}
p {color:white;
background:brown;
font-family:timesnewroman;
}
----------------------
File External css
----------------------
?html>
?head>
?title>Panggil css External?/title>

?link rel="stylesheet" type="text/css" href="efek.css">
?/head>
?body>
?h1>Contoh External CSS?/h1>
?p>?i>Pada MatKul Pemrograman WEB oleh warisman?/i>
?/body>
?/html>
-------------------------
File Internal Css
-------------------------
?html>
?head>
?title>Contoh Internal Style Sheet?/title>
?style type=text/css>
body { color:white;
background:green;
font-family:arial;
}
?/style>
?/head>

?body>
?h1>CONTOH INTERNAL STYLE SHEET (CSS)?/h1>
?p>Pada Mata Kuliah Pemrograman WEB dibuat oleh warisman
?/body>
?/html>
----------------------
File Inline Css
----------------------
?html>
?head>
?title>Contoh Inline Style Sheet?/title>
?/head>

?body style=color:green;
background:aqua;
font-family:arial;>

?h1>CONTOH INLINE STYLE SHEET (CSS)?/h1>
?p>Pada Mata Kuliah Pemrograman WEB dibuat oleh warisman
?/body>
?/html>

Selasa, 18 Agustus 2009

Praktikum Web 4

?html>
?head>?title> Praktikum 4 WEB?/title>?/head>?body> ?form> ?table> ?tr> ?td>NPM ?/td>?td> :?/td> ?td>?input type="text" name="npm" />?/td> ?/tr> ?br /> ?tr> ?td>Nama?/td>?td>:?/td> ?td>?input type="text" name="nama" />?/td> ?tr> ?td>Jenis Kelamin?/td>?td>:?/td> ?td>?input type="radio" name="sex" value="male" /> Pria ?input type="radio" name="sex" value="female" /> Wanita?/td> ?/tr> ?br /> ?tr> ?td>Prodi?/td>?td>:?/td> ?td>?select> ?option value="TI">Teknik Informatika?/option> ?option value="SI">Sistem Informasi?/option> ?option value="MI">Managemen Informatika?/option> ?option value="TK">Teknik Komputer?/option> ?option value="KA">Komputer Akuntansi?/option> ?/select>?/td> ?/tr> ?tr> ?td>Alamat?/td>?td>:?/td> ?td>?input type="text" name="alamat" />?/td> ?/tr> ?tr> ?td>Hobby?/td>?td>:?/td> ?td>Mancing: ?input type="checkbox" name="hobby" value="Mancing" /> Membaca: ?input type="checkbox" name="hobby" value="Membaca" /> Menulis: ?input type="checkbox" name="hobby" value="Menulis" />?/td> ?/tr> ?br /> ?br /> ?br /> ?tr> ?td>?input type="submit" value="Simpan" />?/td> ?td> ?/td> ?td>?input type="reset" value="Reset" />?/td> ?/tr> ?/table> ?/form>?/body>?
/html>

Selasa, 04 Agustus 2009

Praktikum WEB 3

?html>
?head> ?title>Praktikum 3 WEB?/title>
?frameset rows="25%,*"> ?frame src = atas.html> ?frameset cols="25%,* border="1"> ?frame src = kiri.html scrolling ="yes"> ?frame src = tengah.html name ="ok"> ?/frameset> ?/frameset>
?/head>
?body>
?/body>
?/html>

?html>
?head>
?title> Praktikum 3 WEB?/title>
?/head>
?body> ?h3>STMIK KHARISMA KARAWANG ?/h3>
?/body>
?/html>

?html>
?head>
?title> Praktikum 3 WEB?/title>
?/head>
?body> ?a href ="http://www.yahoo.com" target="ok">?h4> Link data yahoo ?/h4> ?/a> ?marquee behavior =scroll direction =up >?i>?h3>Yahoo Can Be Fun!!!!?/i>?/h3>?/marquee>
?/body>
?/html>

?html>
?head> ?title> Praktikum 3 WEB?/title>
?/head>
?body> ?marquee>?h2> WEB dengan Frame ?/h2>?br>?h4>Created by Warisman?/h4>?/marquee>
?/body>
?/html>