update index simulasi, lelong by caw_name
This commit is contained in:
@@ -51,16 +51,34 @@ class LelongController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$lelong = Lelong::all();
|
||||
// $lelong = Lelong::all();
|
||||
|
||||
foreach($lelong as $lel)
|
||||
// foreach($lelong as $lel)
|
||||
// {
|
||||
// $caw_lelong = CawanganLelong::join('cawangan', 'cawangan_lelong.caw_id', '=', 'cawangan.id')
|
||||
// ->where('lelong_id', $lel['id'])
|
||||
// ->get()->toArray();
|
||||
// }
|
||||
$arrayinfo = [];
|
||||
|
||||
$lelong = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
|
||||
->select('lelong_id','tarikh_lelong','masatamat_lelong','harga_emas_asas','jbg','cajlelong','sts_lelong')
|
||||
->groupBy('lelong_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
foreach($lelong as $info)
|
||||
{
|
||||
$caw_lelong = CawanganLelong::join('cawangan', 'cawangan_lelong.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong_id', $lel['id'])
|
||||
->get()->toArray();
|
||||
|
||||
$detailsinfo = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('lelong_id',$info['lelong_id'])
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arrayinfo,['info'=>$info, 'detailsinfo'=>$detailsinfo]);
|
||||
|
||||
}
|
||||
|
||||
return view('lelong.senarailelong',compact('lelong', 'caw_lelong'));
|
||||
return view('lelong.senarailelong',compact('lelong', 'arrayinfo'));
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
@@ -810,22 +828,49 @@ class LelongController extends Controller
|
||||
|
||||
public function lapbrglelongindex (Request $request){
|
||||
|
||||
// $user = Auth::user();
|
||||
|
||||
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
// ->where('cawangan.caw_code','=',$user->kodcaw)
|
||||
->get();
|
||||
$arraydetails = [];
|
||||
|
||||
return view('lelong.laporanlelong',compact('lelongid'));
|
||||
$laporanpembida= Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
|
||||
->select('lelong_id','tarikh_lelong')
|
||||
->groupBy('lelong_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
foreach($laporanpembida as $laporan)
|
||||
{
|
||||
$details = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('lelong_id',$laporan['lelong_id'])
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arraydetails,['laporan' => $laporan,'details' => $details]);
|
||||
}
|
||||
|
||||
return view('lelong.laporanlelong', compact('arraydetails'));
|
||||
}
|
||||
|
||||
public function senaraibrglelong($lelong_id){
|
||||
|
||||
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
|
||||
|
||||
$arraydetails = [];
|
||||
$arrayinfo = [];
|
||||
|
||||
|
||||
$lelongid = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
|
||||
->where('cawangan_lelong.lelong_id','=',$lelong_id)
|
||||
->get();
|
||||
->select('lelong_id','tarikh_lelong')
|
||||
->groupBy('lelong_id')
|
||||
->get()->toArray();
|
||||
|
||||
foreach($lelongid as $laporan)
|
||||
{
|
||||
$details = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('lelong_id',$laporan['lelong_id'])
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arrayinfo,['laporan' => $laporan,'details' => $details]);
|
||||
}
|
||||
|
||||
|
||||
$brglelong = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
@@ -853,7 +898,7 @@ class LelongController extends Controller
|
||||
|
||||
|
||||
|
||||
return view('lelong.senaraibrglelong',compact('lelongid','brglelong','lelong_id','keuntungan','total_hargaasas','total_upahkeuntungan','total_nmarhun','total_pinjaman'));
|
||||
return view('lelong.senaraibrglelong',compact('arrayinfo','lelongid','brglelong','lelong_id','keuntungan','total_hargaasas','total_upahkeuntungan','total_nmarhun','total_pinjaman'));
|
||||
|
||||
}
|
||||
|
||||
@@ -911,6 +956,7 @@ class LelongController extends Controller
|
||||
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->get();
|
||||
|
||||
|
||||
return view('lelong.laporanbidaanindex',compact('lelongid'));
|
||||
}
|
||||
@@ -925,6 +971,7 @@ class LelongController extends Controller
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('cawangan_lelong.lelong_id','=',$lelong_id)
|
||||
->get();
|
||||
|
||||
|
||||
$laporanpembida= LelongBid::join('lelongbidder','lelongbid.id','=','lelongbidder.lelongbid_id')
|
||||
->select('lelongbid_id','norujukan','hargaasas')
|
||||
|
||||
@@ -277,9 +277,28 @@ class SimulasiController extends Controller
|
||||
|
||||
public function senaraisimulasi()
|
||||
{
|
||||
$simulasi = Simulasi::all();
|
||||
// $simulasi = Simulasi::all();
|
||||
|
||||
return view('simulasi.senaraisimulasi',compact('simulasi'));
|
||||
$arrayinfo = [];
|
||||
|
||||
$simulasi = Simulasi::join('cawangan_simulasi','simulasi.id','=','cawangan_simulasi.simulasi_id')
|
||||
->select('simulasi_id','tarikh_lelong')
|
||||
->groupBy('simulasi_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
foreach($simulasi as $info)
|
||||
{
|
||||
$detailsinfo = CawanganSimulasi::join('cawangan','cawangan_simulasi.caw_id','=','cawangan.id')
|
||||
->where('simulasi_id',$info['simulasi_id'])
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
array_push($arrayinfo, ['info'=> $info, 'detailsinfo'=>$detailsinfo]);
|
||||
|
||||
}
|
||||
|
||||
return view('simulasi.senaraisimulasi',compact('simulasi','arrayinfo'));
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
|
||||
@@ -30,7 +30,7 @@ class CreateCawangansTable extends Migration
|
||||
$table->string('nofaks')->nullable();
|
||||
$table->string('lokasi')->nullable();
|
||||
$table->string('pkb_jmc')->nullable();
|
||||
$table->string('para2')->nullable();
|
||||
// $table->string('para2')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class AddPara2ToCawanganTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('cawangan', function (Blueprint $table) {
|
||||
$table->string('para2');
|
||||
$table->string('para2')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class AddPara2ToCawanganTable extends Migration
|
||||
public function down()
|
||||
{
|
||||
Schema::table('cawangan', function (Blueprint $table) {
|
||||
$table->dropColumn('para2');
|
||||
$table->dropColumn('para2') ;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,25 +16,31 @@
|
||||
<table class="table table-striped table-xl" id="tablenotislelong" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
|
||||
<th>No</th>
|
||||
<th>Lelong ID</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Cawangan</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($lelongid as $bid)
|
||||
@foreach ($arraydetails as $laporan)
|
||||
<tr>
|
||||
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $bid->id }}"></td>
|
||||
<td>{{ $bid->lelong_id}}</td>
|
||||
<td>{{ $bid->caw_name}}</td>
|
||||
<td>{{ $bid->tarikh_lelong }}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ route('lelong.senaraibrglelong',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Senarai Barang Lelong" ><i class="far fa-edit"></i></a>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $laporan['laporan']['lelong_id']}}</td>
|
||||
<td>{{ $laporan['laporan']['tarikh_lelong']}}</td>
|
||||
<td>
|
||||
@foreach($laporan['details'] as $details)
|
||||
<span class="m-2">{{ $details['caw_name']}}</span><br>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td class="text-center">
|
||||
<a href="{{ route('lelong.senaraibrglelong',$laporan['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Senarai Barang Lelong" ><i class="far fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
|
||||
@@ -4,12 +4,18 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
@foreach ($lelongid as $info)
|
||||
@foreach ($arrayinfo as $laporan)
|
||||
|
||||
<span class="pt-3" style="margin-left:1%;"><b>Laporan Barang Lelong </b></span>
|
||||
<span class="pt-3" style="margin-left:1%;">Lelong ID: {{ $lelong_id}}</span>
|
||||
<span class="pt-3" style="margin-left:1%;">Cawangan: {{ $info->caw_name}}</span>
|
||||
<span class="pt-3" style="margin-left:1%;">Tarikh Lelong: {{ $info->tarikh_lelong}}</span><br>
|
||||
<span class="pt-3" style="margin-left:1%;">Lelong ID: {{ $laporan['laporan']['lelong_id']}}</span>
|
||||
<span class="pt-3" style="margin-left:1%;">Tarikh Lelong: {{ $laporan['laporan']['tarikh_lelong']}}</span>
|
||||
@foreach($laporan['details'] as $details)
|
||||
<span class="pt-3" style="margin-left:1%;">Cawangan: {{ $details['caw_name']}}</span>
|
||||
@endforeach
|
||||
<br>
|
||||
@endforeach
|
||||
|
||||
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
@@ -85,7 +91,7 @@
|
||||
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 10,
|
||||
"pageLength": 99999999999,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
<table class="table table-striped table-xl text-center" id="tablelelong" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
|
||||
<th>Cawangan</th>
|
||||
<th>No</th>
|
||||
<th>Lelong ID</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Masa Tamat Lelong</th>
|
||||
<th>Harga Emas Asas</th>
|
||||
<th>JBG</th>
|
||||
@@ -27,41 +28,50 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($lelong as $lel)
|
||||
@foreach ($arrayinfo as $lel)
|
||||
<tr>
|
||||
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $lel->id }}"></td>
|
||||
<td>{{ $caw_lelong[0]['caw_name'] }}</td>
|
||||
<td>{{ $lel->tarikh_lelong }}</td>
|
||||
<td>{{ $lel->masatamat_lelong }}</td>
|
||||
<td>{{ $lel->harga_emas_asas }}</td>
|
||||
<td>{{ $lel->jbg }}</td>
|
||||
<td>{{ $lel->cajlelong }}</td>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>{{ $lel['info']['lelong_id'] }}</td>
|
||||
<td>{{ $lel['info']['tarikh_lelong']}}</td>
|
||||
<td>
|
||||
@foreach($lel['detailsinfo'] as $details)
|
||||
<span class="m-2">{{$details['caw_name']}}</span><br>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>{{$lel['info']['masatamat_lelong']}}</td>
|
||||
<td>{{$lel['info']['harga_emas_asas']}}</td>
|
||||
<td>{{$lel['info']['jbg']}}</td>
|
||||
<td>{{$lel['info']['cajlelong']}}</td>
|
||||
|
||||
<td class="text-center">
|
||||
@hasrole('jurulelong')
|
||||
|
||||
@if($lel->sts_lelong == 0)
|
||||
<a href="{{ route('lelong.refresh',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Kemaskini Data" style="margin-right:40px"><i class="fas fa-sync-alt"></i></a>
|
||||
<a class="startlelong" href="{{ route('lelong.start',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Mula Lelong" style="margin-right:40px"><i class="fa fa-play"></i></a>
|
||||
<a href="{{ route('lelong.show',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Butiran" style="margin-right:40px" ><i class="far fa-edit"></i></a>
|
||||
<a class="confirmdel" href="{{ route('lelong.delete',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Padam" ><i class="far fa-trash-alt"></i></a>
|
||||
@elseif ($lel->sts_lelong == 2)
|
||||
<a href="{{ route('lelong.janapemenang',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Jana Pemenang"><i class="fas fa-users-cog"></i></a>
|
||||
@elseif ($lel->sts_lelong == 3)
|
||||
<a href="{{ route('lelong.senaraipemenang',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Senarai Pemenang"><i class="fas fa-trophy"></i></a>
|
||||
@if($lel['info']['sts_lelong'] == 0)
|
||||
<a href="{{ route('lelong.refresh',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Kemaskini Data" style="margin-right:40px"><i class="fas fa-sync-alt"></i></a>
|
||||
<a class="startlelong" href="{{ route('lelong.start',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Mula Lelong" style="margin-right:40px"><i class="fa fa-play"></i></a>
|
||||
<a href="{{ route('lelong.show',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Butiran" style="margin-right:40px" ><i class="far fa-edit"></i></a>
|
||||
<a class="confirmdel" href="{{ route('lelong.delete',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Padam" ><i class="far fa-trash-alt"></i></a>
|
||||
@elseif ($lel['info']['sts_lelong'] == 2)
|
||||
<a href="{{ route('lelong.janapemenang',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Jana Pemenang"><i class="fas fa-users-cog"></i></a>
|
||||
@elseif ($lel['info']['sts_lelong'] == 3)
|
||||
<a href="{{ route('lelong.senaraipemenang',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Senarai Pemenang"><i class="fas fa-trophy"></i></a>
|
||||
@else
|
||||
<a class="stoplelong" href="{{ route('lelong.stop',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Tamat Lelong"><i class="fa fa-stop"></i></a>
|
||||
<a class="stoplelong" href="{{ route('lelong.stop',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Tamat Lelong"><i class="fa fa-stop"></i></a>
|
||||
@endif
|
||||
@endhasrole
|
||||
@hasrole('operasi')
|
||||
|
||||
@if($lel->sts_lelong == 0)
|
||||
<a href="{{ route('lelong.show',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Butiran" style="margin-right:40px" ><i class="far fa-edit"></i></a>
|
||||
<a class="confirmdel" href="{{ route('lelong.delete',$lel->id) }}" data-toggle="tooltip" data-placement="top" title="Padam" ><i class="far fa-trash-alt"></i></a>
|
||||
@if($lel['info']['sts_lelong'] == 0)
|
||||
<a href="{{ route('lelong.show',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Butiran" style="margin-right:40px" ><i class="far fa-edit"></i></a>
|
||||
<a class="confirmdel" href="{{ route('lelong.delete',$lel['info']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Padam" ><i class="far fa-trash-alt"></i></a>
|
||||
@endif
|
||||
@endhasrole
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
@@ -108,7 +118,7 @@
|
||||
// "ordering": false,
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
"pageLength": 99999999,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
// 'copy', 'excel', 'pdf'
|
||||
|
||||
@@ -15,30 +15,32 @@
|
||||
<table class="table table-striped table-xl text-center" id="simulasi" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
|
||||
<th>No</th>
|
||||
<th>Lelong ID</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Cawangan</th>
|
||||
<th>JBG</th>
|
||||
<th>Caj Lelong</th>
|
||||
<th>Cawangan</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($simulasi as $sim)
|
||||
@foreach ($arrayinfo as $info)
|
||||
<tr>
|
||||
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $sim->id }}"></td>
|
||||
<td>{{ $sim->tarikh_lelong }}</td>
|
||||
<td>{{ $sim->harga_emas_asas }}</td>
|
||||
<td>{{ $sim->jbg }}</td>
|
||||
<td>{{ $sim->cajlelong }}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ route('analisa.show',$sim->id) }}" data-toggle="tooltip" data-placement="top" title="Butiran Simulasi" style="margin-right:30px"><i class="far fa-edit"></i></a>
|
||||
{{-- <a href="{{ route('sistem.showConn',$data->id) }}"><i class="far fa-eye"></i></a> --}}
|
||||
<a class="confirmdel" href="{{ route('analisa.delete',$sim->id) }}" data-toggle="tooltip" data-placement="top" title="Padam"><i class="far fa-trash-alt"></i></a>
|
||||
|
||||
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>{{$info['info']['simulasi_id']}}</td>
|
||||
<td>{{$info['info']['tarikh_lelong']}}</td>
|
||||
<td>
|
||||
@foreach($info['detailsinfo'] as $info2)
|
||||
<span class="m-2">{{$info2['caw_name']}}</span><br>
|
||||
@endforeach
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ route('analisa.show',$info['info']['simulasi_id']) }}" data-toggle="tooltip" data-placement="top" title="Butiran Simulasi" style="margin-right:30px"><i class="far fa-edit"></i></a>
|
||||
<a class="confirmdel" href="{{ route('analisa.delete',$info['info']['simulasi_id']) }}" data-toggle="tooltip" data-placement="top" title="Padam"><i class="far fa-trash-alt"></i></a>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user