root hace 5 años
padre
commit
57d2389438

+ 406
- 298
app/Http/Controllers/Api/CompoundResourceController.php Ver fichero

@@ -392,49 +392,93 @@ class CompoundResourceController extends BaseController
*
* @return \Illuminate\Http\Response
*/
public function generateCompoundNumber($jenis, $tag)
public function generateNumber($jenis, $tag, $modul)
{
//check if theres no 001, start fresh with 0001
if (empty(Compound::where('jenis', $jenis)->where('kpd', $tag.'0001')->first())) {
$num= '';

$kpd = '0001';
if($modul == '02')
{
//check if theres no 001, start fresh with 0001
if (empty(Compound::where('jenis_n', $jenis)->where('non', $tag.'0001')->first())) {

}
else{
$num = '0001';

}
else{

//check the lastest compound number stored in dbase filtered by jenis
$compound = Compound::where('jenis', $jenis)->withTrashed()->latest()->first();
//check the lastest compound number stored in dbase filtered by jenis
$notice = Compound::where('jenis_n', $jenis)->withTrashed()->latest()->first();

//sanitize compound number to return only integer
$kpd = filter_var($compound['kpd'], FILTER_SANITIZE_NUMBER_INT);
//sanitize compound number to return only integer
$num = filter_var($notice['non'], FILTER_SANITIZE_NUMBER_INT);

//compulsory increment to store new compound number, WHILE number is found, keep looping
do{
//compulsory increment to store new compound number, WHILE number is found, keep looping
do{

(int)$kpd += 1;
(int)$num += 1;

//add 0s at the fornt if number is less than 1000
if ((strlen((string) $kpd)) == 1) {
//add 0s at the fornt if number is less than 1000
if ((strlen((string) $num)) == 1) {

$kpd = '000'.$kpd;
$num = '000'.$num;

}elseif ((strlen((string)$kpd)) == 2){
}elseif ((strlen((string)$num)) == 2){

$kpd = '00'.$kpd;
$num = '00'.$num;

}elseif ((strlen((string)$kpd )) == 3) {
}elseif ((strlen((string)$num )) == 3) {

$kpd = '0'.$kpd;
}
$num = '0'.$num;
}

}while(!empty(Compound::where('jenis_n', $jenis)->where('non', $tag.$num)->first()));

}
}else if($modul == '03')
{
//check if theres no 001, start fresh with 0001
if (empty(Compound::where('jenis', $jenis)->where('kpd', $tag.'0001')->first())) {

$num = '0001';

}
else{

//check the lastest compound number stored in dbase filtered by jenis
$compound = Compound::where('jenis', $jenis)->withTrashed()->latest()->first();

}while(!empty(Compound::where('jenis', $jenis)->where('kpd', $tag.$kpd)->first()));
//sanitize compound number to return only integer
$num = filter_var($compound['kpd'], FILTER_SANITIZE_NUMBER_INT);

//compulsory increment to store new compound number, WHILE number is found, keep looping
do{

(int)$num += 1;

//add 0s at the fornt if number is less than 1000
if ((strlen((string) $num)) == 1) {

$num = '000'.$num;

}elseif ((strlen((string)$num)) == 2){

$num = '00'.$num;

}elseif ((strlen((string)$num )) == 3) {

$num = '0'.$num;
}

}while(!empty(Compound::where('jenis', $jenis)->where('kpd', $tag.$num)->first()));

}
}


//return kpd with tag
$kpd = $tag . $kpd;
$num = $tag . $num;

return $kpd;
return $num;
}

/**
@@ -516,8 +560,6 @@ class CompoundResourceController extends BaseController

}elseif(($request->jenis == 'Pelbagai_KT') || ($request->jenis == 'Pelbagai_JPB') || ($request->jenis == 'Pelbagai_PA') || ($request->jenis == 'Pelbagai_LESEN')){

$kpd = $request->kpd;

$compound = Compound::where('jenis', $request->jenis)->where('kpd', $kpd)->first();
info($compound);

@@ -528,109 +570,110 @@ class CompoundResourceController extends BaseController
if($compound->modul != '03')
{
if($request->jenis == 'Pelbagai_KT'){
$compound->kpd = $this->generateNumber($request->jenis, 'KT', '03');
$compound->jenis = $request->jenis;
$compound->nama = $request->namaP;
$compound->identity = $request->noIc;
$compound->nama_syarikat = $request->namaS;
$compound->no_daftar_syarikat = strtolower($request->daftarNo);
$compound->alamat = $request->alamat;
$compound->no_plate = $request->no_plate;
$compound->no_cukai_jalan = $request->no_cukai_jalan;
// $compound->no_plate = $request->no_plate;
// $compound->no_cukai_jalan = $request->no_cukai_jalan;
// $compound->nama_kawasan = $request->namaKawasan;
// $compound->nama_taman = $request->namaTaman;
// $compound->nama_jalan = $request->namaJalan;
$compound->catatan = $request->catatan;
$compound->latlong = $request->Latlong;
// $compound->akta = $faulty->deed_law_id;
// $compound->seksyen_kesalahan = $faulty->_id;
// $compound->jumlah_asal_kompaun = $faulty->amount;
$compound->dikeluarkan_ = $staff->_id;
$compound->akta = $faulty->deed_law_id;
$compound->seksyen_kesalahan = $faulty->_id;
$compound->jumlah_asal_kompaun = $faulty->amount;
$compound->dikeluarkan = $staff->_id;
$compound->status = 'Belum Bayar';
$compound->modul = '03';
$compound->no_telefon = $request->tel;
$compound->no_akaun_lesen = $request->lesen;
$compound->cpn_created = Carbon::now()->toDateTimeString();
$compound->created_c = Carbon::now()->toDateTimeString();


}elseif($request->jenis == 'Pelbagai_JPB'){
$compound->kpd = $this->generateNumber($request->jenis, 'JPB', '03');
$compound->jenis = $request->jenis;
$compound->nama = $request->namaP;
$compound->identity = $request->noIc;
$compound->nama_syarikat = $request->namaS;
$compound->no_daftar_syarikat = strtolower($request->daftarNo);
$compound->alamat = $request->alamat;
$compound->no_plate = $request->no_plate;
$compound->no_cukai_jalan = $request->no_cukai_jalan;
// $compound->no_plate = $request->no_plate;
// $compound->no_cukai_jalan = $request->no_cukai_jalan;
// $compound->nama_kawasan => $request->namaKawasan;
// $compound->nama_taman => $request->namaTaman;
// $compound->nama_jalan => $request->namaJalan;
$compound->catatan = $request->catatan;
$compound->latlong = $request->Latlong;
// $compound->akta => $faulty->deed_law_id;
// $compound->seksyen_kesalahan => $faulty->_id;
// $compound->jumlah_asal_kompaun => $faulty->amount;
$compound->dikeluarkan_ = $staff->_id;
$compound->status = 'Belum Bayar';
$compound->modul = '03';
$compound->no_telefon = $request->tel;
$compound->no_akaun_lesen = $request->lesen;
$compound->cpn_created = Carbon::now()->toDateTimeString();


}elseif($request->jenis == 'Pelbagai_PA'){

$compound->jenis = $request->jenis;
$compound->nama = $request->namaP;
$compound->identity = $request->noIc;
$compound->nama_syarikat = $request->namaS;
$compound->no_daftar_syarikat = strtolower($request->daftarNo);
$compound->alamat = $request->alamat;
// $compound->no_plate = $request->no_plate;
// $compound->no_cukai_jalan = $request->no_cukai_jalan;
// $compound->nama_kawasan = $request->namaKawasan;
// $compound->nama_taman = $request->namaTaman;
// $compound->nama_jalan = $request->namaJalan;
$compound->catatan = $request->catatan;
$compound->latlong = $request->Latlong;
// $compound->akta = $faulty->deed_law_id;
// $compound->seksyen_kesalahan = $faulty->_id;
// $compound->jumlah_asal_kompaun = $faulty->amount;
$compound->dikeluarkan_ = $staff->_id;
$compound->status = 'Belum Bayar';
$compound->modul = '03';
$compound->no_telefon = $request->tel;
$compound->no_akaun_lesen = $request->lesen;
$compound->bil_haiwan = $request->lesen;
$compound->cpn_created = Carbon::now()->toDateTimeString();


}elseif($request->jenis == 'Pelbagai_LESEN'){

$compound->jenis = $request->jenis;
$compound->nama = $request->namaP;
$compound->identity = $request->noIc;
$compound->nama_syarikat = $request->namaS;
$compound->no_daftar_syarikat = strtolower($request->daftarNo);
$compound->alamat = $request->alamat;
$compound->no_plate = $request->no_plate;
$compound->no_cukai_jalan = $request->no_cukai_jalan;
// $compound->nama_kawasan = $request->namaKawasan;
// $compound->nama_taman = $request->namaTaman;
// $compound->nama_jalan = $request->namaJalan;
$compound->catatan = $request->catatan;
$compound->latlong = $request->Latlong;
// $compound->akta = $faulty->deed_law_id;
// $compound->seksyen_kesalahan = $faulty->_id;
// $compound->jumlah_asal_kompaun = $faulty->amount;
$compound->dikeluarkan_ = $staff->_id;
$compound->akta = $faulty->deed_law_id;
$compound->seksyen_kesalahan = $faulty->_id;
$compound->jumlah_asal_kompaun = $faulty->amount;
$compound->dikeluarkan = $staff->_id;
$compound->status = 'Belum Bayar';
$compound->modul = '03';
$compound->no_telefon = $request->tel;
$compound->no_akaun_lesen = $request->lesen;
$compound->cpn_created = Carbon::now()->toDateTimeString();
$compound->created_c = Carbon::now()->toDateTimeString();

}
// }elseif($request->jenis == 'Pelbagai_PA'){

// $compound->jenis = $request->jenis;
// $compound->nama = $request->namaP;
// $compound->identity = $request->noIc;
// $compound->nama_syarikat = $request->namaS;
// $compound->no_daftar_syarikat = strtolower($request->daftarNo);
// $compound->alamat = $request->alamat;
// // $compound->no_plate = $request->no_plate;
// // $compound->no_cukai_jalan = $request->no_cukai_jalan;
// // $compound->nama_kawasan = $request->namaKawasan;
// // $compound->nama_taman = $request->namaTaman;
// // $compound->nama_jalan = $request->namaJalan;
// $compound->catatan = $request->catatan;
// $compound->latlong = $request->Latlong;
// $compound->akta = $faulty->deed_law_id;
// $compound->seksyen_kesalahan = $faulty->_id;
// $compound->jumlah_asal_kompaun = $faulty->amount;
// $compound->dikeluarkan = $staff->_id;
// $compound->status = 'Belum Bayar';
// $compound->modul = '03';
// $compound->no_telefon = $request->tel;
// $compound->no_akaun_lesen = $request->lesen;
// $compound->bil_haiwan = $request->lesen;
// $compound->created_c = Carbon::now()->toDateTimeString();


// }elseif($request->jenis == 'Pelbagai_LESEN'){

// $compound->jenis = $request->jenis;
// $compound->nama = $request->namaP;
// $compound->identity = $request->noIc;
// $compound->nama_syarikat = $request->namaS;
// $compound->no_daftar_syarikat = strtolower($request->daftarNo);
// $compound->alamat = $request->alamat;
// $compound->no_plate = $request->no_plate;
// $compound->no_cukai_jalan = $request->no_cukai_jalan;
// // $compound->nama_kawasan = $request->namaKawasan;
// // $compound->nama_taman = $request->namaTaman;
// // $compound->nama_jalan = $request->namaJalan;
// $compound->catatan = $request->catatan;
// $compound->latlong = $request->Latlong;
// $compound->akta = $faulty->deed_law_id;
// $compound->seksyen_kesalahan = $faulty->_id;
// $compound->jumlah_asal_kompaun = $faulty->amount;
// $compound->dikeluarkan = $staff->_id;
// $compound->status = 'Belum Bayar';
// $compound->modul = '03';
// $compound->no_telefon = $request->tel;
// $compound->no_akaun_lesen = $request->lesen;
// $compound->created_c = Carbon::now()->toDateTimeString();

// }

$saved = $compound->save();

@@ -643,7 +686,7 @@ class CompoundResourceController extends BaseController
if($saved){
// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
// if(!empty($compound)){
dispatch(new UpdateCompoundPrice($kpd));
// dispatch(new UpdateCompoundPrice($kpd));
// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun != ''){
// $tawaran = $compound->jumlah_kemaskini_kompaun;
@@ -691,8 +734,9 @@ class CompoundResourceController extends BaseController
$data = array();

$non = '';
$kpd = '';
// $kpd = '';
$no_siri ='';
$noticeData = [];

// $countKPD = $this->compound->withTrashed()->count(); //for parking numbering

@@ -710,77 +754,125 @@ class CompoundResourceController extends BaseController
if($request->jenis == 'Parkir'){

//for compound numbering
$countKPD = $this->compound->withTrashed()->count();
$kpd = 'KPD'.$countKPD;
$non = 'KPD'.$countKPD;

$no_siri = date('yn').'-'.$countKPD.'-0';

$compoundData = [
'jenis' => 'Parkir',
'kpd' => $kpd,
// $countKPD = $this->compound->withTrashed()->count();
// $kpd = 'KPD'.$countKPD;
// $non = 'KPD'.$countKPD;

// $no_siri = date('yn').'-'.$countKPD.'-0';

// $compoundData = [
// 'jenis' => 'Parkir',
// 'kpd' => $kpd,
// 'non' => $non,
// 'nama' => '-',
// 'identity' => '-',
// 'alamat' => '-',
// "no_plate" => strtolower($request->no_plate),
// "no_cukai_jalan" => $request->noCukaijalan,
// "jenis_kenderaan" => $request->jenisKenderaan,
// "model_kenderaan" => $request->modelKenderaan,
// "warna_kenderaan" => $request->warnakenderaan,
// "nama_kawasan" => $request->namaKawasan,
// "nama_taman" => $request->namaTaman,
// "nama_jalan" => $request->namaJalan,
// "no_parking" => $request->noParking,
// "catatan" => $request->catatan,
// "lokasi_kejadian" => '-',
// 'latlong' => $request->Latlong,
// 'jbkod' => $request->jabatan,
// 'akta' => $faulty->deed_law_id,
// 'seksyen_kesalahan' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
// 'dikeluarkan' => $staff->_id,
// "status" => 'Belum Bayar',
// "amount_payment" => '-',
// "receipt" => '-',
// "modul" => $request->modul,
// "penguatkuasa" => '-',
// "notis_created" => Carbon::now()->toDateTimeString(),
// ];
}elseif($request->jenis == 'Notis_NKG'){

// $kpd = $this->generateNumber($request->jenis, 'KT', '02');
// $non = 'NKG'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);

$non = $this->generateNumber($request->jenis, 'NKG', '02');

$no_siri = date('yn').'-'.filter_var($non, FILTER_SANITIZE_NUMBER_INT).'-1';

$noticeData = [
'jenis' => '-',
'jenis_n' => $request->jenis,
'kpd' => '-',
'non' => $non,
'nama' => '-',
'identity' => '-',
'alamat' => '-',
"no_plate" => strtolower($request->no_plate),
"no_cukai_jalan" => $request->noCukaijalan,
"jenis_kenderaan" => $request->jenisKenderaan,
"model_kenderaan" => $request->modelKenderaan,
"warna_kenderaan" => $request->warnakenderaan,
'nama' => $request->namaP,
'identity' => $request->noIc,
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"no_parking" => $request->noParking,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
// "lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
'seksyen_kesalahan' => $faulty->_id,
'jumlah_asal_kompaun' => $faulty->amount,
'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan' => $staff->_id,
'jbkod_n' => $request->jabatan,
'akta_n' => $faulty->deed_law_id,
'seksyen_kesalahan_n' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan_n' => $staff->_id,
"status" => 'Belum Bayar',
"amount_payment" => '-',
"receipt" => '-',
// "amount_payment" => '-',
// "receipt" => '-',
"modul" => $request->modul,
"penguatkuasa" => '-',
"notis_created" => Carbon::now()->toDateTimeString(),
"no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-',
"tindakan" => $request->tindakan,
"tempoh" => $request->tempoh,
"created_n" => Carbon::now()->toDateTimeString(),
];
}elseif($request->jenis == 'Pelbagai_KT'){
}elseif($request->jenis == 'Notis_NMH'){

$kpd = $this->generateCompoundNumber($request->jenis, 'KT');
$non = 'NKG'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);
// $kpd = $this->generateCompoundNumber($request->jenis, 'JPB');
// $non = 'NMH'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-1';
$non = $this->generateNumber($request->jenis, 'NMH', '02');

$compoundData = [
'jenis' => $request->jenis,
'kpd' => $kpd,
$no_siri = date('yn').'-'.filter_var($non, FILTER_SANITIZE_NUMBER_INT).'-2';

$noticeData = [
'jenis' => '-',
'jenis_n' => $request->jenis,
'kpd' => '-',
'non' => $non,
'nama' => $request->namaP,
'identity' => $request->noIc,
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
// "lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
'seksyen_kesalahan' => $faulty->_id,
'jumlah_asal_kompaun' => $faulty->amount,
'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan' => $staff->_id,
'jbkod_n' => $request->jabatan,
'akta_n' => $faulty->deed_law_id,
'seksyen_kesalahan_n' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan_n' => $staff->_id,
"status" => 'Belum Bayar',
"amount_payment" => '-',
"receipt" => '-',
// "amount_payment" => '-',
// "receipt" => '-',
"modul" => $request->modul,
"penguatkuasa" => '-',
"no_telefon" => $request->tel,
@@ -788,41 +880,46 @@ class CompoundResourceController extends BaseController
"maklumat_tambahan" => '-',
"tindakan" => $request->tindakan,
"tempoh" => $request->tempoh,
"notis_created" => Carbon::now()->toDateTimeString(),
"created_n" => Carbon::now()->toDateTimeString(),
];
}elseif($request->jenis == 'Pelbagai_JPB'){
}
elseif($request->jenis == 'Notis_NHN'){

$kpd = $this->generateCompoundNumber($request->jenis, 'JPB');
$non = 'NMH'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);
//HN bcs other N stands for notice. compound number no need front N
// $kpd = $this->generateCompoundNumber($request->jenis, 'HN');
// $non = 'NHN'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-2';
$non = $this->generateNumber($request->jenis, 'NHN', '02' );

$compoundData = [
'jenis' => $request->jenis,
'kpd' => $kpd,
$no_siri = date('yn').'-'.filter_var($non, FILTER_SANITIZE_NUMBER_INT).'-3';

$noticeData = [
'jenis' => '-',
'jenis_n' => $request->jenis,
'kpd' => '-',
'non' => $non,
'nama' => $request->namaP,
'identity' => $request->noIc,
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
// "lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
'seksyen_kesalahan' => $faulty->_id,
'jumlah_asal_kompaun' => $faulty->amount,
'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan' => $staff->_id,
'jbkod_n' => $request->jabatan,
'akta_n' => $faulty->deed_law_id,
'seksyen_kesalahan_n' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan_n' => $staff->_id,
"status" => 'Belum Bayar',
"amount_payment" => '-',
"receipt" => '-',
// "amount_payment" => '-',
// "receipt" => '-',
"modul" => $request->modul,
"penguatkuasa" => '-',
"no_telefon" => $request->tel,
@@ -830,91 +927,100 @@ class CompoundResourceController extends BaseController
"maklumat_tambahan" => '-',
"tindakan" => $request->tindakan,
"tempoh" => $request->tempoh,
"notis_created" => Carbon::now()->toDateTimeString(),
"created_n" => Carbon::now()->toDateTimeString(),
];
}
elseif($request->jenis == 'Pelbagai_LESEN'){
elseif($request->jenis == 'Notis_PA'){

//HN bcs other N stands for notice. compound number no need front N
$kpd = $this->generateCompoundNumber($request->jenis, 'HN');
$non = 'NHN'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);
// $kpd = $this->generateCompoundNumber($request->jenis, 'PA');
// $non = 'PA'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-3';
$non = $this->generateNumber($request->jenis, 'PA', '02');

$compoundData = [
'jenis' => $request->jenis,
'kpd' => $kpd,
$no_siri = date('yn').'-'.filter_var($non, FILTER_SANITIZE_NUMBER_INT).'-4';

$noticeData = [
'jenis' => '-',
'jenis_n' => $request->jenis,
'kpd' => '-',
'non' => $non,
'nama' => $request->namaP,
'identity' => $request->noIc,
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
// "lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
'seksyen_kesalahan' => $faulty->_id,
'jumlah_asal_kompaun' => $faulty->amount,
'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan' => $staff->_id,
'jbkod_n' => $request->jabatan,
'akta_n' => $faulty->deed_law_id,
'seksyen_kesalahan_n' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan_n' => $staff->_id,
"status" => 'Belum Bayar',
"amount_payment" => '-',
"receipt" => '-',
// "amount_payment" => '-',
// "receipt" => '-',
"modul" => $request->modul,
"penguatkuasa" => '-',
"no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-',
"notis_created" => Carbon::now()->toDateTimeString(),
"tindakan" => $request->tindakan,
"tempoh" => $request->tempoh,
"bil_haiwan" => $request->bil_haiwan,
"created_n" => Carbon::now()->toDateTimeString(),
];
}
elseif($request->jenis == 'Pelbagai_PA'){
}elseif($request->jenis == 'Notis_NPPM'){

$kpd = $this->generateCompoundNumber($request->jenis, 'PA');
$non = 'PA'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);
// $kpd = $this->generateCompoundNumber($request->jenis, 'PA');
// $non = 'PA'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT);

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-4';
$non = $this->generateNumber($request->jenis, 'NPPM', '02');

$compoundData = [
'jenis' => $request->jenis,
'kpd' => $kpd,
$no_siri = date('yn').'-'.filter_var($non, FILTER_SANITIZE_NUMBER_INT).'-4';

$noticeData = [
'jenis' => '-',
'jenis_n' => $request->jenis,
'kpd' => '-',
'non' => $non,
'nama' => $request->namaP,
'identity' => $request->noIc,
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
// "lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
'seksyen_kesalahan' => $faulty->_id,
'jumlah_asal_kompaun' => $faulty->amount,
'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan' => $staff->_id,
'jbkod_n' => $request->jabatan,
'akta_n' => $faulty->deed_law_id,
'seksyen_kesalahan_n' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan_n' => $staff->_id,
"status" => 'Belum Bayar',
"amount_payment" => '-',
"receipt" => '-',
// "amount_payment" => '-',
// "receipt" => '-',
"modul" => $request->modul,
"penguatkuasa" => '-',
"no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-',
"tindakan" => $request->tindakan,
"tempoh" => $request->tempoh,
"bil_haiwan" => $request->bil_haiwan,
"notis_created" => Carbon::now()->toDateTimeString(),
"created_n" => Carbon::now()->toDateTimeString(),
];
}

@@ -923,12 +1029,12 @@ class CompoundResourceController extends BaseController
];

$file = ConfidentialFile::create($fileData);
$saved = $file->compound()->create($compoundData);
$saved = $file->compound()->create($noticeData);

if($saved){
// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
// if(!empty($compound)){
dispatch(new UpdateCompoundPrice($kpd));
// dispatch(new UpdateCompoundPrice($kpd));
// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun != ''){
// $tawaran = $compound->jumlah_kemaskini_kompaun;
@@ -939,7 +1045,7 @@ class CompoundResourceController extends BaseController

//mobile already accept 'kpd' string, so no need to change string name to 'notis'.
array_push($data, array(
'kpd' => $kpd,
'kpd' => '-',
'non' => $non
));

@@ -965,6 +1071,7 @@ class CompoundResourceController extends BaseController
}else {

$data = array();
// dd($this->compound->where('jenis', 'Parkir')->withTrashed()->count());

$faulty = Faulty::where('_id',$request->get('seksyen'))->first();
if(!empty($faulty)){
@@ -985,10 +1092,11 @@ class CompoundResourceController extends BaseController
// 'no_siri' => $no_siri,
// ];


if($request->jenis == 'Parkir')
{
//for compound numbering
$countKPD = $this->compound->withTrashed()->count();
$countKPD = $this->compound->where('jenis','Parkir')->withTrashed()->count();
$kpd = 'KPD'.$countKPD;

$no_siri = date('yn').'-'.$countKPD.'-0';
@@ -1023,12 +1131,12 @@ class CompoundResourceController extends BaseController
"receipt" => '-',
"modul" => '03',
"penguatkuasa" => '-',
"cpn_created" => Carbon::now()->toDateTimeString(),
"created_c" => Carbon::now()->toDateTimeString(),
];
}
if ($request->jenis == 'Pelbagai_KT') {

$kpd = $this->generateCompoundNumber($request->jenis, 'KT');
$kpd = $this->generateNumber($request->jenis, 'KT', '03');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-1';

@@ -1040,13 +1148,13 @@ class CompoundResourceController extends BaseController
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
// "lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
@@ -1064,12 +1172,12 @@ class CompoundResourceController extends BaseController
"maklumat_tambahan" => '-',
"tindakan" => '-',
"tempoh" => '-',
"cpn_created" => Carbon::now()->toDateTimeString(),
"created_c" => Carbon::now()->toDateTimeString(),
];
}
elseif ($request->jenis == 'Pelbagai_JPB') {

$kpd = $this->generateCompoundNumber($request->jenis, 'JPB');
$kpd = $this->generateNumber($request->jenis, 'JPB', '03');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-2';

@@ -1081,13 +1189,13 @@ class CompoundResourceController extends BaseController
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
// "lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
@@ -1105,89 +1213,89 @@ class CompoundResourceController extends BaseController
"maklumat_tambahan" => '-',
"tindakan" => '-',
"tempoh" => '-',
"cpn_created" => Carbon::now()->toDateTimeString(),
];
}
elseif ($request->jenis == 'Pelbagai_LESEN') {

//HN bcs other N stands for notice. compound number no need front N
$kpd = $this->generateCompoundNumber($request->jenis, 'HN');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-3';

$compoundData = [
'jenis' => $request->jenis,
'kpd' => $kpd,
'nama' => $request->namaP,
'identity' => $request->noIc,
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
'seksyen_kesalahan' => $faulty->_id,
'jumlah_asal_kompaun' => $faulty->amount,
'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan' => $staff->_id,
"status" => 'Belum Bayar',
"amount_payment" => '-',
"receipt" => '-',
"modul" => $request->modul,
"penguatkuasa" => '-',
"no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-',
"cpn_created" => Carbon::now()->toDateTimeString(),
];
}
else if($request->jenis == 'Pelbagai_PA'){

$kpd = $this->generateCompoundNumber($request->jenis, 'PA');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-4';

$compoundData = [
'jenis' => $request->jenis,
'kpd' => $kpd,
'nama' => $request->namaP,
'identity' => $request->noIc,
'nama_syarikat' => $request->namaS,
'no_daftar_syarikat' => strtolower($request->daftarNo),
'alamat' => $request->alamat,
"no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan,
"lokasi_kejadian" => '-',
'latlong' => $request->Latlong,
'jbkod' => $request->jabatan,
'akta' => $faulty->deed_law_id,
'seksyen_kesalahan' => $faulty->_id,
'jumlah_asal_kompaun' => $faulty->amount,
'jumlah_kemaskini_kompaun' => '-',
'dikeluarkan' => $staff->_id,
"status" => 'Belum Bayar',
"amount_payment" => '-',
"receipt" => '-',
"modul" => $request->modul,
"penguatkuasa" => '-',
"no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-',
"bil_haiwan" => $request->bil_haiwan,
"cpn_created" => Carbon::now()->toDateTimeString(),
"created_c" => Carbon::now()->toDateTimeString(),
];
}
// elseif ($request->jenis == 'Pelbagai_LESEN') {

// //HN bcs other N stands for notice. compound number no need front N
// $kpd = $this->generateCompoundNumber($request->jenis, 'HN');

// $no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-3';

// $compoundData = [
// 'jenis' => $request->jenis,
// 'kpd' => $kpd,
// 'nama' => $request->namaP,
// 'identity' => $request->noIc,
// 'nama_syarikat' => $request->namaS,
// 'no_daftar_syarikat' => strtolower($request->daftarNo),
// 'alamat' => $request->alamat,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
// "nama_kawasan" => $request->namaKawasan,
// "nama_taman" => $request->namaTaman,
// "nama_jalan" => $request->namaJalan,
// "catatan" => $request->catatan,
// "lokasi_kejadian" => '-',
// 'latlong' => $request->Latlong,
// 'jbkod' => $request->jabatan,
// 'akta' => $faulty->deed_law_id,
// 'seksyen_kesalahan' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
// 'dikeluarkan' => $staff->_id,
// "status" => 'Belum Bayar',
// "amount_payment" => '-',
// "receipt" => '-',
// "modul" => $request->modul,
// "penguatkuasa" => '-',
// "no_telefon" => $request->tel,
// "no_akaun_lesen" => $request->lesen,
// "maklumat_tambahan" => '-',
// "created_c" => Carbon::now()->toDateTimeString(),
// ];
// }
// else if($request->jenis == 'Pelbagai_PA'){

// $kpd = $this->generateCompoundNumber($request->jenis, 'PA');

// $no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-4';

// $compoundData = [
// 'jenis' => $request->jenis,
// 'kpd' => $kpd,
// 'nama' => $request->namaP,
// 'identity' => $request->noIc,
// 'nama_syarikat' => $request->namaS,
// 'no_daftar_syarikat' => strtolower($request->daftarNo),
// 'alamat' => $request->alamat,
// "no_plate" => $request->no_plate,
// "no_cukai_jalan" => $request->no_cukai_jalan,
// "nama_kawasan" => $request->namaKawasan,
// "nama_taman" => $request->namaTaman,
// "nama_jalan" => $request->namaJalan,
// "catatan" => $request->catatan,
// "lokasi_kejadian" => '-',
// 'latlong' => $request->Latlong,
// 'jbkod' => $request->jabatan,
// 'akta' => $faulty->deed_law_id,
// 'seksyen_kesalahan' => $faulty->_id,
// 'jumlah_asal_kompaun' => $faulty->amount,
// 'jumlah_kemaskini_kompaun' => '-',
// 'dikeluarkan' => $staff->_id,
// "status" => 'Belum Bayar',
// "amount_payment" => '-',
// "receipt" => '-',
// "modul" => $request->modul,
// "penguatkuasa" => '-',
// "no_telefon" => $request->tel,
// "no_akaun_lesen" => $request->lesen,
// "maklumat_tambahan" => '-',
// "bil_haiwan" => $request->bil_haiwan,
// "cpn_created" => Carbon::now()->toDateTimeString(),
// ];
// }

$fileData = [
'no_siri' => $no_siri,
@@ -1202,7 +1310,7 @@ class CompoundResourceController extends BaseController
// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
// if(!empty($compound)){

dispatch(new UpdateCompoundPrice($kpd));
// dispatch(new UpdateCompoundPrice($kpd));

// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun != ''){

+ 3
- 3
app/Http/Controllers/Api/LoginController.php Ver fichero

@@ -151,10 +151,10 @@ class LoginController extends BaseController
public function testing(Request $request)
{

$date = '2020-10-06 16:19:48';

dd(date('F Y', strtotime($date)));

$test = '02399'; //filter_var('000099', FILTER_SANITIZE_NUMBER_INT);
(int)$test += 1;
dd($test);

}


+ 19
- 18
app/Jobs/StoreNotice.php Ver fichero

@@ -147,26 +147,27 @@ class StoreNotice implements ShouldQueue
// dispatch(new UpdateCompoundPrice($this->kpd));

$staff = Staff::with('StaffDetail')->where('_id', $this->no_badan)->first();
$compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('non',$this->non)->first();
$notice = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('non',$this->non)->first();

$site = SiteSetting::first();
$faulty = Faulty::with('DeedLaw')->where('_id',$compound->seksyen_kesalahan)->first();
$department = Department::where('_id', $compound->jbkod)->first();
$faulty = Faulty::with('DeedLaw')->where('_id',$notice->seksyen_kesalahan_n)->first();

$tawaran = '';
if($compound->jumlah_kemaskini_kompaun == ''){
$tawaran = $compound->jumlah_asal_kompaun;
}else{
$tawaran = $compound->jumlah_kemaskini_kompaun;
}
$department = Department::where('_id', $notice->jbkod_n)->first();

// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun == ''){
// $tawaran = $compound->jumlah_asal_kompaun;
// }else{
// $tawaran = $compound->jumlah_kemaskini_kompaun;
// }

/******************************************************************/
$gDate = $compound->created_at->format('F Y');
$gDate = date('F Y', strtotime($notice->created_n));
$historyData = [
'tarikh_kumpulan' => $gDate,
];
$subHistory = [
'no_siri' => $compound->ConfidentialFile->no_siri,
'no_siri' => $notice->ConfidentialFile->no_siri,
'tajuk' => "Penguatkuasa ".$staff->StaffDetail->full_name." mengeluarkan notis ".$this->non,
'huraian' => "Notis ".$this->non." telah dikeluarkan oleh penguatkuasa <a href='".url('/main/staff')."/".$staff->_id."/profile'>".$staff->StaffDetail->full_name."</a> di bawah akta seksyen kesalahan [".$faulty->sketr."] ".$faulty->nama,
];
@@ -174,25 +175,25 @@ class StoreNotice implements ShouldQueue
$groupByDate = History::where('tarikh_kumpulan', $gDate)->first();
if(!empty($groupByDate)){
$groupByDate->subhistory()->create($subHistory);
$compound->ConfidentialFile->history()->attach($groupByDate);
$notice->ConfidentialFile->history()->attach($groupByDate);
}else{
$history = History::create($historyData);
$history->subhistory()->create($subHistory);
$compound->ConfidentialFile->history()->attach($history);
$notice->ConfidentialFile->history()->attach($history);
}

$memo = Memo::where('itkod', $compound->seksyen_kesalahan)->get();
$memo = Memo::where('itkod', $notice->seksyen_kesalahan)->get();
if(!empty($memo)){
foreach ($memo as $key => $m) {
$staffD = StaffDetail::where('_id',$m->dikeluarkan)->first();
if($m->disahkan != ''){
$compound->ConfidentialFile->memo()->attach($m);
$notice->ConfidentialFile->memo()->attach($m);

$historyData = [
'tarikh_kumpulan' => $gDate,
];
$subHistory = [
'no_siri' => $compound->ConfidentialFile->no_siri,
'no_siri' => $notice->ConfidentialFile->no_siri,
'tajuk' => "Penambahan Memo[ ".$m->no_rujukan." ] : ".$m->subjek." oleh ".$staffD->roles_access." ".$staffD->full_name,
'huraian' => $m->penerangan,
];
@@ -200,11 +201,11 @@ class StoreNotice implements ShouldQueue
$groupByDate = History::where('tarikh_kumpulan', $gDate)->first();
if(!empty($groupByDate)){
$groupByDate->subhistory()->create($subHistory);
$compound->ConfidentialFile->history()->attach($groupByDate);
$notice->ConfidentialFile->history()->attach($groupByDate);
}else{
$history = History::create($historyData);
$history->subhistory()->create($subHistory);
$compound->ConfidentialFile->history()->attach($history);
$notice->ConfidentialFile->history()->attach($history);
}
}
}

+ 1697
- 1697
resources/views/main-dashboard/compound_detail/compound_detail.blade.php
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 47
- 2
resources/views/main-dashboard/compound_detail/compound_job.blade.php Ver fichero

@@ -94,9 +94,54 @@
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> Maklumat Terperinci </h4>
</div>

<div class="panel-body">
@if($compound->status == 'Belum Bayar')
@if($compound->modul == '02')
<div><a href="{{ url('main/compound') }}/{{ $compound->non }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}">Kompaun</a></div>
@else
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
@endif

@if($compound->modul == '04')
<!-- <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/investigation" class="{{ Request::is('main/compound/*/investigation') ? 'active' : '' }}">Pengesahan Kompaun</a></div> -->
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '05')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('main/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '06')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('main/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '07')
<div><a href="{{ url('main/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('main/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@endif

@if($compound->modul == '02')
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->non}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@else
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@endif

