/**
  * Callback action that should be called by auth0, logs the user in
  */
 public function callback()
 {
     // Get a handle of the Auth0 service (we don't know if it has an alias)
     $service = \App::make('auth0');
     // Try to get the user information
     $profile = $service->getUser();
     // Get the user related to the profile
     $auth0User = $this->userRepository->getUserByUserInfo($profile);
     if ($auth0User) {
         if (!str_contains($auth0User->name, '@')) {
             $name = $auth0User->name;
         } else {
             $name = $auth0User->nickname;
         }
         // If we have a user, we are going to log him in, but if
         // there is an onLogin defined we need to allow the Laravel developer
         // to implement the user as he wants an also let him store it.
         $flight = User::firstOrCreate(['github_id' => $auth0User->user_id, 'email' => $auth0User->email, 'picture' => $auth0User->picture, 'name' => $name]);
         if ($service->hasOnLogin()) {
             $user = $service->callOnLogin($auth0User);
         } else {
             // If not, the user will be fine
             $user = $auth0User;
         }
         \Auth::login($user);
     }
     return \Redirect::intended('/');
 }
 public function facturar(Request $request)
 {
     $productos = Venta::obtenerListaReporte($request->input('id_venta'));
     $dompdf = \App::make('dompdf.wrapper');
     $dompdf->loadView('factura', compact('productos'));
     return $dompdf->stream();
 }
Example #3
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function crearPdf($id)
 {
     $reporte = ReporteBajas::consultar($id);
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadView('generarPdf', compact('reporte'));
     return $pdf->stream();
 }
Example #4
0
 public function __construct()
 {
     $this->helper = new HelperRepository();
     $this->request = \App::make('Illuminate\\Http\\Request');
     $this->redirect = \App::make('Illuminate\\Routing\\Redirector');
     $this->session = $this->request->session();
 }
Example #5
0
 public function __construct()
 {
     $this->shop = \App::make('\\Interfaces\\ShopInterface');
     $this->postcode = \App::make('\\Interfaces\\PostcodeInterface');
     $this->calendar = \App::make('\\Interfaces\\CalendarInterface');
     //Input::merge(array('postcodes'=>array('hu52up','m193qd','m80lx')));
 }
Example #6
0
 public function graficos(Request $request)
 {
     $html = $request->input('htmlContent');
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($html);
     return $pdf->stream('graficos');
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $view = \View::make('Expensas.expensas');
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('FicheroEjemplo.pdf');
 }
