本文整理汇总了PHP中app\Course类的典型用法代码示例。如果您正苦于以下问题:PHP Course类的具体用法?PHP Course怎么用?PHP Course使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Course类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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 = Trainer::lists('name', 'id');
$courses = Course::lists('course_name', 'id');
return view('TrainerCoursesRelation.edit', compact('trainer_course', 'trainers', 'courses'));
}
开发者ID:NabanitaBiswas,项目名称:Training_management_BARD,代码行数:13,代码来源:TrainerCourseController.php
示例17: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
\View::composer('*', function ($view) {
$allCourses = \App\Course::with('requirements')->orderBy('course_name', 'ASC')->get()->toArray();
$view->with('user', \Auth::user())->with('allCourses', $allCourses);
});
}
开发者ID:dnvmbr,项目名称:p4,代码行数:12,代码来源:ComposerServiceProvider.php
示例18: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$courses = Course::all();
$user = Auth::User();
$user_id = $user->id;
return view('trainee.create', compact('courses'))->with('user_id', $user_id);
}
开发者ID:NabanitaBiswas,项目名称:Training_management_BARD,代码行数:12,代码来源:InfosController.php
示例19: publicShow
public function publicShow($id)
{
$training = Training::whereid($id)->firstOrFail();
$courses = Course::wheretraining_id($id)->get();
$testimonials = Testimonial::wheretraining_id($id)->get();
return view('trainings.public_training_pages.show', compact('training'), compact('courses'))->with('testimonials', $testimonials);
}
开发者ID:NabanitaBiswas,项目名称:tms_bard-project-previous-,代码行数:7,代码来源:TrainingsController.php
示例20: show
public function show($slug)
{
$course = Course::where('slug', $slug)->firstOrFail();
$breadcrumbs = array(action('HomeController@show') => 'Início', action('CourseController@all') => 'Cursos', action('CourseController@show', $slug) => $course->name);
$previous = action('CourseController@all');
return view('course', compact('breadcrumbs', 'previous', 'course'));
}
开发者ID:joaopluis,项目名称:oldschool,代码行数:7,代码来源:CourseController.php
注:本文中的app\Course类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论