Dashboard sipadu mbip
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

RestfulapiController.php 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. <?php
  2. namespace App\Http\Controllers\api;
  3. use Illuminate\Http\Request;
  4. use App\Http\Controllers\Api\BaseController;
  5. use Illuminate\Support\Facades\Schema;
  6. use Carbon\Carbon;
  7. use App\Model\Staff;
  8. use App\Model\StaffDetail;
  9. use App\Model\User;
  10. use App\Model\UserDetail;
  11. use App\Model\Module\Roles;
  12. use App\Model\Module\Compound;
  13. use App\Model\Module\Department;
  14. use App\Model\Module\DeedLaw;
  15. use App\Model\Module\Faulty;
  16. use App\Model\Module\ConfidentialFile;
  17. use App\Model\Module\History;
  18. use App\Model\Module\Memo;
  19. use App\Model\Module\Attachment;
  20. use App\Model\Module\ApiIntegration;
  21. use App\Jobs\StoreCompound;
  22. use App\Jobs\UpdateCompoundPrice;
  23. class RestfulapiController extends BaseController
  24. {
  25. /**
  26. * Create search compound by category controller.
  27. *
  28. * @return json
  29. */
  30. public function searchIdentity($request){
  31. $compound = Compound::with('Faulty','Department','DeedLaw')->where('identity',$request)->get();
  32. return $compound;
  33. }
  34. public function searchKpd($request){
  35. // if(!empty($request->non)){
  36. // $compound = Compound::with('Faulty','Department','DeedLaw')->where('non','like',$request)->get();
  37. // }
  38. // else{
  39. $compound = Compound::with('Faulty','Department','DeedLaw')->where('kpd','like',$request)->orWhere('non', 'like', $request)->get();
  40. // }
  41. return $compound;
  42. }
  43. public function searchSyarikat($request){
  44. $compound = Compound::with('Faulty','Department','DeedLaw')->where('no_daftar_syarikat','like',$request)->get();
  45. return $compound;
  46. }
  47. public function searchPlate($request){
  48. $compound = Compound::with('Faulty','Department','DeedLaw')->where('no_plate','like',$request)->get();
  49. return $compound;
  50. }
  51. /**
  52. * Create search compound controller.
  53. *
  54. * @return json
  55. */
  56. public function viewCompoundPersonal(Request $request)
  57. {
  58. $compound = array();
  59. $search = $request->search;
  60. $api_integrasi = ApiIntegration::where('key', $request->key)->first();
  61. if(!empty($api_integrasi)){
  62. if($api_integrasi->status == 'active'){
  63. if($search != '' && $search != '-'){
  64. if(count($this->searchIdentity($search)) > 0){
  65. $compound = $this->searchIdentity($search);
  66. }
  67. if(count($this->searchKpd($search)) > 0){
  68. $compound = $this->searchKpd($search);
  69. }
  70. if(count($this->searchSyarikat($search)) > 0){
  71. $compound = $this->searchSyarikat($search);
  72. }
  73. if(count($this->searchPlate($search)) > 0){
  74. $compound = $this->searchPlate($search);
  75. }
  76. $data = array();
  77. if(count($compound) > 0){
  78. foreach($compound as $c){
  79. // $department = Department::where('_id',$c->jbkod)->first();
  80. // $faulty = Faulty::where('_id',$c->seksyen_kesalahan)->first();
  81. // $akta = DeedLaw::where('_id',$faulty->deed_law_id)->first();
  82. $cpn_date = ''; $cpn_time = '';
  83. if (!empty($c->cpn_created))
  84. {
  85. $cpn_date = Carbon::parse($c->cpn_created)->format("D, d M, 'y");
  86. $cpn_time = Carbon::parse($c->cpn_created)->format("g:i A");
  87. }
  88. if($c->modul == '02')
  89. {
  90. if($c->jenis_n == 'Notis_NHN'){
  91. array_push($data,array(
  92. "_id" => $c->_id,
  93. "non" => $c->non,
  94. "jenis" => $c->jenis_n,
  95. // "kpd"=> $c->kpd,
  96. "nama"=> $c->nama,
  97. "identity" => $c->identity,
  98. "no_tel" => $c->no_tel,
  99. "nama_syarikat" => $c->nama_syarikat,
  100. "no_daftar_syarikat" => strtoupper($c->no_daftar_syarikat),
  101. "no_akaun_lesen" => $c->no_akaun_lesen,
  102. "alamat" => $c->alamat,
  103. // "no_plate" => strtoupper($c->no_plate),
  104. // "no_cukai_jalan" => $c->no_cukai_jalan,
  105. "latlong" => $c->latlong,
  106. "nama_kawasan" => $c->nama_kawasan,
  107. "nama_taman" => $c->nama_taman,
  108. "nama_jalan" => $c->nama_jalan,
  109. "jbkod_n" => $c->departmentNotis->jnama,
  110. "akta_n" => $c->deedlawNotis->nama,
  111. "seksyen_kesalahan_n" => $c->FaultyNotis->nama,
  112. "catatan" => $c->catatan,
  113. // "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  114. // "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  115. // "amount_payment" => $c->amount_payment,
  116. // "receipt" => $c->receipt,
  117. "dikeluarkan" => $c->dikeluarkan_n,
  118. "status" => $c->status,
  119. "updated_at" => $c->updated_at->toDateTimeString(),
  120. "created_at" => $c->created_at->toDateTimeString(),
  121. "notice_created" => $c->created_n,
  122. ));
  123. }else if($c->jenis_n == 'Notis_NMH'){
  124. array_push($data,array(
  125. "_id" => $c->_id,
  126. "non" => $c->non,
  127. "jenis" => $c->jenis_n,
  128. // "kpd"=> $c->kpd,
  129. "nama"=> $c->nama,
  130. "identity" => $c->identity,
  131. "no_tel" => $c->no_tel,
  132. "nama_syarikat" => $c->nama_syarikat,
  133. "no_daftar_syarikat" => strtoupper($c->no_daftar_syarikat),
  134. "no_akaun_lesen" => $c->no_akaun_lesen,
  135. "alamat" => $c->alamat,
  136. // "no_plate" => strtoupper($c->no_plate),
  137. // "no_cukai_jalan" => $c->no_cukai_jalan,
  138. "latlong" => $c->latlong,
  139. "nama_kawasan" => $c->nama_kawasan,
  140. "nama_taman" => $c->nama_taman,
  141. "nama_jalan" => $c->nama_jalan,
  142. "jbkod_n" => $c->departmentNotis->jnama,
  143. "akta_n" => $c->deedlawNotis->nama,
  144. "seksyen_kesalahan_n" => $c->FaultyNotis->nama,
  145. "catatan" => $c->catatan,
  146. // "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  147. // "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  148. // "amount_payment" => $c->amount_payment,
  149. // "receipt" => $c->receipt,
  150. "dikeluarkan" => $c->dikeluarkan_n,
  151. "status" => $c->status,
  152. "updated_at" => $c->updated_at->toDateTimeString(),
  153. "created_at" => $c->created_at->toDateTimeString(),
  154. "notice_created" => $c->created_n,
  155. ));
  156. }else if($c->jenis_n == 'Notis_NKG'){
  157. array_push($data,array(
  158. "_id" => $c->_id,
  159. "non" => $c->non,
  160. "jenis" => $c->jenis_n,
  161. // "kpd"=> $c->kpd,
  162. "nama"=> $c->nama,
  163. "identity" => $c->identity,
  164. "no_tel" => $c->no_tel,
  165. "nama_syarikat" => $c->nama_syarikat,
  166. "no_daftar_syarikat" => strtoupper($c->no_daftar_syarikat),
  167. "no_akaun_lesen" => $c->no_akaun_lesen,
  168. "alamat" => $c->alamat,
  169. // "no_plate" => strtoupper($c->no_plate),
  170. // "no_cukai_jalan" => $c->no_cukai_jalan,
  171. "latlong" => $c->latlong,
  172. "nama_kawasan" => $c->nama_kawasan,
  173. "nama_taman" => $c->nama_taman,
  174. "nama_jalan" => $c->nama_jalan,
  175. "jbkod_n" => $c->departmentNotis->jnama,
  176. "akta_n" => $c->deedlawNotis->nama,
  177. "seksyen_kesalahan_n" => $c->FaultyNotis->nama,
  178. "catatan" => $c->catatan,
  179. // "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  180. // "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  181. // "amount_payment" => $c->amount_payment,
  182. // "receipt" => $c->receipt,
  183. "dikeluarkan" => $c->dikeluarkan_n,
  184. "status" => $c->status,
  185. "updated_at" => $c->updated_at->toDateTimeString(),
  186. "created_at" => $c->created_at->toDateTimeString(),
  187. "notice_created" => $c->created_n,
  188. ));
  189. }else if($c->jenis_n == 'Notis_PA'){
  190. array_push($data,array(
  191. "_id" => $c->_id,
  192. "non" => $c->non,
  193. "jenis" => $c->jenis_n,
  194. // "kpd"=> $c->kpd,
  195. "nama"=> $c->nama,
  196. "identity" => $c->identity,
  197. "no_tel" => $c->no_tel,
  198. "nama_syarikat" => $c->nama_syarikat,
  199. "no_daftar_syarikat" => strtoupper($c->no_daftar_syarikat),
  200. "no_akaun_lesen" => $c->no_akaun_lesen,
  201. "alamat" => $c->alamat,
  202. // "no_plate" => strtoupper($c->no_plate),
  203. // "no_cukai_jalan" => $c->no_cukai_jalan,
  204. "latlong" => $c->latlong,
  205. "nama_kawasan" => $c->nama_kawasan,
  206. "nama_taman" => $c->nama_taman,
  207. "nama_jalan" => $c->nama_jalan,
  208. "jbkod_n" => $c->departmentNotis->jnama,
  209. "akta_n" => $c->deedlawNotis->nama,
  210. "seksyen_kesalahan_n" => $c->FaultyNotis->nama,
  211. "catatan" => $c->catatan,
  212. // "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  213. // "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  214. // "amount_payment" => $c->amount_payment,
  215. // "receipt" => $c->receipt,
  216. "dikeluarkan" => $c->dikeluarkan_n,
  217. "status" => $c->status,
  218. "updated_at" => $c->updated_at->toDateTimeString(),
  219. "created_at" => $c->created_at->toDateTimeString(),
  220. "notice_created" => $c->created_n,
  221. ));
  222. }else if($c->jenis_n == 'Notis_NPPM'){
  223. array_push($data,array(
  224. "_id" => $c->_id,
  225. "non" => $c->non,
  226. "jenis" => $c->jenis_n,
  227. // "kpd"=> $c->kpd,
  228. "nama"=> $c->nama,
  229. "identity" => $c->identity,
  230. "no_tel" => $c->no_tel,
  231. "nama_syarikat" => $c->nama_syarikat,
  232. "no_daftar_syarikat" => strtoupper($c->no_daftar_syarikat),
  233. "no_akaun_lesen" => $c->no_akaun_lesen,
  234. "alamat" => $c->alamat,
  235. // "no_plate" => strtoupper($c->no_plate),
  236. // "no_cukai_jalan" => $c->no_cukai_jalan,
  237. "latlong" => $c->latlong,
  238. "nama_kawasan" => $c->nama_kawasan,
  239. "nama_taman" => $c->nama_taman,
  240. "nama_jalan" => $c->nama_jalan,
  241. "jbkod_n" => $c->departmentNotis->jnama,
  242. "akta_n" => $c->deedlawNotis->nama,
  243. "seksyen_kesalahan_n" => $c->FaultyNotis->nama,
  244. "catatan" => $c->catatan,
  245. // "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  246. // "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  247. // "amount_payment" => $c->amount_payment,
  248. // "receipt" => $c->receipt,
  249. "dikeluarkan" => $c->dikeluarkan_n,
  250. "status" => $c->status,
  251. "updated_at" => $c->updated_at->toDateTimeString(),
  252. "created_at" => $c->created_at->toDateTimeString(),
  253. "notice_created" => $c->created_n,
  254. ));
  255. }
  256. }
  257. else if ($c->modul == '03')
  258. {
  259. if($c->jenis == 'Pelbagai_KT'){
  260. array_push($data,array(
  261. "_id" => $c->_id,
  262. "jenis" => $c->jenis,
  263. "kpd"=> $c->kpd,
  264. "nama"=> $c->nama,
  265. "identity" => $c->identity,
  266. "no_tel" => $c->no_tel,
  267. "nama_syarikat" => $c->nama_syarikat,
  268. "no_daftar_syarikat" => strtoupper($c->no_daftar_syarikat),
  269. "no_akaun_lesen" => $c->no_akaun_lesen,
  270. "alamat" => $c->alamat,
  271. "no_plate" => strtoupper($c->no_plate),
  272. "no_cukai_jalan" => $c->no_cukai_jalan,
  273. "latlong" => $c->latlong,
  274. "nama_kawasan" => $c->nama_kawasan,
  275. "nama_taman" => $c->nama_taman,
  276. "nama_jalan" => $c->nama_jalan,
  277. "jbkod" => $c->departmentNotis->jnama,
  278. "akta" => $c->deedlawNotis->nama,
  279. "seksyen_kesalahan" => $c->Faulty->nama,
  280. "catatan" => $c->catatan,
  281. "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  282. "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  283. "amount_payment" => $c->amount_payment,
  284. "receipt" => $c->receipt,
  285. "dikeluarkan" => $c->dikeluarkan,
  286. "status" => $c->status,
  287. "updated_at" => $c->updated_at->toDateTimeString(),
  288. "created_at" => $c->created_at->toDateTimeString(),
  289. "notice_created" => $c->notice_created,
  290. "cpn_created_date" => $cpn_date,
  291. "cpn_created_time" => $cpn_time,
  292. ));
  293. }else if($c->jenis == 'Pelbagai_JPB'){
  294. array_push($data,array(
  295. "_id" => $c->_id,
  296. "jenis" => $c->jenis,
  297. "kpd"=> $c->kpd,
  298. "nama"=> $c->nama,
  299. "identity" => $c->identity,
  300. "no_tel" => $c->no_tel,
  301. "nama_syarikat" => $c->nama_syarikat,
  302. "no_daftar_syarikat" => strtoupper($c->no_daftar_syarikat),
  303. "no_akaun_lesen" => $c->no_akaun_lesen,
  304. "alamat" => $c->alamat,
  305. "no_plate" => strtoupper($c->no_plate),
  306. "no_cukai_jalan" => $c->no_cukai_jalan,
  307. "latlong" => $c->latlong,
  308. "nama_kawasan" => $c->nama_kawasan,
  309. "nama_taman" => $c->nama_taman,
  310. "nama_jalan" => $c->nama_jalan,
  311. "jbkod" => $c->departmentNotis->jnama,
  312. "akta" => $c->deedlawNotis->nama,
  313. "seksyen_kesalahan" => $c->Faulty->nama,
  314. "catatan" => $c->catatan,
  315. "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  316. "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  317. "amount_payment" => $c->amount_payment,
  318. "receipt" => $c->receipt,
  319. "dikeluarkan" => $c->dikeluarkan,
  320. "status" => $c->status,
  321. "updated_at" => $c->updated_at->toDateTimeString(),
  322. "created_at" => $c->created_at->toDateTimeString(),
  323. "notice_created" => $c->notice_created,
  324. "cpn_created_date" => $cpn_date,
  325. "cpn_created_time" => $cpn_time,
  326. ));
  327. }else if($c->jenis == 'Parkir'){
  328. array_push($data,array(
  329. "_id" => $c->_id,
  330. "nama" => $c->nama,
  331. "identity" => $c->identity,
  332. "jenis" => $c->jenis,
  333. "kpd"=> $c->kpd,
  334. "no_plate" => strtoupper($c->no_plate),
  335. "no_cukai_jalan" => $c->no_cukai_jalan,
  336. "jenis_kenderaan" => $c->jenis_kenderaan,
  337. "model_kenderaan" => $c->model_kenderaan,
  338. "warna_kenderaan" => $c->warna_kenderaan,
  339. "nama_taman" => $c->nama_taman,
  340. "nama_jalan" => $c->nama_jalan,
  341. "no_parking" => $c->no_parking,
  342. "latlong" => $c->latlong,
  343. "jbkod" => $c->Department->jnama,
  344. "akta" => $c->DeedLaw->nama,
  345. "seksyen_kesalahan" => $c->Faulty->nama,
  346. "jumlah_asal_kompaun" => $c->jumlah_asal_kompaun,
  347. "jumlah_kemaskini_kompaun" => $c->jumlah_kemaskini_kompaun,
  348. "amount_payment" => $c->amount_payment,
  349. "receipt" => $c->receipt,
  350. "dikeluarkan" => $c->dikeluarkan,
  351. "status" => $c->status,
  352. "updated_at" => $c->updated_at->toDateTimeString(),
  353. "created_at" => $c->created_at->toDateTimeString(),
  354. "notice_created" => $c->notice_created,
  355. "cpn_created_date" => $cpn_date,
  356. "cpn_created_time" => $cpn_time,
  357. ));
  358. }
  359. }
  360. }
  361. return $this->sendResponse($data, 'Result Found');
  362. }else {
  363. return $this->sendResponse('', 'No Result');
  364. }
  365. }else{
  366. return $this->sendError('Search field is compulsory!', '');
  367. }
  368. }else{
  369. return $this->sendError('Invalid Api Key', '');
  370. }
  371. }else{
  372. return $this->sendError('Invalid Api Key', '');
  373. }
  374. }
  375. /**
  376. * Create update compound controller.
  377. *
  378. * @return json
  379. */
  380. public function updatePaymentIntegrasi(Request $request){
  381. $api_integrasi = ApiIntegration::where('key', $request->key)->first();
  382. if(!empty($api_integrasi)){
  383. if($api_integrasi->status == 'active'){
  384. $compound = Compound::with('ConfidentialFile')->where('kpd', $request->kp)->first();
  385. if(!empty($compound)){
  386. if($compound->status != 'Berbayar'){
  387. $compound->status = 'Berbayar';
  388. $compound->receipt = $request->receipt;
  389. $compound->amount_payment = $request->amount;
  390. $compound->save();
  391. $now = Carbon::now();
  392. $gDate = $now->format('F Y');
  393. $historyData = [
  394. 'tarikh_kumpulan' => $gDate,
  395. ];
  396. $subHistory = [
  397. 'no_siri' => $compound->ConfidentialFile->no_siri,
  398. 'tajuk' => "Pembayaran kompaun ".$request->orderid." telah dibuat secara 'online'",
  399. 'huraian' => "Pembayaran kompaun ".$request->orderid." telah dijelaskan pada hari ini.",
  400. ];
  401. $groupByDate = History::where('tarikh_kumpulan', $gDate)->first();
  402. if(!empty($groupByDate)){
  403. $groupByDate->subhistory()->create($subHistory);
  404. $compound->ConfidentialFile->history()->attach($groupByDate);
  405. }else{
  406. $history = History::create($historyData);
  407. $history->subhistory()->create($subHistory);
  408. $compound->ConfidentialFile->history()->attach($history);
  409. }
  410. $kpd = Compound::where('kpd', $request->kp)->first();
  411. $department = Department::where('_id',$kpd->jbkod)->first();
  412. $faulty = Faulty::where('_id',$kpd->seksyen_kesalahan)->first();
  413. $akta = DeedLaw::where('_id',$faulty->deed_law_id)->first();
  414. $data = [
  415. "_id" => $kpd->_id,
  416. "kpd"=> $kpd->kpd,
  417. "nama"=> $kpd->nama,
  418. "identity" => $kpd->identity,
  419. "nama_syarikat" => $kpd->nama_syarikat,
  420. "no_daftar_syarikat" => $kpd->no_daftar_syarikat,
  421. "alamat" => $kpd->alamat,
  422. "no_plate" => $kpd->no_plate,
  423. "latlong" => $kpd->latlong,
  424. "jbkod" => $department->jnama,
  425. "akta" => "[".$akta->akkod."] ".$akta->nama,
  426. "seksyen_kesalahan" => "[".$faulty->sketr."] ".$faulty->nama,
  427. "jumlah_asal_kompaun" => $kpd->jumlah_asal_kompaun,
  428. "jumlah_kemaskini_kompaun" => $kpd->jumlah_kemaskini_kompaun,
  429. "amount_payment" => $kpd->amount_payment,
  430. "receipt" => $kpd->receipt,
  431. "dikeluarkan" => $kpd->dikeluarkan,
  432. "status" => $kpd->status,
  433. "updated_at" => $kpd->updated_at->toDateTimeString(),
  434. "created_at" => $kpd->created_at->toDateTimeString(),
  435. ];
  436. return $this->sendResponse($data, 'Successfully update compound status');
  437. }else{
  438. return $this->sendResponse('', 'This compound already been paid');
  439. }
  440. }else{
  441. return $this->sendError('Record compound not found!', '');
  442. }
  443. }else{
  444. return $this->sendError('Invalid Api Key', '');
  445. }
  446. }else{
  447. return $this->sendError('Invalid Api Key', '');
  448. }
  449. }
  450. public function compoundToEPBT()
  451. {
  452. $compound = Compound::with('Department','DeedLaw','Faulty','StaffDetail')->where('jenis', 'Pelbagai_JPB')->get();
  453. if(!empty($compound))
  454. {
  455. $data = [];
  456. foreach ($compound as $key => $c)
  457. {
  458. if($c->jenis == 'Pelbagai_KT')
  459. {
  460. $data = [
  461. 'no_kom' => $c->kpd,
  462. 'jenis' => $c->jenis,
  463. 'nama' => $c->nama,
  464. 'no_ic' => $c->identity,
  465. 'no_tel' => $c->no_telefon,
  466. 'nama_syarikat' => $c->nama_syarikat,
  467. 'no_daftar_syarikat' => $c->no_daftar_syarikat,
  468. 'no_akaun_lesen' => $c->no_akaun_lesen,
  469. 'alamat' => $c->alamat,
  470. 'jabatan' => $c->Department->jnama,
  471. 'seksyen' => '['.$c->DeedLaw->akkod.'] ' . $c->DeedLaw->nama,
  472. 'kesalahan'=> '['.$c->Faulty->sketr.'] ' . $c->Faulty->nama,
  473. 'catatan' => $c->catatan,
  474. 'latlong' => $c->latlong,
  475. 'status' =>$c->status,
  476. 'amaun_bayar' => $c->amount_payment,
  477. 'receipt' => $c->receipt,
  478. ];
  479. }
  480. if($c->jenis == 'Pelbagai_JPB')
  481. {
  482. $data = [
  483. 'no_kom' => $c->kpd,
  484. 'jenis' => $c->jenis,
  485. 'nama' => $c->nama,
  486. 'no_ic' => $c->identity,
  487. 'no_tel' => $c->no_telefon,
  488. 'nama_syarikat' => $c->nama_syarikat,
  489. 'no_daftar_syarikat' => $c->no_daftar_syarikat,
  490. 'no_akaun_lesen' => $c->no_akaun_lesen,
  491. 'alamat' => $c->alamat,
  492. 'jabatan' => $c->Department->jnama,
  493. 'seksyen' => '['.$c->DeedLaw->akkod.'] ' . $c->DeedLaw->nama,
  494. 'kesalahan'=> '['.$c->Faulty->sketr.'] ' . $c->Faulty->nama,
  495. 'catatan' => $c->catatan,
  496. 'latlong' => $c->latlong,
  497. 'status' =>$c->status,
  498. 'amaun_bayar' => $c->amount_payment,
  499. 'receipt' => $c->receipt,
  500. ];
  501. }
  502. if($c->jenis == 'Pelbagai_PA')
  503. {
  504. $data = [
  505. 'no_kom' => $c->kpd,
  506. 'jenis' => $c->jenis,
  507. 'nama' => $c->nama,
  508. 'no_ic' => $c->identity,
  509. 'no_tel' => $c->no_telefon,
  510. 'nama_syarikat' => $c->nama_syarikat,
  511. 'no_daftar_syarikat' => $c->no_daftar_syarikat,
  512. 'no_akaun_lesen' => $c->no_akaun_lesen,
  513. 'alamat' => $c->alamat,
  514. 'jabatan' => $c->Department->jnama,
  515. 'seksyen' => '['.$c->DeedLaw->akkod.'] ' . $c->DeedLaw->nama,
  516. 'kesalahan'=> '['.$c->Faulty->sketr.'] ' . $c->Faulty->nama,
  517. 'bil_haiwan' => $c->bil_haiwan,
  518. 'catatan' => $c->catatan,
  519. 'latlong' => $c->latlong,
  520. 'status' =>$c->status,
  521. 'amaun_bayar' => $c->amount_payment,
  522. 'receipt' => $c->receipt,
  523. ];
  524. }
  525. if($c->jenis == 'Pelbagai_LESEN')
  526. {
  527. $data = [
  528. 'no_kom' => $c->kpd,
  529. 'jenis' => $c->jenis,
  530. 'nama' => $c->nama,
  531. 'no_ic' => $c->identity,
  532. 'no_tel' => $c->no_telefon,
  533. 'nama_syarikat' => $c->nama_syarikat,
  534. 'no_daftar_syarikat' => $c->no_daftar_syarikat,
  535. 'no_akaun_lesen' => $c->no_akaun_lesen,
  536. 'alamat' => $c->alamat,
  537. 'jabatan' => $c->Department->jnama,
  538. 'seksyen' => '['.$c->DeedLaw->akkod.'] ' . $c->DeedLaw->nama,
  539. 'kesalahan'=> '['.$c->Faulty->sketr.'] ' . $c->Faulty->nama,
  540. 'catatan' => $c->catatan,
  541. 'latlong' => $c->latlong,
  542. 'status' =>$c->status,
  543. 'amaun_bayar' => $c->amount_payment,
  544. 'receipt' => $c->receipt,
  545. ];
  546. }
  547. if($c->jenis == 'Parkir')
  548. {
  549. $data = [
  550. 'no_kom' => $c->kpd,
  551. 'jenis' => $c->jenis,
  552. 'nama' => $c->nama,
  553. 'no_ic' => $c->identity,
  554. 'no_tel' => $c->no_telefon,
  555. 'nama_syarikat' => $c->nama_syarikat,
  556. 'no_daftar_syarikat' => $c->no_daftar_syarikat,
  557. 'no_akaun_lesen' => $c->no_akaun_lesen,
  558. 'alamat' => $c->alamat,
  559. 'jabatan' => $c->Department->jnama,
  560. 'seksyen' => '['.$c->DeedLaw->akkod.'] ' . $c->DeedLaw->nama,
  561. 'kesalahan'=> '['.$c->Faulty->sketr.'] ' . $c->Faulty->nama,
  562. 'catatan' => $c->catatan,
  563. 'latlong' => $c->latlong,
  564. 'status' =>$c->status,
  565. 'amaun_bayar' => $c->amount_payment,
  566. 'receipt' => $c->receipt,
  567. ];
  568. }
  569. }
  570. return $this->sendResponse($data, 'Successfully update compound status');
  571. }
  572. }
  573. }