<?php
    include('loginsession.php');
    error_reporting(E_ALL);
    $filename = __FILE__;  //---Nama file saat ini
    if (strlen(__FILE__) > 48) {$filename = substr(__FILE__, 48);}
    $save = mysqli_query($conn, "INSERT INTO novia_abc_user_logs (userid,filename) VALUES ('$userini_id','$filename')");
//-------------
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//ID" "http://www.w3.org/TR/html4/frameset.dtd">
<html lang="id">
<head>
    <title>EDIT DATA</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="css/style.css">
	<link href="images/balance.ico" rel="icon" type="image/icon" />
</head>
<body>

<?php
//ambil data berdasarkan parameter GET id
$b = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM novia_abc_biodata where id='$_GET[id]'"));

?>
	<table width="100%" max-width="600px" cellpadding="5" align="center">
		<tbody>
			<tr class="satu">
				<td width="50%"><a href="biodata.php?id=<?php echo $b["id"];?>" title="Batalkan pengeditan data pasien"><button style="padding : 10px; width:100%">CANCEL</button></a></td>
				<td width="50%"><a href="index.php?id=<?php echo $b["id"];?>" title="Kembali ke halaman awal"><button style="padding : 10px; width:100%">HOME</button></a></td>
			</tr>
		</tbody>
	</table>

<form  method="post"  action="biodata_edit_update.php?id=<?php echo $b["mr"];?>">
    <table width="100%" max-width="600px" cellpadding="5" align="center">
    <tr class="satu">
		<td colspan="3" style='text-transform:uppercase' align="center">
			<h1><?php echo $b['mr']; ?> - <?php echo $b['name'];?></h1>
		</td>
	</tr>
    <tr class="head" align="left">
		<th width="150">Parameter</th>
        <th>Edit Data Pasien</th>
    </tr>
    <tr class="satu"><td colspan="3"></td></tr>
    <tr class="dua">
        <td>ID</td>
        <td><?php echo $b['mr']; ?></td>
    </tr>
    <tr class="satu">
        <td>MR</td>
        <td><?php echo $b['mr']; ?></td>
    </tr>
    <tr class="dua">
        <td>NAMA</td>
        
        <td><input type="text" name="name" placeholder="Nama Pasien" size="20" maxlength="30" value="<?php echo $b['name'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>HANDPHONE</td>
        
        <td><input type="text" name="phone_wa" placeholder="+62" size="20" maxlength="30" value="<?php echo $b['phone_wa'];?>"/></td>
    </tr>
    <tr class="dua">
        <td>OTHER PHONE</td>
        
        <td><input type="text" name="phone_home" placeholder="+62" size="20" maxlength="30" value="<?php echo $b['phone_home'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>ALAMAT</td>
        
        <td><textarea name="street_address" placeholder="Alamat" rows="5" cols="22"/><?php echo $b['street_address'];?></textarea></td>
    </tr>
    <tr class="dua">
        <td>KELURAHAN</td>
        
        <td><input type="text" name="kelurahan" placeholder="Kelurahan" size="20" maxlength="50" value="<?php echo $b['kelurahan'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>KECAMATAN</td>
        
        <td><input type="text" name="kecamatan" placeholder="Kecamatan" size="20" maxlength="50" value="<?php echo $b['kecamatan'];?>"/></td>
    </tr>
    <tr class="dua">
        <td>KOTA</td>
        
        <td><input type="text" name="city" placeholder="Kota" size="20" maxlength="50" value="<?php echo $b['city'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>PROPINSI</td>
        
        <td><input type="text" name="state" placeholder="Propinsi" size="20" maxlength="50" value="<?php echo $b['state'];?>"/></td>
    </tr>
    <tr class="dua">
        <td>KODE POS</td>
        
        <td><input type="text" name="kode_pos" placeholder="Kode Pos" size="20" maxlength="50" value="<?php echo $b['kode_pos'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>EMAIL</td>
        
        <td><input type="text" name="email" placeholder="Email" size="20" maxlength="30" value="<?php echo $b['email'];?>"/></td>
    </tr>
    <tr class="dua">
        <td>Pertama Datang</td>
        
		<td><input type="text" name="firstcome" placeholder="Pertama Datang" size="20" maxlength="30" value="<?php echo $b['firstcome'];?>"/></td>
    </tr>
    <tr class="dua">
        <td>Terakhir Datang</td>
        
		<td><input type="text" name="lastcome" placeholder="Terakhir Datang" size="20" maxlength="30" value="<?php echo $b['lastcome'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>Tanggal Lahir</td>
        
		<td><input type="text" name="birthday" placeholder="Pertama Datang" size="20" maxlength="30" value="<?php echo $b['birthday'];?>"/></td>
    </tr>
    <tr class="dua">
        <td>Tinggi Badan</td>
        
        <td><input type="text" name="height" placeholder="Tinggi Badan" size="20" maxlength="50" value="<?php echo $b['height'];?>"/></td>
    </tr>
	
    <tr class="dua">
        <td>CATATAN</td>
        
        <td><textarea name="note" placeholder="Catatan" rows="3" cols="22"/><?php echo $b['note'];?></textarea></td>
    </tr>
    <tr class="satu">
		<td><input type="text" name="password" placeholder="Masukkan Password" size="15" maxlength="30" value=""/></td>
        <td colspan="1"><button type="submit" name="simpan" style="padding: 10px; width: 100%">SIMPAN SEMUA PERUBAHAN</button></td>
		
    </tr>
</table>
</form>


</body>
</html>