@elseif($compound->status == 'Berbayar')
@if($compound->modul == '02')
<div><a href="{{ url('main/compound') }}/{{ $compound->non }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->non}}/pdf">Cetak/Papar PDF</a></div>
@else
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
@endif
@endif
</div>

<div class="panel-body">
{{-- <div class="panel-body">
@if($compound->status == 'Belum Bayar')
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
@@ -120,7 +165,7 @@
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
@endif
</div>
</div> --}}
</div>
</div>


+ 232
- 213
resources/views/main-dashboard/compound_detail/history_detail.blade.php Ver fichero

@@ -1,213 +1,232 @@
@extends('layout.master', ['uid' => $user->_id, 'token' => $user->token_firebase])
@section('page_title', 'Kompaun (Kertas Siasatan)')
@section('sub_page_title', '')
@section('name', $user->StaffDetail->full_name)
@section('img_profile', $user->StaffDetail->profile_img)
@section('content')
<style type="text/css">
select.form-control, select.form-control:focus, select.form-control:hover {
border: 1px solid #ccc !important;
height: auto !important;
}
.panel-group .panel {
margin-bottom: 0;
overflow: hidden;
border-radius: 4px;
}
.panel-default {
border-color: #ddd;
}
.panel-default>.panel-heading {
color: #333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}
.panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
padding: 8px 15px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd;
}
.panel-body { padding:0px; }
.panel-body table tr td { padding-left: 15px }
.panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
.panel-body .table, .panel-body div {margin-bottom: 0px; }
.glyphicon { margin-right:10px; }
.active { color: #d84315; }
.active:hover { color: #d84315; }
#custom table {
table-layout:fixed !important;
border-collapse: collapse !important;
width: 100%;
word-wrap:break-word !important;
}
#custom td, #custom th {
border-top: 1px solid #dee2e6;
border-bottom: 1px solid #dee2e6;
}
.longtext{
word-wrap: break-word !important;
word-break: break-word !important;
padding: 0.6rem 2rem;
}
.btn i {
margin-right: 0px;
}
.post-timelines{ border-bottom: 1px solid #CCC !important; padding: 10px 20px !important;}
</style>
<div class="inner-page">
<!-- Display message -->
<div class="row">
<div class="col-xl-12">
@if(count($errors) > 0)
<div class="alert alert-danger border-danger">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<i class="icofont icofont-close-line-circled"></i>
</button>
<strong>Haraf Maaf!</strong><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
</div>
<!-- End Display message -->
<div class="row">
<div class="col-xl-2 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> Maklumat Terperinci </h4>
</div>
<div class="panel-body">
@if($compound->status == 'Belum Bayar')
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
@if($compound->modul == '04')
<!-- <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/investigation" class="{{ Request::is('main/compound/*/investigation') ? 'active' : '' }}">Pengesahan Kompaun</a></div> -->
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '05')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('main/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '06')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('main/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '07')
<div><a href="{{ url('main/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('main/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@endif
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@elseif($compound->status == 'Berbayar')
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
@endif
</div>
</div>
</div>
<div class="col-xl-10 col-md-12">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
@if(empty($role))
<h5 class="card-header-text">
Maklumat Garis Masa [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>-</code>]
</h5>
@else
<h5 class="card-header-text">
Maklumat Garis Masa [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>{{ $role->name }}</code>]
</h5>
@endif
</div>
</div>
</div>
</div>
<div id="timeline">
@foreach($file->History as $h)
<div class="f-30 text-muted text-center">{{ $h->tarikh_kumpulan }}</div>
<div class="row">
<div class="col-md-12 timeline-dot">
@foreach($h->SubHistory as $sh)
@if($sh->no_siri == $file->no_siri)
<div class="social-timelines p-relative">
<div class="row timeline-right p-t-35">
<div class="col-2 col-sm-2 col-xl-1">
<div class="social-timelines-left">
<img class="img-radius timeline-icon" src=" ../files/assets/images/avatar-2.jpg" alt="">
</div>
</div>
<div class="col-10 col-sm-10 col-xl-11 p-l-5 p-b-35">
<div class="card">
<div class="card-block post-timelines">
<div class="social-time text-muted">{{ $sh->created_at->diffForHumans() }}</div>
</div>
<div class="card-block">
<div class="timeline-details">
<div class="chat-header">{{ $sh->tajuk }}</div>
<p class="text-muted">{!! $sh->huraian !!}</p>
</div>
</div>
</div>
</div>
</div>
</div>
@endif
@endforeach
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
@endsection
@section('external_js')
<script type="text/javascript" src="{{ asset('js/toggle_button_edit.js') }}"></script>
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$(document).ready(function() {
var origin = window.location.origin;
$(".theme-loader").animate({
opacity: "0"
},1000);
setTimeout(function() {
$(".theme-loader").remove();
}, 800);
$('[data-toggle="tooltip"]').tooltip();
});
</script>
@endsection
@extends('layout.master', ['uid' => $user->_id, 'token' => $user->token_firebase])
@section('page_title', 'Kompaun (Kertas Siasatan)')
@section('sub_page_title', '')
@section('name', $user->StaffDetail->full_name)
@section('img_profile', $user->StaffDetail->profile_img)

