fix skit2

This commit is contained in:
hafifierahman
2022-03-21 10:48:23 +08:00
parent 28fd9a6a64
commit d58e7dcd09
6 changed files with 186 additions and 1 deletions
+47 -1
View File
@@ -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);
}
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class LookupStatus extends Model
{
protected $table = 'lookup_status';
public $timestamps = false;
protected $connection = 'mysql7';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'statusid',
'description'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
// protected $hidden = [];
}
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Pengesahan extends Model
{
protected $table = 'pengesahan';
public $timestamps = false;
protected $connection = 'mysql7';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'sahno',
'nama_operasi',
'tarikh_pengesahanoperasi',
'nama_akaun',
'tarikh_pengesahanakaun',
'jenisbank',
'noresit',
'tarikh_bankin',
'kodcaw',
'mohonid'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
// protected $hidden = [];
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Permohonan extends Model
{
protected $table = 'permohonan';
public $timestamps = false;
protected $connection = 'mysql7';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'mohonid',
'kodcaw',
'jenismohon',
'baki_petibesi',
'amaun_mohon',
'nama_pemohon',
'tarikh_permohonan',
'tarikh_diluluskan',
'jumlah_diluluskan',
'tarikh_terima',
'nama_penerima',
'outstandingsemasa',
'nopermohonan'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
// protected $hidden = [];
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Status extends Model
{
protected $table = 'status';
public $timestamps = false;
protected $connection = 'mysql7';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'recno',
'mohonid',
'statusid',
'tarikhmasa'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
// protected $hidden = [];
}
+1
View File
@@ -683,6 +683,7 @@ $router->group(['prefix'=>'admin'], function () use ($router){
$router->get('customers/{ic}/gadai/{status}',['uses'=>'AdminPageController@showOneCustomerGadai']);
$router->post('permohonan/add/{kodcaw}',['uses'=>'AdminPageController@TambahPermohonan']);
});
$router->group(['prefix'=>'kelantanpay'], function () use ($router){