Пример #1
0
    public function listA()
    {
        $allowances = Allowance::all();
        $data = "";
        foreach ($allowances as $a) {
            $data .= sprintf('
				<tr>
					<td>
						<p>Region: %s</p>
						<p>Lugar: %s</p>
					</td>
					<td>%s</td>
					<td>%s</td>
					<td><button class="btn btn-default setAllowance" data-id="%s" >Ok</button></td>
				</tr>
			', $a->region, $a->place, $a->value, $a->fondo, $a->id);
        }
        return $data;
    }
Пример #2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function form($type)
 {
     $requesters = Requester::all();
     $allowances = Allowance::all();
     $drivers = User::where('user_type_id', 4)->get();
     $cars = Car::where('status', 3)->get();
     if ($type == 1) {
         $uDts = User::where('user_type_id', 1)->get();
         $match = ['user_type_id' => 1, 'subtype' => 3];
         $uReport = User::where($match)->get();
         $gDts = Group::where('type', 1)->get();
         return view('admin.ots.formdt', compact('requesters', 'allowances', 'uDts', 'gDts', 'uReport', 'drivers', 'cars'));
     } elseif ($type == 2) {
         $gAsrs = Group::where('type', 2)->get();
         $uAsrs = User::where('user_type_id', 2)->get();
         return view('admin.ots.formAsr', compact('requesters', 'allowances', 'uAsrs', 'gAsrs', 'drivers', 'cars', 'jefe'));
     } elseif ($type == 3) {
         $uDts = User::where('user_type_id', 1)->get();
         $match = ['user_type_id' => 1, 'subtype' => 3];
         $uReport = User::where($match)->get();
         $gDts = Group::where('type', 1)->get();
         return view('admin.ots.formBch', compact('requesters', 'allowances', 'uDts', 'gDts', 'uReport', 'drivers', 'cars'));
     }
 }