perbaikan conflict di route web
This commit is contained in:
@@ -1,200 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\BranchExport;
|
||||
use Modules\Lpj\Http\Requests\BranchRequest;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
|
||||
class AuthorizationController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
{// dd('hai');
|
||||
// return view('lpj::branch.index');
|
||||
// $permohonan = Permohonan::find(2);
|
||||
// dd($permohonan->get());
|
||||
return view('lpj::authorization.index');
|
||||
}
|
||||
|
||||
public function store(BranchRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
Branch::create($validate);
|
||||
return redirect()
|
||||
->route('basicdata.branch.index')
|
||||
->with('success', 'Branch created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.branch.create')
|
||||
->with('error', 'Failed to create branch');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::branch.create');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$branch = Branch::find($id);
|
||||
return view('lpj::branch.create', compact('branch'));
|
||||
}
|
||||
|
||||
public function update(BranchRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Update in database
|
||||
$branch = Branch::find($id);
|
||||
$branch->update($validate);
|
||||
return redirect()
|
||||
->route('basicdata.branch.index')
|
||||
->with('success', 'Branch updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.branch.edit', $id)
|
||||
->with('error', 'Failed to update branch');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
// Delete from database
|
||||
$branch = Branch::find($id);
|
||||
$branch->delete();
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Branch deleted successfully']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to delete branch']);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
// if (is_null($this->user) || !$this->user->can('branch.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
// }
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query();
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
// $data = $query->get();
|
||||
$data = $query->select('permohonan.id', 'permohonan.nomor_registrasi'
|
||||
, 'branches.name AS branche_name'
|
||||
, 'debitures.name AS debiture_name'
|
||||
// , 'tujuan_penilaian.name AS debiture_name'
|
||||
, DB::raw("CONCAT(tujuan_penilaian.code,' - ', tujuan_penilaian.name) AS nama_tujuan_penilaian")
|
||||
, 'users.name AS account_officer')
|
||||
->leftJoin('branches', 'branches.id', '=', 'permohonan.branch_id')
|
||||
->leftJoin('debitures', 'debitures.id', '=', 'permohonan.debiture_id')
|
||||
->leftJoin('tujuan_penilaian', 'tujuan_penilaian.id', '=', 'permohonan.tujuan_penilaian_id')
|
||||
->leftJoin('users', 'users.id', '=', 'permohonan.user_id')
|
||||
->get();
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
/*
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('code', 'LIKE', "%$search%");
|
||||
$q->orWhere('name', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
*/
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
return Excel::download(new BranchExport, 'branch.xlsx');
|
||||
}
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\BranchExport;
|
||||
use Modules\Lpj\Http\Requests\BranchRequest;
|
||||
use Modules\Lpj\Models\Branch;
|
||||
|
||||
class BranchController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::branch.index');
|
||||
}
|
||||
|
||||
public function store(BranchRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
Branch::create($validate);
|
||||
return redirect()
|
||||
->route('basicdata.branch.index')
|
||||
->with('success', 'Branch created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.branch.create')
|
||||
->with('error', 'Failed to create branch');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::branch.create');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$branch = Branch::find($id);
|
||||
return view('lpj::branch.create', compact('branch'));
|
||||
}
|
||||
|
||||
public function update(BranchRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Update in database
|
||||
$branch = Branch::find($id);
|
||||
$branch->update($validate);
|
||||
return redirect()
|
||||
->route('basicdata.branch.index')
|
||||
->with('success', 'Branch updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.branch.edit', $id)
|
||||
->with('error', 'Failed to update branch');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
// Delete from database
|
||||
$branch = Branch::find($id);
|
||||
$branch->delete();
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Branch deleted successfully']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to delete branch']);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('branch.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Branch::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('code', 'LIKE', "%$search%");
|
||||
$q->orWhere('name', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
return Excel::download(new BranchExport, 'branch.xlsx');
|
||||
}
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\CurrencyExport;
|
||||
use Modules\Lpj\Http\Requests\CurrencyRequest;
|
||||
use Modules\Lpj\Models\Currency;
|
||||
|
||||
class CurrencyController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::currency.index');
|
||||
}
|
||||
|
||||
public function store(CurrencyRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
Currency::create($validate);
|
||||
return redirect()
|
||||
->route('basicdata.currency.index')
|
||||
->with('success', 'Currency created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.currency.create')
|
||||
->with('error', 'Failed to create currency');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::currency.create');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$currency = Currency::find($id);
|
||||
return view('lpj::currency.create', compact('currency'));
|
||||
}
|
||||
|
||||
public function update(CurrencyRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Update in database
|
||||
$currency = Currency::find($id);
|
||||
$currency->update($validate);
|
||||
return redirect()
|
||||
->route('basicdata.currency.index')
|
||||
->with('success', 'Currency updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.currency.edit', $id)
|
||||
->with('error', 'Failed to update currency');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
// Delete from database
|
||||
$currency = Currency::find($id);
|
||||
$currency->delete();
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Currency deleted successfully']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to delete currency']);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('currency.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Currency::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('code', 'LIKE', "%$search%");
|
||||
$q->orWhere('name', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
return Excel::download(new CurrencyExport, 'currency.xlsx');
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,11 @@
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use Modules\Lpj\Models\DetailDokumenJaminan;
|
||||
use Modules\Lpj\Models\DokumenJaminan;
|
||||
use Modules\Lpj\Models\HubunganPemilikJaminan;
|
||||
use Modules\Lpj\Models\JenisJaminan;
|
||||
use Modules\Lpj\Models\JenisLegalitasJaminan;
|
||||
use Modules\Lpj\Models\PemilikJaminan;
|
||||
use ZipArchive;
|
||||
|
||||
class DokumenJaminanController extends Controller
|
||||
{
|
||||
@@ -86,6 +88,7 @@
|
||||
'dokumen_jaminan' => 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
'details' => isset($request->custom_field[$key]) ? json_encode($request->custom_field[$key]) : '',
|
||||
];
|
||||
DetailDokumenJaminan::create($detail);
|
||||
} catch (Exception $e) {
|
||||
@@ -124,10 +127,18 @@
|
||||
$jenisJaminan = JenisJaminan::all();
|
||||
$jenisLegalitasJaminan = JenisLegalitasJaminan::all();
|
||||
$pemilikJaminan = PemilikJaminan::where('debiture_id', $id)->get();
|
||||
$hubunganPemilik = HubunganPemilikJaminan::all();
|
||||
|
||||
return view(
|
||||
'lpj::debitur.jaminan',
|
||||
compact('debitur', 'provinces', 'jenisJaminan', 'jenisLegalitasJaminan', 'pemilikJaminan'),
|
||||
compact(
|
||||
'debitur',
|
||||
'provinces',
|
||||
'jenisJaminan',
|
||||
'jenisLegalitasJaminan',
|
||||
'pemilikJaminan',
|
||||
'hubunganPemilik',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,6 +152,52 @@
|
||||
DB::beginTransaction();
|
||||
$validate['debiture_id'] = $id;
|
||||
|
||||
if ($validate['pemilik_jaminan_id'] == 00) {
|
||||
$pemilik_jaminan = [
|
||||
'hubungan_pemilik_jaminan_id' => request()->get('hubungan_pemilik_jaminan_id'),
|
||||
'province_code' => $debitur->province_code,
|
||||
'city_code' => $debitur->city_code,
|
||||
'district_code' => $debitur->district_code,
|
||||
'village_code' => $debitur->village_code,
|
||||
'postal_code' => $debitur->postal_code,
|
||||
'address' => $debitur->address,
|
||||
'nomor_id' => request()->get('nomor_id'),
|
||||
'name' => request()->get('pemilik_name'),
|
||||
];
|
||||
|
||||
$detailSertifikat = [];
|
||||
$names = request()->input('detail_sertifikat.name', []);
|
||||
$nomorIds = request()->input('detail_sertifikat.nomor_id', []);
|
||||
|
||||
foreach ($names as $index => $name) {
|
||||
if (isset($nomorIds[$index])) {
|
||||
$detailSertifikat[] = [
|
||||
'name' => $name,
|
||||
'nomor_id' => $nomorIds[$index],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$pemilik_jaminan['detail_sertifikat'] = json_encode($detailSertifikat);
|
||||
|
||||
//dd($pemilik_jaminan);
|
||||
|
||||
try {
|
||||
$pemilikJaminan = PemilikJaminan::updateOrCreate([
|
||||
'debiture_id' => $id,
|
||||
'name' => request()->get('pemilik_name'),
|
||||
], $pemilik_jaminan);
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('debitur.jaminan.index', $id)->with(
|
||||
'error',
|
||||
'Gagal update pemilik jaminan: ' . $e->getMessage(),
|
||||
);
|
||||
}
|
||||
|
||||
$validate['pemilik_jaminan_id'] = $pemilikJaminan->id;
|
||||
}
|
||||
|
||||
|
||||
if ($validate['pemilik_jaminan_id'] == 0) {
|
||||
$pemilik_jaminan = [
|
||||
'hubungan_pemilik_jaminan_id' => 1,
|
||||
@@ -159,11 +216,14 @@
|
||||
'debiture_id' => $id,
|
||||
'name' => $debitur->name,
|
||||
], $pemilik_jaminan);
|
||||
|
||||
$validate['pemilik_jaminan_id'] = $pemilikJaminan->id;
|
||||
}
|
||||
|
||||
$document = DokumenJaminan::find($jaminan);
|
||||
$document->update($validate);
|
||||
|
||||
|
||||
if ($request->detail_dokumen_jaminan_id) {
|
||||
foreach ($request->detail_dokumen_jaminan_id as $key => $value) {
|
||||
if (isset($request->dokumen_jaminan[$key])) {
|
||||
@@ -238,6 +298,7 @@
|
||||
$jenisJaminan = JenisJaminan::all();
|
||||
$jenisLegalitasJaminan = JenisLegalitasJaminan::all();
|
||||
$pemilikJaminan = PemilikJaminan::where('debiture_id', $document->debiture_id)->get();
|
||||
$hubunganPemilik = HubunganPemilikJaminan::all();
|
||||
|
||||
return view(
|
||||
'lpj::debitur.jaminan',
|
||||
@@ -252,6 +313,7 @@
|
||||
'districts',
|
||||
'villages',
|
||||
'pemilikJaminan',
|
||||
'hubunganPemilik',
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -274,6 +336,45 @@
|
||||
}
|
||||
}
|
||||
|
||||
public function bulkDownload()
|
||||
{
|
||||
$dokumenIds = request()->get('jaminan'); // Expecting an array of dokumen_jaminan_id
|
||||
$documents = DetailDokumenJaminan::where('dokumen_jaminan_id', $dokumenIds)->get();
|
||||
if ($documents->isEmpty()) {
|
||||
return redirect()->back()->with('error', 'No documents found for the provided IDs.');
|
||||
}
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$zipFileName = 'documents_jaminan_' . $dokumenIds . '.zip';
|
||||
$zipFilePath = storage_path('app/public/' . $zipFileName);
|
||||
|
||||
if ($zip->open($zipFilePath, ZipArchive::CREATE) === true) {
|
||||
foreach ($documents as $document) {
|
||||
$filePath = storage_path('app/public/' . $document->dokumen_jaminan);
|
||||
if (file_exists($filePath)) {
|
||||
$zip->addFile($filePath, basename($filePath));
|
||||
} else {
|
||||
// Log or display an error message for missing files
|
||||
return redirect()->back()->with('error', 'File not found: ' . $filePath);
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
|
||||
if (!file_exists($zipFilePath)) {
|
||||
return redirect()->back()->with('error', 'Failed to create ZIP file.');
|
||||
}
|
||||
} else {
|
||||
return redirect()->back()->with('error', 'Failed to create ZIP file.');
|
||||
}
|
||||
|
||||
return response()->download($zipFilePath, $zipFileName, [
|
||||
'Content-Type' => 'application/zip',
|
||||
'Content-Disposition' => 'attachment; filename="' . $zipFileName . '"',
|
||||
'Content-Length' => filesize($zipFilePath),
|
||||
])->deleteFileAfterSend(false);
|
||||
}
|
||||
|
||||
|
||||
public function download()
|
||||
{
|
||||
$dokumen = request()->get('dokumen');
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
class JenisFasilitasKreditController extends Controller
|
||||
{
|
||||
use LpjHelpers; // <---- Using the LpjHelpers Trait
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
@@ -28,12 +27,6 @@
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
// andy add
|
||||
$lastNumberCodeJFK = LpjHelpers::onLastCodeJFK();
|
||||
|
||||
$validate['name'] =strtoupper($request->name);
|
||||
$validate['code'] =$lastNumberCodeJFK;
|
||||
// andy add
|
||||
|
||||
JenisFasilitasKredit::create($validate);
|
||||
return redirect()
|
||||
|
||||
34
app/Http/Controllers/LaporanController.php
Normal file
34
app/Http/Controllers/LaporanController.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LaporanController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function sederhana_index()
|
||||
{
|
||||
return view('lpj::laporan.sederhana_index');
|
||||
}
|
||||
|
||||
public function standard_index()
|
||||
{
|
||||
return view('lpj::laporan.standard_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id) {}
|
||||
/**
|
||||
* Store form inspeksi.
|
||||
*/
|
||||
public function store(Request $request) {}
|
||||
|
||||
public function update(Request $request, $id) {}
|
||||
}
|
||||
@@ -42,16 +42,16 @@ class OtorisasiPenawaranController extends Controller
|
||||
$query =PenawaranTender::query()
|
||||
->select('penawaran.*',DB::raw("CONCAT(DATE_FORMAT(penawaran.start_date, '%d %M %Y'), ' - ', DATE_FORMAT(penawaran.end_date, '%d %M %Y')) AS date_range"), 'tujuan_penilaian_kjpp.name as tujuan_penilaian_kjpp_name')
|
||||
->leftJoin('tujuan_penilaian_kjpp', 'tujuan_penilaian_kjpp.id','=','penawaran.tujuan_penilaian_kjpp_id')
|
||||
->where('penawaran.status','=','persetujuan-penawaran')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
->where('penawaran.status','=','proposal-tender')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
|
||||
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
@@ -114,19 +114,19 @@ class OtorisasiPenawaranController extends Controller
|
||||
|
||||
if (request()->ajax()) {
|
||||
$id = $request->id;
|
||||
$penawaran = PenawaranTender::where('status','=','persetujuan-penawaran')->find($id);
|
||||
|
||||
$penawaran = PenawaranTender::where('status','=','proposal-tender')->find($id);
|
||||
|
||||
if ($penawaran) {
|
||||
$penawarandetailLogs = PenawaranDetailTenderLog::where('penawaran_id',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran_logs.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran_logs.kjpp_rekanan_id')
|
||||
->select('detail_penawaran_logs.*', DB::raw("DATE_FORMAT(detail_penawaran_logs.created_at, '%d-%m-%Y %H:%i') AS created_at2"),'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->get();
|
||||
$penawrandetails = PenawaranDetailTender::where('penawaran_id','=',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->get();
|
||||
|
||||
|
||||
if(sizeof($penawarandetailLogs)>0)
|
||||
{
|
||||
$h=0;
|
||||
@@ -139,8 +139,8 @@ class OtorisasiPenawaranController extends Controller
|
||||
}
|
||||
$h++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$i=0;
|
||||
foreach($penawrandetails as $obj)
|
||||
@@ -149,17 +149,17 @@ class OtorisasiPenawaranController extends Controller
|
||||
{
|
||||
$penawrandetails_path = Storage::url($obj->dokumen_persetujuan);
|
||||
$penawrandetails[$i]->dokumen_persetujuan = $penawrandetails_path;
|
||||
|
||||
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$penawaranString = "";
|
||||
if($penawaran->status)
|
||||
{
|
||||
$penawaranString = convertSlug($penawaran->status);
|
||||
$penawaran->status = $penawaranString;
|
||||
}
|
||||
}
|
||||
|
||||
$kjpp=null;
|
||||
$kjpp = KJPP::pluck('name', 'id');
|
||||
@@ -202,11 +202,11 @@ class OtorisasiPenawaranController extends Controller
|
||||
// update status Penawaran menjadi SPK
|
||||
// update status Permohonan menjadi SPK
|
||||
// insert detail_permohonan_log
|
||||
|
||||
|
||||
PenawaranDetailTender::where('status', 1)
|
||||
->where('penawaran_id', $request->penawaran_id)
|
||||
->whereNotIn('id', [$id])
|
||||
->update(['status' => 2,
|
||||
->update(['status' => 2,
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
]);
|
||||
@@ -228,12 +228,12 @@ class OtorisasiPenawaranController extends Controller
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
]);
|
||||
|
||||
|
||||
// log
|
||||
$detailPenawaran = PenawaranDetailTender::where('penawaran_id', $request->penawaran_id)->get();
|
||||
if(sizeof($detailPenawaran)>0)
|
||||
{
|
||||
|
||||
|
||||
foreach ($detailPenawaran as $model) {
|
||||
array_push($dataDetailPenawaranLog, [
|
||||
'detail_penawaran_id' =>$model->id,
|
||||
@@ -248,12 +248,12 @@ class OtorisasiPenawaranController extends Controller
|
||||
'authorized_at' =>$model->authorized_at,
|
||||
'created_at' =>$model->created_at,
|
||||
'updated_at' =>$model->updated_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'created_by' =>$model->created_by,
|
||||
'updated_by' =>$model->updated_by,
|
||||
'deleted_by' =>$model->deleted_by
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
PenawaranDetailTenderLog::insert($dataDetailPenawaranLog);
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
public function update(PemilikJaminanRequest $request, $id, $pemilik)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
$pemilik = PemilikJaminan::find($pemilik);
|
||||
@@ -88,6 +89,7 @@
|
||||
$districts = District::where('city_code', $pemilik->city_code)->get();
|
||||
$villages = Village::where('district_code', $pemilik->district_code)->get();
|
||||
$hubunganPemilik = HubunganPemilikJaminan::all();
|
||||
$detailSertifikat = $pemilik->detail_sertifikat;
|
||||
|
||||
return view(
|
||||
'lpj::pemilik_jaminan.form',
|
||||
@@ -99,6 +101,7 @@
|
||||
'villages',
|
||||
'hubunganPemilik',
|
||||
'pemilik',
|
||||
'detailSertifikat'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
135
app/Http/Controllers/PenilaiController.php
Normal file
135
app/Http/Controllers/PenilaiController.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class PenilaiController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::penilai.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::with('debiture.documents.jenisjaminan')->find($id);
|
||||
|
||||
return view('lpj::penilai.show', compact('permohonan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('lpj::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('penilai.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query()->where('status', '=', 'done');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('jenisfasilitasKredit', 'name', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'jenisfasilitasKredit'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
@@ -304,4 +305,19 @@
|
||||
|
||||
return redirect()->route('authorization.index')->with('success', 'Permohonan updated successfully');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
return view('lpj::permohonan.show', compact('permohonan'));
|
||||
}
|
||||
|
||||
public function print($id){
|
||||
$permohonan = Permohonan::find($id);
|
||||
return view('lpj::permohonan.print', compact('permohonan'));
|
||||
|
||||
// $pdf = Pdf::loadView('lpj::permohonan.print', compact('permohonan'));
|
||||
// return $pdf->stream();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class ProsesPenawaranController extends Controller
|
||||
|
||||
// Get the data for the current page
|
||||
//$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
$data = $query->with(['tujuanPenilaianKJPP'])->get();
|
||||
$data = $query->with(['tujuanPenilaianKJPP','permohonan','permohonan.debiture'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
@@ -110,13 +110,13 @@ class ProsesPenawaranController extends Controller
|
||||
$id = $request->id;
|
||||
$penawaran = PenawaranTender::find($id);
|
||||
$penawrandetails = PenawaranDetailTender::where('penawaran_id','=',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->get();
|
||||
|
||||
|
||||
if ($penawaran) {
|
||||
|
||||
|
||||
$i=0;
|
||||
foreach($penawrandetails as $obj)
|
||||
{
|
||||
@@ -156,11 +156,11 @@ class ProsesPenawaranController extends Controller
|
||||
$dataPenawaranDetail = array();
|
||||
if (request()->ajax()) {
|
||||
$validator = ProsesPenawaranController::rulesEditnya($request, $id);
|
||||
|
||||
|
||||
if ($validator['fails']) {
|
||||
$data['message'] = $validator['errors'];
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
@@ -174,9 +174,9 @@ class ProsesPenawaranController extends Controller
|
||||
{
|
||||
$file_tmp = $request->file('dokumen_persetujuan');
|
||||
$folderPath = 'uploads/penawaran/';
|
||||
if ($file_tmp->isValid())
|
||||
if ($file_tmp->isValid())
|
||||
{
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$file_name = pathinfo($myFile, PATHINFO_FILENAME); // nama file without extension
|
||||
|
||||
$extension = $file_tmp->getClientOriginalExtension();
|
||||
@@ -205,16 +205,16 @@ class ProsesPenawaranController extends Controller
|
||||
{
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['check_file'] = array("Silahkan upload file");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_error_try_catch'] = array('Proses Penawarn KJPP failed.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_ajax'] = array("no ajax request");
|
||||
@@ -257,57 +257,52 @@ class ProsesPenawaranController extends Controller
|
||||
$dataPenawaran = array();
|
||||
$penawaran = PenawaranTender::find($id);
|
||||
$checkActiveDateRange = checkActiveDateRangePenawaran($id);
|
||||
|
||||
|
||||
// cek masa aktif penawaran
|
||||
if($checkActiveDateRange)
|
||||
{
|
||||
|
||||
$checkKelengkapanDetailKJPP = checkKelengkapanDetailKJPP($id);
|
||||
|
||||
$checkKelengkapanDetailKJPP = checkKelengkapanDetailKJPP($id);
|
||||
if($checkKelengkapanDetailKJPP)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$dataPenawaran = ['status' => 'persetujuan-penawaran',
|
||||
$_updatestatus = ['status' => 'proposal-tender',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
$dataPermohonan = ['status' => 'persetujuan-penawaran',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=', $penawaran->nomor_registrasi)->first();
|
||||
|
||||
$penawaran->update($dataPenawaran);
|
||||
$permohonan->update($dataPermohonan);
|
||||
|
||||
|
||||
$penawaran->update($_updatestatus);
|
||||
$permohonan->update($_updatestatus);
|
||||
|
||||
DB::commit();
|
||||
|
||||
|
||||
$data['message'] ['message_success'] = array('Sukses melakukan Proses Penawaran');
|
||||
$data['status'] = 'success';
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
// dd($e);
|
||||
$data['message'] ['message_error_try_catch'] = array("Gagal melakukan Proses Penawaran");
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['message'] ['cek_kelengkapan_data'] = array("Silahkan lengkapi data KJPP");
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['message'] ['active_date_range'] = array("Penawaran sudah di tutup");
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
@@ -326,12 +321,12 @@ class ProsesPenawaranController extends Controller
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
$detailpenawaran->update($dataDetailPenawaran);
|
||||
$detailpenawaran->update($dataDetailPenawaran);
|
||||
|
||||
$data['status'] = 'success';
|
||||
$data['message'] ['message_success'] = array('Sukses delete Penawaran KJPP '.$request->kjppName);
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_error_try_catch'] = array("Gagal delete Penawaran KJPP ".$request->kjppName);
|
||||
}
|
||||
|
||||
@@ -41,16 +41,16 @@ class ProsesPenawaranUlangController extends Controller
|
||||
$query =PenawaranTender::query()
|
||||
->select('penawaran.*',DB::raw("CONCAT(DATE_FORMAT(penawaran.start_date, '%d %M %Y'), ' - ', DATE_FORMAT(penawaran.end_date, '%d %M %Y')) AS date_range"), 'tujuan_penilaian_kjpp.name as tujuan_penilaian_kjpp_name')
|
||||
->leftJoin('tujuan_penilaian_kjpp', 'tujuan_penilaian_kjpp.id','=','penawaran.tujuan_penilaian_kjpp_id')
|
||||
->where('penawaran.status','=','persetujuan-penawaran')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
->where('penawaran.status','=','proposal-tender')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
|
||||
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
@@ -118,11 +118,11 @@ class ProsesPenawaranUlangController extends Controller
|
||||
|
||||
if (request()->ajax()) {
|
||||
$id = $request->id;
|
||||
$penawaran = PenawaranTender::where('status','=','persetujuan-penawaran')->find($id);
|
||||
|
||||
$penawaran = PenawaranTender::where('status','=','proposal-tender')->find($id);
|
||||
|
||||
if ($penawaran) {
|
||||
$penawrandetails = PenawaranDetailTender::where('penawaran_id','=',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->get();
|
||||
@@ -143,7 +143,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
$penawaranString = convertSlug($penawaran->status);
|
||||
$penawaran->status = $penawaranString;
|
||||
}
|
||||
}
|
||||
|
||||
$data['penawaran'] = $penawaran;
|
||||
$data['penawrandetails'] = $penawrandetails;
|
||||
@@ -176,7 +176,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
if ($validator['fails']) {
|
||||
$data['message'] = $validator['errors'];
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// cek masa aktif penawaran
|
||||
@@ -187,7 +187,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
|
||||
|
||||
$dataDetailPenawaranLog = [
|
||||
'detail_penawaran_id' =>$detailpenawaran->id,
|
||||
'kjpp_rekanan_id' =>$detailpenawaran->kjpp_rekanan_id,
|
||||
@@ -201,15 +201,15 @@ class ProsesPenawaranUlangController extends Controller
|
||||
'authorized_at' =>$detailpenawaran->authorized_at,
|
||||
'created_at' =>$detailpenawaran->created_at,
|
||||
'updated_at' =>$detailpenawaran->updated_at,
|
||||
'deleted_at' =>$detailpenawaran->deleted_at,
|
||||
'deleted_at' =>$detailpenawaran->deleted_at,
|
||||
'created_by' =>$detailpenawaran->created_by,
|
||||
'updated_by' =>$detailpenawaran->updated_by,
|
||||
'deleted_by' =>$detailpenawaran->deleted_by
|
||||
|
||||
];
|
||||
|
||||
|
||||
PenawaranDetailTenderLog::create($dataDetailPenawaranLog);
|
||||
|
||||
|
||||
$biaya_penawaran="";
|
||||
if($request->biaya_penawaran)
|
||||
$biaya_penawaran= str_replace(".","",$request->biaya_penawaran);
|
||||
@@ -222,9 +222,9 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
$file_tmp = $request->file('dokumen_persetujuan');
|
||||
$folderPath = 'uploads/penawaran/';
|
||||
if ($file_tmp->isValid())
|
||||
if ($file_tmp->isValid())
|
||||
{
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$file_name = pathinfo($myFile, PATHINFO_FILENAME); // nama file without extension
|
||||
|
||||
$extension = $file_tmp->getClientOriginalExtension();
|
||||
@@ -247,9 +247,9 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
$data['status'] = 'error';
|
||||
$data['message']['check_file'] = array("Silahkan upload file");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$detailpenawaran->update($dataDetailPenawaran);
|
||||
|
||||
if($pleaseCommit)
|
||||
@@ -279,7 +279,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
$data['status'] = 'error';
|
||||
$data['message']['active_date_range'] = array("Penawaran sudah di tutup");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -288,7 +288,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
}
|
||||
|
||||
// delete KJPP di detail_penawaran (status di buat 0)
|
||||
public function updateKJPPStatus(Request $request, $id): JsonResponse
|
||||
@@ -316,16 +316,16 @@ class ProsesPenawaranUlangController extends Controller
|
||||
'authorized_at' =>$model->authorized_at,
|
||||
'created_at' =>$model->created_at,
|
||||
'updated_at' =>$model->updated_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'created_by' =>$model->created_by,
|
||||
'updated_by' =>$model->updated_by,
|
||||
'deleted_by' =>$model->deleted_by
|
||||
|
||||
];
|
||||
|
||||
|
||||
PenawaranDetailTenderLog::create($dataDetailPenawaranLog);
|
||||
// log
|
||||
|
||||
|
||||
$data['id']=$id;
|
||||
|
||||
$dataku = ['status' => '0',
|
||||
@@ -333,7 +333,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
$model->update($dataku);
|
||||
$model->update($dataku);
|
||||
|
||||
DB::commit();
|
||||
$data['status'] = 'success';
|
||||
|
||||
29
app/Http/Controllers/ResumeController.php
Normal file
29
app/Http/Controllers/ResumeController.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ResumeController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::resume.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id) {}
|
||||
/**
|
||||
* Store form inspeksi.
|
||||
*/
|
||||
public function store(Request $request) {}
|
||||
|
||||
public function update(Request $request, $id) {}
|
||||
}
|
||||
65
app/Http/Controllers/SLAController.php
Normal file
65
app/Http/Controllers/SLAController.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SLAController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::SLA.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('lpj::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('lpj::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -241,15 +241,25 @@ class TenderController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* Tampilkan Surat Tender
|
||||
*/
|
||||
public function destroy($id)
|
||||
public function showSuratTender($noreg)
|
||||
{
|
||||
//
|
||||
$penawaran = PenawaranTender::where('nomor_registrasi', '=', $noreg)->first();
|
||||
|
||||
// Kalau tidak ketemu nomor registrasi dengan tabel penawaran
|
||||
if (!$penawaran) {
|
||||
return redirect()->route('tender.penawaran.createPenawaran', ['noreg' => $noreg])
|
||||
->with('error', 'Anda Belum Membuat Penawaran. Silahkan isi terlebih dahulu!');
|
||||
}
|
||||
// Jika batas tanggal penawaran sudah lewat
|
||||
if ($penawaran->end_date < date('Y-m-d')) {
|
||||
return redirect()->route('tender.penawaran.editPenawaran', ['noreg' => $noreg])
|
||||
->with('error', 'Sudah Kadaluarsa. Silahkan perpanjang tanggal penawaran terlebih dahulu!');
|
||||
}
|
||||
|
||||
return view('lpj::penawaran.surat_tender', compact('penawaran', 'noreg'));
|
||||
}
|
||||
|
||||
public function datatablesPenawaran(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user