@section('content')
<style type="text/css">
select.form-control, select.form-control:focus, select.form-control:hover {
border: 1px solid #ccc !important;
height: auto !important;
}

.panel-group .panel {
margin-bottom: 0;
overflow: hidden;
border-radius: 4px;
}
.panel-default {
border-color: #ddd;
}
.panel-default>.panel-heading {
color: #333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}

.panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
padding: 8px 15px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd;
}
.panel-body { padding:0px; }
.panel-body table tr td { padding-left: 15px }
.panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
.panel-body .table, .panel-body div {margin-bottom: 0px; }

.glyphicon { margin-right:10px; }
.active { color: #d84315; }
.active:hover { color: #d84315; }

#custom table {
table-layout:fixed !important;
border-collapse: collapse !important;
width: 100%;
word-wrap:break-word !important;
}
#custom td, #custom th {
border-top: 1px solid #dee2e6;
border-bottom: 1px solid #dee2e6;
}
.longtext{
word-wrap: break-word !important;
word-break: break-word !important;
padding: 0.6rem 2rem;
}

.btn i {
margin-right: 0px;
}

.post-timelines{ border-bottom: 1px solid #CCC !important; padding: 10px 20px !important;}
</style>

<div class="inner-page">
<!-- Display message -->
<div class="row">
<div class="col-xl-12">
@if(count($errors) > 0)
<div class="alert alert-danger border-danger">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<i class="icofont icofont-close-line-circled"></i>
</button>
<strong>Haraf Maaf!</strong><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
</div>
<!-- End Display message -->
<div class="row">
<div class="col-xl-2 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> Maklumat Terperinci </h4>
</div>

<div class="panel-body">
@if($compound->status == 'Belum Bayar')
@if($compound->modul == '02')
<div><a href="{{ url('main/compound') }}/{{ $compound->non }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}">Kompaun</a></div>
@else
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
@endif

@if($compound->modul == '04')
<!-- <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/investigation" class="{{ Request::is('main/compound/*/investigation') ? 'active' : '' }}">Pengesahan Kompaun</a></div> -->
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '05')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('main/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '06')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('main/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '07')
<div><a href="{{ url('main/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('main/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@endif

