/** * 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;*/ }
public function editPet(Pet $pet) { $allServices = Service::all(); $services = array(); foreach ($allServices as $service) { $services[$service->id] = $service->name; } return View::make('edit_pet', compact('pet', 'services')); }
public function scopeGetList() { $services = Service::all(); $data = array(); foreach ($services as $service) { $data[$service->id] = $service->name; } return $data; }
public function getEndpointsAndServices() { $services = Service::all()->toArray(); $endpoints = EndPoint::all(); $computedEndpoints = array(); foreach ($endpoints as $endpoint) { $computedEndpoint = static::GetComputedEndpoint($endpoint); array_push($computedEndpoints, (object) $computedEndpoint); } return Response::json(array("success" => true, "services" => $services, "endpoints" => $computedEndpoints)); }
public static function index() { $user = BaseController::get_user_logged_in(); $services = array(); $deleted_services = null; if ($user->manager) { $services = Service::all(); $deleted_services = Service::all_deleted(); } else { $services = Service::all_for_user($user->id); } View::make('service/index.html', array('services' => $services, 'deleted_services' => $deleted_services)); }
public function run() { $event = Ssms\Event::create(['name' => 'user.add', 'description' => 'When a new user is added']); $this->attach($event, Service::whereName('hipchat')->get()); $event = Ssms\Event::create(['name' => 'user.delete', 'description' => 'When a user is deleted']); $this->attach($event, Service::whereName('hipchat')->get()); $event = Ssms\Event::create(['name' => 'server.up', 'description' => 'When a server is back up after being down']); $this->attach($event, Service::all()); $event = Ssms\Event::create(['name' => 'server.down', 'description' => 'When a server is down (retry threshold breached)']); $this->attach($event, Service::all()); $event = Ssms\Event::create(['name' => 'server.updating', 'description' => 'When a server is updating']); $this->attach($event, Service::where('name', 'email')->orWhere('name', 'hipchat')->get()); $event = Ssms\Event::create(['name' => 'server.restart', 'description' => 'When a server is restarting']); $this->attach($event, Service::whereName('hipchat')->get()); }
public static function sandbox() { $service = Service::find(1); $services = Service::all(); $employees = Employee::all(); $employee = Employee::find(1); $service2 = new Service(array('name' => 'aasdd', 'price' => "2", 'description' => "asfafaf")); $errors = $service2->errors(); Kint::dump($employee); Kint::dump($employees); Kint::dump($service); Kint::dump($services); Kint::dump($errors); // View::make('helloworld.html'); }
public static function vendor() { $faker = Faker\Factory::create(); $image_urls = array('http://i.imgur.com/Gh4ZX.png', 'http://i.imgur.com/vySFV.png', 'http://i.imgur.com/RdBae.png', 'http://i.imgur.com/ED5fa.png', 'http://i.imgur.com/gJncN.png', 'http://i.imgur.com/3pKFS.png', 'http://i.imgur.com/3pKFS.png'); $u = User::create(array('email' => 'vendor' . self::$vendor_count . '@example.com', 'password' => 'password')); $v = new Vendor(array('company_name' => $faker->company, 'contact_name' => $faker->name, 'address' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->stateAbbr, 'zip' => $faker->postcode, 'ballpark_price' => rand(1, 4), 'image_url' => $image_urls[array_rand($image_urls)], 'homepage_url' => $faker->url, 'more_info' => $faker->paragraph)); $v->user_id = $u->id; $v->save(); foreach (Service::all() as $service) { if (rand(1, 2) == 2) { $v->services()->attach($service->id); } } self::$vendor_count++; return $v; }
private static function getServiceResult($text) { $services = Service::all(); $endpointsResult = array(); foreach ($services as $service) { $call_no = 0; $endpoints = $service->endpoints()->get(); foreach ($endpoints as $ep) { array_push($endpointsResult, $ep->call($text)); $call_no++; } $limit = Limit::where('service_id', '=', $service->id)->first(); $limit->current_hits = $limit->current_hits + $call_no; $limit->save(); } return $endpointsResult; }
public static function edit_user($id) { $user = User::find($id); if ($user != null) { $services = array(); $all_services = Service::all(); foreach ($all_services as $service) { $services[$service->id] = array('service' => $service, 'available' => false); } $user_services = Service::all_for_user($id); foreach ($user_services as $service) { $services[$service->id]['available'] = true; } View::make('useradmin/edit_user.html', array('user' => $user, 'services' => $services)); } else { Redirect::to(\Slim\Slim::getInstance()->urlFor('users_index'), array('message' => 'Käyttäjää ei löytynyt!', 'error' => true)); } }
public function getServices() { //internal service for AJAX status $response = array(); $services = Service::all(); foreach ($services as $service) { $endpoints = $service->endpoints()->get(); $limit = $service->limits()->first(); $eps = array(); foreach ($endpoints as $ep) { $epArr = $ep->toArray(); $epArr['paramerters'] = $ep->parameters->toArray(); $eps[] = $epArr; } $response[] = array('name' => $service->name, 'root' => $service->root, 'limit' => $limit->toArray(), 'endpoints' => $eps); } return Response::json($response); }
public function update($id) { $params = $_POST; $services = Service::all(); $attributes = array('id' => $id, 'name' => $params['name'], 'special' => $params['special'], 'introduction' => $params['introduction']); $employee = new Employee($attributes); $errors = $employee->errors(); foreach ($services as $serv) { if (isset($_POST[$serv->id])) { OfferedServicesController::create($id, $serv->id); } else { OfferedServicesController::destroy($id, $serv->id); } } $serviceList = OfferedServicesController::getServices($id, $services); if (count($errors) > 0) { View::make('employee/edit.html', array('errors' => $errors, 'attributes' => $attributes, 'services' => $services, 'serviceList' => $serviceList)); } else { $employee->update(); Redirect::to('/tyontekijat/' . $employee->id, array('message' => "Työntekijään tehdyt muutokset tallennettu!")); } }
public function listServices() { $services = Service::all(); return View::make('services', compact('services')); }
<input type="text" name="vendor[contact_name]" value="<?php echo e($vendor['contact_name']); ?> " /> </div> <div class="control-group"> <label class="required">Your company in 50 words or less</label> <textarea class="input-xlarge" name="vendor[more_info]" rows="7"><?php echo e($vendor['more_info']); ?> </textarea> </div> <div class="control-group"> <label class="required">What kind of work does your company do?</label> <?php foreach (Service::all() as $service) { ?> <label class="checkbox"> <input type="checkbox" name="services[<?php echo e($service->id); ?> ]" <?php echo e(isset($services[$service->id]) ? "checked" : ""); ?> /> <?php echo e($service->name); ?> </label> <?php }
/** * Display a listing of the resource. * * @return Response */ public function index() { return View::make('services.index')->with('services', Service::all())->with('title', 'Services'); }
public function listService() { $title = 'Manage Service'; $services = Service::all(); $outlets = Outlet::lists('name', 'id'); return View::make('admin.services.index', compact('title', 'outlets', 'services')); }
function step1() { $services = Service::all(); return View::make('order.step1', array('services' => $services, 'step' => 1)); }
public static function index() { $services = Service::all(); View::make('service/index.html', array('services' => $services)); }
/** * [getServices - get all the services] * @return [type] [description] */ public function getServices() { $all_services = Service::all(["id", "category_id", "status_id", "invoice_periods_id", "default_monthly_costs", "name"]); return Response::json($all_services); }
<?php $service = Service::all(); ?> <table class='table table-striped table-responsive' id='servicetable'> <thead> <tr> <th>service</th> </tr> </thead> <tbody> <tr> <?php $i = 1; ?> @foreach($service as $service) <td > <div class="col-xs-12"> <div class="col-sm-5"> @if($service->image == "") {{ HTML::image("http://placehold.it/100x100","",array('class'=>'img-rounded')) }} @else {{ HTML::image("uploads/service/{$service->image}","",array('class'=>'img-rounded thumbnail','style'=>'height:100px;width:100px')) }} @endif </div> <div class="col-sm-7" style="font-size: 12px"> <div class="col-xs-8"> Name : <strong>{{$service->name}}</strong><br> Details : <strong>{{ $service->descriptions }}</strong>
<?php if (isset($_GET['id_lang'])) { $id_lang = $_GET['id_lang']; // es } elseif (isset($_COOKIE['id_lang'])) { $id_lang = $_COOKIE['id_lang']; } else { $id_lang = 1; } setcookie("id_lang", $id_lang, time() + 3600); define("ID_LANG", $id_lang); $languages = Language::all(); if (isset($_SESSION["sess_id_user"])) { $user = User::byId($_SESSION['sess_id_user']); } $rooms = Room::all(); $services = Service::all(); require 'controller/localization.php'; $booking_states = array(); $booking_states[0] = __('pending'); $booking_states[1] = __('confirmed'); $booking_states[2] = __('canceled');
public function details($title, $id = '') { $organization = Organization::first(array("id = ?" => $id)); $this->seo(array("title" => $organization->name, "keywords" => $organization->name, "description" => substr(strip_tags($organization->details), 0, 150), "view" => $this->getLayoutView())); $view = $this->getActionView(); $centre = Centre::first(array("organization_id = ?" => $id), array("*"), "created", "desc"); $services = Service::all(array("centre_id = ?" => $centre->id), array("property", "property_id", "charge")); $location = Location::first(array("id = ?" => $centre->location_id), array("street", "area_id", "city_id")); $area = Area::first(array("id = ?" => $location->area_id), array("name")); $city = City::first(array("id = ?" => $location->city_id), array("name")); $view->set("centre", $centre); $view->set("area", $area); $view->set("city", $city); $view->set("location", $location); $view->set("services", $services); $view->set("organization", $organization); }
public function details($title, $id = '') { $medicaltest = Test::first(array("id = ?" => $id)); $services = Service::all(array("property = ?" => "test", "property_id = ?" => $id), array("centre_id", "charge"), "charge", "desc", 10, 1); $this->seo(array("title" => $medicaltest->title, "keywords" => $medicaltest->title, "description" => substr(strip_tags($medicaltest->details), 0, 150), "view" => $this->getLayoutView())); $view = $this->getActionView(); $view->set("medicaltest", $medicaltest); $view->set("services", $services); }
/** * [postModelData - handle company specific posted subscriptions data] * @param [Eloquent model] $model [company model] * @return [json] [DT compatible object] */ public function postModelData($model) { $Model = $this->modelName; if (isset($_POST["data"]) && !empty($_POST["data"])) { $tot_price_str = $_POST['data']['subscriptions']['total_price']; if (empty($tot_price_str)) { $subs_id = (int) $_POST['data']['subscriptions']['id']; $subscription = Subscription::find($subs_id); $tot_price_str = $this->subscriptionTotalPrice($_POST['data']['subscriptions']['subscription_start'], $_POST['data']['subscriptions']['subscription_end'], $_POST['data']['subscriptions']['invoice_periods_id'], $_POST['data']['subscriptions']['price']); $_POST['data']['subscriptions']['total_price'] = $tot_price_str; } //error_log("Le POST".json_encode($_POST['data']['subscriptions']['total_price'])); } // Build our Editor instance and process the data coming from _POST global $db; $data = Editor::inst($db, 'subscriptions')->fields(Field::inst('subscriptions.id'), Field::inst('subscriptions.company_id'), Field::inst('service_categories.id'), Field::inst('service_categories.name'), Field::inst('subscriptions.service_id'), Field::inst('services.name'), Field::inst('subscriptions.description'), Field::inst('subscriptions.price'), Field::inst('subscriptions.total_price'), Field::inst('subscriptions.subscription_start'), Field::inst('subscriptions.subscription_end')->validator(function ($val, $data, $opts) { $date_start = strtotime($data['subscriptions']['subscription_start']); $date_end = strtotime($data['subscriptions']['subscription_end']); return $date_end > $date_start ? true : "Error: End date precedes start date"; }), Field::inst('subscriptions.invoice_id'), Field::inst('subscriptions.invoice_periods_id'), Field::inst('invoice_periods.description'), Field::inst('subscriptions.status_id'), Field::inst('statuses.description'), Field::inst('subscriptions.status_date'))->leftJoin('invoice_periods', 'invoice_periods.id', '=', 'subscriptions.invoice_periods_id')->leftJoin('statuses', 'statuses.id', '=', 'subscriptions.status_id')->leftJoin('companies', 'companies.id', '=', 'subscriptions.company_id')->leftJoin('services', 'services.id', '=', 'subscriptions.service_id')->leftJoin('service_categories', 'service_categories.id', '=', 'services.category_id')->process($_POST)->data(); $data['companies'] = Company::all(['id AS value', 'bedrijfsnaam AS label']); $data['services'] = Service::all(['id AS value', 'name AS label']); $data['service_categories'] = ServiceCategory::all(['id AS value', 'name AS label']); $data['statuses'] = Status::all(['id AS value', 'description AS label']); $data['invoice_periods'] = Period::all(['id AS value', 'description AS label']); return Response::json($data); }