permisi gan, mau nannya soal php. Jadi gini saya mengaplikasikan teknik search dengan multi keyword. Tapi ternyata saat hasil search itu saya buat fungsi penghalaman, eror saat memasuki halaman ke 2 dan selanjutnya. hanya berhasi di halaman pertama. browsing di google katanya karna variabel pencarian tidak ikut ke halaman selanjutnya..kira kira bagaimana solusi nya agar hasil pencarian dapat dibuat halaman ya? Terima kasih...skrip php search multi keyword ada di bawah *YANG ATAS FILE PHP PENCARIAN, YANG BAWAH FILE FORM HTML*

<?php
 
mysql_connect("dbhost", "dbuser", "dbpassword");
mysql_select_db("dbname");
 
$bagianWhere = "";
 
if (isset($_POST['nimCat']))
{
   $nim = $_POST['nim'];
   if (empty($bagianWhere))
   {
        $bagianWhere .= "nim = '$nim'";
   }
}

if (isset($_POST['namaCat']))
{
   $namamhs = $_POST['nama'];
   if (empty($bagianWhere))
   {
        $bagianWhere .= "namamhs LIKE '%$namamhs%'";
   }
   else
  {
        $bagianWhere .= " AND namamhs LIKE '%$namamhs%'";
   }
}
 
if (isset($_POST['alamatCat']))
{
   $alamat = $_POST['alamat'];
   if (empty($bagianWhere))
   {
       $bagianWhere .= "alamat LIKE '%$alamat%'";
   }
  else
  {
        $bagianWhere .= " AND alamat LIKE '%$alamat%'";
  }
}
 
if (isset($_POST['sexCat']))
{
   $sex = $_POST['sex'];
   if (empty($bagianWhere))
   {
        $bagianWhere .= "sex = '$sex'";
   }
   else
   {
        $bagianWhere .= " AND sex = '$sex'";
   }
}
 
$query = "SELECT * FROM mhs WHERE ".$bagianWhere;
$hasil = mysql_query($query);
echo "<table border='1'>";
echo "<tr><td>NIM</td><td>Nama Mahasiswa</td><td>Alamat</td><td>Jenis Kelamin</td></tr>";
while ($data = mysql_fetch_array($hasil))
{
   echo "<tr><td>".$data['nim']."</td><td>".$data['namamhs']."</td><td>".$data['alamat']."</td><td>".$data['sex']."</td></tr>";
}
echo "</table>";
?>
<h1>Cari Data Mahasiswa</h1>
 
<p>Pilih kategori pencarian</p>
 
<form method="post" action="proses.php">
<table>
   <tr><td><input type="checkbox" name="nimCat"> NIM</td><td><input type="text" name="nim"></td></tr>
   <tr><td><input type="checkbox" name="namaCat"> Nama Mahasiswa</td><td><input type="text" name="nama"></td></tr>
   <tr><td><input type="checkbox" name="alamatCat"> Alamat</td><td><input type="text" name="alamat"></td></tr>
   <tr><td><input type="checkbox" name="sexCat"> Jenis Kelamin</td><td><input type="radio" name="sex" value="L"> Laki-Laki <input type="radio" name="sex" value="P"> Perempuan</td></tr>
   <tr><td></td><td><input type="submit" name="submit" value="Submit"></td></tr>
</table>
</form>

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
maaf mas mw minta pencerahan y, saya buat web yg sudah saya hostingkan, di dalam register ada send mail validasi register ke email user, waktu saya buat dilocalhost lancar tapi pas di hosting saya gak tw pengaturan send mail y mas, mohon pencerahannya , sebelumnya terimakasih

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
Mohon pencerahannya mastah.

saya punya tabel invoice (no_invoice, tanggal, total_berat, total_biaya, id_konsultan, id_kurir, status).

saya ingin menampilkan data untuk page kurir, namun data yang tampil harus mensortir coloum (total_berat) tidak boleh lebih dari 46 kg (<46).

