Sei sulla pagina 1di 11

<?

php

session_start();

if(empty($_SESSION[namauser])){echo"<h2>Anda harus <strong><i><a


href='rs.php?module=login'>Login</a></i></strong> !";}

else {

//Home

if ($_GET[module]=='home') {

echo"<h2>Selamat Datang : <i>$_SESSION[namauser]</i></h2>";

echo"<a href='?module=dokter'><img src='images/dokter.png'></a>

<a href='?module=pasien'><img src='images/pasien.png'></a>

<a href='?module=poliklinik'><img src='images/poliklinik.png'></a>

<center>

<a href='?module=pendaftaran'><img src='images/pendaftaran.png'></a>

</center>";

else if ($_GET[module]=='dokter'){

echo"

<a onclick='self.history.back()'>&laquo; Kembali</a>

<table class='hiasan'>

<tr align='left' class='hiasan'>

<th class='hiasan'>No</th>

<th class='hiasan'>Nama Dokter</th>

<th class='hiasan'>Spesialis</th>

<th class='hiasan'>Alamat</th>

<th class='hiasan'>Telepon</th>

<th class='hiasan'>Poliklinik</th>
<th class='hiasan'>Tarif</th>

</tr>";

$tampil=mysql_query("select*from dokter order by kodedkt");

$no=1;

while ($r=mysql_fetch_array($tampil)) {

echo"<tr class='hiasan'>

<td class='hiasan'>$no</td>

<td class='hiasan'>$r[namadkt]</td>

<td class='hiasan'>$r[spesialis]</td>

<td class='hiasan'>$r[alamatdkt]</td>

<td class='hiasan'>$r[telepondkt]</td>";

$plk=mysql_query("select*from poliklinik where kodeplk='$r[kodeplk]'");

$t=mysql_fetch_array($plk);

echo" <td class='hiasan' align='center'>$t[namaplk]</td>

<td class='hiasan'>Rp. $r[tarif]</td>

</tr>";

$no++;

echo"</table>";

elseif ($_GET[module]=='pasien') {

echo "<a onclick='self.history.back()'>&laquo; Kembali</a>

<table class='hiasan'>
<tr align='left' class='hiasan'>

<th class='hiasan' width='15'>No</th>

<th class='hiasan'>Nama Pasien</th>

<th class='hiasan'>Alamat</th>

<th class='hiasan'>Gender</th>

<th class='hiasan'>Umur</th>

<th class='hiasan'>No Telepon</th>

</tr>";

$tampil=mysql_query(" Select * from pasien order by kodepsn");

$no=1;

while ($a=mysql_fetch_array($tampil)) {

echo "<tr class='hiasan'>

<td class='hiasan'>$no</td>

<td class='hiasan'>$a[namapsn]</td>

<td class='hiasan'>$a[alamatpsn]</td>

<td class='hiasan'>$a[genderpsn]</td>

<td class='hiasan'>$a[umurpsn] Tahun</td>

<td class='hiasan'>$a[teleponpsn]</td>

</tr>";

$no++;

echo"</table>";

elseif ($_GET[module]=='poliklinik') {
echo "<a onclick='self.history.back()'>&laquo; Kembali</a>

<table class='hiasan'>

<tr align='left' class='hiasan'>

<th class='hiasan' width='15'>No</th>

<th class='hiasan'>Nama Poliklinik</th>

</tr>";

$tampil=mysql_query(" Select * from poliklinik order by kodeplk");

$no=1;

while ($a=mysql_fetch_array($tampil)) {

echo "<tr class='hiasan'>

<td class='hiasan'>$no</td>

<td class='hiasan'>$a[namaplk]</td>

</tr>";

$no++;

echo"</table>";

else if ($_GET[module]=='pendaftaran'){

echo"<p><a href='?module=home'>&laquo; Kembali</a></p>

<ul>

<li><a href='?module=mendaftar'>Mendaftar</a></li>

<li><a href='?module=daftar'>Lihat Daftar</a></li>

<li><a href='?module=pilihan'>Sudah Daftar ? Masuk menu pilihan</a></li>

</ul>
";

else if ($_GET[module]=='daftar'){

echo"<a onclick='self.history.back()'>&laquo; Kembali</a>

<table class='hiasan'>

<tr align='left' class='hiasan'>

<th class='hiasan'>No</th>

<th class='hiasan'>Tanggal Pendaftaran</th>

<th class='hiasan'>Dokter</th>

<th class='hiasan'>Pasien</th>

<th class='hiasan'>Poliklinik</th>

<th class='hiasan'>Biaya</th>

<th class='hiasan'>Keterangan</th>

</tr>";

$tampil=mysql_query("select*from pendaftaran order by nomorpendf");

$no=1;

while ($r=mysql_fetch_array($tampil)) {

echo"<tr class='hiasan'>

<td class='hiasan'>$no</td>

<td class='hiasan'>$r[tanggalpendf]</td>";

$dkt=mysql_query("select*from dokter where kodedkt='$r[kodedkt]'");

$a=mysql_fetch_array($dkt);

echo"

<td class='hiasan'>$a[namadkt]</td>";

$psn=mysql_query("select*from pasien where kodepsn='$r[kodepsn]'");


$b=mysql_fetch_array($psn);

echo"

<td class='hiasan'>$b[namapsn]</td>";

$plk=mysql_query("select*from poliklinik where kodeplk='$r[kodeplk]'");

$c=mysql_fetch_array($plk);

echo"

<td class='hiasan'>$c[namaplk]</td>

<td class='hiasan'>Rp. $r[biaya]</td>

<td class='hiasan'>$r[ket]</td>

</tr>";

$no++;

echo"</table>";

elseif($_GET[module]=='mendaftar'){

echo"

<h2>Silahkan isi form untuk daftar</h2>

<form method='post' action='aksi.php?module=pendf&act=input'>

<table>

<tr>

<td>Tanggal</td>

<td><input name='tgl' type='text'/></td>

</tr>

<tr>

<td>Dokter</td>

<td><select name='dkt'>";
$dkt=mysql_query("select*from dokter");

while($d=mysql_fetch_array($dkt)){

echo"<option value='$d[kodedkt]'>$d[namadkt]</option>"; }

echo"

</select></td>

</tr>

<tr>

<td>Pasien</td>

<td><select name='psn'>";

$psn=mysql_query("select*from pasien");

while($p=mysql_fetch_array($psn)){

echo"<option value='$p[kodepsn]'>$p[namapsn]</option>"; }

echo"

</select></td>

</tr>

<tr>

<td>Poliklinik</td>

<td><select name='plk'>";

$plk=mysql_query("select*from poliklinik");

while($l=mysql_fetch_array($plk)){

echo"<option value='$l[kodeplk]'>$l[namaplk]</option>"; }

echo"

</select></td>

</tr>
<tr>

<td>Biaya</td>

<td><input name='biaya' type='text' onkeydown='return jsOnlyNumber(event);'/></td>

</tr>

<tr>

<td>Keterangan</td>

<td><textarea name='ket' cols='30' rows='5' id='textarea'></textarea></td>

</tr>

<tr>

<td colspan='2' align='right'><input type=submit value=Simpan>

<input type='button' value=Batal onclick='self.history.back()'>

</td>

</tr>

</table></form>";

elseif($_GET[module]=='pilihan'){

echo"<h2>Silahkan pilih menu dibawah</h2>";

echo"<a href='?module=dokter'><img src='images/dokter.png'></a>

<a href='?module=poliklinik'><img src='images/poliklinik.png'></a>

<a href='?module=obat'><img src='images/obat.png'></a>

";

elseif ($_GET[module]=='obat') {

echo "<a onclick='self.history.back()'>&laquo; Kembali</a>

<table class='hiasan'>

<tr align='left' class='hiasan'>


<th class='hiasan' width='15'>No</th>

<th class='hiasan'>Nama Obat</th>

<th class='hiasan'>Jenis Obat</th>

<th class='hiasan'>Kategori</th>

<th class='hiasan'>Harga Obat</th>

<th class='hiasan'>Jumlah Obat</th>

<th class='hiasan'>Beli Obat</th>

</tr>";

$tampil=mysql_query(" Select * from obat order by kodeobat");

$no=1;

while ($a=mysql_fetch_array($tampil)) {

echo "<tr class='hiasan'>

<td class='hiasan'>$no</td>

<td class='hiasan'>$a[namaobat]</td>

<td class='hiasan'>$a[jenisobat]</td>

<td class='hiasan'>$a[kategori]</td>

<td class='hiasan'>$a[hargaobat]</td>

<td class='hiasan'>$a[jumlahobat]</td>";

$beli=mysql_query("select*from beliobat order by kodebeli");

$b=mysql_fetch_array($beli);

echo" <td class='hiasan'><a href='?module=beli&id=$b[kodebeli]'>Beli</a></td>

</tr>";

$no++;
}

echo"</table>";

elseif($_GET[module]=='beli'){

$beli=mysql_query("select*from beliobat WHERE kodebeli='$_GET[id]'");

echo"

<form method='post' action='aksi.php?module=byr&act=input'>

<table>

<tr>

<td>Pasien</td>

<td><select name='psn'>";

$psn=mysql_query("select*from pasien");

while($p=mysql_fetch_array($psn)){

echo"<option value='$p[kodepsn]'>$p[namapsn]</option>"; }

echo"

</select></td>

</tr>

<tr>

<td>Tanggal</td>

<td><input name='tgl' type='text'/></td>

</tr>

<tr>

<td>Jumlah</td>

<td><input name='jumlah' type='text' onkeydown='return jsOnlyNumber(event);'/></td>

</tr>
<tr>

<td colspan='2' align='right'><input type=submit value=Simpan>

<input type='button' value=Batal onclick='self.history.back()'>

</td>

</tr>

</table></form>";

?>

Potrebbero piacerti anche