<?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')");
//-------------
    $no = 1;
    $sql = "SELECT mr FROM novia_abc_biodata ORDER BY mr DESC ";
    $result = $conn->query($sql);
    if ($result->num_rows > 0) {
        while($row = $result->fetch_assoc()) {
    		$no++;
    	}
    }
    $b = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM novia_abc_onlineform where id='$_GET[id]'"));
//---
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//ID" "http://www.w3.org/TR/html4/frameset.dtd">
<html lang="id">
    <head>
       <title>INPUT PASIEN BARU DARI ONLINE</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>

	<table width="100%" max-width="600px"" cellpadding="5" align="center">
		<tbody>
			<tr class="satu">
				<td><a href="administrasi.php?id=<?php echo $b['id']; ?>" title="KEMBALI"><button style="padding : 10px; width:100%">CANCEL</button></a></td>
			</tr>
		</tbody>
	</table>

<form  method="post"  action="online_to_biodata_insert.php?id=<?php echo $b['id']; ?>">
	<table width="100%" max-width="600px" cellpadding="5" align="center">
    <tbody>
    <tr class="satu"><td colspan="3"><h1>Input Pasien Baru dari Data Online</h1><?php echo $error;?></td></tr>
    <tr class="head" align="left">
		<th width="150">Parameter</th>
        <th>Input Data Pasien</th>
    </tr>
    <tr class="satu"><td colspan="3"><?php echo $error;?></td></tr>
    <tr class="dua">
        <td>ID</td>
        <td><?php echo $no;  ?></td>
    </tr>
    <tr class="satu">
        <td>MR</td>
        <td><input type="text" name="mr" placeholder="mr" size="20" maxlength="30" autocomplete="off" autofocus value="<?php echo $no;  ?>"/></td>
    </tr>
    <tr class="dua">
        <td>NAMA</td>
        <td><input type="text" name="name" placeholder="Nama" 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="3" cols="23"/><?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>PROVINSI</td>
        <td><input type="text" name="state" placeholder="Provinsi" 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="Tanggal Sekarang" size="20" maxlength="30" value="<?php echo date("Y-m-d");?>"/></td> 
    </tr>
    <tr class="satu">
        <td>Tanggal Lahir</td>
        <td><input type="text" name="birthday" placeholder="Tanggal lahir" size="20" maxlength="30" value="<?php echo $b['birthday'];?>"/></td> 
    </tr>
    <tr class="dua">
        <td>CATATAN</td>
        <td><textarea name="note" placeholder="Catatan" rows="3" cols="23"/><?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 DATA</button</td>
    </tr>
</tbody>
</table>
</form>
</body>
</html>