本文整理汇总了PHP中Client::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::all方法的具体用法?PHP Client::all怎么用?PHP Client::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* 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'));
}
示例2: __construct
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;
}
}
}
}
示例3: edit
/**
* 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'));
}
示例4: clients
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');
}
示例5: edit
/**
* 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;*/
}
示例6: __construct
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();
}
示例7: clientList
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;
}
示例8: __construct
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;
}
}
}
示例9: newTrip
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);
}
示例10: testShorthand
/**
* 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());
}
示例11: index
/**
* Display a listing of clients
*
* @return Response
*/
public function index()
{
$clients = Client::all();
return View::make('clients.index', compact('clients'));
}
示例12: testEmptyLinesInFile
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();
}
示例13: getList
public function getList()
{
$clients = Client::all();
return View::make('client.list')->with('clients', $clients);
}
示例14: hash_passwords
function hash_passwords()
{
$clients = Client::all();
foreach ($clients as $client) {
$pass = $client->password_old;
$client->password = $client->set_password($pass);
$client->save();
}
redirect('clients');
}
示例15: index
/**
* 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');
}