Ejemplo n.º 1
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();
 }
Ejemplo n.º 2
0
 /**
  * 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('/');
 }
Ejemplo n.º 3
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')));
 }
Ejemplo n.º 4
0
 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();
 }
 /**
  * Display the password reset view for the given token.
  *
  * @param  string  $token
  * @return Response
  */
 public function getReset($token = null)
 {
     if (is_null($token)) {
         App::abort(404);
     }
     return View::make('password.reset')->with('token', $token);
 }
Ejemplo n.º 6
0
 public function __construct()
 {
     $this->middleware('ipblocked');
     $driver = config('database.default');
     $database = config('database.connections');
     $this->db = $database[$driver]['database'];
     $this->dbuser = $database[$driver]['username'];
     $this->dbpass = $database[$driver]['password'];
     $this->dbhost = $database[$driver]['host'];
     if (\Auth::check() == true) {
         if (!\Session::get('gid')) {
             \Session::put('uid', \Auth::user()->id);
             \Session::put('gid', \Auth::user()->group_id);
             \Session::put('eid', \Auth::user()->email);
             \Session::put('ll', \Auth::user()->last_login);
             \Session::put('fid', \Auth::user()->first_name . ' ' . \Auth::user()->last_name);
             \Session::put('themes', 'sximo-light-blue');
         }
     }
     if (!\Session::get('themes')) {
         \Session::put('themes', 'sximo');
     }
     if (defined('CNF_MULTILANG') && CNF_MULTILANG == 1) {
         $lang = \Session::get('lang') != "" ? \Session::get('lang') : CNF_LANG;
         \App::setLocale($lang);
     }
     $data = array('last_activity' => strtotime(Carbon::now()));
     \DB::table('tb_users')->where('id', \Session::get('uid'))->update($data);
 }
 public function profile_pdf($user)
 {
     $pdf = \App::make('dompdf.wrapper');
     $html = view('pages.users.profile_pdf', compact('user'));
     $pdf->loadHTML($html);
     return $pdf->stream();
 }
Ejemplo n.º 8
0
 public function index()
 {
     $pages = Page::all();
     $landing = Landing::where('lang', \App::getLocale())->first();
     $universities = University::where('lang', \App::getLocale())->take(9)->get();
     return view('pages.index', ['pages' => $pages, 'landing' => $landing, 'universities' => $universities]);
 }
Ejemplo n.º 9
0
 public static function handler()
 {
     $data = array('success' => false, 'title' => trans('t.contactErrorTitle'), 'message' => trans('t.contactErrorMessage'));
     $requestAllowed = true;
     if (self::$requestType == 'ajax') {
         $requestAllowed = \Request::ajax() && \Request::get('getIgnore_isAjax');
     }
     if ($requestAllowed) {
         $validator = \Validator::make(\Request::all(), self::$rules);
         if ($validator->fails()) {
             $messages = $validator->getMessageBag()->toArray();
             $finalMessages = array();
             foreach ($messages as $field => $fieldMessages) {
                 foreach ($fieldMessages as $fieldMessage) {
                     $finalMessages[] = $fieldMessage;
                 }
             }
             $message = implode("\n", $finalMessages);
             $data['message'] = $message;
             return self::returnData($data);
         } else {
             try {
                 Mailer::sendMessage(\Request::all());
                 $data['success'] = true;
                 $data['title'] = trans('t.contactSuccessTitle');
                 $data['message'] = trans('t.contactSuccessMessage');
             } catch (\Exception $e) {
                 Dbar::error("Error while sending message: " . $e->getMessage());
             }
         }
         return self::returnData($data);
     }
     \App::abort(404);
 }
 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(); */
 }
 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");
 }
Ejemplo n.º 12
0
 public function graficos(Request $request)
 {
     $html = $request->input('htmlContent');
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($html);
     return $pdf->stream('graficos');
 }
Ejemplo n.º 13
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');
     }
 }
Ejemplo n.º 14
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function lista()
 {
     //-------PAGINA-63------------
     // $produtos = DB::select('select * from marca');
     $produtos = \App::all();
     return view('listagem');
 }
Ejemplo n.º 15
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');
 }
Ejemplo n.º 16
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();
 }
