123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
-
- namespace App\Http\Controllers;
-
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- use Illuminate\Support\Facades\Auth;
- use Illuminate\Support\Facades\Input;
- use LynX39\LaraPdfMerger\Facades\PdfMerger;
-
- use Validator;
- use Session;
- use Config;
- use File;
- use Carbon\Carbon;
- use PDF;
-
- use App\SiteSetting;
- use App\Model\Staff;
- use App\Model\StaffDetail;
- use App\Model\User;
- use App\Model\UserDetail;
- use App\Model\Module\Roles;
- use App\Model\Module\Department;
- use App\Model\Module\DeedLaw;
- use App\Model\Module\Faulty;
- use App\Model\Module\Compound;
- use App\Model\Module\ConfidentialFile;
- use App\Model\Module\History;
- use App\Model\Module\SubHistory;
- use App\Model\Module\Attachment;
-
- class ResponsiveController extends Controller
- {
- /**
- * Create responsive controller.
- *
- * @return json
- */
- public function showCompoundPage($ic) {
- $site = SiteSetting::first();
- $compound = Compound::with('ConfidentialFile')->where('identity',$ic)->get();
- return view('mobile-responsive.compound_list_result', compact('compound','site'));
- }
-
- public function requestCompoundPaymentPdf($kpd) {
-
- $ready_view_pdf = false;
- $availablePDF = array();
- $now = Carbon::now()->format('d/m/Y h:i:s A');
-
- $compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('kpd', $kpd)->first();
- $file = ConfidentialFile::with(['Memo' => function($q){
- $q->orderBy('updated_at','ASC');
- }],['Investigation' => function($q){
- $q->orderBy('updated_at','ASC');
- }],'ItemInventory')->where('_id',$compound->ConfidentialFile->_id)->first();
-
- $destinationPath = 'document/'.$compound->ConfidentialFile->no_siri.'/pdf';
- if(!File::exists(public_path().'/'.$destinationPath)) {
- File::makeDirectory(public_path().'/'.$destinationPath, $mode = 0777, true, true);
- }
-
- /**
- ** Compound
- **/
- $tawaran = '';
- if($compound->jumlah_kemaskini_kompaun == ''){
- $tawaran = $compound->jumlah_asal_kompaun;
- }else{
- $tawaran = $compound->jumlah_kemaskini_kompaun;
- }
-
- $site = SiteSetting::first();
- $staff = Staff::with('StaffDetail')->where('no_badan', $compound->dikeluarkan)->first();
- $department = Department::where('jbkod', $staff->StaffDetail->jbkod)->first();
- $akta = DeedLaw::where('akkod', $compound->akta)->first();
- $faulty = Faulty::where('itkod',$compound->seksyen_kesalahan)->first();
- return view('mobile-responsive.compound_detail', compact('compound','staff','department','akta','faulty','picArray','tawaran','site'));
- }
- }
|