Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EpbtController.php 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. namespace App\Http\Controllers\api;
  3. use Illuminate\Http\Request;
  4. use App\Http\Controllers\Api\BaseController;
  5. use App\Model\Database\EPBT;
  6. use App\Model\Module\CodeMukim;
  7. use Carbon\Carbon;
  8. use Config;
  9. use File;
  10. use DB;
  11. class EpbtController extends BaseController
  12. {
  13. /**
  14. * Create compound list controller.
  15. *
  16. * @return json
  17. */
  18. public function getEPBTCukai(Request $request){
  19. try {
  20. DB::connection('oracle')->getPdo();
  21. $data = EPBT::where('akaun', $request->acc)->get();
  22. if(!empty($data)) {
  23. return $this->sendResponse($data, ' Berjaya dapatkan rekod akaun');
  24. }else{
  25. return $this->sendError('', 'Rekod akaun tidak ditemui');
  26. }
  27. } catch (\Exception $e) {
  28. die("Could not connect to the database. Please check your configuration. error:" . $e );
  29. }
  30. }
  31. public function getcodeBandar()
  32. {
  33. $bandar = CodeMukim::select('JLN_MKKOD', 'MKM_MNAMA')->orderBy('JLN_MKKOD', 'ASC')->get();
  34. $bandar_detail = [];
  35. foreach($bandar as $i)
  36. {
  37. array_push($bandar_detail, array(
  38. "JLN_MKKOD" => $i->JLN_MKKOD. " - " .$i->MKM_MNAMA,
  39. ));
  40. }
  41. return $this->sendResponse($bandar_detail, 'Senarai Bandar');
  42. }
  43. public function getcodeTaman(Request $request)
  44. {
  45. $tmpD = explode(" - ",$request->code_mukim);
  46. $kawasan_detail = array();
  47. $mukim = $tmpD[0];
  48. $data = CodeMukim::where('JLN_MKKOD', $mukim)->orderBy('JLN_KWKOD', 'ASC')->get();
  49. foreach($data as $i)
  50. {
  51. array_push($kawasan_detail, array(
  52. "JLN_KWKOD" => $i->JLN_KWKOD. " - " .$i->KWS_KNAMA,
  53. ));
  54. }
  55. return $this->sendResponse($kawasan_detail, 'Senarai Kawasan');
  56. }
  57. public function getCodeJalan(Request $request)
  58. {
  59. $tmpE = explode(" - ",$request->code_mukim);
  60. $mukim = $tmpE[0];
  61. $tmpF = explode(" - ",$request->code_kawasan);
  62. $kawasan = $tmpF[0];
  63. $jalan_detail = array();
  64. $data = CodeMukim::where('JLN_KWKOD', $kawasan)->where('JLN_MKKOD', $mukim)->orderBy('JLN_JLKOD', 'ASC')->get();
  65. foreach($data as $i)
  66. {
  67. array_push($jalan_detail, array(
  68. "JLN_JLKOD" => $i->JLN_JNAMA,
  69. "JLN_JNAMA" => $i->JLN_JNAMA
  70. ));
  71. }
  72. return $this->sendResponse($jalan_detail, 'Berjaya dapatkan rekod');
  73. }
  74. }