fix skit2
This commit is contained in:
@@ -22,7 +22,10 @@ use App\BajetTahunan;
|
||||
use App\Blacklist;
|
||||
use App\Pelelong;
|
||||
use App\Mohon;
|
||||
|
||||
use App\Pengesahan;
|
||||
use App\Permohonan;
|
||||
use App\Status;
|
||||
use App\LookupStatus;
|
||||
|
||||
use DB;
|
||||
use Carbon\Carbon;
|
||||
@@ -1802,4 +1805,47 @@ class AdminPageController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function TambahPermohonan(Request $request,$kodcaw)
|
||||
{
|
||||
|
||||
$timeloni = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$curent_year = substr($current->year,2,2);
|
||||
$curent_month = sprintf("%02d", $current->month);
|
||||
$current_day = sprintf("%02d", $current->day);
|
||||
|
||||
try {
|
||||
$permohonan = new Permohonan;
|
||||
$pengesahan = new Pengesahan;
|
||||
$status = new Status;
|
||||
|
||||
$nopermohonan = 'AR' . strtoupper($kodcaw) . $curent_year . $curent_month . $current_day . '-000' .rand(1,9);
|
||||
|
||||
$permohonan->kodcaw = $kodcaw;
|
||||
$permohonan->jenismohon = $request->jenismohon;
|
||||
$permohonan->baki_petibesi = $request->bakipetibesi;
|
||||
$permohonan->amaun_mohon = $request->jumlahmohon;
|
||||
$permohonan->nama_pemohon = $request->namapemohon;
|
||||
$permohonan->tarikh_permohonan = $request->tarikhmohon;
|
||||
$permohonan->outstandingsemasa = $request->outstanding;
|
||||
$permohonan->nopermohonan = $nopermohonan;
|
||||
$permohonan->save();
|
||||
|
||||
|
||||
$pengesahan->mohonid = $permohonan->id;
|
||||
$pengesahan->kodcaw = $kodcaw;
|
||||
$pengesahan->save();
|
||||
|
||||
$status->mohonid = $permohonan->id;
|
||||
$status->statusid = 1;
|
||||
$status->tarikhmasa = $timeloni->toDateTimeString();
|
||||
$status->save();
|
||||
|
||||
return response(1);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
return response($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user