@if($compound->modul == '02')
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->non}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@else
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@endif

@elseif($compound->status == 'Berbayar')
@if($compound->modul == '02')
<div><a href="{{ url('main/compound') }}/{{ $compound->non }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->non}}/pdf">Cetak/Papar PDF</a></div>
@else
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
@endif
@endif
</div>
</div>
</div>

<div class="col-xl-10 col-md-12">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
@if(empty($role))
<h5 class="card-header-text">
Maklumat Garis Masa [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>-</code>]
</h5>
@else
<h5 class="card-header-text">
Maklumat Garis Masa [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>{{ $role->name }}</code>]
</h5>
@endif
</div>
</div>
</div>
</div>

<div id="timeline">
@foreach($file->History as $h)
<div class="f-30 text-muted text-center">{{ $h->tarikh_kumpulan }}</div>
<div class="row">
<div class="col-md-12 timeline-dot">
@foreach($h->SubHistory as $sh)
@if($sh->no_siri == $file->no_siri)
<div class="social-timelines p-relative">
<div class="row timeline-right p-t-35">
<div class="col-2 col-sm-2 col-xl-1">
<div class="social-timelines-left">
<img class="img-radius timeline-icon" src=" ../files/assets/images/avatar-2.jpg" alt="">
</div>
</div>
<div class="col-10 col-sm-10 col-xl-11 p-l-5 p-b-35">
<div class="card">
<div class="card-block post-timelines">
<div class="social-time text-muted">{{ $sh->created_at->diffForHumans() }}</div>
</div>
<div class="card-block">
<div class="timeline-details">
<div class="chat-header">{{ $sh->tajuk }}</div>
<p class="text-muted">{!! $sh->huraian !!}</p>
</div>
</div>

