-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistrasi.php
172 lines (163 loc) · 8.62 KB
/
registrasi.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
function auto_kode(){
include 'koneksi.php';
$num = '';
$prefix = 'RM';
$query = "SELECT MAX(id) AS kode FROM rekam_medis";
$run = mysqli_query($config,$query);
$data = mysqli_fetch_array($run);
$row = mysqli_fetch_row($run);
$num = $data["kode"];
$number = (int)substr($num, 2,5);
$number++;
if ($row > 0) {
return 'kode telah digunakan';
} else {
$value = $prefix.sprintf("%05s", $number);
}
return $value;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registrasi Pasien Baru</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-datepicker.min.css">
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="#">Klinik Tong Fang</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="index.php">Menu Utama</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<br>
<br>
</form>
</div>
</nav>
<br>
<br>
<div class="container">
<br><br>
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Form Pendaftaran Pasien</div>
<div class="card-body">
<form action="ambil.php" method="post">
<div class="form-group row">
<label for="id" class="col-md-4 col-form-label text-md-right">No. Rekam Medis</label>
<div class="col-md-6">
<input type="text" id="id" class="form-control" name="id" value="<?php echo auto_kode() ?>" readonly>
</div>
</div>
<div class="form-group row">
<label for="nik" class="col-md-4 col-form-label text-md-right">NIK</label>
<div class="col-md-6">
<input type="number" id="nik" class="form-control" name="nik" required autofocus placeholder="Masukkan NIK Anda">
</div>
</div>
<div class="form-group row">
<label for="nama" class="col-md-4 col-form-label text-md-right">Nama Lengkap</label>
<div class="col-md-6">
<input type="text" id="nama" class="form-control" name="nama" required autofocus placeholder="Masukkan Nama Lengkap Anda">
</div>
</div>
<div class="form-group row">
<label for="tempat_lahir" class="col-md-4 col-form-label text-md-right">Tempat Lahir</label>
<div class="col-md-6">
<input type="text" id="tempat_lahir" class="form-control" name="tempat_lahir" required autofocus placeholder="Masukkan Tempat Lahir Anda">
</div>
</div>
<div class="form-group row">
<label for="tgl_lahir" class="col-md-4 col-form-label text-md-right">Tanggal Lahir</label>
<div class="col-md-6">
<input type="date" id="tgl_lahir" class="form-control" name="tgl_lahir" required autofocus>
</div>
</div>
<div class="form-group row">
<label for="alamat" class="col-md-4 col-form-label text-md-right">Alamat</label>
<div class="col-md-6">
<input type="text" id="alamat" class="form-control" name="alamat" required autofocus placeholder="Masukkan Alamat Anda">
</div>
</div>
<div class="form-group row">
<label for="keluhan" class="col-md-4 col-form-label text-md-right">Keluhan</label>
<div class="col-md-6">
<textarea class="form-control" name="keluhan" id="keluhan" cols="10" rows="10" required placeholder="Jelaskan Keluhan Anda"></textarea>
</div>
</div>
<div class="form-group row">
<label for="poli" class="col-md-4 col-form-label text-md-right">Poli</label>
<div class="col-md-6">
<select class="form-control" id="poli" name="poli" required autofocus>
<option>Poli Umum</option>
<option>Poli Gigi</option>
<option>Poli Jantung</option>
<option>Poli Hati</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="tgl_daftar" class="col-md-4 col-form-label text-md-right">Tanggal Daftar</label>
<div class="col-md-6">
<input type="date" id="tgl_daftar" class="form-control" name="tgl_daftar" readonly autofocus>
</div>
</div>
<div class="form-group row">
<label for="tgl_janji" class="col-md-4 col-form-label text-md-right">Tanggal Janji</label>
<div class="col-md-6">
<input type="date" id="tgl_janji" class="form-control" name="tgl_janji" required autofocus>
</div>
</div>
<div class="form-group row">
<label for="no_hp" class="col-md-4 col-form-label text-md-right">No HP/WA</label>
<div class="col-md-6">
<input type="tel" id="no_hp" class="form-control" name="no_hp" required autofocus placeholder="Masukkan No HP/WA yang Valid">
</div>
</div>
<div class="form-group row">
<label for="pass" class="col-md-4 col-form-label text-md-right">Password</label>
<div class="col-md-6">
<input type="password" id="pass" class="form-control" name="pass" required autofocus placeholder="Masukkan Password Baru">
</div>
</div>
<div class="form-group text-center">
<input type="submit" name="Submit" class="btn btn-primary" value="Daftar">
<a href="index.php" class="btn btn-secondary">Kembali</a>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Include file jquery.min.js -->
<script src="js/jquery.min.js"></script>
<!-- Include file boootstrap.min.js -->
<script src="js/bootstrap.min.js"></script>
<!-- Include library Bootstrap Datepicker -->
<script src="js/bootstrap-datepicker.min.js"></script>
<!-- Include file custom.js -->
<script src="js/custom.js"></script>
<script>
var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
if (month < 10) month = "0" + month;
if (day < 10) day = "0" + day;
var today = year + "-" + month + "-" + day;
document.getElementById("tgl_daftar").value = today;
</script>
</body>
</html>