Merge branch 'atie' into 'main'
update multiple select cawangan simulasi See merge request online-sistem1/lelong!24
This commit is contained in:
@@ -127,9 +127,7 @@ class ImportDataController extends Controller
|
||||
$berat1 = $row_tender1['berat'];
|
||||
$harga1 = $row_tender1['harga'];
|
||||
$n_marhun1 = $row_tender1['n_marhun'];
|
||||
//$hargaasas1 = $row_tender1['hargaasas'];
|
||||
//$batch_no1 = $row_tender1['batch_no'];
|
||||
|
||||
|
||||
DB::insert("INSERT INTO elelong.gadaimarhun (kodcaw,norujukan,t_gadai,bil,marhun,nota,karat,berat,harga,n_marhun)
|
||||
VALUES ('$kodcaw1','$norujukan1','$t_gadai1','$bil1','$marhun1','$nota1','$karat1','$berat1','$harga1','$n_marhun1')");
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class SimulasiController extends Controller
|
||||
|
||||
public function janadata(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
//dd($request->all());
|
||||
$t_lelong = Carbon::parse($request->tarikh_lelong);
|
||||
$bulan = (int)round($request->jbg);
|
||||
$jbgadai = ($t_lelong->subMonths($bulan))->toDateString();
|
||||
@@ -185,22 +185,27 @@ class SimulasiController extends Controller
|
||||
}
|
||||
elseif($request->caw && $request->caw != 'all')
|
||||
{
|
||||
// dd($request->caw);
|
||||
$caw = Cawangan::where('id','=',$request->caw)->first();
|
||||
//dd($request->caw);
|
||||
$caw = Cawangan::whereIn('id',$request->caw)->get();
|
||||
// dd($caw);
|
||||
foreach($caw as $index=>$cawsimulasi){
|
||||
// dd($cawsimulasi->id);
|
||||
$caw_simulasi = new CawanganSimulasi;
|
||||
$caw_simulasi->simulasi_id = $simulasi->id;
|
||||
$caw_simulasi->caw_id = $caw->id;
|
||||
$caw_simulasi->caw_id = $cawsimulasi->id;
|
||||
$caw_simulasi->online = 'Online';
|
||||
$caw_simulasi->lokasi = $caw->lokasi;
|
||||
$caw_simulasi->lokasi = $cawsimulasi->lokasi;
|
||||
$caw_simulasi->save();
|
||||
// dd($caw_simulasi);
|
||||
|
||||
$suratcaw = $surat->where('kodcaw','=',$cawsimulasi->caw_code)->all();
|
||||
|
||||
$suratcaw = $surat->where('kodcaw','=',$caw->caw_code)->all();
|
||||
// $simulasibid = SimulasiBid::where('caw_id','=',$caw->id)->get();
|
||||
foreach($suratcaw as $data)
|
||||
{
|
||||
$simulasibid = new SimulasiBid;
|
||||
$simulasibid->simulasi_id = $simulasi->id;
|
||||
$simulasibid->caw_id = $caw->id;
|
||||
$simulasibid->caw_id = $cawsimulasi->id;
|
||||
$simulasibid->kodcaw = $data->kodcaw;
|
||||
$simulasibid->norujukan = $data->norujukan;
|
||||
$simulasibid->t_lelong = $request->tarikh_lelong;
|
||||
@@ -267,6 +272,7 @@ class SimulasiController extends Controller
|
||||
$updatesimbid->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dd('error');
|
||||
@@ -301,7 +307,7 @@ class SimulasiController extends Controller
|
||||
return view('simulasi.senaraisimulasi',compact('simulasi','arrayinfo'));
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
$simulasi_id = $id;
|
||||
$simulasi = Simulasi::where('id','=',$id)->first();
|
||||
@@ -461,9 +467,9 @@ class SimulasiController extends Controller
|
||||
$data = Simulasi::where('simulasi.id','=',$simulasi_id)
|
||||
->get();
|
||||
|
||||
$simulasi = new Simulasi;
|
||||
$simulasi->harga_emas_asas = $request->hargaasas;
|
||||
$simulasi->save();
|
||||
// $simulasi = new Simulasi;
|
||||
// $simulasi->harga_emas_asas = $request->hargaasas;
|
||||
// $simulasi->save();
|
||||
}
|
||||
|
||||
|
||||
@@ -494,7 +500,8 @@ class SimulasiController extends Controller
|
||||
'jeniskarat',
|
||||
'data',
|
||||
'total_upahkeuntungan',
|
||||
'total_nilaimarhun'));
|
||||
'total_nilaimarhun'
|
||||
));
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
|
||||
@@ -15,13 +15,13 @@ class CreateSimulasisTable extends Migration
|
||||
{
|
||||
Schema::create('simulasi', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('tarikh_lelong');
|
||||
$table->string('tarikh_lelong')->nullable();
|
||||
$table->time('masatamat_lelong')->nullable();
|
||||
$table->dateTime('masakemaskini_data')->nullable();
|
||||
$table->string('kali')->nullable();
|
||||
$table->string('harga_emas_asas');
|
||||
$table->string('jbg');
|
||||
$table->integer('cajlelong');
|
||||
$table->string('harga_emas_asas')->nullable();
|
||||
$table->string('jbg')->nullable();
|
||||
$table->integer('cajlelong')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ class CreateSimulasisTable extends Migration
|
||||
$table->string('import_data_sts')->nullable();
|
||||
$table->date('export_data_stsdate')->nullable();
|
||||
$table->date('import_data_sts_date')->nullable();
|
||||
$table->string('lokasi');
|
||||
$table->string('lokasi')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('caw_id')
|
||||
|
||||
@@ -37,7 +37,7 @@ class CreateLelongsTable extends Migration
|
||||
$table->string('import_data_sts')->nullable();
|
||||
$table->date('export_data_stsdate')->nullable();
|
||||
$table->date('import_data_sts_date')->nullable();
|
||||
$table->string('lokasi');
|
||||
$table->string('lokasi')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('caw_id')
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/css/select2.min.css" rel="stylesheet"/>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/select2.min.js"></script>
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-12 mx-auto card">
|
||||
@@ -11,7 +14,7 @@
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('analisa.janadata')}}" method="POST">
|
||||
<form action="{{route('analisa.janadata')}}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label for="tarikh_lelong" class="col-sm-1 col-form-label">Tarikh</label>
|
||||
@@ -30,13 +33,13 @@
|
||||
</div>
|
||||
<label for="caw" class="col-sm-1 col-form-label">Cawangan</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="custom-select" name="caw" id="caw">
|
||||
<option value="">Please select</option>
|
||||
<select class="selectpicker" multiple name="caw[]" id="caw">
|
||||
<!-- <option value="">Please select</option> -->
|
||||
@foreach ($caw as $item)
|
||||
<option value="{{$item->id}}">{{$item->caw_name}}</option>
|
||||
@endforeach
|
||||
|
||||
<option value="all">Select All</option>
|
||||
<!-- <option value="all">Select All</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,7 +65,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
$('#caw').select2({
|
||||
width: '100%',
|
||||
placeholder: "Pilih Cawangan",
|
||||
allowClear: true
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<td>{{ $marhun['caw_name'] }}</td>
|
||||
<td>{{ $marhun['norujukan']}}</td>
|
||||
<td>{{ number_format($marhun['pinjaman'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['jbg'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['tempoh'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['berat'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['nilaimarhun'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['hargaasas'], 2, '.', ',') }}</td>
|
||||
|
||||
Reference in New Issue
Block a user