<?php // Import all the models we need. use App\Worker; use App\Institution; use App\Client; use App\User; use App\CashboxTransaction; use App\Sale; // Get the workers. // TODO: Once permissions have been figured out filter only workers who have cashboxes. $workers = Worker::all(); // Get transactions. $defaultStartDate = date('Y-m-d', strtotime(date('Y-m-d') . '-1 days')); $defaultEndDate = date('Y-m-d H:i:s'); ?> <script src="{{ URL::to('/') }}/js/reservations.js"></script> <div class="main hideable hide" id="reservations"> <div class="main-inner"> <div class="container"> <div class="row"> <div class="span6"> <div class="row-fluid v-offset-2"> <div class="control-group span12"> <div class="center" style="width:280px"> <a type="button" class="btn btn-info" href="#history"> <i class="icon-list-alt"></i> Transacciones </a> <a type="button" class="btn btn-info" href="#contracts"> <i class="icon-legal"></i> Contratos </a>
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return Worker::all(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $workers = Worker::all(); $topWorkers = DB::select('CALL top_10_workers()'); return View::make('worker.all', ['workers' => $workers, 'topWorkers' => $topWorkers, 'category' => 2]); }
/** * Show the form for creating a new resource. * @param Request $request * @return Response */ public function postRelated(Request $request) { $people = People::all(); $worker = Worker::all(); $ids = array(); for ($i = 0; $i < $worker->count(); $i++) { for ($j = 0; $j < $people->count(); $j++) { if ($people->get($j)->id == $worker->get($i)->people_id) { $ids[] = $people->get($j)->id; } } } $people = People::whereNotIn('id', $ids)->get(); $branch = Branch::findOrFail($request->get('id')); return view('admin.listpeople', compact('people', 'branch')); }