Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

Tutorial codeigniter kali ini akan membahas tentang bagaimana membuat form input data dengan menggunakan combo box dinamis dengan fungsi auto complete. Combo box auto complete pada form ini kita buat interactif change, ada dua combo box yang kita buat ketika kita memilih data di combo box yang utama isian di combo box yang kedua akan berubah secara otomatis tergantung dari nilai yang kita set dari tabel.

Isi dari combo box kita masukkan pada tabel. Jadi ada 2 tabel yang akan kita gunakan, tabel pertama berisi tabel induk sedangkan tabel ke dua berisi detail dari tabel pertama. Sebagi contoh kita buat tabel nama unit dengan isi POLI, sedangkan tabel ke dua kita isikan dua kolom berisi POLI, PERAWAT – POLI, DOKTER. Ketika kita memilih Poli UGD maka yang akan muncul di combo yang ke dua adalah perawat dan dokter.

Untuk mengubah isi dari combo yang kedua kita gunakan ajax agar load data terjadi otomatis. Ajax kita masukkan pada struktur codeigniter dan kita panggil pada kode controller yang kita buat di form input. Dengan menggunakan ajax tampilan dari combo kedua sebagai isi detail dari combo pertama bisa otomatis dan bisa kita rubah sesuai dengan keinginan kita.

</pre>
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/bootstrap-datepicker3.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/bootstrap-timepicker.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/daterangepicker.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/bootstrap-datetimepicker.min.css">
 
<script type="text/javascript">
function cekreg()
{
/*var noreg = $("#noreg").val();
$.ajax({
type: 'POST',
data: {noreg:noreg},
url : '<?php base_url();?>survei/carireg',
success: function (data) {
$("nama").html(data);
}
});*/
 
/*if($("#noreg").val()=="111")
{
$("#nama").val('masuk');
$("#ruang").focus();
return false;
}*/
}
 
function cekform()
{
if(!$("#tanggal").val())
{
alert('Tanggal tidak boleh kosong');
$("#tanggal").focus();
return false;
}
 
if(!$("#unit").val())
{
alert('Unit tidak boleh kosong');
$("#unit").focus();
return false;
}
 
if(!$("#petugas").val())
{
alert('Petugas tidak boleh kosong');
$("#petugas").focus();
return false;
}
 
/*
if(!$("#nama").val())
{
alert('nama tidak boleh kosong');
$("#nama").focus();
return false;
}
 
if(!$("#ruang").val())
{
alert('Ruangan tidak boleh kosong');
$("#ruang").focus();
return false;
}
 
if(!$("#mrs").val())
{
alert('Tanggal MRS tidak boleh kosong');
$("#mrs").focus();
return false;
}*/
 
}
</script>
 
<script type="text/javascript">
 
$(function(){
 
$.ajaxSetup({
type:"POST",
url: "<?php echo base_url('index.php/i_hh/ambil_data') ?>",
cache: false,
});
 
$("#unit").change(function(){
 
var value=$(this).val();
if(value>0){
$.ajax({
data:{id:value},
success: function(respond){
$("#petugas").html(respond);
}
})
}
 
});
 
})
 
</script>
 
<form class="form-horizontal" method="POST" action="<?php echo base_url();?>index.php/i_hh/cek">
<div class="row">
<div class="col-md-10">
 
<?php
$info = $this->session->flashdata('info');
if(!empty($info))
{
echo $info;
}
?>
 
<div class="widget-box widget-xs">
<div class="widget-header widget-xs">
<h4 class="widget-title">Form Input</h4>
 
<div class="widget-toolbar">
<a href="#" data-action="collapse">
<i class="ace-icon fa fa-chevron-up"></i>
</a>
 
<a href="#" data-action="fullscreen">
<i class="ace-icon fa fa-expand"></i>
</a>
</div>
</div>
 
<div class="widget-body widget-xs">
<div class="widget-main padding-1">
 
<div class="form-group form-group-sm">
<label for="tanggal" class="col-sm-3 control-label">User</label>
<div class="col-sm-6">
<div class="input-group" >
<input class="form-control" name="user_entry" type="text" value = "<?php echo $user_entry;?>" disabled>
</div>
</div>
</div>
 
<div class="form-group form-group-sm">
<label for="tanggal" class="col-sm-3 control-label">Tanggal</label>
<div class="col-sm-2">
<!--input type="text" class="form-control" id="mrs" placeholder="MRS" name="mrs" value=""-->
 
<div class="input-group">
<input class="form-control date-picker" id="tanggal" name="tanggal" type="text" data-date-format="dd-mm-yyyy" value = "<?php echo $tanggal; ?>" >
<span class="input-group-addon">
<i class="fa fa-calendar bigger-110"></i>
</span>
</div>
 
</div>
</div>
 
