<?php
    include('loginsession.php');
    error_reporting(E_ALL);
    $filename = __FILE__;
    if (strlen(__FILE__) > 48) {$filename = substr(__FILE__, 48);}
    $save = mysqli_query($conn, "INSERT INTO novia_abc_user_logs (userid,filename) VALUES ('$userini_id','$filename')");
//-------------
	$medrek = $_GET['imr'];
	$medrek1 = substr($medrek,0,5);
	$tanggal_1 = substr($medrek,6,10);
	$id = substr($medrek,17);
?>

<!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
$b = mysqli_fetch_array(mysqli_query($conn, "SELECT id, name FROM novia_abc_biodata where mr='$medrek1'"));
$c = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM novia_abc_visit where id='$id'"));
$tanggal = $c['date_'];
$_jok = $c["date_"];
$dt = new DateTime($_jok);
$currdate = $dt->format('Y-m-d');
		if ($currdate == $tanggal) {
			$tglmuncul = $c["date_"];
		}


$today = date("Y-m-d");
?>
	<table width="100%" max-width="600px" cellpadding="5" align="center">
		<tbody>
			<tr class="dua">
				<td width="50%"><a href="visit-daily.php?tanggal=<?php echo $currdate;?>" 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="status-view-edit-update.php?imr=<?php echo $medrek ?>">
    <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 $c['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 Visit</td>
        
        <td><?php echo $c['id']; ?></td>
    </tr>
    <tr class="satu">
        <td>MR</td>
        <td><?php echo $c['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>SISTOLE - TDA</td>
        <td><input type="text" name="sistole" placeholder="" size="1" maxlength="3" value="<?php echo $c['sistole'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>DIASTOLE - TDB</td>
        <td><input type="text" name="diastole" placeholder="" size="1" maxlength="3" value="<?php echo $c['diastole'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>NADI</td>
        <td><input type="text" name="pulse" placeholder="" size="1" maxlength="3" value="<?php echo $c['pulse'];?>"/></td> 
    </tr>
    <tr class="satu">
        <td>BB</td>
        <td><input type="text" name="weight" placeholder="" size="1" maxlength="3" value="<?php echo $c['weight'];?>"/></td>
    </tr>
    
    <tr class="satu">
        <td>ANAMNESA<BR>PEMERIKSAAN<BR>DIAGNOSA</td>
        <td><textarea name="anamnesa" placeholder="" rows="5" cols="22"/><?php echo $c['anamnesa'];?></textarea></td>
        
    </tr>
    <tr class="dua">
        <td>TINDAKAN</td>
        <td><textarea name="tindakan" placeholder="" rows="5" cols="22"/><?php echo $c['tindakan'];?></textarea></td>
        
    </tr>
    
    
    <tr class="satu">
        <td>Jarum</td>
        <td><input type="text" name="pin" placeholder="" size="1" maxlength="3" value="<?php echo $c['pin'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>Procain</td>
        <td><input type="text" name="procain" placeholder="" size="1" maxlength="3" value="<?php echo $c['procain'];?>"/></td>
    </tr>
    <tr class="satu">
        <td>Colagen</td>
        <td><input type="text" name="colagen" placeholder="" size="1" maxlength="3" value="<?php echo $c['colagen'];?>"/></td> 
    </tr>
    <tr class="satu">
        <td>Tation</td>
        <td><input type="text" name="tation" placeholder="" size="1" maxlength="3" value="<?php echo $c['tation'];?>"/></td>
    </tr>
    
    
    <tr class="satu">
        <td>BIAYA</td>
        <td><input type="text" name="biaya" placeholder="" size="20" maxlength="30" value="<?php echo $c['biaya'];?>"/></td>
    </tr>
    <tr class="dua">
        <td>Tanggal</td>
        
        <td><input type="text" name="tanggal" placeholder="" size="20" maxlength="30" value="<?php echo $tanggal;?>"/></td>
    </tr>
    <tr class="satu">
		<td><input type="text" name="password" placeholder="Masukkan Password" size="15" maxlength="30" value=""/></td>
        <td colspan="3"><button type="submit" name="simpan" style="padding: 10px; width: 100%">SIMPAN SEMUA PERUBAHAN</button></td>
		
    </tr>
</table>
</form>
<br><br>
</body>
</html>