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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//ID" "http://www.w3.org/TR/html4/frameset.dtd">
<html lang="id">
<head>
   <title>PASIEN BARU</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"/>
	<style>
 		img {
            width: 100%;
            max-width: 500px;
            height: auto;
        }
    </style>	
</head>
<body>

    <div><img src="images/logo_blue.png" alt="Deskripsi Gambar"></div>

	<table width="100%" max-width="600px"" cellpadding="5" align="center">
		<tr class="satu">
			<td><a href="index.php" title="KEMBALI"><button style="padding : 10px; width:100%">CANCEL</button></a></td>
		</tr>
	</table>

    <form  method="post"  action="biodata-new-insert.php?id=<?php echo $no;?>">
	<table width="100%" max-width="600px" cellpadding="5" align="center">
    <tr class="satu"><td colspan="3"><h1>Input Pasien Baru</h1></td></tr>
    <tr class="head" align="left">
		<th width="150">Parameter</th>
        <th>Input Data Pasien</th>
    </tr>
    <tr class="satu"><td colspan="3"></td></tr>
    <tr class="dua">
        <td>ID</td>
        <td><?php echo $no;  ?></td>
    </tr>
    <tr class="satu">
        <td>MR</td>
        <td><?php echo $no;  ?></td>
    </tr>
    <tr class="dua">
        <td>NAMA</td>
        <td><input type="text" name="name" placeholder="Nama" size="20" maxlength="30" value=""/></td>
    </tr>
    <tr class="satu">
        <td>HANDPHONE</td>
        <td><input type="text" name="phone_wa" placeholder="+62" size="20" maxlength="30" value="+62"/></td>
    </tr>
    <tr class="dua">
        <td>OTHER PHONE</td>
        <td><input type="text" name="phone_home" placeholder="+62" size="20" maxlength="30" value="+62"/></td>
    </tr>
    <tr class="satu">
        <td>ALAMAT</td>
        <td><textarea name="street_address" placeholder="Alamat" rows="3" cols="23"/></textarea></td>
    </tr>
    <tr class="dua">
        <td>KELURAHAN</td>
        <td><input type="text" name="kelurahan" placeholder="Kelurahan" size="20" maxlength="50" value=""/></td>
    </tr>
    <tr class="satu">
        <td>KECAMATAN</td>
        <td><input type="text" name="kecamatan" placeholder="Kecamatan" size="20" maxlength="50" value=""/></td>
    </tr>
    <tr class="dua">
        <td>KOTA</td>
        <td><input type="text" name="city" placeholder="Kota" size="20" maxlength="50" value=""/></td>
    </tr>
    <tr class="satu">
        <td>PROVINSI</td>
        <td><input type="text" name="state" placeholder="Provinsi" size="20" maxlength="50" value=""/></td>
    </tr>
    <tr class="dua">
        <td>KODE POS</td>
        <td><input type="text" name="kode_pos" placeholder="Kode Pos" size="20" maxlength="50" value=""/></td>
    </tr>
    <tr class="satu">
        <td>EMAIL</td>
        <td><input type="text" name="email" placeholder="Email" size="20" maxlength="30" value=""/></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="0000-00-00"/></td> 
    </tr>
    <tr class="dua">
        <td>Tinggi Badan</td>
        <td><input type="text" name="height" placeholder="Tinggi Badan" size="20" maxlength="50" value=""/></td>
    </tr>
	
    <tr class="dua">
        <td>CATATAN</td>
        <td><textarea name="note" placeholder="Catatan" rows="3" cols="23"/></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>
    </table>
    </form>
</body>
</html>