@@ -1,29 +1,29 @@ discard block |
||
| 1 | -<?php |
|
| 2 | -session_start(); |
|
| 3 | -if (empty($_SESSION['username']) and empty($_SESSION['password'])) { |
|
| 4 | - echo "<script>window.alert('Please login first.'); window.location=('../../index.php.php')</script>"; |
|
| 1 | + <?php |
|
| 2 | + session_start(); |
|
| 3 | + if (empty($_SESSION['username']) and empty($_SESSION['password'])) { |
|
| 4 | + echo "<script>window.alert('Please login first.'); window.location=('../../index.php.php')</script>"; |
|
| 5 | 5 | } else { |
| 6 | - include './../../config/koneksi.php'; |
|
| 7 | - include './../../config/fungsi_thumb.php'; |
|
| 6 | + include './../../config/koneksi.php'; |
|
| 7 | + include './../../config/fungsi_thumb.php'; |
|
| 8 | 8 | |
| 9 | - $module = $_GET[module]; |
|
| 10 | - $act = $_GET[act]; |
|
| 9 | + $module = $_GET[module]; |
|
| 10 | + $act = $_GET[act]; |
|
| 11 | 11 | |
| 12 | - $date = date('d/m/Y'); |
|
| 13 | - $idate = date('Y-m-d'); |
|
| 14 | - $hour = time() - (1 * 1 * 60 * 60); |
|
| 15 | - $datetime = date('Y-m-d G:i:s', $hour); |
|
| 16 | - $userid = $_SESSION['userid']; |
|
| 17 | - $business_type = $_SESSION['business_type']; |
|
| 12 | + $date = date('d/m/Y'); |
|
| 13 | + $idate = date('Y-m-d'); |
|
| 14 | + $hour = time() - (1 * 1 * 60 * 60); |
|
| 15 | + $datetime = date('Y-m-d G:i:s', $hour); |
|
| 16 | + $userid = $_SESSION['userid']; |
|
| 17 | + $business_type = $_SESSION['business_type']; |
|
| 18 | 18 | |
| 19 | - // Hapus modul |
|
| 20 | - if ($module == 'kunjungan_berobat' and $act == 'hapus') { |
|
| 21 | - $id = $_GET['id']; |
|
| 22 | - $id_module = $_GET['id_module']; |
|
| 19 | + // Hapus modul |
|
| 20 | + if ($module == 'kunjungan_berobat' and $act == 'hapus') { |
|
| 21 | + $id = $_GET['id']; |
|
| 22 | + $id_module = $_GET['id_module']; |
|
| 23 | 23 | |
| 24 | - mysql_query('DELETE FROM '.$module.' WHERE id_'.$module." = $id"); |
|
| 24 | + mysql_query('DELETE FROM '.$module.' WHERE id_'.$module." = $id"); |
|
| 25 | 25 | |
| 26 | - //header('location:../../main.php?module='.$module.'&id_module='.$id_module);?>
|
|
| 26 | + //header('location:../../main.php?module='.$module.'&id_module='.$id_module);?>
|
|
| 27 | 27 | |
| 28 | 28 | <script language="javascript"> |
| 29 | 29 | window.parent.location.href = "<?php echo"./../../main.php?module=$module&id_module=$id_module"; ?>"; |
@@ -31,34 +31,34 @@ discard block |
||
| 31 | 31 | </script> |
| 32 | 32 | |
| 33 | 33 | <?php |
| 34 | - } |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - // Input group |
|
| 37 | - elseif ($module == 'kunjungan_berobat' and $act == 'input') { |
|
| 38 | - $id_module = $_POST['id_module']; |
|
| 36 | + // Input group |
|
| 37 | + elseif ($module == 'kunjungan_berobat' and $act == 'input') { |
|
| 38 | + $id_module = $_POST['id_module']; |
|
| 39 | 39 | |
| 40 | - if ($_POST['ID']) { |
|
| 41 | - mysql_query("UPDATE kunjungan_berobat SET tanggal = '$_POST[tanggal]'
|
|
| 40 | + if ($_POST['ID']) { |
|
| 41 | + mysql_query("UPDATE kunjungan_berobat SET tanggal = '$_POST[tanggal]'
|
|
| 42 | 42 | ,id_pasien = '$_POST[pasien]' |
| 43 | 43 | ,id_poli = '$_POST[poli]' |
| 44 | 44 | ,upddt = '$datetime' |
| 45 | 45 | ,updby = '$userid' |
| 46 | 46 | ,aktif = '$_POST[aktif]' |
| 47 | 47 | WHERE id_kunjungan_berobat = '$_POST[ID]'"); |
| 48 | - } else { |
|
| 49 | - $sql = mysql_query("select no_urut from kunjungan_berobat
|
|
| 48 | + } else { |
|
| 49 | + $sql = mysql_query("select no_urut from kunjungan_berobat
|
|
| 50 | 50 | where tanggal='$_POST[tanggal]' |
| 51 | 51 | and id_poli = '$_POST[poli]' "); |
| 52 | 52 | |
| 53 | - $r = mysql_fetch_array($sql); |
|
| 53 | + $r = mysql_fetch_array($sql); |
|
| 54 | 54 | |
| 55 | - if ($r['no_urut']) { |
|
| 56 | - $no_urut = $r['no_urut'] + 1; |
|
| 57 | - } else { |
|
| 58 | - $no_urut = 1; |
|
| 59 | - } |
|
| 55 | + if ($r['no_urut']) { |
|
| 56 | + $no_urut = $r['no_urut'] + 1; |
|
| 57 | + } else { |
|
| 58 | + $no_urut = 1; |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - mysql_query("INSERT INTO kunjungan_berobat(tanggal
|
|
| 61 | + mysql_query("INSERT INTO kunjungan_berobat(tanggal
|
|
| 62 | 62 | ,no_urut |
| 63 | 63 | ,id_pasien |
| 64 | 64 | ,id_poli |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | ,'$userid' |
| 75 | 75 | ,'$datetime' |
| 76 | 76 | ,'$userid')"); |
| 77 | - } |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - //header('location:../../main.php?module='.$module.'&id_module='.$id_module);?>
|
|
| 79 | + //header('location:../../main.php?module='.$module.'&id_module='.$id_module);?>
|
|
| 80 | 80 | |
| 81 | 81 | <script language="javascript"> |
| 82 | 82 | window.parent.location.href = "<?php echo"./../../main.php?module=$module&id_module=$id_module"; ?>"; |
@@ -84,6 +84,6 @@ discard block |
||
| 84 | 84 | </script> |
| 85 | 85 | |
| 86 | 86 | <?php |
| 87 | - } |
|
| 87 | + } |
|
| 88 | 88 | } |
| 89 | -?> |
|
| 89 | + ?> |
|