本文整理汇总了PHP中App\Http\Controllers\App类的典型用法代码示例。如果您正苦于以下问题:PHP App类的具体用法?PHP App怎么用?PHP App使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了App类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: crearPdf
/**
* 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();
}
示例2: callback
/**
* 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('/');
}
示例3: __construct
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')));
}
示例4: facturar
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();
}
示例5: getReset
/**
* 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);
}
示例6: __construct
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);
}
示例7: profile_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();
}
示例8: index
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]);
}
示例9: handler
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);
}
示例10: getPrint
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(); */
}
示例11: InDanhSachDeTaiNhom
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");
}
示例12: graficos
public function graficos(Request $request)
{
$html = $request->input('htmlContent');
$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML($html);
return $pdf->stream('graficos');
}
示例13: rncStad
/**
*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');
}
}
示例14: lista
/**
* 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');
}
示例15: calificacionDocente
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');
}