</div>
</div>
</div>
</div>
@endif
@endforeach
</div>
</div>
@endforeach
</div>

</div>

</div>
</div>
@endsection

@section('external_js')
<script type="text/javascript" src="{{ asset('js/toggle_button_edit.js') }}"></script>

<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});

$(document).ready(function() {

var origin = window.location.origin;

$(".theme-loader").animate({
opacity: "0"
},1000);
setTimeout(function() {
$(".theme-loader").remove();
}, 800);

$('[data-toggle="tooltip"]').tooltip();
});
</script>
@endsection

+ 364
- 319
resources/views/main-dashboard/compound_detail/notice_detail.blade.php Ver fichero

@@ -1,319 +1,364 @@
@extends('layout.master', ['uid' => $user->_id, 'token' => $user->token_firebase])
@section('page_title', 'Kompaun (Kertas Siasatan)')
@section('sub_page_title', '')
@section('name', $user->StaffDetail->full_name)
@section('img_profile', $user->StaffDetail->profile_img)
@section('content')
<style type="text/css">
select.form-control, select.form-control:focus, select.form-control:hover {
border: 1px solid #ccc !important;
height: auto !important;
}
.panel-group .panel {
margin-bottom: 0;
overflow: hidden;
border-radius: 4px;
}
.panel-default {
border-color: #ddd;
}
.panel-default>.panel-heading {
color: #333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}
.panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
padding: 8px 15px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd;
}
.panel-body { padding:0px; }
.panel-body table tr td { padding-left: 15px }
.panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
.panel-body .table, .panel-body div {margin-bottom: 0px; }
.glyphicon { margin-right:10px; }
.active { color: #d84315; }
.active:hover { color: #d84315; }
#custom table {
table-layout:fixed !important;
border-collapse: collapse !important;
width: 100%;
word-wrap:break-word !important;
}
#custom td, #custom th {
border-top: 1px solid #dee2e6;
border-bottom: 1px solid #dee2e6;
}
.longtext{
word-wrap: break-word !important;
word-break: break-word !important;
padding: 0.6rem 2rem;
}
.btn i {
margin-right: 0px;
}
</style>
<div class="inner-page">
<!-- Display message -->
<div class="row">
<div class="col-md-12">
<div class="fluid">
@if(count($errors) > 0)
<div class="alert alert-danger icons-alert">
@foreach($errors->all() as $error)
<p>{{$error}}</p>
@endforeach
</div>
@endif
@if(Session::get('error_msg'))
<div class="alert alert-danger icons-alert">
{!! Session::get('error_msg') !!}
</div>
@elseif(Session::get('success_msg'))
<div class="alert alert-success icons-alert">
{!! Session::get('success_msg') !!}
</div>
@endif
</div>
</div>
</div>
<!-- End Display message -->
<div class="row">
<div class="col-xl-2 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> Maklumat Terperinci </h4>
</div>
<div class="panel-body">
@if($compound->status == 'Belum Bayar')
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
@if($compound->modul == '04')
<!-- <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/investigation" class="{{ Request::is('main/compound/*/investigation') ? 'active' : '' }}">Pengesahan Kompaun</a></div> -->
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '05')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('main/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '06')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('main/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '07')
<div><a href="{{ url('main/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('main/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@endif
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@elseif($compound->status == 'Berbayar')
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
@endif
</div>
</div>
</div>
<div class="col-xl-10 col-md-12">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-header-text">
Maklumat Notis Amaran [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>{{ $role->name }}</code>]
</h5>
<span><code>Perhatian!!</code> Semua maklumat notis amaran boleh diakses sekiranya kompaun ini berada di dalam kategori <code>modul notis amaran</code> dan status dia adalah <code>aktif</code>. Untuk kemaskini template notis amaran, sila ke bahagian tetapan</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div id="view-surat" class="row">
<div class="col-xl-12">
<div class="data_table_main dt-responsive table-responsive">
<table id="senarai_notis" class="table table-sm table-striped table-bordered nowrap" width="100%">
<thead>
<tr>
<th>#</th>
<th>No.Rujukan</th>
<th>Alasan</th>
<th>No.Pos</th>
<th>Tindakan</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>No.Rujukan</th>
<th>Alasan</th>
<th>No.Pos</th>
<th>Tindakan</th>
</tr>
</tfoot>
</table>
</div>
<!-- <div class="animation-modal"> -->
<div class="modal fade" id="UpdatePos" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Muatnaik Nombor Pos</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" style="padding-left: 2rem;padding-right: 2rem;">
<form action="{{ url('/main/update/number-pos') }}" class="main cussPayment" method="POST" enctype="multipart/form-data">
<input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" />
<input type="hidden" name="letter_id" id="letter_id" value="" />
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<label for="subject"><b>Nombor Pos <code>*</code></b></label>
<div class="form-group">
<input type="text" name="no_pos" class="form-control" required="">
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<label for="subject"><b>Gambar Pos <code>*</code></b></label>
<div class="form-group">
<input type="file" name="gambar_pos" class="form-control" required="">
</div>
</div>
</div>
<hr>
<button type="button" class="btn btn-sm btn-default waves-effect float-left" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-sm btn-danger float-right waves-effect">Simpan Nombor Pos</button>
</form>
</div>
</div>
</div>
</div>
<!-- End <div class="animation-modal"> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('external_js')
<script type="text/javascript" src="{{ asset('js/toggle_button_edit.js') }}"></script>
<script type="text/javascript">
var table = $('#senarai_notis').DataTable({
"ordering": false,
"serverSide": true,
"processing": true,
"ajax": "{{ url('api/setting/template') }}/{{ $compound->kpd }}/aktif/list",
"columns": [
{ "data": "index","name": "index"},
{ "data": "no_rujukan", "name": "no_rujukan" },
{ "data": "alasan", "name": "alasan"},
{ "data": "tindakan1", "name": "tindakan1"},
{ "data": "tindakan2","name": "tindakan2"}
],
"columnDefs": [
{
"render": function ( data, type, row ) {
if (data.indexOf("Baru/") >= 0) {
var split = data.split('/');
return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
}else {
return data;
}
},
"targets": 0,
},
{
"render": function ( data, type, row ) {
if(data == ""){
return '<a onclick="uploadPosTracker(\''+row.tindakan2+'\',\'' + row.no_rujukan + '\')" class="tabledit-edit-button btn btn-sm btn-warning waves-effect waves-light" style="float: none;color:#333" data-toggle="tooltip" data-placement="top" title="Muatnaik Nombor Pos">Muatnaik Nombor Pos</a>';
}else{
return data;
}
},
"targets": 3,
},
{
"render": function ( data, type, row ) {
var kpd = '{{ $compound->kpd }}';
var pdfLink = "{{ url('/main/setting/template/notice') }}"+"/"+data+"/"+kpd+"/view/detail";
return '<div class="btn-group btn-group-sm" style="float: none;"><a target="_blank" href="'+pdfLink+'" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Notis Amaran"><span class="icofont icofont-eye-alt" style="color:white"></span></a></div>';
},
"targets": 4,
},
],
"language": {
"paginate": {
"previous": "Sebelum",
"next": "Selepas"
},
"sLengthMenu": "Tunjukkan _MENU_ entri",
"zeroRecords": "Tiada Data Ditemui",
"infoEmpty": "Tiada Rekod Yang Wujud",
"infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
"info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
"sSearch": "Cari:",
}
});
function uploadPosTracker(cid,rujukan) {
var mid = cid;
var rujukan = rujukan;
$('#letter_id').val(mid);
$('#UpdatePos').modal({
show: true
});
};
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$(document).ready(function() {
var origin = window.location.origin;
$(".theme-loader").animate({
opacity: "0"
},1000);
setTimeout(function() {
$(".theme-loader").remove();
}, 800);
$('[data-toggle="tooltip"]').tooltip();
});
</script>
@endsection
@extends('layout.master', ['uid' => $user->_id, 'token' => $user->token_firebase])
@section('page_title', 'Kompaun (Kertas Siasatan)')
@section('sub_page_title', '')
@section('name', $user->StaffDetail->full_name)
@section('img_profile', $user->StaffDetail->profile_img)

