/** * Show the form for editing the specified booking. * * @param int $id * @return Response */ public function edit($id) { $booking = Booking::find($id); $clients = Client::all(); $cars = Car::all(); return View::make('bookings.edit', compact('booking', 'cars', 'clients')); }
public function __construct() { parent::__construct(); /* This checks the client list for the CID. If a matching CID is found, all caching will be ignored for this request */ if (Cache::has('clients')) { $clients = Cache::get('clients'); } else { $clients = Client::all(); Cache::put('clients', $clients, 1); } if (Cache::has('keys')) { $keys = Cache::get('keys'); } else { $keys = Key::all(); Cache::put('keys', $keys, 1); } $input_cid = Input::get('cid'); if (!empty($input_cid)) { foreach ($clients as $client) { if ($client->uuid == $input_cid) { $this->client = $client; } } } $input_key = Input::get('k'); if (!empty($input_key)) { foreach ($keys as $key) { if ($key->api_key == $input_key) { $this->key = $key; } } } }
/** * Show the form for editing the specified order. * * @param int $id * @return Response */ public function edit($id) { $items = Item::all(); $customers = Client::all(); $order = Order::findOrFail($id); return View::make('orders.edit', compact('items', 'customers', 'order')); }
public function clients() { $clients = Client::all(); $organization = Organization::find(1); $pdf = PDF::loadView('erpreports.clientsReport', compact('clients', 'organization'))->setPaper('a4')->setOrientation('potrait'); return $pdf->stream('Client List.pdf'); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $project = Project::find($id); $services = Service::all(); $clients = Client::all(); return View::make('projects.edit')->withProject($project)->withService($services)->withClients($clients); /*return $clients;*/ }
function __construct() { parent::__construct(); $this->view_data['core_settings'] = Setting::first(); if ($this->input->cookie('language') != "") { $language = $this->input->cookie('language'); } else { if (isset($this->view_data['language'])) { $language = $this->view_data['language']; } else { if (!empty($this->view_data['core_settings']->language)) { $language = $this->view_data['core_settings']->language; } else { $language = "english"; } } } $this->lang->load('application', $language); $this->lang->load('messages', $language); $this->lang->load('event', $language); $this->user = $this->session->userdata('user_id') ? User::find_by_id($this->session->userdata('user_id')) : FALSE; $this->client = $this->session->userdata('client_id') ? Client::find_by_id($this->session->userdata('client_id')) : FALSE; if ($this->client) { $this->theme_view = 'application_client'; } $this->view_data['datetime'] = date('Y-m-d H:i', time()); $this->view_data['sticky'] = Project::all(array('conditions' => 'sticky = 1')); $this->view_data['quotations_new'] = Quote::find_by_sql("select count(id) as amount from quotations where status='New'"); if ($this->user || $this->client) { $access = $this->user ? $this->user->access : $this->client->access; $access = explode(",", $access); if ($this->user) { $this->view_data['menu'] = Module::find('all', array('order' => 'sort asc', 'conditions' => array('id in (?) AND type = ?', $access, 'main'))); $this->view_data['widgets'] = Module::find('all', array('conditions' => array('id in (?) AND type = ?', $access, 'widget'))); } else { $this->view_data['menu'] = Module::find('all', array('order' => 'sort asc', 'conditions' => array('id in (?) AND type = ?', $access, 'client'))); } if ($this->user) { $update = User::find($this->user->id); } else { $update = Client::find($this->client->id); } $update->last_active = time(); $update->save(); if ($this->user) { $this->view_data['user_online'] = User::all(array('conditions' => array('last_active+(30 * 60) > ? AND status = ?', time(), "active"))); $this->view_data['client_online'] = Client::all(array('conditions' => array('last_active+(30 * 60) > ? AND inactive = ?', time(), "0"))); } $email = $this->user ? 'u' . $this->user->id : 'c' . $this->client->id; $this->view_data['messages_new'] = Privatemessage::find_by_sql("select count(id) as amount from privatemessages where `status`='New' AND recipient = '" . $email . "'"); $this->view_data['tickets_new'] = Ticket::find_by_sql("select count(id) as amount from tickets where `status`='New'"); } /*$this->load->database(); $sql = "select * FROM templates WHERE type='notes'"; $query = $this->db->query($sql); */ $this->view_data["note_templates"] = ""; //$query->result(); }
public function clientList($id = null) { if ($id == null) { $clients = Client::all(array('id', 'name')); } else { $clients = Client::where('id_user', '=', Auth::user()->id)->get(array('id', 'name')); } $clientsRow = array(); $clientsRow[0] = "Cliente"; foreach ($clients as $client) { $clientsRow[$client["id"]] = $client["name"]; } return $clientsRow; }
public function __construct() { parent::__construct(); /* This checks the client list for the CID. If a matching CID is found, all caching will be ignored for this request */ if (Cache::has('clients')) { $clients = Cache::get('clients'); } else { $clients = Client::all(); Cache::put('clients', $clients, 1); } foreach ($clients as $client) { if ($client->uuid == Input::get('cid')) { $this->client = $client; } } }
public function newTrip() { if (!Session::get('logged')) { return Redirect::to('/'); } $carId = Session::get('car_id'); $car = Cars::find($carId); $clients = Client::all(); if (!$car instanceof Cars) { $carId = 0; $carName = 'N/A'; $carRegistration = 'N/A'; } else { $carId = $car->id; $carName = $car->name; $carRegistration = $car->registration; } return View::make('driver/newTrip')->with('car', array('car_id' => $carId, 'car_name' => $carName, 'car_reg' => $carRegistration))->with('clients', $clients); }
/** * Test shorthand * * @return void */ public function testShorthand() { $clients = Client::all(); $columns = array('name', 'Birthdate' => function ($row) { return date('d-M Y', strtotime($row->birth_date)); }, 'lead_source' => array('heading' => 'Lead Source', 'value' => function ($row) { return Client::select_value('lead_source', $row->lead_source); })); $expected_horizontal = $this->markup('classconfig_horizontal'); $expected_vertical = $this->markup('classconfig_vertical'); $table = Squi\Table::make($columns, $clients, 'vertical'); $this->assertSame($expected_vertical, $table->render()); $table = Squi\Table::horizontal($columns, $clients); $this->assertSame($expected_horizontal, $table->render()); $table = Squi\Table::vertical($columns, $clients); $this->assertSame($expected_vertical, $table->render()); $table = Squi\Table::of('Client', $clients, 'summary_columns'); $expected = $this->markup('classconfig_summary'); $this->assertSame($expected, $table->render()); $table = Squi\Table::of($clients); $this->assertSame($expected_horizontal, $table->render()); $table = Squi\Table::of('Client', $clients); $this->assertSame($expected_horizontal, $table->render()); }
/** * Display a listing of clients * * @return Response */ public function index() { $clients = Client::all(); return View::make('clients.index', compact('clients')); }
public function testEmptyLinesInFile() { $this->resetEvents(); $fileName = "with_empty_lines.csv"; $path = $this->copyFileToTemp($fileName); $s = $this->service(); $companyId = rand(1000, 1000000); $fileDetails = ["year" => 2015, "month" => 7]; $rpf = $s->process($path, $companyId, $fileDetails); $this->assertTrue($rpf->status == RoyaltyPaymentFile::STATUS_PAYMENTS_PROCESSED); $rpf = $s->processRoyaltyStreams($rpf); $this->assertTrue($rpf->status == RoyaltyPaymentFile::STATUS_PROCESSED); $payments = RoyaltyPayment::all(); $this->assertTrue(count($payments) == 4); $this->assertTrue($payments[0]->payee_code == 1128); $this->assertTrue($payments[1]->payee_code == 1111); $this->assertTrue($payments[2]->payee_code == 1545); $this->assertTrue($payments[3]->payee_code == 1332); $clients = Client::all(); $this->assertTrue(count($clients) == 4); $payeePayments = PayeePayment::all(); $this->assertTrue(count($payments) == 4); $deals = Deal::all(); $this->assertTrue(count($deals) == 4); $streams = RoyaltyStream::all(); $this->assertTrue(count($streams) == 4); $this->assertTrue($streams[0]->song_number == 33959); $this->assertTrue($streams[1]->song_number == 14402); $this->assertTrue($streams[2]->song_number == 12043); $this->assertTrue($streams[3]->song_number == 51311); $streamFiles = RoyaltyStreamFile::all(); $this->assertTrue(count($streamFiles) == 4); $this->resetEvents(); }
public function getList() { $clients = Client::all(); return View::make('client.list')->with('clients', $clients); }
function hash_passwords() { $clients = Client::all(); foreach ($clients as $client) { $pass = $client->password_old; $client->password = $client->set_password($pass); $client->save(); } redirect('clients'); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $clients = Client::all(); return View::make('clients.index')->with('clients', $clients)->with('title', 'Clients'); }
<br/> <div class="CSSTableGenerator"> <table> <tr align="left"> <td width="50%">Name</td> <td width="20%" >Passport</td> <td width="20%">DoB</td> <td width="10%">Gender</td> </tr> <?php /* foreach($booking['client'] as $client) */ foreach (Client::all() as $client) { ?> <tr> <td><?php $client['name']; ?> </td> <td><?php $client['passport_number']; ?> </td> <td><?php $client['dob']; ?> </td>
public function getClients() { $clients = Client::all()->toArray(); foreach ($clients as $key => $client) { $clients[$key]['price_per_km'] = round($client['price_per_km'], 3); $clients[$key]['price_per_min'] = round($client['price_per_km'], 3); $clients[$key]['us_dollar_exchange_rate'] = round($client['us_dollar_exchange_rate'], 3); } return json_encode($clients); }
$locations = Location::all(); $clients = Client::all(); return View::make('erporders.create', compact('items', 'locations', 'order_number', 'clients')); }); Route::get('purchaseorders/create', function () { $order_number = rand(100, 100000); $items = Item::all(); $locations = Location::all(); $clients = Client::all(); return View::make('erppurchases.create', compact('items', 'locations', 'order_number', 'clients')); }); Route::get('quotationorders/create', function () { $order_number = rand(100, 100000); $items = Item::all(); $locations = Location::all(); $clients = Client::all(); return View::make('erpquotations.create', compact('items', 'locations', 'order_number', 'clients')); }); Route::post('erporders/create', function () { $data = Input::all(); $client = Client::findOrFail(array_get($data, 'client')); /* $erporder = array( 'order_number' => array_get($data, 'order_number'), 'client' => $client, 'date' => array_get($data, 'date') ); */ Session::put('erporder', array('order_number' => array_get($data, 'order_number'), 'client' => $client, 'date' => array_get($data, 'date'))); Session::put('orderitems', []);