Ejemplo n.º 17
0
 public function getUser()
 {
     $all = User::all();
     $env = \App::environment();
     var_dump($all, $env);
     foreach ($all as $v) {
         var_dump($env);
         var_dump($v->name);
         var_dump($v->nickname);
         var_dump($v->createTime);
         var_dump($v->updateTime);
         var_dump($v->deleteTime);
     }
     //$id = 30;
     //$user = UserService::getUserById($id);
     //$list = UserService::getList(1,10);
     //\Debugbar::info();
     //\Debugbar::error('Error!');
     //\Debugbar::warning('Watch out…');
     //\Debugbar::addMessage('Another message', 'mylabel');
     //\Debugbar::startMeasure('render','Time for rendering');
     //\Debugbar::stopMeasure('render');
     //\Debugbar::addMeasure('now', LARAVEL_START, microtime(true));
     //echo 'ssss';
     //\Debugbar::disable();
     /*
     foreach($list  as $k=>$v){
     	   //var_dump($v['name']);
     }
     var_dump($list);
     */
 }
Ejemplo n.º 18
0
 /**
  * [updatePhoto description]
  * @param  Integer Id do usuário
  * @return ??
  */
 public function cropPhotoEntidade($entidade, CropPhotoRequest $request)
 {
     if (!$entidade) {
         App::abort(500, 'Erro durante o processamento do crop');
     }
     $file = Input::file('image_file_upload');
     if ($file && $file->isValid()) {
         $widthCrop = $request->input('w');
         $heightCrop = $request->input('h');
         $xSuperior = $request->input('x');
         $ySuperior = $request->input('y');
         $destinationPath = public_path() . '/uploads/';
         $extension = Input::file('image_file_upload')->getClientOriginalExtension();
         // Pega o formato da imagem
         $fileName = self::formatFileNameWithUserAndTimestamps($file->getClientOriginalName()) . '.' . $extension;
         $file = \Image::make($file->getRealPath())->crop($widthCrop, $heightCrop, $xSuperior, $ySuperior);
         $upload_success = $file->save($destinationPath . $fileName);
         //Salvando imagem no avatar do usuario;
         if ($upload_success) {
             /* Settando tipo da foto atual para null, checando se existe antes */
             if ($entidade->avatar) {
                 $currentAvatar = $entidade->avatar;
                 $currentAvatar->tipo = null;
                 $currentAvatar->save();
             }
             $foto = new Foto(['path' => $fileName, 'tipo' => 'avatar']);
             $entidade->fotos()->save($foto);
             return true;
         } else {
             return false;
         }
     }
 }
Ejemplo n.º 19
0
 function form($id = null)
 {
     /////////////////////////////
     // Load Data if applicable //
     /////////////////////////////
     if ($id) {
         $query['id'] = $id;
         $api_response = json_decode($this->api->get($this->api_url . '/travel_agents?' . http_build_query(array_merge($query, ['access_token' => Session::get('access_token')])))->getBody());
         if ($api_response->status != 'success') {
             return App::abort(404);
         }
         $data = $this->reformat_images($api_response->data->data)[0];
         foreach ($data->addresses as $address) {
             $address->status = 'data';
         }
         unset($data->addresses);
         $data->addresses = [$address];
     }
     /////////////////
     // Create Form //
     /////////////////
     $this->layout->page_template = view($this->version . '.vendors.template');
     $this->layout->page_template->page = view($this->version . '.vendors.travel_agents.form')->with('id', $id);
     $this->layout->page_template->page->data = $data;
     return $this->layout;
 }
Ejemplo n.º 20
0
 public function debug()
 {
     echo '<pre>';
     echo '<h1>Environment</h1>';
     echo \App::environment() . '</h1>';
     echo '<h1>Debugging?</h1>';
     if (config('app.debug')) {
         echo "Yes";
     } else {
         echo "No";
     }
     echo '<h1>Database Config</h1>';
     /*
     The following line will output your MySQL credentials.
     Uncomment it only if you're having a hard time connecting to the database and you
     need to confirm your credentials.
     When you're done debugging, comment it back out so you don't accidentally leave it
     running on your live server, making your credentials public.
     */
     //print_r(config('database.connections.mysql'));
     echo '<h1>Test Database Connection</h1>';
     try {
         $results = \DB::select('SHOW DATABASES;');
         echo '<strong style="background-color:green; padding:5px;">Connection confirmed</strong>';
         echo "<br><br>Your Databases:<br><br>";
         print_r($results);
     } catch (Exception $e) {
         echo '<strong style="background-color:crimson; padding:5px;">Caught exception: ', $e->getMessage(), "</strong>\n";
     }
     echo '</pre>';
 }