@section('content')
<style type="text/css">
select.form-control, select.form-control:focus, select.form-control:hover {
border: 1px solid #ccc !important;
height: auto !important;
}

.panel-group .panel {
margin-bottom: 0;
overflow: hidden;
border-radius: 4px;
}
.panel-default {
border-color: #ddd;
}
.panel-default>.panel-heading {
color: #333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}

.panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
padding: 8px 15px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd;
}
.panel-body { padding:0px; }
.panel-body table tr td { padding-left: 15px }
.panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
.panel-body .table, .panel-body div {margin-bottom: 0px; }

.glyphicon { margin-right:10px; }
.active { color: #d84315; }
.active:hover { color: #d84315; }

#custom table {
table-layout:fixed !important;
border-collapse: collapse !important;
width: 100%;
word-wrap:break-word !important;
}
#custom td, #custom th {
border-top: 1px solid #dee2e6;
border-bottom: 1px solid #dee2e6;
}
.longtext{
word-wrap: break-word !important;
word-break: break-word !important;
padding: 0.6rem 2rem;
}

.btn i {
margin-right: 0px;
}
</style>

<div class="inner-page">
<!-- Display message -->
<div class="row">
<div class="col-md-12">
<div class="fluid">
@if(count($errors) > 0)
<div class="alert alert-danger icons-alert">
@foreach($errors->all() as $error)
<p>{{$error}}</p>
@endforeach
</div>
@endif

