Dashboard sipadu mbip
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ResponsiveController.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Http\Controllers\Controller;
  5. use Illuminate\Support\Facades\Auth;
  6. use Illuminate\Support\Facades\Input;
  7. use LynX39\LaraPdfMerger\Facades\PdfMerger;
  8. use Validator;
  9. use Session;
  10. use Config;
  11. use File;
  12. use Carbon\Carbon;
  13. use PDF;
  14. use App\SiteSetting;
  15. use App\Model\Staff;
  16. use App\Model\StaffDetail;
  17. use App\Model\User;
  18. use App\Model\UserDetail;
  19. use App\Model\Module\Roles;
  20. use App\Model\Module\Department;
  21. use App\Model\Module\DeedLaw;
  22. use App\Model\Module\Faulty;
  23. use App\Model\Module\Compound;
  24. use App\Model\Module\ConfidentialFile;
  25. use App\Model\Module\History;
  26. use App\Model\Module\SubHistory;
  27. use App\Model\Module\Attachment;
  28. class ResponsiveController extends Controller
  29. {
  30. /**
  31. * Create responsive controller.
  32. *
  33. * @return json
  34. */
  35. public function showCompoundPage($ic) {
  36. $site = SiteSetting::first();
  37. $compound = Compound::with('ConfidentialFile')->where('identity',$ic)->get();
  38. return view('mobile-responsive.compound_list_result', compact('compound','site'));
  39. }
  40. public function requestCompoundPaymentPdf($kpd) {
  41. $ready_view_pdf = false;
  42. $availablePDF = array();
  43. $now = Carbon::now()->format('d/m/Y h:i:s A');
  44. $compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('kpd', $kpd)->first();
  45. $file = ConfidentialFile::with(['Memo' => function($q){
  46. $q->orderBy('updated_at','ASC');
  47. }],['Investigation' => function($q){
  48. $q->orderBy('updated_at','ASC');
  49. }],'ItemInventory')->where('_id',$compound->ConfidentialFile->_id)->first();
  50. $destinationPath = 'document/'.$compound->ConfidentialFile->no_siri.'/pdf';
  51. if(!File::exists(public_path().'/'.$destinationPath)) {
  52. File::makeDirectory(public_path().'/'.$destinationPath, $mode = 0777, true, true);
  53. }
  54. /**
  55. ** Compound
  56. **/
  57. $tawaran = '';
  58. if($compound->jumlah_kemaskini_kompaun == ''){
  59. $tawaran = $compound->jumlah_asal_kompaun;
  60. }else{
  61. $tawaran = $compound->jumlah_kemaskini_kompaun;
  62. }
  63. $site = SiteSetting::first();
  64. $staff = Staff::with('StaffDetail')->where('no_badan', $compound->dikeluarkan)->first();
  65. $department = Department::where('jbkod', $staff->StaffDetail->jbkod)->first();
  66. $akta = DeedLaw::where('akkod', $compound->akta)->first();
  67. $faulty = Faulty::where('itkod',$compound->seksyen_kesalahan)->first();
  68. return view('mobile-responsive.compound_detail', compact('compound','staff','department','akta','faulty','picArray','tawaran','site'));
  69. }
  70. }