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>';
?>
------------------
Senin, 19 Oktober 2009
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>";
?>
---------------------------------
------------------------
?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>";
?>
---------------------------------
Langganan:
Postingan (Atom)