本文整理汇总了PHP中Department::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::all方法的具体用法?PHP Department::all怎么用?PHP Department::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Department
的用法示例。
在下文中一共展示了Department::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMyprofile
public function getMyprofile()
{
$id = Auth::user()->id;
$alumni_id = null;
$sql = "SELECT * FROM alumni WHERE account_id = ?";
$prof = DB::select($sql, array($id));
if ($prof != null) {
$alumni_id = $prof[0]->id;
}
$sql2 = "SELECT * FROM degree WHERE alumni_id = ?";
$deg = DB::select($sql2, array($alumni_id));
$sql3 = "SELECT * FROM work_experience WHERE alumni_id = ?";
$wrk_exp = DB::select($sql3, array($alumni_id));
$sql4 = "SELECT * FROM certificate WHERE alumni_id = ?";
$certificate = DB::select($sql4, array($alumni_id));
// $sql5 = "SELECT * FROM alumni_tracer WHERE alumni_id = ?";
$sql5 = "SELECT at.*, sq.question, sc.choice\n\t\t\t\tFROM alumni_tracer AS at\n\t\t\t\tINNER JOIN survey_questions AS sq\n\t\t\t\tON sq.id = at.question_id\n\t\t\t\tINNER JOIN survey_choices AS sc\n\t\t\t\tON sc.id = at.choice_id\n\t\t\t\tWHERE at.alumni_id = ?\n\t\t\t\tORDER BY at.question_id";
$a_tracer = DB::select($sql5, array($alumni_id));
$dept = Department::all();
$region = Region::all();
$province = Province::all();
$occupation = Occupation::all();
$company = Company::all();
$deg_title = DegreeTitle::all();
$school = School::all();
$jobs = Job::all();
$field = Field::all();
$questions = DB::select("SELECT * FROM survey_questions");
$civil_status = DB::select("SELECT * FROM civil_status");
return View::make('user.profile')->with('company', $company)->with('field', $field)->with('occupation', $occupation)->with('work_exp', $wrk_exp)->with('degree', $deg)->with('a_tracer', $a_tracer)->with('certificate', $certificate)->with('school', $school)->with('deg_title', $deg_title)->with('profile', $prof)->with('dept', $dept)->with('region', $region)->with('province', $province)->with('civil_status', $civil_status)->with('questions', $questions)->with('jobs', $jobs);
}
示例2: startIndexAction
/**
* Start test
*/
public function startIndexAction()
{
Assets::reset()->add('main');
$token = $this->getToken();
if (!$token) {
return Redirect::route('info')->with('message', 'Токен не найден');
}
if ($token->status == Token::TOKEN_STATUS_EMPTY) {
/**
* вывести форму где пользователь введёт свои данные
*/
$departments = Department::all();
$groups = Group::all();
$selectedDepartments = array();
$selectGroups = array();
$selectedDepartments[] = 'Не выбран';
$selectGroups[] = 'Не выбран';
foreach ($departments as $department) {
$selectedDepartments[$department->id] = $department->name;
}
foreach ($groups as $group) {
$selectGroups[$group->id] = $group->name;
}
return View::make('test.start', ['token' => $token, 'departments' => $selectedDepartments, 'groups' => $selectGroups]);
} elseif ($token->status == Token::TOKEN_STATUS_STARTED) {
if ($this->isTokenValid($token)) {
return Redirect::route('test.index');
} else {
Session::forget('token_string');
$token->status = Token::TOKEN_STATUS_EXPIRED;
$token->save();
return Redirect::route('info')->with('message', 'Время теста истекло');
}
}
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$product = Product::find($id);
$departments = Department::all()->lists('name', 'id');
$categories = Category::all()->lists('name', 'id');
$brands = Brand::all()->lists('name', 'id');
$sizes = Size::all()->lists('name', 'id');
$colors = Color::all()->lists('name', 'id');
return View::make('admin::products.edit', compact('product', 'departments', 'categories', 'brands', 'sizes', 'colors'));
}
示例4: format
public static function format(array $data = [], $single = false)
{
$departments = Department::all(true);
if ($single) {
$data = [$data];
}
foreach ($data as &$row) {
$row['dname'] = $departments[$row['did']]['name'];
}
return $single ? $data[0] : $data;
}
示例5: index
/**
* Display a listing of departments
*/
public function index()
{
$this->data['departments'] = Department::all();
$this->data['departmentActive'] = 'active';
$employeeCount = array();
foreach (Department::all() as $dept) {
$employeeCount[$dept->id] = Employee::join('designation', 'employees.designation', '=', 'designation.id')->join('department', 'designation.deptID', '=', 'department.id')->where('department.id', '=', $dept->id)->count();
}
$this->data['employeeCount'] = $employeeCount;
return View::make('admin.departments.index', $this->data);
}
示例6: edit
/**
* Show the form for editing the specified branch.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$employee = Employee::find($id);
$branches = Branch::all();
$departments = Department::all();
$jgroups = JGroup::all();
$etypes = EType::all();
$banks = Bank::all();
$bbranches = BBranch::all();
return View::make('employees.edit', compact('branches', 'departments', 'etypes', 'jgroups', 'banks', 'bbranches', 'employee'));
}
示例7: period_summary
public function period_summary()
{
$branches = Branch::all();
$depts = Department::all();
return View::make('pdf.summarySelect', compact('branches', 'depts'));
}
示例8: getModifyPub
public function getModifyPub($id)
{
$pub = Publicaciones::find($id);
$title = "Modificar publicacion | pasillo24.com";
if ($pub->tipo == 'Lider') {
$url = "usuario/publicacion/modificar/lider/" . $id;
} elseif ($pub->tipo == 'Habitual') {
$url = "usuario/publicacion/modificar/habitual/" . $id;
} elseif ($pub->tipo == 'Casual') {
$url = "usuario/publicacion/modificar/casual/" . $id;
}
$categorias = Categorias::all();
$subCat = SubCat::all();
$departamento = Department::all();
if ($pub->categoria == 34) {
$marcas = Marcas::all();
$modelos = Modelo::where('marca_id', '=', $pub->marca_id)->get();
return View::make('publications.modifyPub')->with('title', $title)->with('tipo', $pub->tipo)->with('publicaciones', $pub)->with('url', $url)->with('categorias', $categorias)->with('subCat', $subCat)->with('departamento', $departamento)->with('marcas', $marcas)->with('modelos', $modelos);
} else {
return View::make('publications.modifyPub')->with('title', $title)->with('tipo', $pub->tipo)->with('publicaciones', $pub)->with('url', $url)->with('categorias', $categorias)->with('subCat', $subCat)->with('departamento', $departamento);
}
}
示例9: manageDepartments
/**
* Show list of employee department choices
*
* @return mixed
*/
public function manageDepartments()
{
$depts = Department::all();
return View::make('admin.departments', compact('depts'));
}
示例10: listAction
public function listAction()
{
$departments = Department::all();
$this->view->setVar('departments', $departments);
}
示例11: indexAction
/**
* Display all departments
*/
public function indexAction()
{
$departments = Department::all();
return View::make('department.index', ['departments' => $departments]);
}
示例12: foreach
@extends('layouts.admin.default')
@section('content')
<?php
$employeeEditId = $employeeEditInfo[0]->id;
$message = Session::get('message');
//echo 'employeeEdit:'.$employeeEditId;
//exit;
$companies = Company::all();
$departments = Department::all();
$jobTitles = JobTitle::all();
$managers = Employee::all();
$supervisors = Employee::all();
$roles = DB::table('groups')->get();
if (isset($employeeEditId) && !empty($employeeEditId)) {
$userEdit = DB::table('users')->where('employee_id', $employeeEditId)->first();
}
if (isset($userEdit) && !empty($userEdit)) {
$userGroupEdit = DB::table('users_groups')->where('user_id', $userEdit->id)->first();
}
if (isset($userGroupEdit) && !empty($userGroupEdit)) {
$groupEdit = DB::table('groups')->where('id', (int) $userGroupEdit->group_id)->first();
}
$companyArr[0] = '';
if (!empty($companies)) {
foreach ($companies as $company) {
$companyArr[$company->id] = $company->name;
}
}
$departmentArr[0] = '';
示例13: getListDepartments
public function getListDepartments()
{
$departments = Department::all();
return View::make('admin.departments')->with('departments', $departments);
}
示例14: online
public function online()
{
if (\KodeInfo\Utilities\Utils::isDepartmentAdmin(Auth::user()->id)) {
$department_admin = DepartmentAdmins::where('user_id', Auth::user()->id)->first();
$department = Department::where('id', $department_admin->department_id)->first();
$user_ids = OperatorsDepartment::where('department_id', $department->id)->lists('user_id');
} else {
$group = Groups::where("name", "operator")->first();
$user_ids = UsersGroups::where("group_id", $group->id)->lists("user_id");
}
if (sizeof($user_ids) > 0) {
$this->data["operators"] = User::whereIn("id", $user_ids)->where("is_online", 1)->get();
} else {
$this->data["operators"] = [];
}
foreach ($this->data["operators"] as $operator) {
$department_id = OperatorsDepartment::where('user_id', $operator->id)->pluck("department_id");
$department = Department::find($department_id);
$company = Company::find($department->company_id);
$operator->department = $department;
$operator->company = $company;
}
$this->data['permissions'] = Permissions::all();
$this->data['departments'] = Department::all();
return View::make('operators.all', $this->data);
}
示例15: getEditInfo
public function getEditInfo($id)
{
$user = User::find($id);
if (!$user) {
App::abort(404);
}
/*
Redirects the user if user
meddles with the id in the url
*/
/*first param becomes a variable user
2nd param is the user variable in this page*/
$alldepartments = Department::all();
return View::make('emp.edit-info')->with('user', $user)->with('alldepartments', $alldepartments);
}