Exemplo n.º 1
0
 public function edit($id)
 {
     $activity = Activity::find($id);
     $cars = Car::lists('name', 'id');
     $customers = Customer::lists('name', 'id');
     $locations = Location::lists('name', 'id');
     $costs = null;
     $items = null;
     $ondayOtherCosts = null;
     if ($activity->type == "On Day") {
         $data = Onday::where('activity_id', '=', $id)->get()->pop();
         $ondayOtherCosts = OndayOtherCost::where('onday_id', $data->id)->get();
     } else {
         if ($activity->type == "Maintenance") {
             $data = Maintenance::where('activity_id', '=', $id)->get()->pop();
             $costs = $activity->maintenance->items;
             $items = Item::lists('name', 'id')->sort();
         } else {
             if ($activity->type == "Nil") {
                 $data = Nil::where('activity_id', '=', $id)->get()->pop();
             }
         }
     }
     return view('activity.edit', ['activity' => $activity, 'data' => $data, 'cars' => $cars, 'customers' => $customers, 'locations' => $locations, 'costs' => $costs, 'items' => $items, 'ondayOtherCosts' => $ondayOtherCosts]);
 }
 /**
  * User chose single employee from dropdown to be edited
  *
  * @param Request $request
  * @return mixed
  */
 public function doChooseEmployee(Request $request)
 {
     $employee = Employee::find($request->input('choose'));
     $dept = ['' => 'Choose...'] + Department::lists('name', 'id')->all();
     $location = ['' => 'Choose...'] + Location::lists('name', 'id')->all();
     return view('admin.edit-employee', compact('dept', 'location', 'employee'));
 }
Exemplo n.º 3
0
 public function addProducts($id)
 {
     $requesition = $this->requesition->with(['items'])->where('id', $id)->first();
     $locations = Location::lists('name', 'id');
     $locationLists = [null => trans('main.label.select')];
     if ($locations != null) {
         $locationLists = $locationLists + $locations->toArray();
     }
     return view('requesitions.add_product', ['requesition' => $requesition, 'items' => $requesition->items, 'locationLists' => $locationLists]);
 }
Exemplo n.º 4
0
 public function processOndayFormView()
 {
     $activities = Activity::orderBy('created_at', 'desc')->take(10)->get();
     $customers = Customer::lists('name', 'id');
     $locations = Location::lists('name', 'id')->sort();
     $activity = Session::get('activity');
     $ondayOtherCostItems = OndayOtherCostItem::lists('name', 'id');
     // Session::forget('activity');
     return view('home', ['type' => '1', 'activity' => $activity, 'customers' => $customers, 'locations' => $locations, 'activities' => $activities, 'ondayOtherCostItems' => $ondayOtherCostItems]);
 }
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function scraper()
 {
     $success = '';
     $groups = Group::lists('name', 'group_id');
     $locations = Location::lists('location', 'location_id');
     //$tournaments = Tournament::orderBy('start_date', 'desc')
     //	->lists('name','tournament_id');
     $tournaments = Tournament::selectRaw('CONCAT(name, " (", start_date, ")") as name, tournament_id')->orderBy('start_date', 'desc')->lists('name', 'tournament_id');
     $players = Player::select('first_name', 'last_name', 'player_id', \DB::raw('CONCAT(first_name, " ", last_name) as full_name'))->orderBy('first_name')->orderBy('last_name')->get()->lists('full_name', 'player_id');
     return view('admin.scraper', compact('groups', 'locations', 'tournaments', 'players', 'success'));
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $locations = Location::lists('id')->all();
     $limit = 3;
     foreach ($locations as $location) {
         for ($i = 0; $i < $limit; $i++) {
             DB::table('stories')->insert(['location_id' => $location, 'title' => $faker->sentence, 'story' => $faker->text, 'published' => $faker->boolean]);
         }
     }
 }
Exemplo n.º 7
0
 public function addProducts($id)
 {
     $receive = Receive::with(['receiveItems', 'receiveItems.product', 'receiveItems.product.unit'])->whereId($id)->whereStatus(Receive::CREATE)->first();
     if ($receive == null) {
         flash()->error(trans('receive.label.name'), trans('receive.message_alert.warning_receive_is_not_create'));
         return redirect()->back();
     }
     $locations = Location::lists('name', 'id');
     $locationLists = [null => trans('main.label.select')];
     if ($locations != null) {
         $locationLists = $locationLists + $locations->toArray();
     }
     $receiveItems = $receive->receiveItems()->orderBy('id', 'asc')->get();
     return view('receives.add_product', compact('receive', 'products', 'locationLists', 'receiveItems'));
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $locations = App\Location::lists('name', 'id');
     $subcontractors = App\Subcontractor::lists('subcontractor_name', 'id');
     return view('assignments.create', compact('locations', 'locations', 'subcontractors', 'subcontractors'));
 }
Exemplo n.º 9
0
 public function edit($id)
 {
     $chart = Chart::findOrFail($id);
     $locations = Location::lists('name', 'id');
     $units = ChartUnit::lists('unit', 'id');
     $types = ChartType::lists('type', 'id');
     $auth = $chart->auth;
     $visible = $chart->visible;
     return view('partials.editChart', compact('chart', 'locations', 'units', 'types', 'auth', 'visible'));
 }
Exemplo n.º 10
0
 public function index()
 {
     JavaScript::put(['loggedIn' => Auth::check()]);
     $locations = Location::lists('name', 'id');
     return View::make('home', compact('locations'));
 }
Exemplo n.º 11
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $locations = Location::lists('name', 'id');
     $payment_methods = Payment_Method::lists('name', 'id');
     $all_memberships = Membership::orderBy('created_at', 'desc')->get();
     $memberships = $all_memberships->lists('name', 'id');
     $admins = User::Admins()->get();
     $supervisors = $admins->lists('fullname', 'id');
     $instructors = User::Instructors()->get()->lists('fullname', 'id');
     $class = Classe::findOrFail($id);
     return view('classes.edit', compact('class', 'locations', 'payment_methods', 'supervisors', 'memberships', 'instructors'));
 }