public function edit($id) { $access = Access::findOrFail($id); $client = Client::all()->lists('name', 'id'); $selected = array(); return view('access.edit', compact('access', 'client', 'selected')); }
/** * Show the application dashboard. * * @return Response */ public function index() { $clients = Client::all(); $projects = Project::all(); $notes = ClientNote::all(); return view('home')->with('clientCount', count($clients))->with('projectCount', count($projects))->with('noteCount', count($notes)); }
public function index() { if (Auth::user()['role'] == 'Accounting' or Auth::user()['role'] == 'General Manager') { $clients = Client::all(); $overdue = new SalesInvoice(); $delivered = new SalesInvoice(); $check = new SalesInvoice(); $salesinvoice = new SalesInvoice(); $salesinvoice2 = new SalesInvoice(); $salesinvoice3 = new SalesInvoice(); $salesinvoiceTotal; foreach ($clients as $client) { $overdue[$client->id] = SalesInvoice::where('client_id', $client->id)->where('status', 'Overdue')->count(); $delivered[$client->id] = SalesInvoice::where('client_id', $client->id)->where('status', 'Delivered')->count(); $check[$client->id] = SalesInvoice::where('client_id', $client->id)->where('status', 'Check on Hand')->count(); // $salesinvoice[$client->id] = DB::SELECT("SELECT sum(total_amount) as total FROM sales_invoices // WHERE (status = 'Overdue' or status = 'Delivered') and client_id = '$client->id'"); $salesinvoice = SalesInvoice::where('status', '=', 'Overdue')->where('client_id', '=', $client->id)->sum('total_amount'); $salesinvoice2 = SalesInvoice::where('status', 'Delivered')->where('client_id', $client->id)->sum('total_amount'); $salesinvoice3 = SalesInvoice::where('status', 'Check on Hand')->where('client_id', $client->id)->sum('total_amount'); $salesinvoiceTotal[$client->id] = $salesinvoice + $salesinvoice2 + $salesinvoice3; //$salesinvoice[$client->id] = SalesInvoice::where('status = Overdue or status = Delivered and client_id = '.$client->id.'')->sum('total_amount'); } // for ($x = 1; $x < count($clients)+1; $x++) // { // $overdue[$x] = SalesInvoice::where('client_id', $x)->where('status', 'Overdue')->count(); // $delivered[$x] = SalesInvoice::where('client_id', $x)->where('status', 'Delivered')->count(); // $pending[$x] = SalesInvoice::where('client_id', $x)->where('status', 'Pending')->count(); // } return view('collectibles.index', compact('clients', 'overdue', 'delivered', 'check', 'salesinvoiceTotal')); } }
public function destroy($id) { $client = Client::find($id); $client->delete(); $clients = Client::all(); return view('client.list')->with(['success' => 'Cliente excluído com sucesso!', 'clients' => $clients]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { if (Gate::denies('viewClients', new Client())) { abort(403, 'Not allowed'); } $clients = Client::all(); return View::make('client.index')->with('clients', $clients); }
public function index(Request $request) { if ($request->ajax()) { $handler = Input::get('handler'); if ($handler == 0) { $clients = Client::all(); } elseif ($handler == 1) { $clients = Client::where('active', true)->get(); } else { $clients = Client::where('active', false)->get(); } return view('clients.table', ['clients' => $clients]); } else { $clients = Client::all(); return view('clients.index', ['clients' => $clients]); } }
/** * Show the form for creating a new resource. * * @return Response */ public function create(Request $request, $project_id = null) { if ($project_id != null) { $project = Project::find($project_id); // Get all clients for dropdown $clients = Client::all(); } else { $this->sys_notifications[] = array('type' => 'danger', 'message' => '<i class="fa fa-warning"></i> Projeto não informado!'); $request->session()->flash('sys_notifications', $this->sys_notifications); return back()->withInput($request->all()); } if ($request->ajax()) { return view('project_stages.create-modal', compact('project', $project)); } else { return view('project_stages.create', compact('project', $project)); } }
public function index(Request $request) { $sort = Input::get('sort') == null ? 'relation_id' : Input::get('sort'); $client_id_select = Input::get('client_id_select') == null ? 'all' : Input::get('client_id_select'); $countCongestion = Input::get('count_congestion') == null ? 'balance_owed' : Input::get('count_congestion'); $sortDirection = Input::get('sortDirection') == null ? 'DESC' : Input::get('sortDirection'); $clients = Client::all(); $debtors = Debtor::all(); $limits = Limit::whereHas('relation', function ($query) use($client_id_select) { if ($client_id_select !== 'all') { $query->where('client_id', '=', $client_id_select); } })->get(); $usedLimit = array(); foreach ($limits as $key => $limit) { $usedLimitItem = 0; foreach ($limit->relation->deliveries as $value) { if ($value->status == 'Профинансирована') { if ($countCongestion == 'remainder_of_the_debt_first_payment') { $usedLimitItem += $value->remainder_of_the_debt_first_payment; } else { $usedLimitItem += $value->balance_owed; } } } $usedLimit[$key] = $usedLimitItem; } $relations = Relation::select('client_id')->distinct()->get(); if ($request->ajax()) { if ($sort == 'client_id') { return view('limits.indexAjaxClient', ['clients' => $clients, 'countCongestion' => $countCongestion]); } else { if ($sort == 'debtor_id') { return view('limits.indexAjaxDebtor', ['countCongestion' => $countCongestion, 'debtors' => $debtors]); } else { return view('limits.indexAjax', ['limits' => $limits, 'relations' => $relations, 'usedLimit' => $usedLimit]); } } } else { return view('limits.index', ['limits' => $limits, 'relations' => $relations, 'usedLimit' => $usedLimit, 'clients' => $clients]); } }
/** * Display a list of Client's name * @return static */ public function client() { return Client::all()->lists('name', 'name')->sort(); }
public function index() { $clients = Client::all(); $leftmenu['client'] = 'active'; return view('/clients/clients', ['clients' => $clients, 'leftmenu' => $leftmenu]); }
/** * Display the specified resource. * Last updated by smartrahat Date: 29.11.2015 Time: 05:51PM * @param int $id * @return Response */ public function show($id) { $title = 'SHOW VEHICLE'; $vehicle = Vehicles::findOrFail($id); $client = Client::all()->where('id', $vehicle->cid)->sortByDesc('updated_at')->first(); $driver = Employee::all()->where('id', $vehicle->eid)->sortByDesc('updated_at')->first(); $fitness = Log::all()->where('action', 'Fitness Check')->where('bid', $vehicle->id)->last(); $police = Log::all()->where('action', 'Police Case')->where('bid', $vehicle->id)->sortByDesc('updated_at')->count(); $accident = Log::all()->where('action', 'Accident')->where('bid', $vehicle->id)->sortByDesc('updated_at')->count(); //dd($accident); $repository = $this->repository; return view('vehicle.show', compact('title', 'vehicle', 'driver', 'client', 'status', 'repository', 'fitness', 'police', 'accident')); }
public function getRegistrar() { $clientes = Client::all(); return view('cliente.clientes', ['clientes' => $clientes]); }
public function seed(Request $request) { if ($request->ajax()) { if ($request->q) { $clients = Client::where('firm_name', 'LIKE', '%' . $request->q . '%')->orwhere('last_name', 'LIKE', '%' . $request->q . '%')->get(); } else { $clients = Client::all(); } $list = array(); foreach ($clients as $key => $value) { $list[$key]['id'] = $value->id; $list[$key]['text'] = '#' . $value->id . ' ' . $value->last_name . ' - ' . strtoupper($value->firm_name); } return $list; } // return Client::select('id', \DB::raw('CONCAT(firm_name, " ", first_name, " ", last_name) as full_name'))->pluck('full_name', 'id'); }
public function index() { // \Auth::user()->name; //get name of Auth user $clients = Client::all(); return view('clients.index', compact('clients', 'client')); }
/** * Display a listing of the resource.Andrei111111 * * @return \Illuminate\Http\Response */ public function index() { $clients = Client::all(); return view('clients.index', ['clients' => $clients, 'count' => Client::count()]); }
public function client_report() { parent::$_data['client'] = Client::all(); return view("report.client_report", parent::$_data); }
public function getAll() { return Client::all(); }
/** * Show Partners page * * @return $this */ public function viewPartners() { $pageContent = Page::where('slug', 'partners')->get()->first(); $data = ['parentPage' => 'Company', 'page' => 'Partners', 'title' => 'Teleaus | Partners Page', 'clients' => Client::all(), 'pageContent' => $pageContent]; return view('partners')->with($data); }
static function clientList() { $clients = Client::all(); return $clients; }
/** * Display records of a specified driver. * * @param int $id * @return \Illuminate\View\View */ public function show($id) { $employee = Employee::query()->findOrFail($id); $title = $employee['name']; $client = Client::all()->where('id', $employee['cid'])->sortByDesc('updated_at')->first(); $vehicle = Vehicles::all()->where('eid', $employee['id'])->sortByDesc('updated_at')->first(); $police = Log::all()->where('action', 'Police Case')->where('eid', $employee['id'])->sortByDesc('updated_at')->count(); $accident = Log::all()->where('action', 'Accident')->where('eid', $employee['id'])->sortByDesc('updated_at')->count(); $repository = $this->repository; return view('employee.show', compact('title', 'employee', 'vehicle', 'client', 'status', 'repository', 'accident', 'police')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $allClients = Client::all(); return $allClients; }
/** * get all client * @return \Illuminate\Http\JsonResponse */ public function index() { $client = Client::all(); return response()->json($client); }
private function _client() { $client = Client::all(); $res = []; foreach ($client as $key => $value) { # code... $res[$value['id_client']] = $value['nama_pt']; } return $res; }
public function quotation() { if (Auth::user()['role'] == 'Sales') { $clientOptions = Client::where('user_id', Auth::user()['id'])->lists('name', 'id'); } else { $clientOptions = Client::all()->lists('name', 'id'); } $supplierOptions = Supplier::all()->lists('name', 'id'); $supplierOptions["none"] = "NONE"; $supplierOptions1 = Supplier::all()->lists('name', 'id'); $itemOptions = DB::table('items')->where('deleted_at', null)->orderBy('name', 'asc')->lists('name', 'id'); return view('sales_invoices.quotation', compact('supplierOptions', 'itemOptions', 'clientOptions', 'supplierOptions1')); }
public function checkAccess() { $clients = Client::all(); foreach ($clients as $client) { $hash = $client->hash; foreach ($client->series as $series) { $url = 'http://training.gpilearn.com/GPiLearn63814304e967a2.' . $hash . '/gpi/en/' . $series->code . '/hasAccess.html'; echo $url; $guzzle = new Guzzle(['http_errors' => false]); $response = $guzzle->request('GET', $url); if ($response->getStatusCode() == 200) { $client->series()->updateExistingPivot($series->id, array('is_accessible' => true), false); } else { $client->series()->updateExistingPivot($series->id, array('is_accessible' => false), false); } } } }
/** * Display a listing of the resource. * * @return Response */ public function index() { return \App\Client::all(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $clients = Client::all(); return view()->make('clients.index')->with('clients', $clients); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $clients = Client::all(); return view('clients.index', compact('clients')); }
public function index() { $clients = Client::all(); $debtors = Debtor::all(); return view('chargeCommission.index', ['debtors' => $debtors, 'clients' => $clients]); }
public function getIndexRepayment() { $repayments = Repayment::OrderBy('date')->get(); $clients = Client::all(); $debtors = Debtor::all(); return view('repayment.tableRepaymentRow', ['repayments' => $repayments, 'clients' => $clients, 'debtors' => $debtors]); }