예제 #1
0
 /**
  * Display a listing of the resource.
  *
  * @param ReportingRepo $reporting
  * @return Response
  */
 public function dashboard(ReportingRepo $reporting)
 {
     $lead_sources = $reporting->leads_by_source();
     $leads = Lead::where('is_scrubbed', 0)->paginate(10);
     $pending_leads = PendingLead::orderBy('est_closing_date', 'ASC')->get();
     return view('admin.leadrouter.dashboard', compact('leads', 'pending_leads', 'lead_sources'));
 }
예제 #2
0
 /**
  * Mencari Lead yang dimiliki oleh Play pada wilayah kerja
  * tertentu.
  *
  * @param  int $playId Play ID
  * @param  string $workingAreaIid
  * @param  boolean $withDeleted Termasuk Lead yang sudah dihapus
  * @return \Illuminate\Support\Collection
  */
 public function findLead($playId, $workingAreaId, $withDeleted = false)
 {
     $data = Lead::where(['play_id' => $playId, 'working_area_id' => $workingAreaId]);
     if ($withDeleted) {
         $data->withTrashed();
     }
     return $data->get();
 }
 /**
  * Handle the event.
  *
  * @param  AttributionSubmitted  $event
  * @return Boolean
  */
 public function handle(AttributionSubmitted $event)
 {
     $lead = Lead::where('landing_page_id', $event->attribution->landing_page_id)->where('email', $event->attribution->email)->where('has_attribution', 0)->orderBy('created_at', 'DESC')->first();
     // If attribution entry is found already, set the lead id
     if (!is_null($lead)) {
         $event->attribution->lead_id = $lead->id;
         $lead->has_attribution = true;
         $event->attribution->save();
         $lead->save();
     }
     return true;
 }
예제 #4
0
 public function getUrllinks($urlId)
 {
     $leads = Lead::where('url_id', '=', $urlId)->get();
     return view('app.ajax-link-list', compact('leads'));
 }
예제 #5
0
 public function getMyLeads($user_id)
 {
     $leads = $this->lead->where('user_id', $user_id)->orderBy('updated_at')->all();
     return $leads;
 }
예제 #6
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $leads = Lead::where('active', 0)->where('disposition_id', '=', 3)->orderBy('updated_at')->get();
     return view('callback.index', compact('leads'));
 }
예제 #7
0
 public function postAdd()
 {
     if (!Auth::check()) {
         return Redirect::to('leads/login');
     }
     $Lead = Lead::where('Country', '=', Input::get('country'))->where('user_id', '=', 0)->take(Input::get('count'));
     $Lead->update(['user_id' => Input::get('user_id')]);
     return Redirect::to('leads/employees');
 }
예제 #8
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     Lead::where('id', '=', $id)->update(['first_name' => $request->get('first_name'), 'last_name' => $request->get('last_name'), 'job_title' => $request->get('job_title'), 'company_name' => $request->get('company_name'), 'email' => $request->get('email'), 'phone' => $request->get('phone'), 'market_segments' => $request->get('market_segments'), 'newsletter' => $request->get('newsletter'), 'interested_product' => $request->get('interested_product'), 'interested_demo' => $request->get('interested_demo'), 'notes' => $request->get('notes')]);
     return redirect('leadForms');
 }
예제 #9
0
 public static function UpdateLeadInformation($request)
 {
     Lead::where('id', $request->get('lead_id'))->update(['city' => $request->get('city'), 'state' => $request->get('state'), 'date_of_birth' => date('Y-m-d', strtotime($request->get('date_of_birth'))), 'zip' => $request->get('zip')]);
     return Redirect::back()->with('message', 'Lead has been updated');
 }
예제 #10
0
 protected function modifyDbHomeFinder()
 {
     $leads = Lead::where('source_name', 'like', '%Homefinder.com%')->get();
     foreach ($leads as $lead) {
         $lead->source_name = 'Homefinder.com';
         $lead->save();
     }
 }
예제 #11
0
 public function all($communityId)
 {
     $leads = \App\Lead::where('community_id', '=', $communityId)->get();
     return json_encode($leads);
 }