public function areaporAplicativo() { $area = Area::all(); //->lists('id','nombre_area'); $mensaje = ""; return view('persona.create_Aplicativo_area', compact('mensaje', 'area')); }
public function update($id) { $territory = Territory::findOrFail($id); $areas = Area::all(); $dataView = ['territory' => $territory, 'areas' => $areas]; return view('admin.territory.edit', $dataView); }
public function getRegister() { $presupuestos = DB::table('areas')->join('presupuestos', 'areas.id', '=', 'presupuestos.area')->select('*')->get(); $areas = Area::all(); //dd($operaciones); return view('presupuestos.registrar')->with(compact(['presupuestos', 'areas'])); }
public function edit($id) { $request = Request::with(['equipment', 'area', 'location', 'category', 'uploads', 'approvers', 'status', 'actions' => function ($query) { $query->orderBy('created_at', 'desc'); }, 'actions.submitted', 'comments.author' => function ($query) { $query->orderBy('created_at', 'asc'); }])->find($id); if (is_null($request)) { return view('security.not-found'); } $data['request'] = $request; $data['areas'] = Area::all(['id', 'name']); $data['organizations'] = Organization::all(); $data['categories'] = Category::all(['id', 'name']); $data['locations'] = Location::all(['id', 'name']); $data['approvers'] = Approval::getRecent($id); $data['hasApproved'] = Approval::hasApproved($id)->exists(); if ($request->Status->name == 'Approved') { return view('request.view', $data); } if ($request->submitted_by != Auth::User()->id && !Auth::User()->hasRole(['administrator', 'approver'])) { return view('security.401'); } return view('request.edit', $data); }
/** * Run the migrations. * * @return void */ public function up() { foreach (\App\Area::all() as $are) { $are->position = preg_replace("/[\\n\\r\\s]+/", "", $are->position); $are->save(); } }
public function update($id) { $territory = Territory::findOrFail($id); $areas = Area::all(); $MRs = Employee::where('level_id', 7)->active()->get(); $dataView = ['territory' => $territory, 'areas' => $areas, 'MRs' => $MRs]; return view('admin.territory.edit', $dataView); }
/** * 地下城进入首页 */ public function index() { // 取得全部可进入的区域 $lstAreas = Area::all(); foreach ($lstAreas as $objArea) { // 取得该Area的全部地下城 $lstDungeons = Dungeon::where("area_id", $objArea->id)->get(); foreach ($lstDungeons as $objDungeon) { echo "<a href='dungeon/entry?player_id={$this->_intPlayerId}&device_id={$this->_strDeviceId}&area_id={$objArea->id}&dungeon_id={$objDungeon->id}'>进入[{$objArea->name_cn}][{$objDungeon->name_cn}]</a>"; echo "<br />"; } } }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $waiterArea = WaiterArea::findorfail($id); $areas = Area::all(); $data['areas'] = $areas; $data['waiterArea'] = $waiterArea; return View('waiterArea.edit')->with($data); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $areas = Area::all(); return view('admin.area.area', compact('areas')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { return Area::all(); }
public function getRegister() { $areas = Area::all(); return view('areas.registrar', ['areas' => $areas]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $professor = Professor::with('areas')->findOrFail($id); $areas = Area::all(); return view('professors.edit', compact('professor', 'areas')); }
public function getGCFinanciero() { $areas = Area::all(); return view('indicadores.gestion-calidad.info-financiero')->with(compact(['areas'])); }
public function trainerAdd() { $this->info['namespace'] = "trainerIndex"; $this->info['arii'] = Area::all(); $this->info['title'] = "Adauga Training | " . $this->info['title']; return view('trainerPages.add', ['info' => $this->info]); }
/** * 创建区域 * @return mixed */ public function areaCreate() { return view('admin.dungeon.area-create')->withAreas(Area::all()); }
public function __construct() { $variable10 = Image::where("filename", "=", 'fcytlogo')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'fcytlogo'; $variable10->filename = 'fcytlogo'; $variable10->save(); } $variable10 = Image::where("filename", "=", 'fcyt')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'fcyt'; $variable10->filename = 'fcyt'; $variable10->save(); } $variable10 = Image::where("filename", "=", 'organigramafcyt')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'organigramafcyt'; $variable10->filename = 'organigramafcyt'; $variable10->save(); } $variable10 = Image::where("filename", "=", 'avatar1')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'avatar1'; $variable10->filename = 'avatar1'; $variable10->save(); } $variable10 = Image::where("filename", "=", 'avatar2')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'avatar2'; $variable10->filename = 'avatar2'; $variable10->save(); } $variable10 = Image::where("filename", "=", 'avatar3')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'avatar3'; $variable10->filename = 'avatar3'; $variable10->save(); } $variable10 = Image::where("filename", "=", 'avatar4')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'avatar4'; $variable10->filename = 'avatar4'; $variable10->save(); } $variable10 = Image::where("filename", "=", 'avatar5')->first(); if (empty($variable10)) { $variable10 = new Image(); $variable10->original_name = 'avatar5'; $variable10->filename = 'avatar5'; $variable10->save(); } $variable9 = Configuracion::where("estado", "=", 1)->first(); //$variable9= Configuracion::all()->last(); if (empty($variable9)) { $Configuracion = new Configuracion(); $Configuracion->nombre = 'lugrawibe'; $Configuracion->estado = 1; $Configuracion->logo = 'fcytlogo'; $Configuracion->facultad = 'fcyt'; $Configuracion->organigrama = 'organigramafcyt'; $Configuracion->imgenuno = 'avatar1'; $Configuracion->imgendos = 'avatar2'; $Configuracion->imgentres = 'avatar3'; $Configuracion->imgencuatro = 'avatar4'; $Configuracion->imgencinco = 'avatar5'; $Configuracion->save(); $variable9 = Configuracion::findOrFail($Configuracion->id); } $variable8 = Materium::all()->last(); if (!empty($variable8)) { $variable8 = $variable8->codigo + 1; } if (empty($variable8)) { $variable8 = 400; } $variable7 = Sistemapg::all()->last(); if (!empty($variable7)) { $variable7 = $variable7->nombre_de_facultad; } if (empty($variable7)) { $Sistema = new Sistemapg(); $Sistema->nombre_de_facultad = 'Lugrawibe'; $Sistema->save(); $variable7 = 'Lugrawibe'; } $variable6 = Autoridad::all()->last(); if (!empty($variable6)) { $variable6 = $variable6->codigo + 1; } if (empty($variable6)) { $variable6 = 400; } $variable5 = Docente::all()->last(); if (!empty($variable5)) { $variable5 = $variable5->codigo + 1; } if (empty($variable5)) { $doc = new Docente(); $doc->nombre = 'por designar'; $doc->codigo = 399; $doc->save(); $variable5 = 400; } $variable4 = Carrera::all()->last(); if (!empty($variable4)) { $variable4 = $variable4->codigo + 1; } if (empty($variable4)) { $variable4 = 400; } $variable3 = Area::all()->last(); if (!empty($variable3)) { $variable3 = $variable3->codigo + 1; } if (empty($variable3)) { $variable3 = 400; } $variable2 = tema::all()->last(); if (!empty($variable2)) { $variable2 = $variable2->tema; } if (empty($variable2)) { $tema = new tema(); $tema->tema = 'skin-black'; $tema->menu = 'sidebar-mini'; $tema->save(); $variable2 = 'skin-black'; } $variable1 = tema::all()->last(); if (!empty($variable1)) { $variable1 = $variable1->menu; } if (empty($variable1)) { $variable1 = 'sidebar-mini'; } $variablefecha = Carbon::now(); $variablefecha = $variablefecha->format('d-m-Y'); View::share('variablefecha', $variablefecha); View::share('variable1', $variable1); View::share('variable2', $variable2); View::share('variable3', $variable3); View::share('variable4', $variable4); View::share('variable5', $variable5); View::share('variable6', $variable6); View::share('variable7', $variable7); View::share('variable8', $variable8); View::share('variable9', $variable9); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($date, $area, $professorId = null) { if ($professorId == null) { } $insert_control = Insert_control::where('period', $date)->first(); if ($insert_control == null) { $insert_control = 0; } else { $insert_control = $insert_control->available; } $userRole = Auth::user()->role()->first()->name; $dateExp = explode("-", $date); $year = $dateExp[0]; $semester = $dateExp[1]; $professor = Professor::find($professorId); $professorFromAreas = Area::where('name', $area)->first()->professors()->get(); $arrayProfessors = array(); foreach ($professorFromAreas as $professorFromArea) { $arrayProfessors[$professorFromArea->id] = $professorFromArea->name; } if (!isset($professor)) { $status = 1; $arrayProfessorss = $arrayProfessors; $arrayProfessorss[""] = ""; return view('schedules.show', compact("status", "year", "semester", "arrayProfessorss")); } $todasAreas = Area::all()->toArray(); $arrayAreas = array(); foreach ($todasAreas as $unArea) { $arrayAreas[$unArea['id']] = $unArea['name']; } $professorLoad = 0; $arrayCourses = array(); $areaCourses = Course::join('areas', 'areas.id', '=', 'courses.area_id')->where('areas.name', $area)->where('courses.year', $year)->where('courses.semester', $semester)->select('courses.id', 'courses.year', 'courses.semester', 'areas.name', 'courses.branch', 'courses.section', 'courses.code', 'courses.schedule')->get(); $courseSelect = array(); foreach ($areaCourses as $oneCourse) { if (count($oneCourse->schedule()->groupBy('professor_id')->get()) == 0) { $courseSelect[$oneCourse->id] = $oneCourse->code . "-" . $oneCourse->section . "-" . $oneCourse->year . "-" . $oneCourse->semester . " " . $oneCourse->branch . " (" . $oneCourse->schedule . ")"; } } $schedules = Schedule::join('courses', 'courses.id', '=', 'schedules.course_id')->where('schedules.professor_id', $professorId)->where('courses.year', $year)->where('courses.semester', $semester)->get(); foreach ($schedules as $schedule) { $course = array(); $code = $schedule->course()->first()->code; $course['name'] = $schedule->course()->first()->name; $course['area'] = $arrayAreas[$schedule->course()->first()->area_id]; $course['branch'] = $schedule->course()->first()->branch; $course['section'] = $schedule->course()->first()->section; $course['semester'] = $schedule->course()->first()->semester; $course['id'] = $schedule->course()->first()->id; $course['year'] = $schedule->course()->first()->year; $course['schedule'] = explode("-", $schedule->course()->first()->schedule); $course['code'] = $code; $arrayCourses[$code . "-" . $course['section']] = $course; // $professorLoad = $professorLoad + count($course['schedule'])*22.5; foreach ($course['schedule'] as $horario) { $array[$horario] = $course['code'] . "-" . $course['section']; } } $schedulesYear = Schedule::join('courses', 'courses.id', '=', 'schedules.course_id')->where('schedules.professor_id', $professorId)->where('courses.year', $year)->get(); foreach ($schedulesYear as $sche) { $professorLoad = $professorLoad + count(explode("-", $sche->course()->first()->schedule)) * 22.5; } if ($semester == 1) { $nextSemester = 2; $nextYear = $year; $previewsYear = $year - 1; } else { $nextSemester = 1; $nextYear = $year + 1; $previewsYear = $year; } $nextDate = $nextYear . "-" . $nextSemester; $previewsDate = $previewsYear . "-" . $nextSemester; $urlAnterior = "schedules/{$previewsDate}/{$area}/{$professor->id}"; $urlSiguiente = "schedules/{$nextDate}/{$area}/{$professor->id}"; return view('schedules.show', compact('year', 'semester', 'urlAnterior', 'urlSiguiente', 'professor', 'courseSelect', 'arrayCourses', 'arrayProfessors', 'array', 'area', 'professorLoad', 'userRole', 'insert_control')); }
public function listAll() { $areas = Area::all(); $dataView = ['areas' => $areas]; return view('admin.area.list', $dataView); }
public function checkout(Request $request) { //if cart is set then checkout //** if cod set payment status to cod if ($cart = Cart::content()) { //check for payment success $checkout = true; //user paymet success $payment_type = 'cod'; if ($checkout) { //get the user who made purchase $user = Sentinel::check(); //check if temp address is isset if ($request->session()->has('tmp_address')) { // $address = $request->session()->get('tmp_address'); } else { $address = $user->address; } if ($area_id = $user->area_id) { //$delivery_cost = $areas->find($area_id)->delivery_cost; } elseif ($area_id = $request->session()->get('deli_area')) { //$delivery_cost = $areas->find($area_id)->delivery_cost; } else { $area_id = "unknown"; } //dd($address); if ($request->session()->has('deli_time')) { // $deli_id = $request->session()->get('deli_time'); $dt = DB::table('deliverytimes')->where('id', $deli_id)->first(); } else { $dt = DB::table('deliverytimes')->first(); } //dd($dt); if ($dt) { $start = Carbon::parse($dt->start)->format('h:ia'); $stop = Carbon::parse($dt->stop)->format('h:ia'); $delivery_time = $start . '-' . $stop; } else { $start = Carbon::now()->format('h:ia'); $stop = Carbon::now()->format('h:ia'); $delivery_time = $start . '-' . $stop; } //dd($delivery_time); $total = Cart::total(); $areas = Area::all(); //calculate the total and delivery cost if ($total < 250) { if ($area_id) { $delivery_cost = $areas->find($area_id)->delivery_cost; } else { $delivery_cost = "0"; } } else { $delivery_cost = "0"; } $total = $total + $delivery_cost; //dd($total); //create checkout and set user to it and also set payment status $checkout = Checkout::create(['user_id' => $user->id, 'area_id' => $area_id, 'payment' => false, 'payment_type' => $payment_type, 'status' => 'not confirmed', 'deliverytime' => $delivery_time, 'total' => $total]); //dd($checkout); //if address is set then add to checkout if ($address) { $checkout->address = $address; $checkout->save(); } if ($checkout) { //create order list foreach ($cart as $order) { //dd($order); $newOrderinput = ['checkout_id' => $checkout->id, 'product_id' => $order->id, 'nos' => $order->qty, 'offer_name' => $order->offer_name, 'offered_price' => $order->price, 'pqty' => $order->options->pqty . $order->options->pqunit]; //insert offer name if ($offer_name = $order->offer_name) { $newOrderinput['offer_name'] = $offer_name; } else { $newOrderinput['offer_name'] = "no offer"; } //dd($newOrderinput); Order::create($newOrderinput); } } $checkout->status = "Order Placed"; $checkout->save(); Cart::destroy(); if ($user = Sentinel::check()) { $user = User::findorfail($user->id); Event::fire(new MadeCheckout($user, $checkout)); //temp cart gets deleted in the listener } //clear cart data } } $notification = "Thankyou. Your order has been successfully placed. <br> Continue <a href='/'>shopping</a>."; return view('site.notification', compact('notification')); }