@if(Session::get('error_msg'))
<div class="alert alert-danger icons-alert">
{!! Session::get('error_msg') !!}
</div>
@elseif(Session::get('success_msg'))
<div class="alert alert-success icons-alert">
{!! Session::get('success_msg') !!}
</div>
@endif
</div>
</div>
</div>
<!-- End Display message -->
<div class="row">
<div class="col-xl-2 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> Maklumat Terperinci </h4>
</div>

<div class="panel-body">
@if($compound->status == 'Belum Bayar')
@if($compound->modul == '02')
<div><a href="{{ url('main/compound') }}/{{ $compound->non }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}">Kompaun</a></div>
@else
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
@endif

@if($compound->modul == '04')
<!-- <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/investigation" class="{{ Request::is('main/compound/*/investigation') ? 'active' : '' }}">Pengesahan Kompaun</a></div> -->
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '05')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('main/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '06')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('main/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '07')
<div><a href="{{ url('main/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('main/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@endif

@if($compound->modul == '02')
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->non}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@else
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@endif

@elseif($compound->status == 'Berbayar')
@if($compound->modul == '02')
<div><a href="{{ url('main/compound') }}/{{ $compound->non }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->non}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->non}}/pdf">Cetak/Papar PDF</a></div>
@else
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
@endif
@endif
</div>

