public function Supplierlist() { $name = Input::get('name'); $partners = Partner::where('name', 'like', '%' . $name . '%')->where('supplier', 'Yes')->where('status', 'Active')->get(); $data = ['supplier' => $partners]; return Response::json($data, 200, array(), JSON_PRETTY_PRINT); }
public function edit($partnerID) { if (!Auth::check() || !Auth::user()->is_admin) { return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions']]), 403); } $partner = Partner::where('id', $partnerID)->firstOrFail(); return view('partners.edit', ['partner' => $partner], ['locations' => Location::all()]); //return view('partners.edit')->with(['partner'=>$partner]); }
public function delete($id) { $entry = Partner::find($id); if (isset($entry)) { Partner::where('id', $id)->update(array('trash' => 1)); return \Redirect::route('partner')->with('success', $entry->title . ' deleted succesfully!'); } else { return \Redirect::route('partner')->with('error', 'Failed to delete, invalid credentials.'); } }
/** * Run the database seeds. * * @return void */ public function run() { //$partner_id = \App\Partner::where('acronym','=','MBA')->pluck('id'); //$application_id = \App\Application::where('acronym','=','MBAGrades')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #1', 'description' => 'MBA Grades Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'MBA')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'MBAGrades')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #2', 'description' => 'MBA Grades Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'MBA')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'MBAGrades')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #3', 'description' => 'MBA Grades Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'DOC')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'DOCGrades')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #4', 'description' => 'Doctoral Grades Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'EE')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'Atlas')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #5', 'description' => 'Atlas Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'EE')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'Atlas')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #6', 'description' => 'Atlas Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'EE')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'Atlas')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #7', 'description' => 'Atlas Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'OPS')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'QuickCodes')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #8', 'description' => 'Quick Codes Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'OPS')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'QuickCodes')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #9', 'description' => 'Quick Codes Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'OPS')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'QuickCodes')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #10', 'description' => 'Quick Codes Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); $partner_id = \App\Partner::where('acronym', '=', 'OPS')->pluck('id'); $application_id = \App\Application::where('acronym', '=', 'QuickCodes')->pluck('id'); $environment_id = \App\Environment::where('name', '=', 'CEE')->pluck('id'); DB::table('runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Test Run #11', 'description' => 'Quick Codes Smoke Tests', 'start_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'end_date_time' => Carbon\Carbon::now()->toDateTimeString(), 'environment_id' => $environment_id]); }
/** * 编辑股东 * @param int $pid 股东序号 * @param int $id * @return mixed * @author AndyLee <*****@*****.**> */ public function getModifyPartner($id, $pid) { $map = ['id' => $pid, 'company_id' => Session::get('customer_id')]; try { $record = Partner::where($map)->firstOrFail(); } catch (ModelNotFoundException $e) { Session::flash('error', '无法进行编辑,您可以没权限进行操作'); return Redirect::to(action('PartnerController@getPartner', Session::get('customer_id'))); } return view('customer.partner.modify')->with('record', $record); }
public function index() { $viewBag = array('newsEntry' => News::where('trash', '=', '0')->orderBy('created_at', 'desc')->paginate(4), 'sliderEntry' => Slider::where('trash', '=', '0')->get(), 'partnerEntry' => Partner::where('trash', '=', '0')->get()); return \View::make('index', $viewBag); }