當前位置: 首頁>>代碼示例>>PHP>>正文


PHP app\Course類代碼示例

本文整理匯總了PHP中app\Course的典型用法代碼示例。如果您正苦於以下問題:PHP Course類的具體用法?PHP Course怎麽用?PHP Course使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Course類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createBill

 private function createBill(Course $course)
 {
     $user = $course->user()->getResults();
     // $name = 'Fritz';
     // $lastname ='Hauser';
     // $courseName ='Parties für Introvertierte';
     $id = 1;
     $date = date('m.d.Y');
     // $maxPart=34;
     $pdf = new FPDI();
     $disk = Storage::disk('local');
     $templatePath = base_path() . '/resources/assets/pdf/bill_template.pdf';
     $filename = $this->generateFileName();
     # set fonts and whatnot
     $pdf->AddFont('Calibri', '', 'calibri.php');
     $pdf->AddFont('Calibri', 'B', 'calibrib.php');
     $pdf->SetFont('Calibri', '', 11);
     # load template PDF
     $pdf->AddPage();
     $pdf->setSourceFile($templatePath);
     $tplIdx = $pdf->importPage(1);
     $pdf->useTemplate($tplIdx);
     #put text into PDF
     $pdf->SetXY(23, 55);
     $pdf->Write(0, $this->sanitizeString($user->firstName));
     $pdf->SetXY(23, 60);
     $pdf->Write(0, $this->sanitizeString($user->lastName));
     $pdf->SetXY(23, 65);
     $pdf->Write(0, $this->sanitizeString($user->address));
     $pdf->SetXY(23, 70);
     $pdf->Write(0, $this->sanitizeString($user->zip));
     $pdf->SetXY(33, 70);
     $pdf->Write(0, $this->sanitizeString($user->city));
     $pdf->SetXY(23, 75);
     $pdf->Write(0, $this->sanitizeString($user->country));
     $pdf->SetXY(55, 101);
     $pdf->Write(0, $this->sanitizeString(mt_rand(1232, 3545345)));
     $pdf->SetXY(55, 106);
     $pdf->Write(0, $this->sanitizeString(utf8_decode($date)));
     $pdf->SetXY(26, 124);
     $pdf->Write(0, $this->sanitizeString($course->courseName));
     $pdf->SetXY(32, 128.2);
     $pdf->Write(0, $course->id);
     $pdf->SetXY(70, 124);
     $pdf->Write(0, utf8_decode($date));
     $pdf->SetXY(110, 124);
     $pdf->Write(0, $course->participantNum);
     $pdf->SetXY(165, 124);
     $pdf->Write(0, $course->participantNum);
     $pdf->SetXY(165, 138);
     $pdf->SetFont('Calibri', 'B', 11);
     $pdf->Write(0, $course->participantNum);
     $output = $pdf->Output('', 's');
     $disk->put($filename, $output);
     return $filename;
 }
開發者ID:salvomulas,項目名稱:angryproton,代碼行數:56,代碼來源:Bill.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //dd($request->all());
     $course = new Course();
     $course->course_name = $request->input('course_name');
     $course->course_instructor = $request->input('course_instructor');
     $course->semester_id = $request->input('semester_id');
     $course->course_time_id = $request->input('course_time_id');
     $course->course_location = $request->input('course_location');
     $course->save();
     return redirect('courses');
 }
開發者ID:bigschlong69,項目名稱:capstoneAll,代碼行數:18,代碼來源:CoursesController.php

示例3: new_courses

 public function new_courses()
 {
     Course::where('offered_this_semester', true)->update(['offered_this_semester' => false]);
     $courseSeeder = new \CourseTableSeeder();
     $courseSeeder->run();
     return redirect(route('course.index'));
 }
開發者ID:AUCSC,項目名稱:sac,代碼行數:7,代碼來源:CoursesController.php

示例4: destroy

 public function destroy($id)
 {
     $courses = Course::find($id);
     $courses->schedules()->delete();
     $courses->delete();
     return response()->json(['id' => $id]);
 }
開發者ID:Kangaroos,項目名稱:restart-reserve,代碼行數:7,代碼來源:CourseController.php

示例5: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     factory(User::class, 50)->create()->each(function ($user) {
         // store 10 rounds per user
         for ($i = 0; $i < 10; $i++) {
             // pick a random course to play on
             $course = Course::orderByRaw("random()")->first();
             // pick a random tee set on that course
             $teeSet = TeeSet::orderByRaw("random()")->where('course_id', $course->id)->first();
             $holes = $course->holes;
             $scores = [];
             // each round has 18 scores
             for ($j = 0; $j < 18; $j++) {
                 $scores[] = factory(Score::class)->make(['hole_id' => $holes[$j]->id]);
             }
             $round = factory(Round::class)->make(['tee_set_id' => $teeSet->id]);
             $round = $user->rounds()->save($round);
             $round->scores()->saveMany($scores);
         }
         $followed = [$user->id];
         // follow 10 random users
         for ($i = 0; $i < 10; $i++) {
             // pick a random user, that is not the current user and is not already followed
             $userToFollow = User::orderByRaw("random()")->whereNotIn('users.id', $followed)->first();
             $user->following()->attach($userToFollow);
             $followed[] = $userToFollow->id;
         }
     });
 }
