Как отобразить 1 данные, если тот же идентификатор и при нажатии отображает тот же идентификатор в контроллере laravel
как это исправить?
контроллер
public function daftar_paket(){
if(!Session::get('login')){
return redirect('/login')->with('alert','Kamu harus login dulu');
}
else{
$paket = DB::table('tbl_paket as a')
->select('*')
->join('tbl_profil_penyedia as b', 'a.id_profil_penyedia', '=', 'b.id_profil_penyedia')
->join('tbl_kategori_belanja as c', 'a.id_kategori_belanja', '=', 'c.id_kategori_belanja')
->join('tbl_kategori_produk as d', 'a.id_kategori_produk', '=', 'd.id_kategori_produk')
->join('tbl_pagu as e', 'a.id_pagu', '=', 'e.id_pagu')
->join('tbl_pembayaran as f', 'a.id_pembayaran', '=', 'f.id_pembayaran')
->get();
$pesanan = DB::table('tbl_pesanan as a')
->select('*')
->join('tbl_bmn2 as b', 'a.kode_bmn', '=', 'b.kode_bmn')
->join('tbl_paket as c', 'a.id_paket', '=', 'c.id_paket')
->join('tbl_profil_penyedia as d', 'c.id_profil_penyedia', '=', 'd.id_profil_penyedia')
->join('tbl_kategori_produk as e', 'c.id_kategori_produk', '=', 'e.id_kategori_produk')
->get();
return view('paket/home_daftar_paket',['paket' => $paket, 'pesanan' => $pesanan]);
}
}
добавить это может помочь?
посмотреть
@foreach($pesanan as $p)
@php $status = $p->status_paket; @endphp
@if ($status == 2)
<table style="width:100%">
<tr>
<td style="width: 15%;"><b>Nama Pesanan</b></td>
<td style="width: 1%;">:</td>
<td>{{$p->nama_pesanan }}</td>
</tr>
<tr>
<td style="width: 15%;"><b>Jenis Belanja</b></td>
<td style="width: 1%;">:</td>
<td>
{{$p->nama_kategori_produk}}
</td>
</tr>
<tr>
<td style="width: 15%;"><b>Kategori Belanja</b></td>
<td style="width: 1%;">:</td>
<td>{{$p->kode}} - {{$p->kategori_belanja}}</td>
</tr>
<tr>
<td style="width: 15%;"><b>Pagu</b></td>
<td style="width: 1%;">:</td>
<td>{{$p->kegiatan}}-{{$p->output}}-{{$p->sub_output}}-{{$p->komponen}}-{{$p->sub_komponen}}-{{$p->mak}} {{$p->uraian_mak}}</td>
</tr>
<tr>
<td style="width: 15%;"><b>Pembayaran</b></td>
<td style="width: 1%;">:</td>
<td>{{$p->jenis_pembayaran}}</td>
</tr>
</table><br>
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'Pesanan')" >Pesanan</button>
<button class="tablinks" onclick="openCity(event, 'Penawaran')" id="defaultOpen">Penawaran</button>
<button class="tablinks" onclick="openCity(event, 'Negosiasi')">Negosiasi</button>
</div>
<div id="Pesanan" class="tabcontent">
<div class="col-md-12">
<table class="table">
<thead>
<tr>
<th style="text-align: center; width: 25px;">Kode BMN</th>
<th style="text-align: center; width: 25px;">Nama Barang</th>
<th style="text-align: center; width: 1px;">Kuantitas</th>
<th style="text-align: center; width: 25px;">Satuan Ukuran</th>
<th style="text-align: center; width: 25px;">Kode Unit</th>
</tr>
</thead>
<tbody>
<tr id="addRow" >
<td class="col-xs-3" style="text-align: center;">{{$p->kode_bmn}}
</td>
<td class="col-xs-3" style="text-align: center;">{{$p->jenis_barang}}
</td>
<td class="col-xs-5" style="text-align: center;">{{$p->kuantitas}}
</td>
<td class="col-xs-5" style="text-align: center;">{{$p->satuan_ukuran}}
</td>
<td class="col-xs-5" style="text-align: center;">{{$p->kode_ruang}}
</td>
</tr>
</tbody>
</table>
<div class="col-md-1 pull-right"><br><br>
<button type="submit" class="btn btn-primary pull-right">Save</button>
</div>
</form>
</div>
</div>
<div id="Penawaran" class="tabcontent">
<div class="col-md-12">
<table class="table">
<thead>
<tr>
<th style="text-align: center; width: 20px;">Kode BMN</th>
<th style="text-align: center; width: 15px;">Nama Barang</th>
<th style="text-align: center; width: 5px;">Kuantitas</th>
<th style="text-align: center; width: 5px;">Satuan Ukuran</th>
<th style="text-align: center; width: 20px;">Kode Unit</th>
<th style="text-align: center; width: 5px;">Harga Satuan</th>
</tr>
</thead>
<tbody>
<tr id="addRow" >
<td class="col-xs-3" style="text-align: center;">{{$p->kode_bmn}}
</td>
<td class="col-xs-3" style="text-align: center;">{{$p->jenis_barang}}
</td>
<td class="col-xs-5" style="text-align: center;">{{$p->kuantitas}}
</td>
<td class="col-xs-5" style="text-align: center;">{{$p->satuan_ukuran}}
</td>
<td class="col-xs-5" style="text-align: center;">{{$p->kode_ruang}}
</td>
<td class="col-xs-3">
<input class="form-control " type="text" placeholder="Enter title" />
</td>
</tr>
</tbody>
</table>
<div class="col-md-1 pull-right"><br><br>
<button class="btn btn-primary pull-right">Save</button>
</div>
</div>
</div>
<div id="Negosiasi" class="tabcontent">
<table class="table">
<thead>
<tr>
<th style="text-align: center; width: 1px;">No</th>
<th style="text-align: center; width: 20px;">Kode BMN</th>
<th style="text-align: center; width: 15px;">Nama Barang</th>
<th style="text-align: center; width: 5px;">Kuantitas</th>
<th style="text-align: center; width: 5px;">Satuan Ukuran</th>
<th style="text-align: center; width: 20px;">Kode Unit</th>
<th style="text-align: center; width: 5px;">Harga Satuan</th>
<th style="text-align: center; width: 10px;">Negosiasi</th>
<th style="text-align: center; width: 5px;">Status Negosiasi</th>
</tr>
</thead>
@php $no = 1; @endphp
<tbody>
<tr id="addRow" >
<td>{{ $no++ }}</td>
<td style="text-align: center;">1010101008</td>
<td style="text-align: center;">meja</td>
<td style="text-align: center;">5</td>
<td style="text-align: center;">UNIT</td>
<td style="text-align: center;">10001</td>
<td style="text-align: center;">Rp50.000</td>
<td class="col-xs-3">
<input class="form-control " type="text" placeholder="Enter title" />
</td>
<td style="text-align: center;">
<a href="" title="Sepakat"><i class="fas fa-thumbs-up" style="color: green;"></i></a>
<a href="" title="Tolak"><i class="fas fa-thumbs-down" style="color: red;"></i></a>
</td>
</tr>
</tbody>
</table>
<div class="col-md-1 pull-right"><br><br>
<button type="submit" class="btn btn-primary pull-right">Save</button>
</div>
</div>
@endif
Как? Как вы нажимаете кнопку «отправить ставку», чтобы отобразить тот же список ip? Пожалуйста, помогите мне
Как отобразить 1 данные, если тот же идентификатор и при нажатии отображает тот же идентификатор в контроллере laravel