Example #8
0
 /**
  *Devuelve un pdf con todos los datos 
  *estadisticos del Reg, de tumores del año  
  *y del mes que se pase
  *responde a @GET /reporte/estadisticas/rncs
  */
 public function rncStad(Request $data)
 {
     //Reglas de validacion
     $rules = ['year' => 'required', 'mon' => 'required|numeric|min:1|max:12'];
     /*
      *Valida datos segun las reglas $rules
      *y genera mensajes segun $messages
      */
     $validator = Validator::make($data->all(), $rules, $this->messages);
     /*
      *Si hay error en los datos, 
      *regresa el primer mensaje de
      *error
      */
     if ($validator->fails()) {
         //Primer mensaje de error
         $errMessage = $validator->errors()->first();
         return Response()->json(['status' => 'danger', 'message' => $errMessage]);
     } else {
         $year = $data->year;
         $mon = '0' . $data->mon;
         $date = $year . '-' . $mon;
         $mons = ['ENERO', 'FEBRERO', 'MARZO', 'ABRIL', 'MAYO', 'JUNIO', 'JULIO', 'AGOSTO', 'SEPTIEMBRE', 'OCTUBRE', 'NOVIEMBRE', 'DICIEMBRE'];
         $mo = $mons[$mon - 1];
         $registers = DB::table('rncs')->where('fec_reg', 'like', $date . '%')->select('reg_rgn', 'nom_pri', 'nom_seg', 'ape_pri', 'ape_seg', 'sex', 'eda_adm', 'prc_edo', 'mun_prc', 'des_ltg', 'cod_ltg', 'sco_ltg', 'des_morf', 'cod_morf', 'fec_fall', 'qui_otra', 'num_his')->get();
         $man = DB::table('rncs')->where('fec_reg', 'like', $date . '%')->where('sex', 'MASCULINO')->count();
         $girl = DB::table('rncs')->where('fec_reg', 'like', $date . '%')->where('sex', 'FEMENINO')->count();
         $view = \View::make('pdfs.rncStad', compact('registers', 'year', 'mo', 'man', 'girl'))->render();
         $pdf = \App::make('dompdf.wrapper');
         $pdf->loadHTML($view)->setPaper('latter')->setOrientation('landscape');
         return $pdf->stream('invoice');
     }
 }
 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");
 }
 public function getPrint($id, $term)
 {
     // $pdf = \App::make('dompdf.wrapper');
     $ActivitiesData = $this->getCombineData($id, $term);
     // dd($ActivitiesData);
     $pdf = \App::make('dompdf.wrapper');
     $html = '<html><body>-----------------';
     foreach ($ActivitiesData[1] as $data) {
         $html .= '<table><tr><th>' . $data['act_name'] . '  :  ' . $data['score'] . '/' . $data['total'] . '</th> </tr></table>';
     }
     $html .= '-----------------</body></html>';
     $pdf->loadHTML($html)->setPaper('a4')->setOrientation('portrait')->setWarnings(false)->save('myfile.pdf');
     return $pdf->stream();
     /*   $pdf->loadHTML(''
               . ''
               . '<h1 style = "text-align:center;">Class Record</h1>'
               .'<table>'
               . ' <tr>'
               foreach($ActivitiesData[1] as $data){
               .'<th>'.$data['act_name']
               . '</th>'
               }
               . '</tr>'
               . '</table>'
               )->setPaper('a4')->setOrientation('portrait')->setWarnings(false)->save('myfile.pdf');
     
     
               return $pdf->stream(); */
 }
