<th>No of Staff</th> <th>No of Teachers</th> <th>HOD</th> <th>VHOD</th> <th>Action</th> </tr> <?php // an object of class 'DepartmentRepository' is made here // there, it creates objects of 'db' clas and 'Department' class // all database function is in 'db' class and is accessed using the object // setter functions of class 'Department' are accessed from the object of 'Department' // they are used to set the values obtained from database to the private variable in 'Department' // then multiple objects of 'Department' is stored in array in 'DepartmentRepository' // that array is returned here using the object of 'DepartmentRepository' $department_info = new DepartmentRepository(); foreach ($department_info->get_all() as $dept) { ?> <tr> <td><?php echo $dept->get_id(); ?> </td> <td><?php echo $dept->get_name(); ?> </td> <td><?php echo $dept->get_no_of_staff(); ?> </td>
/** * Remove the specified resource from storage. * * @param Department $department * @return Response */ public function destroy(\Illuminate\Http\Request $request) { $department = $this->department->findById($request->input('id')); $this->dispatch(new Department\Jobs\DeleteJob($department)); return $department; }
/** * @param $slug * * @return object */ public function show($slug) { $company = $this->company->findBySlug($slug); return view('customers.show', compact('company')); }
/** * * Handle the register form for user. * * @param type DepartmentRepository $department_gestion * @param type RegionRepository $region_gestion * @return type view */ public function getRegister(DepartmentRepository $department_gestion, RegionRepository $region_gestion) { $regions = $region_gestion->lists(); $departments = $department_gestion->listsWithRegion(); return view('front.auth.register', compact('departments', 'regions')); }
<?php require_once 'models/department.class.php'; require_once 'repository/departmentrepository.class.php'; $repository = new DepartmentRepository(); $department1 = new Department(); $department1->initialize(1, "BCT", "Dhaneshwor", "Vjit", 20, 3); $repository->add($department1); $department2 = new Department(); $department2->initialize(2, "BEX", "Sajan Thapa", "Romit Amgai", 25, 2); $repository->add($department2); $department3 = new Department(); $department3->initialize(3, "BEL", "Rajiv Shah", "Ritesh", 18, 1); $repository->add($department3); $department4 = new Department(); $department4->initialize(4, "BCE", "Promish", "Sagun", 22, 0); $repository->add($department4); include_once 'includes/formvalidation.php'; include_once 'includes/header.php'; ?> <tr> <th colspan="8" class="text-center">department Info<button class="btn btn-xs btn-primary pull-right" data-toggle="modal" data-target="#add_department"><span class="glyphicon glyphicon-plus"></span></button></th> </tr> <tr> <th><input type="checkbox" id="select_all"/></th> <th>Id</th> <th>Name</th> <th>Hod</th> <th>Vhod</th> <th>Teacher</th> <th>Floor</th>