@extends('layouts.leads', ['page' => 'Manage employees']) @section('content') <?php $waiting_leads = App\Lead::where('user_id', '=', Auth::user()->id)->where('call', '=', false)->count(); ?> <div class="row"> <div class="col-md-12"> <table class="table table-bordered"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Waiting Leads</th> <th>Remove Leads</th> <td>Add Leads</td> </tr> </thead> <tbody> @foreach($users as $user) <tr> <td>{{$user->id}}</td> <td>{{$user->firstname}}</td> <td>{{$user->lastname}}</td> <td>{{ App\Lead::where('user_id', '=', $user->id)->where('call', '=', false)->count() }}</td> <th><a href="{{Config::get('app.url')}}/leads/remove/{{$user->id}}" class="btn btn-danger">Remove Waiting Leads</a></th> <th><button type="button" data-toggle="modal" data-target="#addLeads{{$user->id}}" class="btn btn-info">Add Leads</button></th> <!-- Modal --> <div class="modal fade" id="addLeads{{$user->id}}" tabindex="-1" role="dialog" aria-labelledby="addLeadsLabel{{$user->id}}"> <div class="modal-dialog" role="document">
return $doctor->locations; }); Route::get('timeslot/{location_id}/daysofweek', function ($location_id) { $daysOfWeek = \App\Timeslot::select('day')->where('location_id', $location_id)->groupBy('day')->lists('day')->toArray(); $fullDaysOfWeek = ["0", "1", "2", "3", "4", "5", "6"]; return array_diff($fullDaysOfWeek, $daysOfWeek); }); Route::get('timeslot/location/{location_id}/dayofweek/{day}', function ($location_id, $day) { $timeslots = \App\Timeslot::select('time')->where('location_id', $location_id)->where('day', $day)->lists('time'); return $timeslots; }); use App\LeadUnload; // set lead active to 0 Route::get('lead/{lead}/inactive', function ($lead) { $lead->active = 0; $lead->save(); // send pusher event event(new LeadUnload($lead)); return 'done'; }); Route::get('{lead_id}/retrieve_notes', ['as' => 'retrieve_notes_by_lead', 'uses' => 'NoteController@retrieveNote']); get('{lead_id}/disposition_history', ['as' => 'disposition_lead_history', 'uses' => 'LeadController@getDispositionHistory']); get('leads/success', ['as' => 'success_leads', 'uses' => 'LeadController@getSuccessLeads']); get('patient/{query}', function ($query) { $json = []; $patients = App\Lead::where('name', 'LIKE', '%' . $query . '%')->orWhere('phone_no', 'LIKE', '%' . $query . '%')->orWhere('patient_no', 'LIKE', '%' . $query . '%')->get(); foreach ($patients as $patient) { $json['items'][] = array('title' => $patient->name, 'description' => $patient->patient_no . ' ▪ ' . $patient->address, 'html_url' => route('lead.show', $patient->id)); } return $json; });