{{-- <div class="panel-body">
@if($compound->status == 'Belum Bayar')
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
@if($compound->modul == '04')
<!-- <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/investigation" class="{{ Request::is('main/compound/*/investigation') ? 'active' : '' }}">Pengesahan Kompaun</a></div> -->
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '05')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('main/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '06')
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('main/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@elseif($compound->modul == '07')
<div><a href="{{ url('main/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('main/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
@endif
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
@elseif($compound->status == 'Berbayar')
<div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
<div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
<div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
@endif
</div> --}}
</div>
</div>

<div class="col-xl-10 col-md-12">

<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-header-text">
Maklumat Notis Amaran [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>{{ $role->name }}</code>]
</h5>
<span><code>Perhatian!!</code> Semua maklumat notis amaran boleh diakses sekiranya kompaun ini berada di dalam kategori <code>modul notis amaran</code> dan status dia adalah <code>aktif</code>. Untuk kemaskini template notis amaran, sila ke bahagian tetapan</span>
</div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div id="view-surat" class="row">
<div class="col-xl-12">
<div class="data_table_main dt-responsive table-responsive">
<table id="senarai_notis" class="table table-sm table-striped table-bordered nowrap" width="100%">
<thead>
<tr>
<th>#</th>
<th>No.Rujukan</th>
<th>Alasan</th>
<th>No.Pos</th>
<th>Tindakan</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>No.Rujukan</th>
<th>Alasan</th>
<th>No.Pos</th>
<th>Tindakan</th>
</tr>
</tfoot>
</table>
</div>
<!-- <div class="animation-modal"> -->
<div class="modal fade" id="UpdatePos" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Muatnaik Nombor Pos</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" style="padding-left: 2rem;padding-right: 2rem;">
<form action="{{ url('/main/update/number-pos') }}" class="main cussPayment" method="POST" enctype="multipart/form-data">
<input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" />
<input type="hidden" name="letter_id" id="letter_id" value="" />

<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<label for="subject"><b>Nombor Pos <code>*</code></b></label>
<div class="form-group">
<input type="text" name="no_pos" class="form-control" required="">
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<label for="subject"><b>Gambar Pos <code>*</code></b></label>
<div class="form-group">
<input type="file" name="gambar_pos" class="form-control" required="">
</div>
</div>
</div>

<hr>
<button type="button" class="btn btn-sm btn-default waves-effect float-left" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-sm btn-danger float-right waves-effect">Simpan Nombor Pos</button>
</form>
</div>
</div>
</div>
</div>
<!-- End <div class="animation-modal"> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</div>
</div>
@endsection

@section('external_js')
<script type="text/javascript" src="{{ asset('js/toggle_button_edit.js') }}"></script>

<script type="text/javascript">

var table = $('#senarai_notis').DataTable({
"ordering": false,
"serverSide": true,
"processing": true,
"ajax": "{{ url('api/setting/template') }}/{{ $compound->kpd }}/aktif/list",
"columns": [
{ "data": "index","name": "index"},
{ "data": "no_rujukan", "name": "no_rujukan" },
{ "data": "alasan", "name": "alasan"},
{ "data": "tindakan1", "name": "tindakan1"},
{ "data": "tindakan2","name": "tindakan2"}
],
"columnDefs": [
{
"render": function ( data, type, row ) {
if (data.indexOf("Baru/") >= 0) {
var split = data.split('/');
return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
}else {
return data;
}
},
"targets": 0,
},
{
"render": function ( data, type, row ) {
if(data == ""){
return '<a onclick="uploadPosTracker(\''+row.tindakan2+'\',\'' + row.no_rujukan + '\')" class="tabledit-edit-button btn btn-sm btn-warning waves-effect waves-light" style="float: none;color:#333" data-toggle="tooltip" data-placement="top" title="Muatnaik Nombor Pos">Muatnaik Nombor Pos</a>';
}else{
return data;
}
},
"targets": 3,
},
{
"render": function ( data, type, row ) {
var kpd = '{{ $compound->kpd }}';
var pdfLink = "{{ url('/main/setting/template/notice') }}"+"/"+data+"/"+kpd+"/view/detail";
return '<div class="btn-group btn-group-sm" style="float: none;"><a target="_blank" href="'+pdfLink+'" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Notis Amaran"><span class="icofont icofont-eye-alt" style="color:white"></span></a></div>';
},
"targets": 4,
},
],
"language": {
"paginate": {
"previous": "Sebelum",
"next": "Selepas"
},
"sLengthMenu": "Tunjukkan _MENU_ entri",
"zeroRecords": "Tiada Data Ditemui",
"infoEmpty": "Tiada Rekod Yang Wujud",
"infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
"info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
"sSearch": "Cari:",
}
});

function uploadPosTracker(cid,rujukan) {
var mid = cid;
var rujukan = rujukan;

$('#letter_id').val(mid);
$('#UpdatePos').modal({
show: true
});
};

$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});

$(document).ready(function() {

var origin = window.location.origin;

$(".theme-loader").animate({
opacity: "0"
},1000);
setTimeout(function() {
$(".theme-loader").remove();
}, 800);

$('[data-toggle="tooltip"]').tooltip();
});
</script>
@endsection

+ 3
- 3
routes/api.php Ver fichero

@@ -26,9 +26,9 @@ Route::group(['middleware' => 'mobileapps'], function() {
Route::post('/mobile/staff/update/coordinates', 'Api\TrackMapController@save_updateLocation');
Route::post('/mobile/staff/compound/today/list', 'Api\CompoundController@viewCompoundToday');
Route::post('/mobile/staff/notice/today/list', 'Api\CompoundController@viewNoticeToday');
Route::post('/mobile/store/compound', 'Api\CompoundResourceController@store');
Route::post('/mobile/store/notice', 'Api\CompoundResourceController@storeNewNotice');
Route::post('/mobile/store', 'Api\CompoundResourceController@storeNewCompound');
Route::post('/mobile/store/compound', 'Api\CompoundResourceController@store'); //create compound from notice
Route::post('/mobile/store/notice', 'Api\CompoundResourceController@storeNewNotice'); //create new notice
Route::post('/mobile/store', 'Api\CompoundResourceController@storeNewCompound'); //create new compound
Route::post('/mobile/store/compound/picture', 'Api\CompoundController@storeCompoundAttachment');
Route::post('/mobile/store/acceptance/compound', 'Api\CompoundController@storeAcceptanceCompound');
/*-------------------------------------------------------------------------

Cargando…
Cancelar
Guardar