Postingan lainnya
Kelas Premium!
Belajar bikin website dari nol sekarang
Gunakan kupon "lebihcepat" untuk diskon 25%!
Mengedit form dengan 2 pencarian sebagai kunci
image.pngimage.png
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>NO</th>
<th>Nama Store</th>
<th>Nama Produk</th>
<th>Stock</th>
<th>ED</th>
<th>Keterangan</th>
</tr>
</thead>
<tbody>
<?php $no=0; foreach($data_stk_mt as $row) { $no++ ?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $row['namastr']; ?></td>
<td><?php echo $row['namabrg']; ?></td>
<td><?php echo $row['qty']; ?></td>
<td><?php echo $row['ed']; ?></td>
<td>
<a class="btn btn-warning btn-sm" href="<?php echo base_url(); ?>stk/editstk/<?php echo $row['kodestr'];?><?php echo $row['kode_product']?>"><i class="fa fa-pencil-square-o"></i></a>
<a onclick="return confirm('Hapus data??');" class="btn btn-danger btn-sm" href="<?php echo base_url(); ?>stk/hapusstk/<?php echo $row['kodestr']; ?>"><i class="fa fa-trash"></i></a>
</td>
</tr>
<?php } ?>
</tbody>
view.php
function editstk($kodestr=null,$kode_product=null){
//$kodestr = $this->input->post('kodestr');
//$kode_product = $this->input->post('kode_product');
$tampung = $this->model->GetMstrStk("where kodestr = '$kodestr' or kode_product = '$kode_product'")->result_array();
//echo $tampung();
$data = array(
'nama' => $this->session->userdata('nama'),
'status' => 'lama',
'namabrg' => $tampung[0]['namabrg'],
'namastr' => $tampung[0]['namastr'],
'qty' => $tampung[0]['qty'],
'ed' => $tampung[0]['ed'],
//'data_str' => $this->model->GetMstrStr("where t.kodestr != '$kodestr' order by kodestr asc")->result_array()
);
$this->load->view('stk/edit_stk_mt', $data);
}
controller.php
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban