notis lelong
This commit is contained in:
@@ -6,18 +6,17 @@ use Illuminate\Http\Request;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\User;
|
||||
use PDF;
|
||||
use App\Models\Cawangan;
|
||||
use App\Models\JenisEmas;
|
||||
use App\Models\JenisKarat;
|
||||
|
||||
use App\Models\LelongBidder;
|
||||
use App\Models\Lelong;
|
||||
use App\Models\CawanganLelong;
|
||||
use App\Models\LelongBid;
|
||||
use App\Models\LelongBidMarhun;
|
||||
use App\Models\LelKarat;
|
||||
use App\Models\LelKarat_temp;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Resit;
|
||||
|
||||
|
||||
class NotisController extends Controller
|
||||
{
|
||||
@@ -36,45 +35,77 @@ class NotisController extends Controller
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
|
||||
public function notislelong()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
$caw = Cawangan::where('caw_code','=',$user->kodcaw)->first();
|
||||
$lelongbid = LelongBid::where('caw_id','=',$caw->id)->get();
|
||||
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
|
||||
->first();
|
||||
|
||||
$lelongid = LelongBid::select('lelong_id')->where('caw_id','=',$caw->id)->groupBy('lelong_id')->get();
|
||||
$lelong = Lelong::whereIn('id', $lelongid)->get();
|
||||
$lelongbid = LelongBid::where('caw_id','=',$caw->id)
|
||||
->get();
|
||||
|
||||
$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();
|
||||
|
||||
$lelong = Lelong::where('id', $lelongid)->get();
|
||||
|
||||
return view('jananotis.notislelong',compact('lelongbid','lelongid'));
|
||||
}
|
||||
|
||||
public function senarainotis($lelong_id){
|
||||
|
||||
$lelong_id = $lelong_id;
|
||||
|
||||
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get()->toArray();
|
||||
|
||||
|
||||
|
||||
return view('jananotis.senarainotis',compact('payment','lelong_id'));
|
||||
|
||||
return view('marhun.senaraimarhun',compact('lelongbid','lelong'));
|
||||
}
|
||||
|
||||
public function jananotis($lelong_id){
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
|
||||
->first();
|
||||
|
||||
$lelong_id = $lelong_id;
|
||||
|
||||
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
// -join('customer','gadai.')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get()->toArray();
|
||||
|
||||
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('cawangan.caw_code','=',$user->kodcaw)
|
||||
->where('cawangan_lelong.lelong_id', $lelong_id)
|
||||
|
||||
->get();
|
||||
|
||||
$lelong = Lelong::where('id', $lelongid)->get();
|
||||
|
||||
|
||||
// return view ('pdf.jananotis',compact('payment','lelong_id','lelongid','caw'));
|
||||
|
||||
$pdf = PDF::loadView('pdf.jananotis',compact('payment','lelong_id','lelongid','caw'))
|
||||
->setPaper('a4', 'potrait');
|
||||
|
||||
return $pdf->download('Penjanaan Notis.pdf');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// public function exportmarhundetails(Request $request)
|
||||
// {
|
||||
// $lelongbid = LelongBid::where('id','=',$request->lelongbid)->first();
|
||||
// $marhun = LelongBidMarhun::where('lelongbid_id','=',$request->lelongbid)->get();
|
||||
|
||||
// $karatall = JenisKarat::all();
|
||||
// $emasall = JenisEmas::all();
|
||||
|
||||
|
||||
|
||||
// $pdf = PDF::loadView('pdf.marhundetails',compact('marhun',
|
||||
// 'lelongbid',
|
||||
// 'karatall',
|
||||
|
||||
// 'emasall'))->setPaper('a4', 'landscape');
|
||||
|
||||
// return $pdf->download('Senarai Lelong Details.pdf');
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,26 +10,13 @@ use Carbon\Carbon;
|
||||
use App\Models\User;
|
||||
use PDF;
|
||||
use App\Models\Cawangan;
|
||||
use App\Models\Gadai;
|
||||
use App\Models\GadaiMarhun;
|
||||
use App\Models\Simulasi;
|
||||
use App\Models\SimulasiBid;
|
||||
use App\Models\SimulasiBidMarhun;
|
||||
use App\Models\SimKarat;
|
||||
use App\Models\SimKarat_temp;
|
||||
use App\Models\CawanganSimulasi;
|
||||
use App\Models\JenisEmas;
|
||||
use App\Models\JenisKarat;
|
||||
use App\Models\LelongBidder;
|
||||
|
||||
|
||||
use App\Models\Lelong;
|
||||
use App\Models\CawanganLelong;
|
||||
use App\Models\LelongBid;
|
||||
use App\Models\LelongBidMarhun;
|
||||
use App\Models\LelKarat;
|
||||
|
||||
use App\Models\Payment;
|
||||
use App\Models\Resit;
|
||||
|
||||
|
||||
class SerahanController extends Controller
|
||||
{
|
||||
@@ -57,14 +44,14 @@ class SerahanController extends Controller
|
||||
->first();
|
||||
|
||||
$lelongbid = LelongBid::where('caw_id','=',$caw->id)
|
||||
->get();
|
||||
->get();
|
||||
|
||||
$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();
|
||||
|
||||
$lelong = Lelong::whereIn('id', $lelongid)->get();
|
||||
$lelong = Lelong::where('id', $lelongid)->get();
|
||||
|
||||
return view('serahan.laporanserahan',compact('lelongbid','lelongid'));
|
||||
}
|
||||
@@ -218,11 +205,7 @@ class SerahanController extends Controller
|
||||
|
||||
return $pdf->download('Senarai Bidaan.pdf');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user