<div class="form-group form-group-sm">
<label for="unit" class="col-sm-3 control-label">Pilih Unit Layanan</label>
<div class="col-sm-6">
<div class="input-group" >
<select class="form-control" name="unit" id="unit">
<option value="">--Pilih Unit--</option>
<?php foreach($unit as $l){ ?>
<option value="<?php echo $l['IDUNIT']; ?>"><?php echo $l['NAMAUNIT']; ?> </option>
<?php } ?>
</select>
 
</div>
</div>
</div>
 
<div class="form-group form-group-sm">
<label for="unit" class="col-sm-3 control-label">Pilih Petugas</label>
<div class="col-sm-6">
<div class="input-group" >
<select class="form-control" name="petugas" id='petugas'>
<option value='0'>--pilih--</option>
</select>
 
</div>
</div>
</div>
 
<div class="form-group form-group-sm">
<label for="unit" class="col-sm-3 control-label">Pilih Tindakan</label>
<div class="col-sm-6">
<div class="input-group" >
<select class="form-control" name="tindakan">
<option value="">--Pilih Tindakan--</option>
<?php foreach($tindakan as $l){ ?>
<option value="<?php echo $l['IDTINDAKAN']; ?>"><?php echo $l['NAMATINDAKAN']; ?> </option>
<?php } ?>
</select>
 
</div>
</div>
</div>
 
<div class="form-group form-group-sm">
<label for="tanggal" class="col-sm-3 control-label">MOMENT</label>
<div class="col-sm-6">
<input type="checkbox" value='1' name='M1'>M1   
<input type="checkbox" value='1' name='M2'>M2   
<input type="checkbox" value='1' name='M3'>M3   
<input type="checkbox" value='1' name='M4'>M4   
<input type="checkbox" value='1' name='M5'>M5
</div>
</div>
 
</div>
</div>
</div>
 
<button type="submit" class="btn btn-primary btn-sm" name="tombol" value="simpan" onclick="return cekform();">Simpan</button>
<a href="<?php echo base_url();?>index.php/i_hh/list_data" class="btn btn-info btn-sm">List Data</a>
 
<table id="dynamic-table" class="table table-responsive table-bordered table-hover">
<thead>
<tr>
<th style="text-align:center; word-wrap:break-word;" >NO</th>
<th style="text-align:center; word-wrap:break-word;" >TANGGAL</th>
<th style="text-align:center; word-wrap:break-word;" >UNIT</th>
<th style="text-align:center; word-wrap:break-word;" >PROFESI</th>
<th style="text-align:center; word-wrap:break-word;" >TINDAKAN</th>
<th style="text-align:center; word-wrap:break-word;" >M1</th>
<th style="text-align:center; word-wrap:break-word;" >M2</th>
<th style="text-align:center; word-wrap:break-word;" >M3</th>
<th style="text-align:center; word-wrap:break-word;" >M4</th>
<th style="text-align:center; word-wrap:break-word;" >M5</th>
<th style="text-align:center; word-wrap:break-word;" >USER</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
foreach($data->result() as $row)
{
?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $row->TANGGAL; ?></td>
<td><?php echo $row->NAMAUNIT; ?></td>
<td><?php echo $row->NAMAPROFESI; ?></td>
<td><?php echo $row->NAMATINDAKAN; ?></td>
<td><?php echo $row->M1; ?></td>
<td><?php echo $row->M2; ?></td>
<td><?php echo $row->M3; ?></td>
<td><?php echo $row->M4; ?></td>
<td><?php echo $row->M5; ?></td>
<td><?php echo $row->USER_ENTRY; ?></td>
<td>
<a href="<?php echo base_url();?>index.php/i_hh/delete/<?php echo $row->id;?>" onclick="return confirm('anda yakin akan menghapus data??')"> <span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
</td>
</tr>
<?php
$no+=1;
}//end FOR..
?>
 
</tbody>
<tfoot>
</tfoot>
 
</table>
 
</div>
</div>
 
</form>
 
<script src="<?php echo base_url();?>assets/js/bootstrap-datepicker.min.js"></script>
<script src="<?php echo base_url();?>assets/js/bootstrap-timepicker.min.js"></script>
<script src="<?php echo base_url();?>assets/js/daterangepicker.min.js"></script>
<script src="<?php echo base_url();?>assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="<?php echo base_url();?>assets/js/bootstrap-datetimepicker.js"></script>
 
<script type="text/javascript">
 