Ejemplo n.º 21
0
 /**
  * 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');
 }
Ejemplo n.º 22
0
 function __construct()
 {
     $this->errors = new MessageBag();
     $this->page_attributes = new \Stdclass();
     $api_url = '/oauth/client/access_token';
     $api_data = ['grant_type' => 'client_credentials', 'client_id' => env('CLIENT_ID'), 'client_secret' => env('CLIENT_SECRET')];
     $api = new API();
     $result = json_decode($api->post($api_url, $api_data), true);
     // Get success API token
     if ($result['status'] == "success") {
         Session::set('API_token_public', $result['data']['token']['token']);
         Session::set('API_token', $result['data']['token']['token']);
     } else {
         \App::abort(503);
     }
     //generate balin information
     $APIConfig = new APIConfig();
     $config = $APIConfig->getIndex(['search' => ['default' => 'true'], 'sort' => ['name' => 'asc']]);
     $balin = $config['data'];
     unset($balin['info']);
     foreach ($config['data']['info'] as $key => $value) {
         $balin['info'][$value['type']] = $value;
     }
     $this->balin = $balin;
     //nanti kalu butuh template lebih dari satu, switch case aja disini.
     $this->layout = view('web_v2.page_templates.layout');
 }
Ejemplo n.º 23
0
 public function getPoster($id)
 {
     $poster = Poster::find($id);
     if (!$poster) {
         App::abort(404);
     }
     return view('posters/view', array('poster' => $poster));
 }
Ejemplo n.º 24
0
 public function generaPdf($id)
 {
     $salida = salidasModelo::getInfoSalida($id);
     $vista = view('generapdf', compact('salida'));
     $dompdf = \App::make('dompdf.wrapper');
     $dompdf->loadHTML($vista);
     return $dompdf->stream();
 }
Ejemplo n.º 25
0
 public function __construct(Request $request)
 {
     $this->user = \Auth::user();
     if (!$this->user->userCan('adminka-access')) {
         \App::abort(403, 'Access denied');
     }
     $this->request = $request;
 }
Ejemplo n.º 26
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);
 }
Ejemplo n.º 27
0
 public function feedback()
 {
     \App::setLocale(Auth::user()->language());
     $user = Auth::user();
     $propositionFactory = new PropositionFactory();
     $viewUser = ['fullName' => $user->firstName() . " " . $user->lastName(), 'firstName' => $user->firstName(), 'lastName' => $user->lastName(), 'contactEmail' => $user->contactEmail(), 'email' => $user->email(), 'avatar' => $user->avatar(), 'belongsToSchool' => $user->belongsToSchool(), 'schoolEmail' => $user->googleEmail(), 'role' => $user->role(), 'propositionsCount' => $propositionFactory->getPropositionsCountByUser($user->userId())];
     return view('feedback', ['fullName' => $user->firstName() . " " . $user->lastName(), 'user' => $viewUser]);
 }
Ejemplo n.º 28
0
 /**
  * [showProfile description]
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function showProfile($id)
 {
     $user = User::find($id);
     if (is_null($user)) {
         App::abort(404);
     }
     return View::make('pages.user.profile', array('user' => $user, 'briefingRows' => trans('profile.briefingRows')));
 }
Ejemplo n.º 29
0
 public function getEmbedded($slug = null)
 {
     $doc = Doc::findDocBySlug($slug);
     if (is_null($doc)) {
         App::abort('404');
     }
     $view = View::make('doc.reader.embed', compact('doc'));
     return $view;
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $file = UploadedFile::findOrFail($id);
     if ($file->uploader_id !== Auth::user()->id) {
         App::abort(403);
     }
     $file->delete();
     return response('');
 }