Example #11
0
 public function calificacionDocente(Request $request)
 {
     $cursanteCalificador = \DB::table('users')->select('nombres', 'paterno', 'materno')->where('id', Auth::user()->id)->get();
     $docenteCalificado = \DB::table('users')->select('nombres', 'paterno', 'materno')->where('id', (int) $request['idDoc'])->get();
     $nombreMateria = \DB::table('materias')->where('id', (int) $request['materia'])->value('nombreMateria');
     $uno = $request['1'];
     $dos = $request['2'];
     $tres = $request['3'];
     $cuatro = $request['4'];
     $cinco = $request['5'];
     $seis = $request['6'];
     $siete = $request['7'];
     $ocho = $request['8'];
     $nueve = $request['9'];
     $diez = $request['10'];
     $once = $request['11'];
     $doce = $request['12'];
     $trece = $request['13'];
     $catorce = $request['14'];
     $quince = $request['15'];
     $dieciseis = $request['16'];
     $diecisiete = $request['17'];
     $dieciocho = $request['18'];
     $diecinueve = $request['19'];
     $veinte = $request['20'];
     $view = \View::make('cursante.pdfCalifDocente', compact('cursanteCalificador', 'nombreMateria', 'docenteCalificado', 'uno', 'dos', 'tres', 'cuatro', 'cinco', 'seis', 'siete', 'ocho', 'nueve', 'diez', 'once', 'doce', 'trece', 'catorce', 'quince', 'dieciseis', 'diecisiete', 'dieciocho', 'diecinueve', 'veinte'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->download('calificacionDocente.pdf');
 }
 public function profile_pdf($user)
 {
     $pdf = \App::make('dompdf.wrapper');
     $html = view('pages.users.profile_pdf', compact('user'));
     $pdf->loadHTML($html);
     return $pdf->stream();
 }
 public function generaPdf($id)
 {
     $salida = salidasModelo::getInfoSalida($id);
     $vista = view('generapdf', compact('salida'));
     $dompdf = \App::make('dompdf.wrapper');
     $dompdf->loadHTML($vista);
     return $dompdf->stream();
 }
Example #14
0
 public function imprimirSalida($id)
 {
     $data = Salida_Material::find($id);
     $view = \View::make('n_transf', compact('data'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('n_salida ' . $data->codigo);
 }
Example #15
0
 public function submitEditRequest()
 {
     $request = \App::make('request');
     $request['store-id'] = '1';
     $request['key'] = 'sub-category';
     $request['value'] = 'swimming';
     $request['action'] = 'insert';
     \DB::insert("INSERT INTO `store_edit_requests` (`id`, `store_id`, `key`, `value`, `action`, `approved`, `created_at`, `updated_at`) VALUES (NULL, ?, ?, ?, ?, '', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)", [$request['store-id'], $request['key'], $request['value'], $request['action']]);
 }
 public function generapdf($id)
 {
     $grupo = Grupo::getInfoGrupo($id);
     $alumnos = Alumno::getAlumnos($id);
     $vista = view('generapdf', compact('grupo', 'alumnos'));
     $dompdf = \App::make('dompdf.wrapper');
     $dompdf->loadHTML($vista);
     return $dompdf->stream();
 }
Example #17
0
 public function invoice()
 {
     $data = $this->getData();
     $date = date('Y-m-d');
     $view = \View::make('pdf.invoice', compact('data', 'date', 'invoice'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->download('invoice');
 }
Example #18
0
 public function invoice()
 {
     $data = $this->getData();
     $date = date('Y-m-d');
     $invoice = "2222";
     $view = \View::make('pdf.invoice', compact('data', 'date', 'invoice'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('invoice.pdf', array('Attachment' => 1));
 }
 public function invoice()
 {
     $data = $this->getData();
     $date = date('d/m/Y H:i');
     $titulo = "Relatório teste";
     $view = \View::make('pdf.invoice', compact('data', 'date', 'titulo'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('invoice');
 }
 public function getGrupo($id_grupo)
 {
     $grupo = Grupo::getGrupo($id_grupo);
     $alumnos = Alumno::getAlumnosGrupo($id_grupo);
     $total = Alumno::getTotalAlumnosGrupo($id_grupo);
     $vista = view('templates.pdf', compact('grupo', 'alumnos', 'total'));
     $dompdf = \App::make('dompdf.wrapper');
     $dompdf->loadHTML($vista);
     return $dompdf->stream();
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $config = Configuracion::where('id', $id)->first();
     //dd($config->logotipo);
     $view = View('pdf.pdfconfig', ['id' => $id, 'nom_factura' => $config->nom_factura, 'logotipo' => $config->logotipo, 'nit_factura' => $config->nit_factura, 'tip_factura' => $config->tip_factura, 'dir_factura' => $config->dir_factura, 'tel_factura' => $config->tel_factura, 'mailfactura' => $config->mailfactura, 'web_factura' => $config->web_factura, 'nota_factura' => $config->nota_factura]);
     //return $view;
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('previa.pdf');
 }
Example #22
0
 public function invoice($blade_path, $data)
 {
     $blade_path = 'admin.pdf.goleadores';
     //$data = $this->getData();
     dd('aaa');
     $date = date('Y-m-d');
     $view = \View::make($blade_path, $data)->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('LCBB');
 }
Example #23
0
 public function exportar($id)
 {
     $funcionesItem = Funcion::find($id);
     $funcionesPeliculas = $funcionesItem->peliculas;
     $funcionesProgramas = $funcionesItem->programas;
     $funcionesFestivales = $funcionesItem->festivales;
     $funcionesPatrocinadores = $funcionesItem->patrocinadores;
     $view = \View::make('Reportes', compact('funcionesItem', 'funcionesPeliculas', 'funcionesProgramas', 'funcionesFestivales', 'funcionesPatrocinadores'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('invoice.pdf');
 }
 public function postIndex(SongRequest $r)
 {
     $r['user_id'] = Auth::user()->id;
     $pic = \App::make('\\App\\Libs\\Img')->url(Input::file('picture1'));
     if ($pic) {
         $r['picture'] = $pic;
     } else {
         $r['picture'] = '-';
     }
     Song::create($r->all());
     return redirect('cabinet');
 }
 public function pdf($id)
 {
     $horas = $this->horarioRepo->horas($id);
     $dias = $this->horarioRepo->dias();
     $horario = $this->horarioRepo->horario($id);
     $ciclo = $this->horarioRepo->ciclo();
     $grupo = $this->horarioRepo->findGrupo($id);
     $materias = $this->materiaRepo->materias($id);
     $view = view('horario.pdf', compact('horas', 'dias', 'horario', 'ciclo', 'grupo', 'materias'));
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view)->setOrientation('landscape');
     return $pdf->stream();
 }
Example #26
0
 public function facebook()
 {
     $fb = App::make('SammyK\\LaravelFacebookSdk\\LaravelFacebookSdk');
     $app_id = env('FACEBOOK_APP_ID');
     $app_secret = env('FACEBOOK_APP_SECRET');
     $app_graph = env('default_graph_version');
     $fb = new Facebook(['app_id' => $app_id, 'app_secret' => $app_secret, 'default_graph_version' => $app_graph, 'default_access_token' => '903539709730443|d46fd1d4d733eda0600f3f29b1d818eb']);
     $helper = $fb->getRedirectLoginHelper();
     $permissions = ['publish_actions'];
     // optional
     //$helper->getLoginUrl($params);
     return Redirect::to($helper->getLoginUrl('http://localhost/projects/master3/public/profilesetting/callback', $permissions));
 }
 public function invoice()
 {
     $data = $this->getData();
     $date = date('Y-m-d');
     $invoice = "2222";
     $view = \View::make('pdf.invoice', compact('data', 'date', 'invoice'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('invoice');
     //         $pdf = PDF::loadView('pdf.invoice', compact('data', 'date', 'invoice') );
     //            return $pdf->download('invoice.pdf');
     //        return view('pdf/invoice',compact('data', 'date', 'invoice') );
 }
 public function search()
 {
     if (!\Input::has('query')) {
         return view("search");
     }
     $options = ['maxResults' => 16, 'q' => \Input::get("query")];
     if (\Input::has('page')) {
         $options['pageToken'] = \Input::get('page');
     }
     $youtube = \App::make('youtube');
     $videos = $youtube->search->listSearch("snippet", $options);
     // after video ends, use relatedToVideoId for suggestions
     return view("search", ['videos' => $videos, 'query' => \Input::get('query')]);
 }
 public function generate(DataRequest $request)
 {
     $data = $request->all();
     $barcodes = [];
     $limit = $data['start'] + $data['quantity'];
     for ($i = $data['start']; $i < $limit; $i++) {
         $sufix = str_pad($i, strlen($limit), '0', STR_PAD_LEFT);
         $barcodes[] = $data['prefix'] . $sufix;
     }
     $view = \View::make('layout_print', compact('barcodes'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view)->setPaper([0, 0, 141.7323, 85.03937999999999]);
     return $pdf->stream();
 }
Example #30
0
 public function process_daily(Request $request)
 {
     $date_start = $this->saved_date_format($request->input('date_start'));
     $date_end = $this->saved_date_format($request->input('date_end'));
     $data = $this->get_data_report_daily($date_start, $date_end);
     // dd($data);
     // die();
     $date_start = $request->input('date_start');
     $date_end = $request->input('date_end');
     $view = \View::make('reports.print_daily_recap', compact('data', 'date_start', 'date_end'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('invoice');
 }