<?php
include('koneksi.php');
?>
<html>
<head>
<title>From Evaluasi</title>
</head>
<body>
<table width="520" bgcolor="#CCCC99">
<tr>
<td width="305" align="center">
<h1>Form Input Data</h1>
</td></tr></table>
<table><tr><td>
<?php
$id = $_GET['id'];
$query = mysql_query("select * from evaluasi where kd_evaluasi='$id'") or die(mysql_error());
$data = mysql_fetch_array($query);
// memecah tanggal dari MySQL
// menggunakan separator '-'
$pecahTanggal = explode("-", $data['tgl_sekarang']);
$tanggal = $pecahTanggal[2];
$bulan = $pecahTanggal[1];
$tahun = $pecahTanggal[0];
?>
</td></tr></table>
<form name="update_data" action="updatedataevaluasi.php" method="post">
<input type="hidden" name="kd_evaluasi" value="<?php echo $id; ?>" />
<table width="519" border="0" cellpadding="5" cellspacing="0" bgcolor="#CCCC99">
<tbody>
<tr>
<td width="217">Kode Evaluasi</td>
<td width="8">:</td>
<td width="264">
<input type="text" name="kd_evaluasi" maxlength="20" required="required" value="<?php echo $data['kd_evaluasi']; ?>" disabled />
</td>
</tr>
<tr>
<td>Tanggal Evaluasi</td>
<td>:</td>
<td><select name=\"tgl\">
<?
for ($tgl=1; $tgl<=31; $tgl++)
{
if ($tgl == $tanggal) echo "<option value=\"
".$tgl."\" selected>".$tgl.
"</option>";
else echo "<option value=\"".$tgl."\">".$tgl."</item>";
}
?>
</select>
<select name=\"bln\">
<?
for ($bln=1; $bln<=12; $bln++)
{
if ($bln == $bulan) echo "<option value=\"
".$bln."\" selected>".$bln.
"</option>";
else echo "<option value=\"".$bln."\">".$bln."</option>";
}
?>
</select>
<select name=\"thn\">
<?
for ($thn=1940; $thn<=2040; $thn++)
{
if ($thn == $tahun) echo "<option value=\"
".$thn."\" selected>".$thn.
"</option>";
else echo "<option value=\"".$thn."\">".$thn."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Nama Pasien</td>
<td>:</td>
<td>
<select name="no_rm">
<?php
// query untuk menampilkan semua pasien
$query = "SELECT * FROM pasien";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil))
{
if ($data['no_rm'] == $r['no_rm'])
{
echo "<option value='".$data['no_rm']."' selected>".$data['nm_pasien']."</option>";
}
// setiap pasien yang dibaca dari tabel disisipkan ke tag <option></option>
else{
echo "<option value='".$data['no_rm']."'>".$data['nm_pasien']."</option>";
}
}
?>
</select>
</td>
</tr>
<tr>
<td>Pilih Dokter</td>
<td>:</td>
<td>
<select name="kd_dokter">
<?php
// query untuk menampilkan semua dokter
$query = "SELECT * FROM dokter";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil))
{
if ($data['kd_dokter'] == $r['kd_dokter'])
{
// setiap dokter yang dibaca dari tabel disisipkan ke tag <option></option>
echo "<option value='".$data['kd_dokter']."' selected>".$data['nm_dokter']."</option>";
}
else
{
// setiap dokter yang dibaca dari tabel disisipkan ke tag <option></option>
echo "<option value='".$data['kd_dokter']."'>".$data['nm_dokter']."</option>";
}
}
?>
</select>
</td>
</tr>
<tr>
<td>Pilih Ruangan</td>
<td>:</td>
<td>
<select name="kd_ruangan">
<?php
// query untuk menampilkan semua ruangan
$query = "SELECT * FROM ruangan";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil))
{
if ($data['kd_ruangan'] == $r['kd_ruangan'])
{
// setiap ruangan yang dibaca dari tabel disisipkan ke tag <option></option>
echo "<option value='".$data['kd_ruangan']."' selected>".$data['nm_ruangan']."</option>";
}
else
{
// setiap ruangan yang dibaca dari tabel disisipkan ke tag <option></option>
echo "<option value='".$data['kd_ruangan']."'>".$data['nm_ruangan']."</option>";
}
}
?>
</select>
</td>
</tr>
<tr>
<td>Formulir Diagnosa</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select diagnosa from evaluasi");
$data = mysql_fetch_array($query);
?>
<input type="radio" name="diagnosa" value="L" <? echo $data['diagnosa'] == 'L' ? 'checked="checked"' : '';?>/> Lengkap
<input type="radio" name="diagnosa" value="TL" <? echo $data['diagnosa'] == 'TL' ? 'checked="checked"' : '';?> /> Tidak Lengkap
</td>
</tr>
<tr>
<td>Formulir Ringkasan Masuk Keluar</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select ringkasan_msk_klr='L' from evaluasi");
$data = mysql_fetch_array($query);
?>
<input type="radio" name="ringkasan_msk_klr" value="L" <? echo $data['ringkasan_msk_klr'] == 'L' ? 'checked="checked"' : '';?>/> Lengkap
<input type="radio" name="ringkasan_msk_klr" value="TL" <? echo $data['ringkasan_msk_klr'] == 'TL' ? 'checked="checked"' : '';?> /> Tidak Lengkap
</td>
</tr>
<tr>
<td>Catatan Perkembangan</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select ctt_perkembangan='L' from evaluasi");
$data = mysql_fetch_array($query);
if ($query)
{
echo"<input type='radio' name='ctt_perkembangan' value='L' checked>Lengkap";
echo"<input type='radio' name='ctt_perkembangan' value='TL' >Tidak Lengkap";
}
else
{
echo"<input type='radio' name='ctt_perkembangan' value='L'>Lengkap";
echo"<input type='radio' name='ctt_perkembangan' value='TL' checked >Tidak Lengkap";
}
?>
</td>
</tr>
<tr>
<td>Catatan Perawat</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select ctt_perawat='L' from evaluasi");
$data = mysql_fetch_array($query);
if ($query)
{
echo"<input type='radio' name='ctt_perawat' value='L' checked>Lengkap";
echo"<input type='radio' name='ctt_perawat' value='TL' >Tidak Lengkap";
}
else
{
echo"<input type='radio' name='ctt_perawat' value='L'>Lengkap";
echo"<input type='radio' name='ctt_perawat' value='TL' checked >Tidak Lengkap";
}
?>
</td>
</tr>
<tr>
<td>Lembaran Pengobatan</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select lmbr_pengobatan='L' from evaluasi");
$data = mysql_fetch_array($query);
if ($query)
{
echo"<input type='radio' name='lmbr_pengobatan' value='L' checked>Lengkap";
echo"<input type='radio' name='lmbr_pengobatan' value='TL' >Tidak Lengkap";
}
else
{
echo"<input type='radio' name='lmbr_pengobatan' value='L'>Lengkap";
echo"<input type='radio' name='lmbr_pengobatan' value='TL' checked >Tidak Lengkap";
}
?>
</td>
</tr>
<tr>
<td>Inform Consent</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select inform_consent='L' from evaluasi");
$data = mysql_fetch_array($query);
if ($query)
{
echo"<input type='radio' name='inform_consent' value='L' checked>Lengkap";
echo"<input type='radio' name='inform_consent' value='TL' >Tidak Lengkap";
}
else
{
echo"<input type='radio' name='inform_consent' value='L'>Lengkap";
echo"<input type='radio' name='inform_consent' value='TL' checked >Tidak Lengkap";
}
?>
</td>
</tr>
<tr>
<td>Resume Medis</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select resume_medis='L' from evaluasi");
$data = mysql_fetch_array($query);
if ($query)
{
echo"<input type='radio' name='resume_medis' value='L' checked>Lengkap";
echo"<input type='radio' name='resume_medis' value='TL' >Tidak Lengkap";
}
else
{
echo"<input type='radio' name='resume_medis' value='L'>Lengkap";
echo"<input type='radio' name='resume_medis' value='TL' checked >Tidak Lengkap";
}
?>
</td>
</tr>
<tr>
<td>Resep</td>
<td>:</td>
<td>
<?php
$query = mysql_query("select resep='L' from evaluasi");
$data = mysql_fetch_array($query);
if ($query)
{
echo"<input type='radio' name='resep' value='L' checked>Lengkap";
echo"<input type='radio' name='resep' value='TL' >Tidak Lengkap";
}
else
{
echo"<input type='radio' name='resep' value='L'>Lengkap";
echo"<input type='radio' name='resep' value='TL' checked >Tidak Lengkap";
}
?>
</td>
</tr>
<tr>
<td align="right" colspan="3"><input type="submit" name="submit" value="Simpan" /></td>
</tr>
</tbody>
</table>
</form>
<a href="viewdataevaluasi.php">Lihat Data</a>
</body>
</html>
<?php
session_start();
include "../connect.php";
if($_POST){
$id_per = $_POST['id'];
$perusahaan = $_POST['perusahaan'];
$alamat = $_POST['alamat'];
$email = $_POST['email'];
$telpon = $_POST['telpon'];
$fax = $_POST['fax'];
$ket_per=$_POST['ket_per'];
$polaemail="^.+@.+\..+$";
$polatelpon="^[0-9]+$";
$polafax="^[0-9]+$";
$error=array();
if(empty($perusahaan)){
$error['perusahaan']='Nama perusahaan tidak boleh kosong';
}
if(!empty($telpon)){
if(!is_numeric($telpon)){
$error['telpon']='Nomor telpon harus berupa angka';
}
}
if(!empty($fax)){
if(!is_numeric($fax)){
$error['fax']='Nomor fax harus berupa angka';
}
}
if(!empty($email)){
if(!eregi($polaemail, $email)){
$error['email']='Email contohnya siloker@gmail.com';
}
}
if(empty($error)){
$sql = "insert into perusahaan(id_per,perusahaan,alamat,email,telpon,fax,ket_per) values('$id_per','$perusahaan','$alamat','$email','$telpon','$fax', '$ket_per')";
$hasil=mysql_query($sql);
if ($hasil) header('location:perusahaan.php');
else echo "<h1>Tambah perusahaan gagal</h1>";
}
else{
$_SESSION['error']=$error;
$_SESSION['post']=$_POST;
header('location:tambah_perusahaan.php');
}
}
?>
<?php
session_start();
if(isset($_SESSION['error'])){
$error=$_SESSION['error'];
$_POST=$_SESSION['post'];
unset($_SESSION['error']);
unset($_SESSION['post']);
}
include "../connect.php";
$hasil = mysql_query("SELECT max(id_per) as maxID FROM perusahaan");
$data = mysql_fetch_array($hasil);
$idMax=$data['maxID'];
// mengambil angka atau bilangan dalam kode anggota terbesar,
// dengan cara mengambil substring mulai dari karakter ke-0 diambil 5 karakter
// misal '001', akan diambil '001'
// setelah substring bilangan diambil lantas dicasting menjadi integer
$noUrut = (int) substr($idMax, 0, 3);
// bilangan yang diambil ini ditambah 1 untuk menentukan nomor urut berikutnya
$noUrut++;
// membentuk kode anggota baru
// perintah sprintf("%03s", $noUrut); digunakan untuk memformat string sebanyak 3 karakter
// misal sprintf("%03s", 12); maka akan dihasilkan '012'
// atau misal sprintf("%03s", 1); maka akan dihasilkan string '001'
$newID = sprintf("%03s", $noUrut);
// kode anggota yang baru di atas nanti akan ditampilkan dalam komponen text box
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Situs Lowongan Kerja Universitas Kristen Duta Wacana</title>
<link href="../adminstyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="wrapper">
<div id="header-wrapper"><a href="../index.php"><img src="../images/silokerukdw.jpg"/></a>
<!--<div id="header">
<div id="logo">
</div>
</div>-->
</div>
</div>
<!-- end #header -->
<div id="navigation">
<ul>
<a href="hal_admin.php">ADMIN </a>
<li id="current"><a href="perusahaan.php">PERUSAHAAN</a></li>
<a href="lowongan.php">LOWONGAN</a>
<a href="kriteria.php">KRITERIA</a>
<a href="logout.php">LOGOUT</a>
</ul>
</div>
<!-- end #navigation -->
<div id="page">
<div id="content">
<p>
<?php
if(empty($_SESSION[user])and empty($_SESSION[pass])){
echo "<center>Untuk mengakses data, anda harus LOGIN dulu</center><br>";
echo "<center><a href=login.php><b>LOGIN</b></a></center>";
}
//kalau sudah login benar
else{
echo "<h2>Tambah Data Perusahaan :</h2>
<form method=post action=input_perusahaan.php>
<table>
<tr>";?>
<td class=noborder>ID Perusahaan</td>
<td class=noborder>:</td>
<td class=noborder><input type="text" name="id_per" maxlength="4" value="<?php echo $newID; ?>" size=10 disabled/>
<input name="id" type="hidden" value="<?php echo $newID; ?>" /></td>
</tr>
<tr>
<?php
echo"<td class=noborder>Nama Perusahaan</td>
<td class=noborder>:</td>";
?>
<td class=noborder><input name="perusahaan" id="perusahaan" type="text" size="50" maxlength="75" value="<?php echo isset($_POST['perusahaan']) ? $_POST['perusahaan'] : '';?>" /></td>
<td class=noborder><font size=-3>*)harus diisi</font></td>
</tr>
<tr>
<td class="noborder" colspan="2"></td>
<td class="noborder"><div style="color:#F00"><?php echo isset($error['perusahaan'])?$error['perusahaan']:''; ?></div></td>
</tr>
<?php
echo "<tr>
<td class=noborder>Alamat</td>
<td class=noborder>:</td>
<td class=noborder><input type=text name=alamat size=50 maxlength=100 ></td>
</tr>
<tr>
<td class=noborder>Email</td>
<td class=noborder>:</td>";
?>
<td class=noborder><input name="email" id="email" type="text" value="<?php echo isset($_POST['email']) ? $_POST['email'] : '';?>" /></td>
</tr>
<tr>
<td class="noborder" colspan="2"></td>
<td class="noborder"><div style="color:#F00"><?php echo isset($error['email'])?$error['email']:''; ?></div></td>
</tr>
<?php
echo "<tr>
<td class=noborder>No. Telp</td>
<td class=noborder>:</td>";
?>
<td class=noborder><input name="telpon" id="telpon" type="text" value="<?php echo isset($_POST['telpon']) ? $_POST['telpon'] : '';?>" /></td>
</tr>
<tr>
<td class="noborder" colspan="2"></td>
<td class="noborder"><div style="color:#F00"><?php echo isset($error['telpon'])?$error['telpon']:''; ?></div></td>
</tr>
<?php
echo "<tr>
<td class=noborder>Fax</td>
<td class=noborder>:</td>";
?>
<td class=noborder><input name="fax" id="fax" type="text" value="<?php echo isset($_POST['fax']) ? $_POST['fax'] : '';?>" /></td>
</tr>
<tr>
<td class="noborder" colspan="2"></td>
<td class="noborder"><div style="color:#F00"><?php echo isset($error['fax'])?$error['fax']:''; ?></div></td>
</tr>
<?php
echo "<tr>
<td class=noborder>Keterangan</td>
<td class=noborder>:</td>";
?>
<td class=noborder><textarea name=ket_per cols=50 rows=4><?php echo "$r[ket_per]";?></textarea></td>
</tr>
<?php
echo "<td colspan=4 class=noborder><input type=submit name=submit value=Simpan>
<a href=perusahaan.php><input type=button value=Batal></a></td>
</table>";
}
?>
</p>
<p> </p>
</div>
</div>
<div id="footer">
© 2012 Situs Lowongan Kerja UKDW
</div>
</body>
</html>
<?
$submit=$_POST['submit'];
if(!isset($submit)){
?>
<blink>Galeri Foto</blink><br><br>
<form method=POST action=<? $PHP_SELF;?>>
<td><form name="form_upload" enctype="multipart/form-data">
Foto <td> <input type="file" name="foto"><br>
</td></tr>
<td colspan=2 align='center'><input type='submit' name='submit' value='submit'></td></tr>
</form></table>
</center>
<?
}else{
$foto = $_FILES['picture']['foto'];
$fileSize = $_FILES['picture']['size'];
$fileError = $_FILES['picture']['error'];
if($fileSize > 0 || $fileError == 0){
$move = move_uploaded_file($_FILES['picture']['tmp_name'], 'upload/'.$foto);
if($move){
echo "Gambar berhalil diupload";
}else{
echo "Gagal mengupload gambar";
}
}else{
echo "Gagal mengupload gambar: ".$fileError;
}