開發者ID:robeasdon,項目名稱:golf-stat-tracker,代碼行數:34,代碼來源:UserSeeder.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $teacher = User::find(Auth::user()->id);
     $resourceTypes = Resource_type::all();
     $courses = $crs = Course::orderBy('affiliateId', 'DESC')->orderBy('streamId', 'DESC')->orderBy('levelId', 'DESC')->get();
     return view('teacher')->with('teacher', $teacher)->with('resourceTypes', $resourceTypes)->with('courses', $courses);
 }
開發者ID:premsingh4github,項目名稱:SchoolUmbrella,代碼行數:12,代碼來源:TeacherController.php

示例7: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $trainees = Registration::lists('english_name', 'id');
     $courses = Course::lists('course_name', 'id');
     $data = TraineeCourse::whereId($id)->firstOrFail();
     return view('traineeCourse.edit', compact('trainees', 'courses', 'data'));
 }
開發者ID:sanjidarafin,項目名稱:tms_bard-laravel-,代碼行數:13,代碼來源:TraineeCoursesController.php

示例8: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create($course_url, $stage_url)
 {
     $curso = Course::where('url', $course_url)->first();
     $etapa = Stage::where('url', $stage_url)->where('course_id', $curso->id)->first();
     $tiposItem = ItemType::all()->pluck('name', 'id');
     return view('pages.items.create', ['curso' => $curso, 'etapa' => $etapa, 'tiposItem' => $tiposItem]);
 }
開發者ID:juanfe190,項目名稱:adminclubinnova,代碼行數:12,代碼來源:ItemController.php

示例9: getUnavailableGpAsgs

 public function getUnavailableGpAsgs($courseId)
 {
     $gpAsgs = Course::find($courseId)->gpAsgs;
     return $gpAsgs->filter(function ($gpAsg) {
         return !$this->testGpAsgAvailable($gpAsg);
     });
 }
開發者ID:joseph1125,項目名稱:cis,代碼行數:7,代碼來源:GpAsgsController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $course = Course::findOrFail($id);
     $course->delete();
     Session::flash('message', 'Successfully Deleted your Data!');
     return redirect()->back();
 }
開發者ID:minhajCSE,項目名稱:teleaus-dev,代碼行數:13,代碼來源:TrainingController.php

示例11: show

 public function show($slug)
 {
     $page = Page::where('slug', $slug)->first();
     $courses = Course::published()->hasCategory()->orderBy('created_at', 'desc')->take(4)->get();
     $articles = Article::published()->orderBy('published_at', 'desc')->take(2)->get();
     return view('pages.show', ['page' => $page, 'latest_courses' => $courses, 'latest_articles' => $articles]);
 }
開發者ID:dadigu,項目名稱:haskolabru,代碼行數:7,代碼來源:PagesController.php

示例12: index

 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     // Get an array of courses which this instructor has created
     $courses = Course::where('instructor_id', '=', Auth::id())->get();
     // Render the view, passing the courses array into it
     return view('home')->with('courses', $courses);
 }
開發者ID:carbide20,項目名稱:courses,代碼行數:12,代碼來源:HomeController.php

示例13: run

 public function run()
 {
     DB::table('courses')->delete();
     Course::create(['course_code' => 5660, 'course_name' => "Legal", 'course_type' => "Pre-Requisite", 'description' => "This is a core Course"]);
     Course::create(['course_code' => 4665, 'course_name' => "JAVA", 'course_type' => "Track", 'description' => "This is a Track Course"]);
     Course::create(['course_code' => 5656, 'course_name' => "Android", 'course_type' => "Track", 'description' => "This is a Track Course"]);
 }
開發者ID:abhijith444,項目名稱:enroll,代碼行數:7,代碼來源:DatabaseSeeder.php

示例14: getUnavailableWithinGpAsgs

 public function getUnavailableWithinGpAsgs($courseId)
 {
     $withinGpAsgs = Course::find($courseId)->withinGpAsgs;
     return $withinGpAsgs->filter(function ($withinGpAsg) {
         return !$this->testWithinGpAsgAvailable($withinGpAsg);
     });
 }
開發者ID:joseph1125,項目名稱:cis,代碼行數:7,代碼來源:WithinGpAsgsController.php

示例15: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $trainer_course = TrainerCourse::whereid($id)->firstOrfail();
     $trainers = DB::table('users')->leftjoin('role_user', 'users.id', '=', 'role_user.user_id')->where('role_user.role_id', 2)->select('users.id as id', 'users.name as name')->lists('name', 'id');
     $courses = Course::lists('course_name', 'id');
     return view('TrainerCoursesRelation.edit', compact('trainer_course', 'trainers', 'courses'));
 }
開發者ID:polodev,項目名稱:Bard-Ftfl-Laravel-Project,代碼行數:13,代碼來源:TrainerCourseController.php


注:本文中的app\Course類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。