jQuery(function($) {
 
//datepicker plugin
//link
$('.date-picker').datepicker({
autoclose: true,
todayHighlight: true
})
//show datepicker when clicking on the icon
.next().on(ace.click_event, function(){
$(this).prev().focus();
});
 
//or change it into a date range picker
$('.input-daterange').datepicker({autoclose:true});
 
 
//to translate the daterange picker, please copy the "examples/daterange-fr.js" contents here before initialization
$('input[name=date-range-picker]').daterangepicker({
'applyClass' : 'btn-sm btn-success',
'cancelClass' : 'btn-sm btn-default',
locale: {
applyLabel: 'Apply',
cancelLabel: 'Cancel',
}
})
.prev().on(ace.click_event, function(){
$(this).next().focus();
});
 
 
$('#timepicker1').timepicker({
minuteStep: 1,
showSeconds: true,
showMeridian: false,
disableFocus: true,
icons: {
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down'
}
}).on('focus', function() {
$('#timepicker1').timepicker('showWidget');
}).next().on(ace.click_event, function(){
$(this).prev().focus();
});
 
 
 
 
if(!ace.vars['old_ie']) $('#date-timepicker1').datetimepicker({
format: 'MM/DD/YYYY h:mm:ss A',//use this option to display seconds
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function(){
$(this).prev().focus();
});
 
});
</script>
<pre>
Source Code Bridging BPJS dengan simrs

Source Code Bridging BPJS dengan simrs tutorial php lengkap untuk bridging bpjs dengan simrs agag sulit kita dapatkan diinternet. Namun Read more

Tutorial Codeigniter Gratis Membangun Sistem Informasi Akademik

Tutorial Codeigniter Gratis Membangun Sistem Informasi Akademik Codeigniter adalah salah satu framework yang bisa digunakan untuk membuat aplikasi dengan menggunakan Read more

Source Code Aplikasi PHP Gratis untuk Mengelola Berkas di Tempat Kerja

Source Code Aplikasi PHP Gratis untuk Mengelola Berkas di Tempat Kerja Aplikasi ini berfungsi untuk mengelompokkan file document secara digital Read more

Download PHP Sistem Pakar Penyakit Manusia Berbasis Web

Download PHP Sistem Pakar Penyakit Manusia Berbasis Web Sistem pakar atau dalam bahasa Inggris disebut dengan Expert System adalah sebuah Read more

1,379 Replies to “Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete”

  1. ToloJalse says:

    http://buytadalafshop.com/ – buy cialis online with prescription

  2. Viagra says:

    Smoking Pot On Amoxicillin

  3. Stromectol says:

    Where To Purchase Amoxicillin

  4. z pack price says:

    Viagra Ohne Rezept Landern

  5. non-prescription cialis

  6. eyeBum says:

    hello, how can i solve this problem with this page showing? eyeg

  7. Fruclip says:

    http://buypriligyhop.com/ – priligy over the counter

  8. Prednisone says:

    buy cialis soft c o d

  9. Neurontine says:

    Cheap Viagra Online Canada Pharmacy

  10. optiowica says:

    https://prednisonebuyon.com/ – prednisolone hair loss

  11. PaysfuG says:

    https://buyneurontine.com/ – what is gabapentin prescribed for

  12. Propecia says:

    Does Amoxicillin Need To Be Refrigerated

  13. Cialis says:

    Drug Interactions Xanax Amoxicillin

  14. instagram says:

    What’s Going down i’m new to this, I stumbled upon this I have found It positively helpful
    and it has aided me out loads. I am hoping to contribute & help different users like its helped me.

    Good job.

  15. It’s very simple to find out any matter on web as compared to
    books, as I found this article at this website.

  16. It’s remarkable designed for me to have a website, which is helpful
    in favor of my knowledge. thanks admin

  17. I visited many sites but the audio quality for audio songs existing at this website is genuinely superb.

  18. Viagra says:

    Cialis 10mg Erfahrungsberichte

  19. SidglAnk says:

    how to get modafinil prescription provigil prescription

  20. Hi, Neat post. There is an issue along with your site in internet explorer, would test this?
    IE still is the marketplace chief and a huge part of other people will miss your fantastic writing due to this
    problem.

  21. Hey there! I just wanted to ask if you ever have any problems with hackers?
    My last blog (wordpress) was hacked and I ended up losing
    months of hard work due to no backup. Do you have any solutions to prevent hackers?

  22. Viagra says:

    Propecia England

  23. LucyVEt says:

    how to get modafinil prescription provigil medication

  24. Metformin Without A Prescription

  25. Williamvar says:

    play slots online online casinos [url=https://onlinecasinonetp.com/ ]free casino games [/url]

  26. DavidVEt says:

    modafinil prescription online provigil cost

  27. ColinsCew says:

    how to get modafinil prescription modafinil weight loss

  28. LucyVEt says:

    modafinil prescription online buy modafinil

  29. SidglAnk says:

    modafinil prescription online modafinil

  30. Cialis Generique En Pharmacie Canada

  31. MikeglAnk says:

    how to get modafinil prescription buy modalert

  32. Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    https://www.graythair.org/product/3d-mink-lash-6/

  33. NormanCew says:

    modafinil prescription online provigil 100 mg

  34. Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    https://bitaspain.com/calibracion-de-arco/

  35. Good day very nice site!! Guy .. Excellent .. Wonderful .. I will bookmark your site and take the feeds also? I am satisfied to seek out a lot of useful info right here within the publish, we’d like develop more strategies on this regard, thanks for sharing. . . . . .|

  36. Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    http://oldmarket.gr/?product=integer

  37. Antonioquots says:

    viagra without a doctor prescription usa cost of viagra

  38. PatrickDok says:

    slots for real money casino blackjack [url=https://casinoslotseue.com/ ]vegas slots online [/url]

  39. Diamondvar says:

    how to get modafinil prescription provigil 100mg

  40. aspercasino says:

    Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    https://veechemglobal.com/iftar-dinner/

  41. aspercasino says:

    Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    https://www.focusitinc.com/5-time-management-tips-for-loan-officers/

  42. Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    https://brandonbauder.com/about-the-writer/

  43. ColinsCew says:

    how to get modafinil prescription modalert

  44. ColinsCew says:

    how to get modafinil prescription buy modalert online

  45. SidglAnk says:

    modafinil prescription online provigil 200 mg

  46. Diamondvar says:

    how to get modafinil prescription provigil

  47. SamuelBok says:

    provigil over the counter https://casinoonlinekah.com/ – provigil

  48. NormanCew says:

    provigil 100mg https://casinoonlineqiw.com/ – provigil vs adderall

  49. Williamvar says:

    modafinil prescription https://casinoonlineiew.com/ – provigil side effects

  50. SidglAnk says:

    provigil prescription https://onlinecasinoslles.com/ – buy modafinil

  51. NormanCew says:

    buy provigil https://casinoonlineqiw.com/ – buy provigil online

  52. DavidVEt says:

    provigil 100 mg https://casinoonlineier.com/ – modafinil online

  53. DavidVEt says:

    provigil 100 mg https://casinoonlineier.com/ – modafinil online

  54. Williamvar says:

    modafinil online https://casinoonlineiew.com/ – provigil vs adderall

  55. Williamvar says:

    provigil prescription https://casinoonlineiew.com/ – provigil online

  56. eurocasino says:

    Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    https://lammehiendai.com/2021/08/02/98__trashed-52/

  57. SamuelBok says:

    provigil medication https://casinoonlinekah.com/ – provigil medication

  58. If you want to obtain a good deal from this paragraph then you have to apply these strategies to your won website.|

  59. NormanCew says:

    buy modafinil https://casinoonlineqiw.com/ – armodafinil medication

  60. DavidVEt says:

    provigil 100 mg https://casinoonlineier.com/ – armodafinil medication

  61. Williamvar says:

    provigil pill https://casinoonlineiew.com/ – provigil medication

  62. MikeglAnk says:

    provigil over the counter provigil

  63. SidglAnk says:

    provigil 100mg https://onlinecasinoslles.com/ – provigil side effects

  64. NormanCew says:

    provigil for sale https://casinoonlineqiw.com/ – provigil medication

  65. DavidVEt says:

    modafinil prescription online https://casinoonlineier.com/ – armodafinil medication

  66. kronosslot says:

    Tutorial Codeigniter Membuat Input Data dengan Combo Auto Complete

    http://rabies.cz/photos/

  67. SidglAnk says:

    modafinil generic https://onlinecasinoslles.com/ – provigil online

  68. SamuelBok says:

    modafinil prescription https://casinoonlinekah.com/ – provigil vs adderall

  69. SamuelBok says:

    modafinil prescription https://casinoonlinekah.com/ – provigil medication

  70. NormanCew says:

    provigil generic https://casinoonlineqiw.com/ – buy provigil online

  71. DavidVEt says:

    provigil 100 mg https://casinoonlineier.com/ – provigil side effects

  72. chiplot says:

    Greetings from Ohio! I’m bored to tears at work so I decided to browse your blog
    on my iphone during lunch break. I love the information you provide
    here and can’t wait to take a look when I get home. I’m shocked
    at how fast your blog loaded on my phone
    .. I’m not even using WIFI, just 3G .. Anyways, good site!

  73. Link says:

    I truly love your site.. Excellent colors & theme.
    Did you develop this site yourself? Please reply back as I’m planning to create my own site and
    would like to find out where you got this from or what the theme is named.
    Appreciate it!

  74. Difference Between Red Or Green Keflex

  75. katalog firm says:

    Its such as you read my mind! You seem to
    understand a lot about this, like you wrote
    the ebook in it or something. I believe that you just could do with a
    few % to force the message house a little bit, however instead of that, this is great blog.
    A great read. I’ll definitely be back.

Leave a Reply

Your email address will not be published.

© 2021 javacposjavacpos.com ALL RIGHT RESERVED