/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); DB::statement('SET FOREIGN_KEY_CHECKS=0;'); DB::table('divisions')->truncate(); DB::table('categories')->truncate(); DB::table('sub_categories')->truncate(); DB::table('brands')->truncate(); DB::table('skus')->truncate(); $reader = ReaderFactory::create(Type::XLSX); // for XLSX files $filePath = 'database/seeds/seed_files/Items.xlsx'; $reader->open($filePath); foreach ($reader->getSheetIterator() as $sheet) { if ($sheet->getName() == 'SKU Data') { $rowcnt = 0; foreach ($sheet->getRowIterator() as $row) { if ($rowcnt > 1) { if (!is_null($row[0])) { $division = Division::firstOrCreate(['division' => $row[8]]); $category = Category::firstOrCreate(['category_short' => strtoupper($row[1]), 'category_long' => strtoupper($row[0])]); $sub_category = SubCategory::firstOrCreate(['subcategory' => strtoupper($row[6])]); $brand = Brand::firstOrCreate(['brand' => strtoupper($row[7])]); $sku = Sku::firstOrCreate(['division_id' => $division->id, 'category_id' => $category->id, 'sub_category_id' => $sub_category->id, 'brand_id' => $brand->id, 'sku_code' => $row[2], 'item_desc' => $row[3], 'sku_desc' => $row[4], 'conversion' => $row[5]]); } } $rowcnt++; } } } $reader->close(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); Model::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('divisions')->delete(); Division::create(['id' => '1', 'name' => 'Mens Singles: IRT Pro']); Division::create(['id' => '2', 'name' => 'Mens Singles: Open']); Division::create(['id' => '3', 'name' => 'Mens Singles: A']); Division::create(['id' => '4', 'name' => 'Mens Singles: B']); Division::create(['id' => '34', 'name' => 'Womens Singles: LPRT Pro']); Division::create(['id' => '35', 'name' => 'Womens Singles: Open']); }
/** * * @return a list of objects. */ public static function listByFullName($division_id = '') { if ($division_id != '') { $items = Division::where('id', $division_id)->get(); } else { $items = Division::get(); } $key = 'id'; $value = 'full_name'; return Division::getListFields($items, $key, $value); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create($temporada_id) { $temporada = Temporada::findOrFail($temporada_id); $this->webpage['whereAmI'] = $this->BreadcrumbRoot($temporada); $this->webpage['whereAmI'] .= $this->listOneBreadcrumb('crear'); $this->webpage['tab_title'] .= ' - Crear'; $equipos = Club::get(); $tipos_torneo = TipoTorneo::get(); $tipos_torneos = TipoTorneo::with('fases.tipo_fase')->get(); $divisiones = Division::with("categoria")->get(); $this->data = array_merge(['webpage' => $this->webpage, 'equipos' => $equipos, 'temporada' => $temporada_id, 'tipos_torneo' => $tipos_torneo, 'tipos_torneos' => $tipos_torneos, 'divisiones' => $divisiones], $this->data); return view('admin.seasons.torneos.create', $this->data); }
public function editinstutedinfo($incode) { //saif for admin // $division= Institute::where('institute_code', '=', $incode) //$district= Institute::where('institute_code', '=', $incode) //$thana= Institute::where('institute_code', '=', $incode) $division = Division::all()->lists('id', 'Division'); $detailsinist = Institute::where('institute_code', '=', $incode)->first(); return view('admin.instutededit')->with('detailinf', $detailsinist)->with('division', $division); }
public function updateDivisiones($request, $id) { $divisiones = $request->input("divisiones"); foreach ($divisiones as $division_id) { if (!empty($division_id)) { $division = Division::find($division_id); $club_division = ClubDivision::where("club_id", $id)->where("categoria_id", $division->categoria_id)->first(); if (!sizeof($club_division)) { $club_division = new ClubDivision(); $club_division->club_id = $id; $club_division->division_id = $division_id; $club_division->categoria_id = $division->categoria_id; } else { $club_division->division_id = $division_id; } $club_division->save(); } } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $divisions = Division::all(); return view('pages/divisions', compact('divisions')); }
public function getDailyRoster() { $users = User::all(); $divisions = Division::all(); $monday = Carbon::now()->startofweek(); $planning = Planning::where('date', '=', Carbon::today())->where('status', '=', 2)->get(); return view('dailyroster', ['users' => $users, 'divisions' => $divisions, 'planning' => $planning, 'monday' => $monday]); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $temporada = Temporada::findOrFail($id); $categorias = Categoria::all(); $divisiones = Division::all(); $tipos_torneos = TipoTorneo::all(); $this->webpage['whereAmI'] .= $this->listOneBreadcrumb(strtolower($temporada->minimal_full_name), '', 1); $this->webpage['tab_title'] .= ' - ' . $temporada->full_name; $this->data = array_merge(['webpage' => $this->webpage, 'categorias' => $categorias, 'divisiones' => $divisiones, 'temporada' => $temporada, 'torneos' => $temporada->torneos, 'tipos_torneos' => $tipos_torneos], $this->data); return view('admin.seasons.temporadas.show', $this->data); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $divisions = Division::orderBy('division')->get(); return view('division.index', compact('divisions')); }
public function getInstitute() { $division = Division::all()->lists('id', 'Division'); $Isetting = Institute::where('institute_code', '=', Auth::user()->institute_id)->first(); $divisionName = Division::where('id', '=', $Isetting->division)->pluck('Division'); // return $Isetting->division; return view('admin.instituteSetting')->with('Isetting', $Isetting)->with('divisionlist', $division)->with('divisionName', $divisionName); }
public function setGerencias(Request $request) { $division = Division::where('division', Input::get('division'))->get(); $division = $division[0]['attributes']['id']; $gerencias = Gerencia::all()->where('division_id', $division); $departamentos = Departamento::all()->where('division_id', $division); if ($request->ajax()) { return response()->json(['gerencias' => $gerencias->toArray(), 'departamentos' => $departamentos->toArray()]); } }