Advertisement
rafisbr

r_pasien.php

Aug 15th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.36 KB | None | 0 0
  1. <?php
  2. require '../api/koneksi.php';
  3. // require 'api_checksessions.php';
  4. ?>
  5.  
  6. <!-- ======= Header ======= -->
  7. <?php require '../widgets/header.php'; ?>
  8. <!-- End Header -->
  9.  
  10. <!-- ======= Sidebar ======= -->
  11. <?php require '../widgets/sidebar.php'; ?>
  12.  
  13. <!-- End Sidebar-->
  14.  
  15. <!-- <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> -->
  16. <!-- <link rel="stylesheet" type="text/css" href="../assets/css/datatables.min.css" /> -->
  17.  
  18. <!-- <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.11.4/date-1.1.1/datatables.min.js"></script> -->
  19.  
  20. <!-- <link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" /> -->
  21. <!-- <script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script> -->
  22. <!-- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jszip-2.5.0/dt-1.11.4/b-2.2.2/b-colvis-2.2.2/b-html5-2.2.2/b-print-2.2.2/datatables.min.css" /> -->
  23.  
  24. <?php
  25. function tanggal_indo($tanggal)
  26. {
  27. $bulan = array(
  28. 1 => 'Januari',
  29. 'Februari',
  30. 'Maret',
  31. 'April',
  32. 'Mei',
  33. 'Juni',
  34. 'Juli',
  35. 'Agustus',
  36. 'September',
  37. 'Oktober',
  38. 'November',
  39. 'Desember'
  40. );
  41. $pecahkan = explode('-', $tanggal);
  42.  
  43. // variabel pecahkan 0 = tanggal
  44. // variabel pecahkan 1 = bulan
  45. // variabel pecahkan 2 = tahun
  46.  
  47. return $pecahkan[2] . ' ' . $bulan[(int)$pecahkan[1]] . ' ' . $pecahkan[0];
  48. }
  49. ?>
  50. <body>
  51. <main id="main" class="main">
  52.  
  53. <div class="pagetitle">
  54. <h1>DATA PENDAFTARAN</h1>
  55. <nav>
  56. <ol class="breadcrumb">
  57. <li class="breadcrumb-item"><a href="../pages/home.php">Home</a></li>
  58. <li class="breadcrumb-item"><a href="../forms/add_pendaftaran.php">Input Pendaftaran</a></li>
  59. <li class="breadcrumb-item active">Data Pendaftaran</li>
  60. </ol>
  61. </nav>
  62. </div><!-- End Page Title -->
  63.  
  64. <section class="section">
  65. <div class="card shadow mb-4">
  66. <div class="col-lg-12">
  67. <div class="card-body">
  68. <h5 class="card-title">Data Pasien</h5>
  69. <div class="card-body">
  70. <table border="0" cellspacing="5" cellpadding="5">
  71. <tbody>
  72. <tr>
  73. <td>Start Date:</td>
  74. <td><input type="text" class="form-control ml-2" id="min" name="min"></td>
  75. </tr>
  76. <tr>
  77. <td>End Date:</td>
  78. <td><input type="text" class="form-control ml-2 mt-2" id="max" name="max"></td>
  79. </tr>
  80. </tbody>
  81. </table>
  82.  
  83. <br>
  84. <div class="table-responsive">
  85. <table class="table table-striped table-bordered" id="rPasien" width="100%" cellspacing="1">
  86. <thead>
  87. <tr>
  88. <th>#</th>
  89. <th>NO PASIEN</th>
  90. <th>NIK</th>
  91. <th>NAMA PASIEN</th>
  92. <th>JENIS KELAMIN</th>
  93. <th>NO BPJS</th>
  94. <th>TANGGAL LAHIR</th>
  95. <th>UMUR</th>
  96. <th>STATUS</th>
  97. <th>NAMA PEKERJA</th>
  98. <th>JABATAN PEKERJA</th>
  99. <th>STATUS</th>
  100. <th>NO HP</th>
  101. <th>ESTATE</th>
  102. <th>OP</th>
  103. <th>AUTHOR</th>
  104. <th>Opsi</th>
  105. </tr>
  106. </thead>
  107. <tbody>
  108. <?php
  109. require "../api/koneksi.php";
  110. $sql = mysqli_query($koneksi, "SELECT * from tbl_pasien order by id Desc") or die("error karena" . mysqli_error($connection));
  111. $no = 1;
  112. while ($read = mysqli_fetch_array($sql)) {
  113. $id_pasien = $read['id_pasien'];
  114. $nik = $read['nik'];
  115. $nama_pasien = $read['nama_pasien'];
  116. $jk = $read['jk'];
  117. $no_bpjs = $read['no_bpjs'];
  118.  
  119. $tgl_lahir = $read['tgl_lahir'];
  120. $tanggal_lahir = $read['tgl_lahir'];
  121. $umur = $read['umur'];
  122.  
  123. // $umur = strtotime($tgl_lahir);
  124. // $today =strtotime(date("Y-m-d"));
  125. // $usia = $today-$umur;
  126. // $usia=floor($usia/(60*60*24*365));
  127.  
  128. $status_pasien = $read['status_pasien'];
  129. $nama_pekerja = $read['nama_pekerja'];
  130. $jabatan_pekerja = $read['jabatan_pekerja'];
  131. $status_pekerja = $read['status_pekerja'];
  132. $nohp_pekerja = $read['nohp_pekerja'];
  133. $estate = $read['estate'];
  134. $op = $read['op'];
  135. $author = $read['author'];
  136. ?>
  137. <tr>
  138. <td><?php echo $no++; ?></td>
  139. <td><?php echo $id_pasien; ?></td>
  140. <td><?php echo $nik; ?></td>
  141. <td><?php echo $nama_pasien; ?></td>
  142. <td><?php
  143. if ($jk == "1") {
  144. echo "Laki-laki";
  145. } else {
  146. echo "Perempuan";
  147. }
  148. ?>
  149. </td>
  150. <td><?php echo $no_bpjs; ?></td>
  151. <td><?php echo $tgl_lahir; ?></td>
  152. <td><?php echo $umur; ?> Tahun</td>
  153. <td><?php echo $status_pasien; ?></td>
  154. <td><?php echo $nama_pekerja; ?></td>
  155. <td><?php echo $jabatan_pekerja; ?></td>
  156. <td><?php echo $status_pekerja; ?></td>
  157. <td><?php echo $nohp_pekerja; ?></td>
  158. <td><?php echo $estate; ?></td>
  159. <td> <?php echo $op; ?></td>
  160. <td> <?php echo $author; ?></td>
  161. <td style="text-align: center; width: 30%;">
  162. <a href="../forms/edit_pasien.php?id=<?= $read['id_pasien'] ?>" class="label label-sm label-info">
  163. <i class="bi bi-pencil-square btn btn-success btn-sm"></i></a>
  164. <a href="../api/delete_pasiens.php?id=<?= $read['id_pasien'] ?>" onclick="return confirm('Apakah Anda Yakin Ingin Menghapusnya ?')">
  165. <i class="bi bi-trash btn btn-danger btn-sm"></i></a>
  166. </td>
  167.  
  168. </tr>
  169. <?php } ?>
  170. </tbody>
  171. </table>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </section>
  178. </main>
  179. <!-- End #main -->
  180.  
  181. <?php require '../widgets/footer.php'; ?>
  182.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement