Пример #1
0
 public function pdf()
 {
     // data
     $sekolah = Sekolah::data();
     $kembali = Pengembalian::semua();
     return PDF::loadHTML(View::make('pdf.pengembalian', compact('sekolah', 'kembali')))->setPaper('a4')->download('data pengembalian.pdf');
 }
 public function InDanhSachDeTaiNhom($mahp, $macb)
 {
     $date = date('Y-m-d');
     $nguoiin = DB::table('giang_vien')->where('macb', $macb)->value('hoten');
     //Lấy giá trị năm học và học kỳ hiện tại
     $namht = DB::table('nien_khoa')->distinct()->orderBy('nam', 'desc')->value('nam');
     $hkht = DB::table('nien_khoa')->distinct()->orderBy('hocky', 'desc')->where('nam', $namht)->value('hocky');
     $mank = DB::table('nien_khoa as nk')->join('nhom_hocphan as hp', 'nk.mank', '=', 'hp.mank')->where('nk.nam', $namht)->where('nk.hocky', $hkht)->value('nk.mank');
     $mahp = \Request::segment(3);
     if ($mahp == "all") {
         $gv_hp = DB::table('nhom_hocphan as hp')->select('gv.macb', 'gv.hoten', 'hp.tennhomhp', 'hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('gv.macb', $macb)->where('hp.mank', $mank)->get();
         //Lấy mảng các mã nhóm HP của cán bộ này ở hk-nk hiện tại
         $ds_hpgv = DB::table('nhom_hocphan as hp')->select('hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('gv.macb', $macb)->where('hp.mank', $mank)->lists('hp.manhomhp');
         $dssv = DB::table('sinh_vien as sv')->leftjoin('chia_nhom as chn', 'sv.mssv', '=', 'chn.mssv')->leftjoin('ra_de_tai as radt', 'chn.manhomthuchien', '=', 'radt.manhomthuchien')->leftjoin('de_tai as dt', 'radt.madt', '=', 'dt.madt')->whereIn('chn.manhomhp', $ds_hpgv)->orderBy('chn.manhomthuchien', 'asc')->get();
     } else {
         if ($mahp != null) {
             $gv_hp = DB::table('nhom_hocphan as hp')->select('gv.macb', 'gv.hoten', 'hp.tennhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('hp.manhomhp', $mahp)->first();
             $dssv = DB::table('sinh_vien as sv')->leftjoin('chia_nhom as chn', 'sv.mssv', '=', 'chn.mssv')->leftjoin('ra_de_tai as radt', 'chn.manhomthuchien', '=', 'radt.manhomthuchien')->leftjoin('de_tai as dt', 'radt.madt', '=', 'dt.madt')->where('chn.manhomhp', $mahp)->orderBy('chn.manhomthuchien', 'asc')->get();
         }
     }
     $view = \View::make('giangvien.in-danh-sach-de-tai-nhom', compact('macb', 'nguoiin', 'namht', 'hkht', 'gv_hp', 'dssv', 'date', 'mahp'));
     $pdf = \App::make('dompdf.wrapper');
     $pdf = \PDF::loadHTML($view)->setPaper('a4')->setOrientation('landscape');
     return $pdf->stream("DanhSachDeTaiNhom.pdf");
 }
Пример #3
0
 protected function upload()
 {
     $validator = $this->fileValidator(Input::all());
     if ($validator->passes()) {
         if ($this->_user->download_count) {
             \Excel::selectSheetsByIndex(0)->load(Input::get('file'), function ($reader) {
                 $finalHtml = '';
                 $currentTime = date('d-m-Y_His');
                 mkdir($currentTime);
                 foreach ($reader->toArray() as $row) {
                     $html = "\n\t\t\t<style>\n\t\t\t\t.page-break {\n\t    \t\t\tpage-break-after: always;\n\t\t\t\t}\n\t\t\t\t.outer-container {\n\t\t\t\t\tmargin: 0% auto;\n\t\t\t\t\tborder: 1px solid black;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\theight: 99%;\n\t\t\t\t}\n\t\t\t\t.subject-container {\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\tmargin-top: 30px;\n\t\t\t\t}\n\t\t\t\t.content-container {\n\t\t\t\t\ttext-align: left;\n\t\t\t\t\tpadding: 10px;\n\t\t\t\t\tmargin-top: 50px;\n\t\t\t\t}\n\t\t\t\tol {\n\t\t\t\t\ttext-align: left;\n\t\t\t\t}\n\t\t\t\tol li{\n\t\t\t\t\tpadding-bottom: 40px;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div class='outer-container'>\n\t\t\t\t\n\t\t\t \t\t<p class='subject-container'>Subject: NOTICE UNDER SECTION 138 OF NEGOTIABLE INSTRUMENT ACT READ WITH SECTION 420 OF INDIAN PENAL CODE</p>\n\n\t\t\t\t\t<p class='content-container'>\n\t\t\t\t\t\tOn behalf of and under instructions of my client <u>{$row['name']}</u> S/o__________ R/o __________ (hereinafter referred to as &quot;my client&quot;). I do hereby serve you with the following legal notice:\n\n\t\t\t\t\t\t<ol>\n\t\t\t\t\t\t\t<li>That my client, an engineering student, while looking for job paid Rs {$row['amount']} to you for assured placement in an MNC, last year.</li>\n\t\t\t\t\t\t\t<li>That thereafter my client issued a number of reminders to you for placement, but still no opportunity was provided to him, i.e. as you were unable to fulfill the promise as to placement of my client. Therefore, it was decided between you and my client that the amount of Rs {$row['amount']} should be refunded and as a result you issued him a cheque no {$row['cheque_number']} dated {$row['cheque_date']}.</li>\n\t\t\t\t\t\t\t<li>That the said cheque was presented by my client to State Bank of India, Noida for credit in his account in the month of December 2011 itself, but it bounced due to insufficient funds. And my client contacted you and was assured of cash in lieu of bounced cheque, therefore, my client did not take legal action earlier. My client thereafter again requested many a time to you for the payment of the said cheque amount by telephone and/or through personal visit of his representative, but in vain.</li>\n\t\t\t\t\t\t\t<li>That in April 2012, my client again tried depositing the cheque with State Bank of India, Mysore but it was again returned as unpaid with remarks &#45; Funds Insufficient, vide Syndicate Bank memo dated 19 April 2012.</li>\n\t\t\t\t\t\t\t<li>That in the facts and circumstances created by you my above said client left with no alternative except to serve you the present notice and calling upon all of you to make the payment of the above mentioned cheque amount totaling Rs {$row['amount']}/- (Rupees Ten Thousand only) including bouncing charges in cash with interest @ 24% per annum within 15 days of the receipt of this notice failing which my client shall be constrained to institute against you a criminal complaint under section 138 of the Negotiable Instrument Act read with section 420 of IPC where under you could be sentenced to undergo imprisonment of the two years and also pay the fine equivalent of the double amount of the above mentioned cheque as well as legal charges of this notice of Rs 2100/-</li>\n\t\t\t\t\t\t\t<li>That a copy of this notice retained in my office for further reference /record and legal action.</li>\n\t\t\t\t\t\t</ol>\n\t\t\t\t\t</p>\n\t\t\t</div>";
                     $finalHtml .= $html . "<div class='page-break'></div>";
                     \PDF::loadHTML($html)->setPaper('a4')->setOrientation('portrait')->setWarnings(false)->save($currentTime . '/' . $row["name"] . '_' . $row['cheque_number'] . '.pdf');
                 }
                 \PDF::loadHTML($finalHtml)->setPaper('a4')->setOrientation('portrait')->setWarnings(false)->save($currentTime . '/' . $currentTime . '.pdf');
                 // Here we choose the folder which will be used.
                 $dirName = public_path() . '/' . $currentTime;
                 // Choose a name for the archive.
                 $zipFileName = $this->_user->email . '_' . $currentTime . '.zip';
                 // Create ".zip" file in public directory of project.
                 $zip = new ZipArchive();
                 if ($zip->open(public_path() . '/' . $zipFileName, ZipArchive::CREATE) === TRUE) {
                     // Copy all the files from the folder and place them in the archive.
                     foreach (glob($dirName . '/*') as $fileName) {
                         $file = basename($fileName);
                         $zip->addFile($fileName, $file);
                     }
                     $zip->close();
                     $headers = array('Content-Type' => 'application/octet-stream');
                 } else {
                     echo 'failed';
                 }
                 $filename = $this->_user->email . '_' . $currentTime . '.zip';
                 $filepath = $_SERVER["DOCUMENT_ROOT"];
                 ob_start();
                 // http headers for zip downloads
                 header("Pragma: public");
                 header("Expires: 0");
                 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                 header("Cache-Control: public");
                 header("Content-Description: File Transfer");
                 header("Content-type: application/octet-stream");
                 header("Content-Disposition: attachment; filename=\"" . $filename . "\"");
                 header("Content-Transfer-Encoding: binary");
                 header("Content-Length: " . filesize($filepath . "/" . $filename));
                 @readfile($filepath . "/" . $filename);
                 ob_end_flush();
                 \File::deleteDirectory($currentTime);
                 \File::delete($this->_user->email . '_' . $currentTime . '.zip');
                 // reader methods
                 $this->_user->download_count = $this->_user->download_count - 1;
                 $this->_user->save();
             });
         } else {
             return Redirect::to("home")->with('message', 'Your maximum download limit 3, exceeded in beta version.  Please subscribe to use this feature.');
         }
     }
     return Redirect::to("home")->withErrors($validator->messages());
 }
Пример #4
0
 /**
  * Convert a page to a pdf file.
  * @param Page $page
  * @return mixed|string
  */
 public function pageToPdf(Page $page)
 {
     $cssContent = file_get_contents(public_path('/css/export-styles.css'));
     $pageHtml = view('pages/pdf', ['page' => $page, 'css' => $cssContent])->render();
     $containedHtml = $this->containHtml($pageHtml);
     $pdf = \PDF::loadHTML($containedHtml);
     return $pdf->output();
 }
 function process()
 {
     $this->MagicFetch = new MagicalFetch();
     if (Input::has("project_folder")) {
         $getfolderID = Input::get("project_folder");
         reset($getfolderID);
         ## get the workspace ID
         $folderID = current($getfolderID);
         ## set the work space folder
         define("WORKS_SPACE_ID", $folderID);
         /**
          * Copy files from temp to workspace
          */
         rename(base_path() . "/tmp/" . $folderID, base_path() . "/workspace/{$folderID}");
         define("SOURCE_DIR", base_path() . "/workspace/{$folderID}");
         chmod(SOURCE_DIR, 0777);
         $target_path = base_path() . "/projects/{$folderID}";
         ## create project directory
         if (!is_dir($target_path)) {
             mkdir($target_path, 0777);
         }
         ## set the target folder
         define("TARGET_DIR", $target_path);
     }
     if (!is_readable(SOURCE_DIR)) {
         echo "Error. Source Directory " . SOURCE_DIR . " is not readable. Program will terminate<br>";
         exit;
     }
     if (!is_writeable(TARGET_DIR)) {
         echo "Error. Target Directory " . TARGET_DIR . " is not writeable. Program will terminate<br>";
         exit;
     }
     $data['html'] = $this->ScanSourceFiles();
     krsort($this->FuncArray);
     krsort($this->ConstArray);
     krsort($this->VarArray);
     sort($this->FileArray);
     $data['html'] .= $this->WriteTargetFiles();
     $data['html'] .= $this->MagicFetch->ShowArrays();
     if (Input::get('ciphers') == 'fw') {
         $this->CiphersLaravel();
     } elseif (Input::get('ciphers') == 'none') {
         $this->CiphersNonFW();
     }
     if (Input::has('blenciT')) {
         $data['blenc_report'] = $this->BLENCiT();
         if (Input::has('BLENC_Report') && Input::get('BLENC_Report') == 1) {
             PDF::loadHTML($data['blenc_report'])->setPaper('a4')->setOrientation('landscape')->setWarnings(false)->save(TARGET_DIR . '/blenc/blenc_report.pdf');
         }
     }
     if (Input::has('PDF_Report') && Input::get('PDF_Report') == 1) {
         PDF::loadHTML($data['html'])->setPaper('a4')->setOrientation('landscape')->setWarnings(false)->save(TARGET_DIR . '/guide.pdf');
     }
     MagicalHelpers::CompressProject();
     MagicalHelpers::DeleteDir(SOURCE_DIR);
     return View::make('magical.process', $data)->with($data)->render();
 }
 public function InDSPhanCV($manth)
 {
     $date = date('Y-m-d');
     //Carbon::now();
     //Lấy năm học và học kỳ hiện tại
     $namht = DB::table('nien_khoa')->distinct()->orderBy('nam', 'desc')->value('nam');
     $hkht = DB::table('nien_khoa')->where('nam', $namht)->orderBy('hocky', 'desc')->value('hocky');
     $gv = DB::table('giang_vien as gv')->select('gv.macb', 'gv.hoten', 'gv.email')->join('de_tai as dt', 'gv.macb', '=', 'dt.macb')->join('ra_de_tai as radt', 'dt.madt', '=', 'radt.madt')->where('radt.manhomthuchien', $manth)->first();
     $thongtin = DB::table('de_tai as dt')->select('dt.tendt', 'sv.hoten', 'sv.mssv', 'sv.email', 'hp.tennhomhp')->join('ra_de_tai as radt', 'dt.madt', '=', 'radt.madt')->join('chia_nhom as chn', 'radt.manhomthuchien', '=', 'chn.manhomthuchien')->join('sinh_vien as sv', 'chn.mssv', '=', 'sv.mssv')->join('nhom_hocphan as hp', 'chn.manhomhp', '=', 'hp.manhomhp')->where('chn.nhomtruong', 1)->where('chn.manhomthuchien', $manth)->first();
     $dscv = DB::table('cong_viec as cv')->join('thuc_hien as th', 'cv.macv', '=', 'th.macv')->where('th.manhomthuchien', $manth)->get();
     $view = \View::make('giangvien.in-ke-hoach-phan-cong-nhomsv', compact('manth', 'date', 'thongtin', 'namht', 'hkht', 'dscv', 'gv'));
     $pdf = \App::make('dompdf.wrapper');
     $pdf = \PDF::loadHTML($view)->setPaper('a4')->setOrientation('landscape');
     return $pdf->stream("KeHoach_" . $manth . ".pdf");
 }
Пример #7
0
 public function reporteCursantePdf(Request $request)
 {
     $id = $request['cursante'];
     $cursante = DB::table('users')->where('users.id', $id)->join('kardexes', 'users.id', '=', 'user')->get();
     $directores = Leader::all();
     $nombreJefe = $request['jefe'];
     $jefes = DB::table('jeves')->where('jefe_est', $nombreJefe)->get();
     $view = \View::make('director.RepdfCursante', compact('cursante', 'directores', 'jefes'))->render();
     $pdf = \PDF::loadHTML($view)->setPaper('letter');
     return $pdf->stream('Cursate-{users.paterno}.pdf');
 }
Пример #8
0
 public function generatePdf($chart)
 {
     $file_name = time() . 'report.pdf';
     $file_path = public_path('report');
     $user_stat = $this->getUserStatsForPdf();
     $skill_stat = $chart;
     $htmlcontent = view('report.report')->with(['user_stat' => $user_stat, 'skill_stat']);
     \PDF::loadHTML($htmlcontent)->setPaper('a4')->setOrientation('portrait')->save($file_path . $file_name);
     $mail_template = 'emails.email_report';
     $data['receipent_name'] = \Auth::user()->name;
     $data['receipent_email'] = \Auth::user()->email;
     $data['message'] = $message;
     $mail_receipents[\Auth::user()->email] = \Auth::user()->name;
     $mail_subject = 'Result Report';
     $mailMessage = 'Please see the report attatched for you order.';
     $mail_attachment = $file_path . $file_name;
     \Mail::send($mail_template, $data, function ($mailMessage) use($mail_receipents, $mail_subject, $mail_attachment) {
         $message->to($mail_receipents)->subject($mail_subject);
         $message->attach($mail_attachment);
     });
     unlink($file_path . $file_name);
 }
Пример #9
0
 public function pdf()
 {
     // data
     $sekolah = Sekolah::data();
     $admin = Admin::semua();
     return PDF::loadHTML(View::make('pdf.pengguna', compact('sekolah', 'admin')))->setPaper('a4')->download('data pengguna.pdf');
 }
Пример #10
0
 /**
  * Show the form for creating a new resource PDF.
  *
  * @param string $view
  * @param string $title
  * @return \Illuminate\Http\Response
  */
 public function create($view, $title)
 {
     $pdf = \PDF::loadHTML($view);
     return $pdf->setPaper('Letter')->stream($title);
 }
Пример #11
0
 /**
  * @param $factura
  * @param $tmpDir
  * @return array
  */
 private function savePdf($factura, $tmpDir)
 {
     $view = $this->viewInvoice($factura);
     $view = str_replace("localhost:8080", "localhost", $view);
     $uidPdf = uniqid();
     $pdfPath = storage_path("app") . "{$tmpDir}/{$uidPdf}.pdf";
     \PDF::loadHTML($view)->setPaper('a4')->setOption('margin-right', 0)->setOption('margin-bottom', 0)->setOption('margin-left', 0)->setOption('margin-top', 0)->save($pdfPath);
     return array($uidPdf, $pdfPath);
 }
Пример #12
0
 protected function generate_pdf($html, $filepath, $footer = 'footerpdf', $header = '', $type = '1', $headerparam = '')
 {
     $pdf = PDF::loadHTML($html);
     $footer = route($footer);
     $footer = str_replace("https", "http", $footer);
     $pdf_options = array('page-size' => 'Letter', 'margin-top' => 26, 'margin-bottom' => 26, 'footer-html' => $footer, 'disable-smart-shrinking' => false);
     if ($header != '') {
         if ($headerparam == '') {
             $pdf_options['header-center'] = $header;
             $pdf_options['header-font-size'] = 8;
         } else {
             $header = route($header, array($headerparam));
             $header = str_replace("https", "http", $header);
             $pdf_options['header-html'] = $header;
             $pdf_options['header-spacing'] = 5;
         }
     }
     if ($type == '1') {
         $pdf_options['margin-left'] = 26;
         $pdf_options['margin-right'] = 26;
     }
     if ($type == '2') {
         $pdf_options['margin-left'] = 16;
         $pdf_options['margin-right'] = 16;
     }
     $pdf->setOptions($pdf_options)->save($filepath);
     while (!file_exists($filepath)) {
         sleep(2);
     }
     return true;
 }
Пример #13
0
 function cetak_surat_penunjukan($id)
 {
     $pengadaan = $this->get_pengadaan($id);
     $jadwal = $this->get_jadwal($id);
     $rekanan = $this->get_rekanan($pengadaan->id_rekanan);
     $pegawai = $this->get_pegawai($pengadaan->id_users);
     $data = new stdclass();
     $data->tanggal = Date::parse($jadwal->thp10_smp)->format('j F Y');
     $data->no_penunjukan = $pengadaan->no_srt12;
     $data->rekanan = $rekanan->nama_rkn;
     $data->judul = $pengadaan->desk_kegiatan;
     $data->thn_anggaran = $pengadaan->thn_anggaran;
     $data->tgl_penawaran = $jadwal->thp4_smp;
     $data->hps_nego = number_format($pengadaan->hps_deal, 0, ',', '.');
     $data->hps_nego_huruf = number_format($pengadaan->hps_deal, 0, ',', '.');
     $data->pegawai = $pegawai->nama;
     $data->nip = $pegawai->nik;
     $html = View::make('admin.report.sppb')->with('data', $data);
     return PDF::loadHTML($html)->setPaper('legal')->setOrientation('portait')->stream('surat_penunjukan_penyedia.pdf');
 }
Пример #14
0
 public function getPdfView(Request $request, $id)
 {
     $view = $this->getHtmlContent($id);
     $nombreFact = "factura-{$this->data['row']->serfac}-{$this->data['row']->ejefac}-{$this->data['row']->numfac}.pdf";
     $output = \PDF::loadHTML($view)->setPaper('a4')->setOption('margin-right', 0)->setOption('margin-bottom', 0)->setOption('margin-left', 0)->setOption('margin-top', 0)->output();
     return Response::make($output, 200, ['Content-Type' => 'application/pdf', 'Content-Disposition' => 'inline; ' . $nombreFact]);
 }
Пример #15
0
 function cetakPengalaman_rekanan($id)
 {
     $data = new stdclass();
     $pengadaan = $this->get_pengadaan($id);
     $data = Rekanan::where('id_rkn', $pengadaan->id_rekanan)->first();
     $data->tanggal = date("d F Y", strtotime($this->get_jadwal($id)->thp2_dari));
     $pengurus = $this->get_pengurus($pengadaan->id_rekanan);
     $data->pemilik = $pengurus->nama_pengurus;
     $data->jabatan = $pengurus->jabatan;
     $html = View::make('admin.report.data_pengalaman_rekanan')->with('data', $data);
     return PDF::loadHTML($html)->setPaper('legal')->setOrientation('landscape')->stream('pengalaman_perusahaan.pdf');
 }
Пример #16
0
 public function storeStatus(Request $request)
 {
     //
     $qualityControl = qualityControl::find($request->get('qualityControl_id'));
     $qualityControl->update(['status' => $request->get('status'), 'status_note' => $request->get('status_note')]);
     $qualityControl->touch();
     if ($request->get('status') == '完成') {
         $selectMeasureTool = explode("|", $qualityControl->measureTool);
         $QC_Samples = QC_Samples::where('qualityControl_id', '=', $qualityControl->id)->get()->toArray();
         $POrecord = $qualityControl->POrecord;
         $customersJoinQuery = DB::table('customers')->select(DB::raw('id AS c_id'), 'institute', 'department', 'c_name', 'address');
         $usersJoinQuery = DB::table('users')->select(DB::raw('id AS u_id'), 'name');
         $project = DB::table('projects')->leftJoin(DB::raw('(' . $customersJoinQuery->toSql() . ') i'), function ($join) {
             $join->on('projects.Customer_id', '=', 'i.c_id');
         })->leftJoin(DB::raw('(' . $usersJoinQuery->toSql() . ') j'), function ($join) {
             $join->on('projects.salesman', '=', 'u_id');
         })->where('projects.id', $POrecord->project->id)->first();
         $extraction = Extraction::where('POrecord_id', '=', $POrecord->id)->first();
         $shipment = Shipment::find($extraction->shipment_id);
         $mytime = Carbon::now();
         $timeStamp = $mytime->format('Y') . $mytime->format('m') . $mytime->format('d') . $mytime->format('H') . $mytime->format('i');
         if ($qualityControl->QCtype == 'DNA') {
             $data = \View::make('research.qualityControl.dnaqc_report')->with('project', $project)->with('extraction', $extraction)->with('shipment', $shipment)->with('selectMeasureTool', $selectMeasureTool)->with('POrecord', $POrecord)->with('qualityControl', $qualityControl)->with('QC_Samples', $QC_Samples);
             $filepath = base_path() . '/storeFiles/ngs/dnaqc_report/' . $qualityControl->id . '-' . $timeStamp . '.pdf';
             $pdf = \PDF::loadHTML($data)->setPaper('a4')->setOption('disable-smart-shrinking', null)->save($filepath);
         } elseif ($qualityControl->QCtype == 'RNA') {
             $data = \View::make('research.qualityControl.rnaqc_report')->with('project', $project)->with('extraction', $extraction)->with('shipment', $shipment)->with('selectMeasureTool', $selectMeasureTool)->with('POrecord', $POrecord)->with('qualityControl', $qualityControl)->with('QC_Samples', $QC_Samples);
             $filepath = base_path() . '/storeFiles/ngs/rnaqc_report/' . $qualityControl->id . '-' . $timeStamp . '.pdf';
             if (\File::exists($filepath)) {
                 \File::delete($filepath);
             }
             $pdf = \PDF::loadHTML($data)->setPaper('a4')->setOption('disable-smart-shrinking', null)->save($filepath);
         }
     }
     return \Redirect::to('research/ngs/projects/show/' . $qualityControl->POrecord->project->id)->with('message', 'Your Quality Control has been updated!');
 }
Пример #17
0
 public function pdf()
 {
     // data
     $sekolah = Sekolah::data();
     $buku = Buku::semua();
     return PDF::loadHTML(View::make('pdf.buku', compact('sekolah', 'buku')))->setPaper('a4')->download('data buku.pdf');
 }
Пример #18
0
 public function generatepdf($id)
 {
     ini_set("max_execution_time", 0);
     $pdf = \PDF::loadHTML($this->generate($id));
     return $pdf->stream();
 }
Пример #19
0
 public function pdf()
 {
     // data
     $sekolah = Sekolah::data();
     $pinjam = Peminjaman::semua();
     return PDF::loadHTML(View::make('pdf.peminjaman', compact('sekolah', 'pinjam')))->setPaper('a4')->download('data peminjaman.pdf');
 }
Пример #20
0
 public function PCargarPlaneacion()
 {
     $data = Input::all();
     $nombrePDF = $this->CrearCadenaAleatoria();
     $this->AgregarDocumento('Documentos/Planeaciones didacticas/' . $nombrePDF . '.pdf', Input::get('fecha_creacion'), Input::get('ciclo'), PLANEACION, Auth::user()->id, null, Input::get('asignatura_id'));
     $html = View::make('documentos.planeacion-didactica')->with('data', $data)->render();
     $pdf = PDF::loadHTML($html)->setPaper('a4')->setOrientation('landscape')->save("Documentos/Planeaciones didacticas/" . $nombrePDF . ".pdf");
     return Redirect::route('p-doc');
 }
 public function InDanhSachSV($mahp, $macbqt)
 {
     $date = date('Y-m-d');
     $nguoiin = DB::table('giang_vien')->where('macb', $macbqt)->value('hoten');
     //Lấy giá trị năm học và học kỳ hiện tại
     $namht = DB::table('nien_khoa')->distinct()->orderBy('nam', 'desc')->value('nam');
     $hkht = DB::table('nien_khoa')->distinct()->orderBy('hocky', 'desc')->where('nam', $namht)->value('hocky');
     $mank = DB::table('nien_khoa as nk')->join('nhom_hocphan as hp', 'nk.mank', '=', 'hp.mank')->where('nk.nam', $namht)->where('nk.hocky', $hkht)->value('nk.mank');
     $mahp = \Request::segment(3);
     if ($mahp == "all") {
         //Lấy tất cả các nhóm HP trong học kỳ năm học hiện tại
         $gv_hp = DB::table('nhom_hocphan as hp')->select('gv.macb', 'gv.hoten', 'hp.tennhomhp', 'hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('hp.mank', $mank)->get();
         //Lấy mảng các mã nhóm HP của năm học - học kỳ hiện tại
         $ds_hp = DB::table('nhom_hocphan as hp')->select('hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('hp.mank', $mank)->lists('hp.manhomhp');
         $dssv = DB::table('sinh_vien as sv')->join('chia_nhom as chn', 'sv.mssv', '=', 'chn.mssv')->whereIn('chn.manhomhp', $ds_hp)->orderBy('chn.manhomthuchien', 'asc')->get();
     } else {
         if ($mahp != null || $mahp != 0) {
             $gv_hp = DB::table('nhom_hocphan as hp')->select('gv.macb', 'gv.hoten', 'hp.tennhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('hp.manhomhp', $mahp)->first();
             $dssv = DB::table('sinh_vien as sv')->join('chia_nhom as chn', 'sv.mssv', '=', 'chn.mssv')->where('chn.manhomhp', $mahp)->orderBy('chn.manhomthuchien', 'asc')->get();
         }
     }
     $view = \View::make('quantri.in-danh-sach-sinh-vien', compact('macbqt', 'nguoiin', 'namht', 'hkht', 'gv_hp', 'dssv', 'date', 'mahp'));
     $pdf = \App::make('dompdf.wrapper');
     $pdf = \PDF::loadHTML($view)->setPaper('a4')->setOrientation('portrait');
     return $pdf->stream("DanhSachSV.pdf");
 }
Пример #22
0
        Route::get('get/device/all-html', 'DatabaseController@getDeviceAllHtml');
        Route::post('store/employees/all', 'DatabaseController@storeEmployeesAll');
        Route::get('/date/{from}/{to}', 'DatabaseController@getLogsFromTo');
    });
});
Route::get('/tad', function () {
    $options = ['ip' => '192.168.0.201', 'udp_port' => 4370, 'connection_timeout' => 2];
    $zk = new TADPHP\Providers\TADZKLib($options);
    return $zk->get_commands_available();
    $zk->connect();
    // dd(hex2bin("70"));
    return $zk->send_command_to_device(31, 'aa');
});
/**
 * PDF test route. Will use latter in app
 */
Route::get('/pdf', function () {
    $pdf = PDF::loadHTML('<h1>Test PDF</h1>');
    return $pdf->loadHTML('<h1>Test PDF</h1>')->setPaper('a4')->setOrientation('portrait')->setWarnings(false)->stream();
});
Route::get('/tt', function () {
    $tadf = new TADPHP\TADFactory(['ip' => '192.168.0.201']);
    $tad = $tadf->get_instance();
    return $fs = $tad->get_free_sizes()->to_array();
});
// ZKCOM Demo
Route::get('zkcom', function () {
    $zk = new zkcom();
    $zk->init();
    // $zk->RestartDevice();
});
Пример #23
0
 public function reportPageGenerator()
 {
     //$action_selection = Former::select( Config::get('kickstart.actionselection'))->name('action');
     $heads = $this->heads;
     $fields = $this->fields;
     $this->ajaxsource = is_null($this->ajaxsource) ? strtolower($this->controller_name) : $this->ajaxsource;
     $this->addurl = is_null($this->addurl) ? strtolower($this->controller_name) . '/add' : $this->addurl;
     $this->importurl = is_null($this->importurl) ? strtolower($this->controller_name) . '/import' : $this->importurl;
     $this->rowdetail = is_null($this->rowdetail) ? strtolower($this->controller_name) . '.rowdetail' : $this->rowdetail;
     $this->delurl = is_null($this->delurl) ? strtolower($this->controller_name) . '/del' : $this->delurl;
     $this->newbutton = is_null($this->newbutton) ? Str::singular($this->controller_name) : $this->newbutton;
     //dialog related url
     //$this->product_info_url = (is_null($this->product_info_url))? strtolower($this->controller_name).'/info': $this->product_info_url;
     $this->prefix = is_null($this->prefix) ? strtolower($this->controller_name) : $this->prefix;
     $select_all = Former::checkbox()->name('All')->check(false)->id('select_all');
     // add selector and sequence columns
     $start_index = -1;
     if ($this->place_action == 'both' || $this->place_action == 'first') {
         array_unshift($heads, array('Actions', array('sort' => false, 'clear' => true, 'class' => 'action')));
         array_unshift($fields, array('', array('sort' => false, 'clear' => true, 'class' => 'action')));
     }
     if ($this->show_select == true) {
         array_unshift($heads, array($select_all, array('sort' => false)));
         array_unshift($fields, array('', array('sort' => false)));
     } else {
         $start_index = $start_index + 1;
     }
     array_unshift($heads, array('#', array('sort' => false)));
     array_unshift($fields, array('', array('sort' => false)));
     // add action column
     if ($this->place_action == 'both') {
         array_push($heads, array('Actions', array('search' => false, 'sort' => false, 'clear' => true, 'class' => 'action')));
         array_push($fields, array('', array('search' => false, 'sort' => false, 'clear' => true, 'class' => 'action')));
     }
     $disablesort = array();
     for ($s = 0; $s < count($heads); $s++) {
         if ($heads[$s][1]['sort'] == false) {
             $disablesort[] = $s;
         }
     }
     $disablesort = implode(',', $disablesort);
     /* additional features */
     $this->dlxl = is_null($this->dlxl) ? strtolower($this->controller_name) . '/dlxl' : $this->dlxl;
     $this->printlink = is_null($this->printlink) || $this->printlink == '' ? strtolower($this->controller_name) . '/print' : $this->printlink;
     $this->pdflink = is_null($this->pdflink) || $this->pdflink == '' ? strtolower($this->controller_name) . '/genpdf' : $this->pdflink;
     $this->xlslink = is_null($this->xlslink) || $this->xlslink == '' ? strtolower($this->controller_name) . '/genxls' : $this->xlslink;
     /*
     if($this->report_entity == false){
     
     }else{
         $this->report_entity = (is_null($this->report_entity) || $this->report_entity == '')? strtolower($this->controller_name): $this->report_entity;
     
         if($this->doc_number == false){
             $sequencer = new Sequence();
             $this->doc_number = $sequencer->getNewId($this->report_entity);
         }
     }
     */
     $html = View::make($this->report_view)->with('title', $this->title)->with('report_data', $this->report_data)->with('newbutton', $this->newbutton)->with('disablesort', $disablesort)->with('addurl', $this->addurl)->with('importurl', $this->importurl)->with('ajaxsource', URL::to($this->ajaxsource))->with('ajaxdel', URL::to($this->delurl))->with('ajaxdlxl', URL::to($this->dlxl))->with('crumb', $this->crumb)->with('printlink', $this->printlink)->with('pdflink', $this->pdflink)->with('xlslink', $this->xlslink)->with('can_add', $this->can_add)->with('is_report', $this->is_report)->with('report_action', $this->report_action)->with('doc_number', $this->doc_number)->with('is_additional_action', $this->is_additional_action)->with('additional_action', $this->additional_action)->with('additional_filter', $this->additional_filter)->with('js_additional_param', $this->js_additional_param)->with('modal_sets', $this->modal_sets)->with('tables', $this->table_raw)->with('table_dnd', $this->table_dnd)->with('table_dnd_url', $this->table_dnd_url)->with('table_dnd_idx', $this->table_dnd_idx)->with('table_group', $this->table_group)->with('table_group_field', $this->table_group_field)->with('table_group_idx', $this->table_group_idx)->with('table_group_collapsible', $this->table_group_collapsible)->with('js_table_event', $this->js_table_event)->with('column_styles', $this->column_styles)->with('additional_page_data', $this->additional_page_data)->with('additional_table_param', $this->additional_table_param)->with('product_info_url', $this->product_info_url)->with('prefix', $this->prefix)->with('heads', $heads)->with('fields', $fields)->with('start_index', $start_index)->with('row', $this->rowdetail)->with('pdf', $this->pdf);
     /*
     PDF::loadHTML($html->render())->setPaper('a4')
              ->setOrientation('landscape')
              ->setOption('margin-bottom', 0)
              ->save($this->report_file_path.$this->report_file_name);
     */
     if ($this->report_file_name) {
         file_put_contents($this->report_file_path . $this->report_file_name, $html);
         $sd = new Document();
         $sd->timestamp = new MongoDate();
         $sd->type = $this->report_type;
         $sd->fullpath = $this->report_file_path . $this->report_file_name;
         $sd->filename = $this->report_file_name;
         $sd->creator_id = Auth::user()->_id;
         $sd->creator_name = Auth::user()->fullname;
         $sd->save();
     }
     if ($this->pdf == true) {
         $html->render();
         $snappy = App::make('snappy.pdf');
         return PDF::loadHTML($html)->setPaper('a4')->setOrientation('landscape')->setOption('margin-bottom', 0)->stream($this->report_file_name);
     }
     if ($this->xls == true) {
         $tables = $this->table_raw;
         $heads = $this->additional_filter;
         Excel::create($this->report_file_name, function ($excel) use($tables, $heads) {
             $excel->sheet('New sheet', function ($sheet) use($tables, $heads) {
                 $xls_view = 'tables.xls';
                 $sheet->loadView($xls_view)->with('heads', $heads)->with('tables', $tables);
             });
         })->download('xls');
     } else {
         return $html;
     }
 }
Пример #24
0
 function cetak_hps($id)
 {
     $data = new stdclass();
     $data->detil = DB::table('detil_pengadaan')->select('nama_brg', 'spesifikasi', 'kebutuhan', 'hrg_satuan_hps', 'total_hrg_hps')->where('id_pengadaan', $id)->get();
     $pengadaan = $this->get_desk($id);
     $user = $this->get_user($pengadaan->id_users);
     $data->nik = $pengadaan->id_users;
     $data->hps = $pengadaan->hps;
     $data->huruf = $this->convert($pengadaan->hps);
     $data->deskripsi = $pengadaan->desk_kegiatan;
     $data->pegawai = $user->nama;
     $data->departement = $this->get_departement($user->id_departement)->nama_departement;
     $data->tanggal = date('d F Y', strtotime($this->get_jadwal($id)->thp1_dari));
     $data->no = 0;
     $html = View::make('admin.report.surat_hps')->with('data', $data);
     return PDF::loadHTML($html)->setPaper('legal')->stream('hps.pdf');
 }
Пример #25
0
 public function storeStatus(Request $request)
 {
     //
     $library = Library::find($request->get('library_id'));
     $library->status = $request->get('status');
     $library->status_note = $request->get('status_note');
     $library->save();
     $library->touch();
     if ($request->get('status') == '完成') {
         $Library_Samples = Library_Samples::where('library_id', '=', $library->id)->get()->toArray();
         $POrecord = $library->POrecord;
         $customersJoinQuery = DB::table('customers')->select(DB::raw('id AS c_id'), 'institute', 'department', 'c_name', 'address');
         $usersJoinQuery = DB::table('users')->select(DB::raw('id AS u_id'), 'name');
         $project = DB::table('projects')->leftJoin(DB::raw('(' . $customersJoinQuery->toSql() . ') i'), function ($join) {
             $join->on('projects.Customer_id', '=', 'i.c_id');
         })->leftJoin(DB::raw('(' . $usersJoinQuery->toSql() . ') j'), function ($join) {
             $join->on('projects.salesman', '=', 'u_id');
         })->where('projects.id', $POrecord->project->id)->first();
         $mytime = Carbon::now();
         $timeStamp = $mytime->format('Y') . $mytime->format('m') . $mytime->format('d') . $mytime->format('H') . $mytime->format('i');
         $data = \View::make('research.library.libraryqc_report')->with('project', $project)->with('POrecord', $POrecord)->with('library', $library)->with('Library_Samples', $Library_Samples);
         $filepath = base_path() . '/storeFiles/ngs/libraryqc_report/' . $library->id . '-' . $timeStamp . '.pdf';
         if (\File::exists($filepath)) {
             \File::delete($filepath);
         }
         $pdf = \PDF::loadHTML($data)->setPaper('a4')->setOption('disable-smart-shrinking', null)->save($filepath);
     }
     return \Redirect::to('research/ngs/projects/show/' . $library->POrecord->project->id)->with('message', 'Your Library has been updated!');
 }
Пример #26
0
 public function pdf()
 {
     // data
     $sekolah = Sekolah::data();
     $siswa = Siswa::semua();
     return PDF::loadHTML(View::make('pdf.siswa', compact('sekolah', 'siswa')))->setPaper('a4')->download('data siswa.pdf');
 }
Пример #27
0
 public function reportePorMateria(REQUEST $request)
 {
     $nombreMateria = $request['materia'];
     $materia = DB::table('materias')->where('nombreMateria', $request['materia'])->value('id');
     //dd($materia);
     $cursantes = DB::table('kardexes')->join('users', 'users.id', '=', 'user')->where('materia_id', $materia)->select('user', 'nombres', 'paterno', 'materno', 'prom4Cursante', 'prom4Facil', 'prom4JE')->orderBy('paterno')->get();
     $directores = Leader::all();
     $nombreJefe = $request['jefe'];
     $jefes = DB::table('jeves')->where('jefe_est', $nombreJefe)->get();
     $view = \View::make('director.pdfReportePorMateria', compact('cursantes', 'nombreMateria', 'directores', 'jefes'))->render();
     $pdf = \PDF::loadHTML($view)->setPaper('a4')->setOrientation('landscape');
     return $pdf->stream('ReportePorMateria.pdf');
     /*$pdf = \App::make('dompdf.wrapper');
       $pdf->loadHTML($view)->setPaper('a4')->setOrientation('landscape');
       return $pdf->download('calificacionDocente.pdf');*/
 }
 public function InBangDiemGV($macb)
 {
     $tencb = DB::table('giang_vien')->select('macb', 'hoten')->where('macb', $macb)->first();
     $tieuchi = $this->LayDSTieuChi($macb);
     //Lấy năm học và học kỳ hiện tại
     $nam = DB::table('nien_khoa')->distinct()->orderBy('nam', 'desc')->value('nam');
     $hk = DB::table('nien_khoa')->distinct()->orderBy('hocky', 'desc')->where('nam', $nam)->value('hocky');
     $mank = DB::table('nien_khoa')->where('nam', $nam)->where('hocky', $hk)->value('mank');
     //Lấy Mã nhóm HP trên url
     $mahp = \Request::segment(5);
     if ($mahp == "all") {
         $gv_hp = DB::table('nhom_hocphan as hp')->select('gv.macb', 'gv.hoten', 'hp.tennhomhp', 'hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('gv.macb', $macb)->where('hp.mank', $mank)->get();
         //Lấy mảng các mã nhóm HP của cán bộ này ở hk-nk hiện tại
         $ds_hpgv = DB::table('nhom_hocphan as hp')->select('hp.manhomhp')->join('giang_vien as gv', 'gv.macb', '=', 'hp.macb')->where('gv.macb', $macb)->where('hp.mank', $mank)->lists('hp.manhomhp');
         $dssv = DB::table('sinh_vien as sv')->orderBy('chn.manhomthuchien', 'asc')->select('chn.manhomthuchien', 'hp.tennhomhp', 'sv.mssv', 'sv.hoten', 'chn.nhomtruong')->join('chia_nhom as chn', 'sv.mssv', '=', 'chn.mssv')->join('nhom_hocphan as hp', 'hp.manhomhp', '=', 'chn.manhomhp')->whereIn('chn.manhomhp', $ds_hpgv)->where('chn.manhomthuchien', '<>', "")->get();
         //Lấy điểm của mỗi sv trong mảng mssv trên
         $dsdiem = $this->LayDSDiemHP($macb, $ds_hpgv);
         $tongdiem = $this->LayTongDiemHP($macb, $ds_hpgv);
         $nhanxet = $this->LayNhanXetHP($macb, $ds_hpgv);
     } else {
         if ($mahp != "all") {
             $dssv = $this->LayDSNhomSV($macb, $mahp);
             $dsdiem = $this->LayDSDiem($macb, $mahp);
             $tongdiem = $this->LayTongDiem($macb, $mahp);
             $nhanxet = $this->LayNhanXet($macb, $mahp);
         }
     }
     $date = date('Y-m-d');
     //Carbon::now();
     $view = \View::make('giangvien.in-bang-diem-gv', compact('nam', 'hk', 'tencb', 'tieuchi', 'dssv', 'dsdiem', 'tongdiem', 'date', 'macb', 'nhanxet', 'mahp', 'gv_hp'));
     $pdf = \App::make('dompdf.wrapper');
     //        $pdf->loadHTML($view);
     $pdf = \PDF::loadHTML($view)->setPaper('a4')->setOrientation('landscape');
     //$pdf = \PDF::loadView('giangvien.in-bang-diem-gv');
     //return $pdf->download('Nhom_'.$manhom.'.pdf'); //this code is used for the name pdf
     return $pdf->stream("Bangdiem" . $macb . ".pdf");
 }
Пример #29
0
 public function accounts()
 {
     $accs = Account::all();
     $title = "ACCOUNTS";
     return \PDF::loadHTML(view('reports.account_template', compact('accs', 'title')))->stream('report.pdf');
 }
Пример #30
0
 public function handle()
 {
     $pdf = \PDF::loadHTML($this->html)->setOptions($this->options);
     $fileSystem = \Storage::createS3Driver($this->S3Options);
     $fileSystem->put($this->fileName, $pdf->output());
 }