Esempio n. 1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data['title'] = 'Staff Mgt';
     $data['staff_menu'] = 1;
     $data['staffs'] = Staff::all();
     return view('admin.staff.index', $data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $staff = Staff::all();
     //$staff = DB::select("SELECT * FROM Staff;");
     return view('staff.index', ['staff' => $staff, 'count' => Staff::count()]);
 }
Esempio n. 3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($type, $id)
 {
     if ($id == 'video') {
         $events = Video::all();
         return view('video.show', compact('events'));
     } elseif ($id == 'staff') {
         $events = Staff::all();
         return view('staff.show', compact('events'));
     } elseif ($id == 'gallery') {
         $events = Image::all();
         return view('gallery.show', compact('events'));
     } else {
         $event = Event::where('slug', $id)->where('type', $type)->first();
         $location = Location::where('event_id', $event->id)->first();
         $slider = EventImage::where('event_id', $event->id)->orderBy(\DB::raw('RAND()'))->take(4)->get();
         $gallery = EventImage::where('event_id', $event->id)->first();
         if ($event->type == $type) {
             if ($event->status == 1) {
                 return view($type . '.show', compact('event', 'location', 'slider', 'gallery'));
             } else {
                 return redirect('/' . $type . '/');
             }
         }
     }
 }
Esempio n. 4
0
 public function syncWithJira()
 {
     $staff_list = Staff::all();
     Timelog::where('project_id', '=', $this->id)->delete();
     $issue_service = new IssueService(app(ConfigurationInterface::class));
     $start = 0;
     while (1) {
         try {
             $issues = $issue_service->search("project={$this->jira_key} and timespent>0 and updated >= {$this->start_date}", $start, 250, ["key", "worklog"]);
         } catch (JiraException $exception) {
             return false;
         }
         if (count($issues->getIssues()) == 0) {
             break;
         }
         $timelogs = [];
         foreach ($issues->getIssues() as $issue) {
             $jira_work_logs = $issue->fields->worklog->worklogs;
             foreach ($jira_work_logs as $jira_work_log) {
                 if (!isset($jira_work_log->author)) {
                     continue;
                 }
                 $employee = $staff_list->where('email', $jira_work_log->author->emailAddress)->first();
                 if ($employee == null) {
                     continue;
                 }
                 $timelogs[] = ['project_id' => $this->id, 'staff_id' => $employee->id, 'time_spent' => $jira_work_log->timeSpentSeconds, 'jira_id' => $jira_work_log->id, 'started' => $jira_work_log->started];
             }
         }
         Timelog::insert($timelogs);
         $start += count($issues->getIssues());
     }
     return true;
 }
Esempio n. 5
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // Create some data
     $title = 'About Page TEST';
     $metaDesc = 'We have staff members';
     $allStaff = Staff::all();
     return view('about.index', compact('title', 'metaDesc', 'allStaff'));
 }
Esempio n. 6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // Create some data
     $title = 'About page';
     $metaDesc = 'Learn more about us';
     $allStaff = Staff::all();
     return view('about.index', compact('title', 'metaDesc', 'allStaff'));
 }
 /**
  * Show the index page for all staff.
  * Responds to requests to GET /staff
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::user()->is_admin) {
         $centreStaff = Staff::all();
     } else {
         $centreStaff = Staff::ofCentres(Auth::user())->get();
     }
     return view('staff.index', compact('centreStaff'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     //create some data
     $title = 'about page';
     $metaDesc = 'its an about us page';
     $allStaff = \App\Staff::all();
     return view('about.index', compact('title', 'metaDesc', 'allStaff'));
 }
Esempio n. 9
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $learners = \App\Student::all();
     $staff = Staff::all();
     $subjects = \App\Subject::all();
     $streams = \App\Stream::all();
     $classes = \App\Grade::all();
     return view('admin.index')->with('title', 'SMS|Dashboard')->with('learners', $learners)->with('staff', $staff)->with('subjects', $subjects)->with('streams', $streams)->with('classes', $classes);
 }
Esempio n. 10
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($type)
 {
     if ($type == 'staff') {
         $events = Staff::all();
         return view('admin.' . $type . '.index')->with('events', $events);
     } elseif ($type == 'video') {
         $events = Video::all();
         return view('admin.' . $type . '.index')->with('events', $events);
     } elseif ($type == 'event' || $type == 'page') {
         $events = Event::where('type', $type)->orderBy('updated_at', 'desc')->get();
         return view('admin.' . $type . '.index')->with('events', $events);
     } else {
         return view('errors.404');
     }
 }
Esempio n. 11
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $staffs = Staff::all();
     return view('admin.users.index')->with('staffs', $staffs);
 }
 public function index()
 {
     $staff = Staff::all()->toArray();
     return $staff;
 }
Esempio n. 13
0
 /**
  * Show the form for editing the specified resource.
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $staff = Staff::all();
     $staffrate = StaffRate::findOrFail($id);
     return view('staff-rate.edit', compact('staffrate', 'staff'));
 }
Esempio n. 14
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data['staff'] = Staff::all();
     return view('admin.staff', $data);
 }