bagaimana cara saya mensortir nya ketika data tersebut ditampilakan.

mohon sekali pencerahannya mastah :(
elseif($_GET[act]=="terbaru"){
?>
<div class="table-header">
	    DATA PESANAN TERBARU
	</div>
	<div class="row-fluid">
	<table id="myTable" class="table table-striped table-bordered table-hover">
	<thead>
	    <tr>
	    <th class="center" width="85px">No Invoice</th>
	    <th class="center" width="90px">Tanggal</th>	    
	    <th class="center" width="100px">Nama Petugas</th>
	    <th class="center" width="85px">Berat Total</th>
	    <th class="center" width="85px">Total Harga</th>
	    <th class="center" width="120px">Nama Konsultan</th>
	    <th class="center" width="150px">Nama Jalan</th>	    
	    <th class="center" width="85px">Nama Kurir</th>	    
	    <th class="center" width="100px">Status</th>
	    <th class="hidden-480 center" width="75px">Aksi</th>
	    </tr>
	</thead>
	<tbody>
	 <?php
	 	$qry = mysql_query("SELECT a.*, b.nama_konsultan, c.nama, d.nama_jalan, e.nama_kurir FROM invoice a LEFT JOIN konsultan b ON a.id_konsultan=b.id_konsultan LEFT JOIN user c ON a.id_user=c.id_user LEFT JOIN jalan d ON a.id_jalan=d.id_jalan LEFT JOIN kurir e ON a.id_kurir=e.id_kurir WHERE a.status =1 AND a.tanggal='$now' and a.id_kurir=$uUser ORDER BY a.no_invoice ASC");
	 	$hitmax = mysql_num_rows(qry);

		while ($d = mysql_fetch_array($qry)){
		$angka = getValue("total_biaya","invoice","no_invoice='$d[no_invoice]'");
		$rp = rupiah($angka);
		$brt = getValue("total_berat","invoice","no_invoice='$d[no_invoice]'");
		$br = berat($brt);
		$petugas = getValue("nama","user","id_user='$d[no_invoice]'");
		$konsultan = getValue("nama_konsultan","konsultan","id_konsultan='$d[no_invoice]'");
		$jalan = getValue("nama_jalan","jalan","id_jalan='$d[no_invoice]'");
		$kurir = getValue("nama_kurir","kurir","id_kurir='$d[no_invoice]'");
		$tgl = getTglIndo($d[tanggal]);
		$arStt = array(
	      	'1' => "<div class='btn btn-mini btn-yellow'> Prepare <i class='icon-refresh'></i> </div>",
	      	'2' => "<div class='btn btn-mini btn-info'> On Proccess <i class='icon-gift'> </i></div>",
	      	'3' => "<div class='btn btn-mini btn-success'> Delivered <i class='icon-ok'></i> </div>",
	      	'4' => "<div class='btn btn-mini btn-danger'> Return <i class='icon-ban-circle'></i> </div>",
	      );
	      $ptA = $d['status'];
	      $stAktif = $arStt[$ptA];
	      ?>
	      <script>
			function new_win(clicked_id)
			{			
			window.open("infoinvoice.php?noinv="+clicked_id+"","mywin","width=1000,height=500,screenX=50,left=50,screenY=50,top=50,status=yes,menubar=yes");
			}
			</script>
	      <tr>
	      <?php
	      $no++;
	      echo "	      
	      <td class='center'><a href='#' id='$d[no_invoice]' onClick='new_win(this.id)'>$d[no_invoice]</a></td>
	      <td class='center'>$tgl</td>
	      <td class='center'>$d[nama]</td>
	      <td class='center'><b>$rp</b></td>
	      <td class='center'><b>$br</b></td>
	      <td class='center'>$d[nama_konsultan]</td>
	      <td class='center'>$d[nama_jalan]</td>
	      <td class='center'>$d[nama_kurir]</td>
	      <td class='center'>$stAktif</td>
	      <td class='center'>
	      	<div class='inline position-relative'>
              <button class='btn btn-mini btn-primary dropdown-toggle' data-toggle='dropdown' data-rel='tooltip' data-original-title='Aksi'><i class='icon-cog icon-only bigger-110'></i></button>
              <ul class='dropdown-menu dropdown-icon-only dropdown-yellow pull-right dropdown-caret dropdown-close'>                  
                  <li><a href='?page=$page&act=3&id=$d[no_invoice]' class='tooltip-success' data-rel='tooltip' data-original-title='Delivered'>
                      <span class='green'><i class='icon-refresh bigger-120'></i></span>
                      </a>
                  </li>                   
	          </ul>
	        </div></td>";
	      ?>
	     </tr>
	    <?php 
	       }
	    ?>
	</tbody>
	</table>
	</div>

Lihat semua 1 jawaban

Silahkan login untuk menjawab!

focus kursor onclick

dony · Aug 22, 2016
siang para mastah..... saya sudah membuat sebuah form input. saya ingin ketika input text di klik maka
pointer berada di awal kata value tanpa mengosongkan value input text kecuali diketik user. misal pada input "Your Name" ketika di klik makan kursor akan berada sebelum huruf "Y" ato paling awal. mohon bantuan nya mastah, ini form saya
<form>
        <table>
            <tr>
                <td><input name="txtname" type="text" value="Your Name"></td>
            </tr>
            <tr>
                <td><input name="txtcom" type="text" value="Company"></td>
            </tr>
            <tr>
                <td><input name="txtweb" type="text" value="Website"></td>
            </tr>
            <tr>
                <td><input name="txtphone" type="text" value="Phone Number"></td>
            </tr>
            <tr>
                <td><input name="txtemail" type="text" value="Your Email"></td>
            </tr>
            <tr>
                <td><textarea cols="30" name="txtmessage" rows="10"></textarea></td>
            </tr>
            <tr>
                <td><input type="submit" value="Submit"></td>
            </tr>
	</table>
</form>

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
<?php require_once('Connections/koneksi.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_koneksi, $koneksi);
$query_ppl = "SELECT * FROM sekolah";
$ppl = mysql_query($query_ppl, $koneksi) or die(mysql_error());
$row_ppl = mysql_fetch_assoc($ppl);
$totalRows_ppl = mysql_num_rows($ppl);
?>
<!DOCTYPE html>
<html>

<head>
<title>Sistem PPL</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Fonts -->
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:300,400' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900' rel='stylesheet' type='text/css'>
<!-- CSS Libs -->
<link rel="stylesheet" type="text/css" href="lib/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="lib/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="lib/css/animate.min.css">
<link rel="stylesheet" type="text/css" href="lib/css/bootstrap3/bootstrap-switch.min.css">
<link rel="stylesheet" type="text/css" href="lib/css/checkbox3.min.css">
<link rel="stylesheet" type="text/css" href="lib/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="lib/css/dataTables.bootstrap.css">
<link rel="stylesheet" type="text/css" href="lib/css/select2.min.css">
<!-- CSS App -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/themes/flat-blue.css">
<script type="text/javascript" src="./js/pilih.js"></script>
</head>

<body class="flat-blue">
<div class="app-container">
<div class="row content-container">
<nav class="navbar navbar-default navbar-fixed-top navbar-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-expand-toggle">
<i class="fa fa-bars icon"></i>
</button>
<ol class="breadcrumb navbar-breadcrumb">
<li>Pilih Data</li>
<li class="active">Tempat PPL</li>
</ol>
<button type="button" class="navbar-right-expand-toggle pull-right visible-xs">
<i class="fa fa-th icon"></i>
</button>
</div>
<ul class="nav navbar-nav navbar-right">
<button type="button" class="navbar-right-expand-toggle pull-right visible-xs">
<i class="fa fa-times icon"></i>
</button>

</ul>
</div>
</nav>
<div class="side-menu sidebar-inverse">
<nav class="navbar navbar-default" role="navigation">
<div class="side-menu-container">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<span class="logo-mini"><img src="img/logo.png" width="50"/></span>
<div class="title">Sistem PPL</div>
</a>
<button type="button" class="navbar-expand-toggle pull-right visible-xs">
<i class="fa fa-times icon"></i>
</button>
</div>
<ul class="nav navbar-nav">
<li>
<a href="home-mahasiswa.php">
<span class="icon fa fa-tachometer"></span><span class="title">Dashboard</span>
</a>
</li>

<li class="active panel panel-default dropdown">
<a data-toggle="collapse" href="#dropdown-form">
<span class="icon fa fa-file-text-o"></span><span class="title">Pilih Data</span>
</a>
<!-- Dropdown level 1 -->
<div id="dropdown-form" class="panel-collapse collapse">
<div class="panel-body">
<ul class="nav navbar-nav">
<li><a href="data-tempat-ppl.php">Pilih Data Tempat PPL</a></li>

</ul>
</div>
</div>
</li>

<!-- Dropdown-->
<li class="panel panel-default dropdown">
<a data-toggle="collapse" href="#dropdown-example">
<span class="icon fa fa-slack"></span><span class="title">System</span>
</a>
<!-- Dropdown level 1 -->
<div id="dropdown-example" class="panel-collapse collapse">
<div class="panel-body">
<ul class="nav navbar-nav">
<li><a href="index.php">Close</a>
</li>
</ul>
</div>
</div>
</li>

</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
</div>
<!-- Main Content -->
<div class="container-fluid">
<div class="side-body">
<div class="page-title">
<span class="title"></span>
<div class="description"></div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="card">
<div class="card-header">

<div class="card-title">
<div class="title">Pilih Tempat PPL</div>
</div>
</div>
<div class="card-body">
<table class="datatable table table-striped" cellspacing="0" width="100%">
<thead>
<tr>

<th>Nama Sekolah</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Nama Sekolah</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<?php
include 'config.php';
$query = mysql_query("select * from sekolah");

$no = 1;
while ($data = mysql_fetch_array($query)) {
?>
<tr>
<td><?php echo $data; ?></td>
<td><?php ?><a type="button" class="btn btn-danger" href="pilih-jurusan.php?nama_sekolah=<?php echo $data; ?>">PILIH</a>
</td>
</tr>
<?php
$no++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="app-footer">
<div class="wrapper">
<span class="pull-right">2.1 <a href="#"><i class="fa fa-long-arrow-up"></i></a></span> © 2016 Teknik Informatika.
</div>
</footer>
<div>
<!-- Javascript Libs -->
<script type="text/javascript" src="lib/js/jquery.min.js"></script>
<script type="text/javascript" src="lib/js/bootstrap.min.js"></script>
<script type="text/javascript" src="lib/js/Chart.min.js"></script>
<script type="text/javascript" src="lib/js/bootstrap-switch.min.js"></script>

<script type="text/javascript" src="lib/js/jquery.matchHeight-min.js"></script>
<script type="text/javascript" src="lib/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/js/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="lib/js/select2.full.min.js"></script>
<script type="text/javascript" src="lib/js/ace/ace.js"></script>
<script type="text/javascript" src="lib/js/ace/mode-html.js"></script>
<script type="text/javascript" src="lib/js/ace/theme-github.js"></script>
<!-- Javascript -->
<script type="text/javascript" src="js/app.js"></script>
</body>

</html>
<?php
mysql_free_result($ppl);
?>
Silahkan login untuk menjawab!
siang semuanya, saya sudah buat autocomplete, dan jalan kalau menggunakan text, tapi kalau radio button tidak bisa nampil sesuai yang di pilih, solusinya bagaimana ya?
<?php
include "../../koneksi.php";
$term = $_GET['term'];
$sql = "SELECT * FROM tb_pasien WHERE nomor_rekam_medis LIKE '%".$term."%'";
$hs = mysql_query($sql);
$json = array();
while($data = mysql_fetch_array($hs)){
	$json[] = array(
		'label' => $data['nomor_rekam_medis'] ." - ". $data['nama_pasien'],
		'value' => $data['nomor_rekam_medis'],
		'nama_pasien' => $data['nama_pasien'],
		'jenis_kelamin_pasien' => $data['jenis_kelamin_pasien']

	);
}
header("Content-Type: application/json");
echo json_encode($json);
?>
<?php

$aksi="module/transaksi_pasien/transaksi_pasien_aksi.php";


switch(isset($_GET["aksi"]) ? $_GET["aksi"] :'"'){
default:

?>
<hr/>

  <div class="box box-solid box-primary">
    <div class="box-header">
    <h3 class="btn btn disabled box-title">
    <i class="fa fa-user-md"></i>
    Data Pasien </h3>
    <a class="btn btn-primary pull-right" href="?module=transaksi_pasien&aksi=tambah">
    <i class="fa  fa-plus"></i> Tambah Data</a> 
    </div>    
  <div class="box-body">
  <table id="example1" class="table table-bordered table-striped">
<thead>
  <tr class="text-blue">
    <th>TGL/JAM INPUT</th>
    <th>MR</th>
    <th>NAMA PASIEN</th>
    <th>JK</th>
    <th>NAMA POLI</th>
    <th>NAMA BAGIAN</th>
    <th>AKSI</th>
  </tr>
</thead>

<tbody>
<?php
$sql = "SELECT * FROM tb_pasien a, tb_distribusi b, tb_poli c, tb_bagian d where a.id_pasien=b.id_pasien AND b.id_poli=c.id_poli AND b.id_bagian=d.id_bagian AND status_distribusi='TERIMA' order by tanggal_input DESC";
$tampil = mysql_query($sql);
$no=1;
while ($data = mysql_fetch_array($tampil)) { 
$Kode = $data['nomor_rekam_medis'];?>

  <tr>
  <td><?php echo date('d-m-Y', strtotime($data['tanggal_input'])) .", ". $data['jam_input']; ?></td>
  <td><?php echo $data['nomor_rekam_medis']; ?></td>
  <td><?php echo $data['nama_pasien']; ?></td>
  <td><?php echo $data['jenis_kelamin_pasien']; ?></td>
  <td><?php echo $data['poli']; ?></td>
  <td><?php echo $data['bagian']; ?></td>
  
  <td align="center">&nbsp;&nbsp;|
    <a class="fa fa-pencil-square-o edit"   data-toggle="tooltip" title="Edit Data <?php echo $data['id_pasien'];?>" href="?module=transaksi_pasien&aksi=edit&id_pasien=<?php echo $data['id_pasien'];?>"></a> &nbsp;&nbsp;|
    <a class="fa fa-trash hapus"   data-toggle="tooltip" title="Hapus Semua Data pasien" href="<?php echo $aksi ?>?module=transaksi_pasien&aksi=hapus&id_distribusi=<?php echo $data['id_distribusi'];?>"></a>&nbsp;&nbsp;|
    <a class="fa fa-motorcycle beset" data-toggle="tooltip" title="Antar <?php echo $data['id_pasien'];?>" href="?module=transaksi_antar&aksi=edit&id_pasien=<?php echo $data['id_pasien'];?>"></i></a>&nbsp;&nbsp;|
    <a class="fa fa-undo kembali" data-toggle="tooltip" title="Kembali <?php echo $data['id_pasien'];?>" href="?module=transaksi_kembali&aksi=edit&id_pasien=<?php echo $data['id_pasien'];?>"></i></a>&nbsp;&nbsp;|
    <a class="fa fa-bed beset" data-toggle="tooltip" title="Rawat <?php echo $data['id_pasien'];?>" href="?module=transaksi_rawat&aksi=edit1&id_pasien=<?php echo $data['id_pasien'];?>"></i></a>&nbsp;&nbsp;|
  </td>
  <?php
  }
  ?>
  </tr>
      </tbody>
    </table>
  </div>
</div>
<?php 
break;
case "tambah": 
?>
<form class="form-horizontal" role="form" method="post" action="<?php echo $aksi?>?module=transaksi_pasien&aksi=tambah" >
<div class="row">
<div class="col-md-12">
<div class="box box-success">
<div class="box-header with-border">
  <h3 class="box-title">DATA PASIEN</h3>
  <div class="box-tools pull-right">
  <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
  <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  </div>
</div>
<div class="box-body">
<form class="form-horizontal" action="<?php echo $aksi?>?module=kelas&aksi=tambah" role="form" method="post">
<div class="form-group">
    <label class="col-sm-4 control-label">Tanggal Register</label>
    <div><div class="col-sm-2">
            <?php
              date_default_timezone_set("Asia/Jakarta");
              $jam_input = date("H:i:s");
              $tanggal_input = date("d-m-Y");
            ?>
      <input type="text" class="form-control" readonly name="jam_input" value="<?php echo"$jam_input";?>">
  </div>
  <div class="col-sm-2">
    <div class="input-group">
  <div class="input-group-addon">
       <i class="fa fa-calendar"> </i>
    </div>
      <input type="text" class="form-control" readonly name="tanggal_input" value="<?php echo date('d-m-Y');?>">
  </div><!-- /.input group -->
  </div></div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-4 control-label">Rekam Medis</label>
    <div class="col-sm-2">
      <input type="text" autofocus required class="form-control" data-toggle="tooltip" title="Nomor Rekam Medis" onkeypress="return hanyaAngka(event)" required="required" name="nomor_rekam_medis" id="nomor_rekam_medis" placeholder="Nomor Rekam Medis" maxlength="6">
    </div>
  </div>

<div class="form-group">
  <label class="col-sm-4 control-label">Nama Pasien</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" data-toggle="tooltip" title="Nama Pasien" required="required" name="nama_pasien" id="nama_pasien" placeholder="Nama Pasien">
      <input type="text" class="form-control" data-toggle="tooltip" title="Nama Pasien" required="required" name="jenis_kelamin_pasien" id="jenis_kelamin_pasien" placeholder="Nama Pasien">
    </div>
    </div>
<div class="form-group">
  <label class="col-sm-4 control-label">Jenis Kelamin</label>
    <div class="col-sm-4">
      <input name="jenis_kelamin_pasien" type="radio" value="LAKI-LAKI" checked id="jenis_kelamin_pasien"> LAKI-LAKI &nbsp;&nbsp;
      <input name="jenis_kelamin_pasien" type="radio" value="PEREMPUAN" id="jenis_kelamin_pasien"> PEREMPUAN
    </div>
</div>
<div class="form-group">
  <label class="col-sm-4 control-label">Nama Poli</label>
    <div class="col-sm-3">
    <select name="id_poli" id="poli" class="form-control">
      <option value=" "> -- Pilih Poli -- </option>
        <?php 
              $sondang=mysql_query("select * from tb_poli");
              while($b=mysql_fetch_array($sondang)){
            ?>  
            <option value="<?php echo $b['id_poli']; ?>"><?php echo $b['poli'] ?></option>
            <?php 
            }
            ?>
    </select>
  </div>
</div>
<div class="form-group">
  <label class="col-sm-4 control-label">Nama Bagian</label>
    <div class="col-sm-3">
    <select name="id_bagian" id="bagian" class="form-control">
      <option value=" "> -- Pilih Bagian -- </option>
        <?php 
              $sondang=mysql_query("select * from tb_bagian");
              while($b=mysql_fetch_array($sondang)){
            ?>  
            <option value="<?php echo $b['id_bagian']; ?>"><?php echo $b['bagian'] ?></option>
            <?php 
            }
            ?>
    </select>
  </div>
</div>
<div class="form-group">
    <label class="col-sm-4"></label>
    <div class="col-sm-5">
      <button type="submit"name="submit" class="btn btn-primary" onclick="sweet()"><i class="glyphicon glyphicon-floppy-disk"></i> Simpan</button>
    <button type="reset" class="btn btn-danger"><i class="fa fa-refresh"></i><i> Batal</i></button>
    <button type="button" class="btn btn-danger" onclick="history.back(-1)"><i class="glyphicon glyphicon-arrow-left"></i> Back</button>
    </div>
  </div>
</div>
</div>
</div>


<?php
break;
case "edit":
$data=mysql_query("SELECT * FROM tb_pasien a, tb_distribusi b, tb_poli c, tb_bagian d where a.id_pasien=b.id_pasien AND b.id_poli=c.id_poli AND b.id_bagian=d.id_bagian AND a.id_pasien='$_GET[id_pasien]'");
$edit=mysql_fetch_array($data);

?>

<form class="form-horizontal" action="<?php echo $aksi?>?module=transaksi_pasien&aksi=edit" role="form" method="post">             

<div class="row">
<div class="col-md-12">
<div class="box box-success">
<div class="box-header with-border">
  <h3 class="box-title">Data Pasien</h3>
  <div class="box-tools pull-right">
  <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
  <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  </div>
</div>
<div class="box-body">
<form class="form-horizontal" action="<?php echo $aksi?>?module=transaksi_pasien&aksi=edit" role="form" method="post">
<div class="form-group">
    <label class="col-sm-3 control-label">Tanggal Register</label>
    <div><div class="col-sm-3">
            <?php
              date_default_timezone_set("Asia/Jakarta");
              $jam_input = date("H:i:s");
           ?>
      <input type="text" class="form-control" readonly name="jam_input" value="<?php echo"$jam_input";?>">
  </div>
  <div class="col-sm-5">
    <div class="input-group">
  <div class="input-group-addon">
       <i class="fa fa-calendar"> </i>
    </div>
    <input type="text" class="form-control" required="required" data-toggle="tooltip" name="tanggal_input" id="tanggal_input" value="<?php echo $edit['tanggal_input'];?>">
      
  </div><!-- /.input group -->
  </div></div>
  </div>
  <div class="form-group">
    <label class="col-sm-3 control-label">Rekam Medis</label>
    <div class="col-sm-8">
    <input type="hidden" class="form-control" readonly name="id_pasien" value="<?php echo $_GET['id_pasien']; ?>">
      <input type="text" class="form-control"  required="required" name="nomor_rekam_medis"value="<?php echo $edit['nomor_rekam_medis']; ?>">
    </div>
  </div>
<div class="form-group">
  <label class="col-sm-3 control-label">Nama Pasien</label>
    <div class="col-sm-8">
      <input type="text" class="form-control"  required="required" name="nama_pasien"value="<?php echo $edit['nama_pasien']; ?>">
    </div>
    </div>

<div class="form-group">
    <label class="col-sm-3 control-label">Jenis Kelamin</label>
    <div class="col-sm-8">
    <input  class="minimal" name="jenis_kelamin_pasien" type="radio" value="LAKI-LAKI" <?php if(($edit['jenis_kelamin_pasien'])== "LAKI-LAKI")
        {echo "checked=\"checked\"";};?>/> LAKI-LAKI &nbsp;&nbsp;
    <input class="minimal" name="jenis_kelamin_pasien" type="radio" value="PEREMPUAN" <?php if(($edit['jenis_kelamin_pasien'])== "PEREMPUAN")
        {echo "checked=\"checked\"";};?>/> PEREMPUAN
    </div></div>
  <div class="form-group">
  <label class="col-sm-3 control-label">Poli</label>
    <div class="col-sm-8">
    <select name="id_poli" id="poli" class="form-control">
        <?php
          $cur_poli=$edit['id_poli'];
          $q=mysql_query("select * from tb_poli");
          while($row=mysql_fetch_array($q)){ 
            $selected='';
            if($row['id_poli']==$cur_poli){$selected='selected';}else{$selected='';}
            echo "<option value='".$row['id_poli']."' ".$selected.">". $row['id_poli']." / ".$row['poli']."</option>";
            ?>
          <?php }?>
      </select>
  </div>
</div>
  <div class="form-group">
  <label class="col-sm-3 control-label">Bagian</label>
    <div class="col-sm-8">
    <select name="id_bagian" id="bagian" class="form-control">
        <?php
          $cur_bagian=$edit['id_bagian'];
          $q=mysql_query("select * from tb_bagian");
          while($row=mysql_fetch_array($q)){ 
            $selected='';
            if($row['id_bagian']==$cur_bagian){$selected='selected';}else{$selected='';}
            echo "<option value='".$row['id_bagian']."' ".$selected.">". $row['id_bagian']." / ".$row['bagian']."</option>";
            ?>
          <?php }?>
      </select>
  </div>
</div>



<div class="form-group">
    <label class="col-sm-4"></label>
    <div class="col-sm-7">
      <button type="submit"name="submit" class="btn btn-primary" onclick="sweet()"><i class="glyphicon glyphicon-floppy-disk"></i> Simpan</button>
    <input type="reset" class="btn btn-warning" value="Batal" onclick="window.history.back();">
    </div>
  </div>
</div> 

<div id="yyy" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
</div></div>
</div></div>

<?php
break;
} 
?>
<!--<script src="../aset/plugins/jQuery/jq.js"></script> -->
<link rel="stylesheet" href="../aset/plugins/jQuery/jquery-ui-1.10.3.custom.css" type="text/css" media="" />
<script src="../aset/plugins/jquery/jquery-2.2.4.min.js" type="text/javascript"></script>
<script src="../aset/plugins/jQuery/jquery-ui-1.10.3.custom.min.js"></script>
<script src="../aset/dist/js/bootstrap.min.js" type="text/javascript"></script>


<script>
    function hanyaAngka(evt) {
      var charCode = (evt.which) ? evt.which : event.keyCode
       if (charCode > 31 && (charCode < 48 || charCode > 57))
 
        return false;
      return true;
    }
  </script>

  <script>
            $(document).ready(function () {
                $("#poli").select2({
                    placeholder: "--Pilih Poli--",
                    theme: "bootstrap"

                });
            });

            $(document).ready(function () {
                $("#id_unit").select2({
                    placeholder: "Pilih Bagian",
                    theme: "bootstrap"

                });
            });

            $(document).ready(function () {
                $("#bagian").select2({
                    placeholder: "--Pilih Bagian--",
                    theme: "bootstrap"

                });
            });

            $(document).ready(function () {
                $("#pendidikan").select2({
                    placeholder: "Please Select",
                    theme: "bootstrap"

                });
            });

            $(document).ready(function () {
                $("#pekerjaan").select2({
                    placeholder: "Please Select",
                    theme: "bootstrap"

                });
            });

            $(document).ready(function () {
                $("#status_nikah").select2({
                    placeholder: "Please Select",
                    theme: "bootstrap"

                });
            });

            $(document).ready(function () {
                $("#unit").select2({
                    placeholder: "Please Select",
                    theme: "bootstrap"

                });
            });

            $(document).ready(function () {
                $("#agama").select2({
                    placeholder: "Please Select",
                    theme: "bootstrap"

                });
            });
  </script>
  
<script>
var $jnoc = jQuery.noConflict();
    $jnoc(function() {
        $jnoc( "#nomor_rekam_medis" ).autocomplete({
            source: "module/transaksi_pasien/load_data.php",
            minLength: 2,
            select: function( event, ui ) {
              
    $jnoc('#nama_pasien').val(ui.item.nama_pasien);
    $jnoc('#jenis_kelamin_pasien').val(ui.item.jenis_kelamin_pasien);
    

            }
        });
    });
</script>

Silahkan login untuk menjawab!