Josh 4 жил өмнө
parent
commit
3d95cebb24

+ 19 - 0
app/Http/Controllers/leads_Controller.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Auth;
+
+class leads_Controller extends Controller
+{
+    public $selfName = 'leads_Controller';
+    public $dashboardName = 'dashboard';
+
+	// GET /leads
+	public function index(Request $request) {
+		$records = DB::table('lead')->get();
+		return response()->view('pro/leads/index', compact('records'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+}

+ 10 - 0
app/Http/Controllers/pros_SINGLE_Controller.php

@@ -371,6 +371,16 @@ class pros_SINGLE_Controller extends Controller
 		return response()->view('admin/pros_SINGLE/ACTION_setIsSsnCompleteToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
 	}
 
+	// GET /pros/view/{uid}/ACTION_setProType
+	public function ACTION_setProType(Request $request, $uid) {
+		$record = DB::table('pro')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('pro')->where('id', $uid)->first();
+			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setProType');
+		}
+		return response()->view('admin/pros_SINGLE/ACTION_setProType', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
 	// GET /pros/view/{uid}/SUB_dashboard
 	public function SUB_dashboard(Request $request, $uid) {
 		$record = DB::table('pro')->where('uid', $uid)->first();

+ 2 - 1
resources/views/admin/pros/actions.blade.php

@@ -33,4 +33,5 @@
 <a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/pros/view/<?= $record->uid ?>/ACTION_setIsDriverLicenseCompleteToTrue?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Set Is Driver License Complete To True</a>
 <a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/pros/view/<?= $record->uid ?>/ACTION_setIsDriverLicenseCompleteToFalse?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Set Is Driver License Complete To False</a>
 <a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/pros/view/<?= $record->uid ?>/ACTION_setIsSsnCompleteToTrue?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Set Is Ssn Complete To True</a>
-<a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/pros/view/<?= $record->uid ?>/ACTION_setIsSsnCompleteToFalse?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Set Is Ssn Complete To False</a>
+<a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/pros/view/<?= $record->uid ?>/ACTION_setIsSsnCompleteToFalse?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Set Is Ssn Complete To False</a>
+<a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/pros/view/<?= $record->uid ?>/ACTION_setProType?optimised=1' class='d-block btn btn-sm btn-default mb-3'>Set Pro Type</a>

+ 46 - 0
resources/views/admin/pros_SINGLE/ACTION_setProType.blade.php

@@ -0,0 +1,46 @@
+@extends('admin.pros.view')
+@section('content-inner')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Set Pro Type</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="#" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_uid" value="{{ $record->uid }}">
+        <input type="hidden" name="_api" value="/api/pro/setProType">
+        <input type="hidden" name="_success" value="{{route('pros-view', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('pros_SINGLE-ACTION_setProType', ['uid' => $record->uid])}}">
+        <div class='form-group mb-3'>
+<label class='control-label'>Pro Type </label>
+<select class='form-control' name='proType' value='{{ old('proType') ? old('proType') : '' }}' >
+<option value=''>-- Select --</option>
+<option <?= 'ADMIN' === (old('proType') ? old('proType') : '') ? 'selected' : '' ?> value='ADMIN'>ADMIN</option>
+<option <?= 'INDIVIDUAL' === (old('proType') ? old('proType') : '') ? 'selected' : '' ?> value='INDIVIDUAL'>INDIVIDUAL</option>
+<option <?= 'GROUP' === (old('proType') ? old('proType') : '') ? 'selected' : '' ?> value='GROUP'>GROUP</option>
+</select>
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('pros-view', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 15 - 0
resources/views/admin/pros_SINGLE/SUB_dashboard.blade.php

@@ -5,6 +5,21 @@
     <div class="col-12">
 
         <div class="table-responsive p-0 bg-white table-sm mb-3">
+    <table class="table table-hover text-nowrap table-striped border-left border-right border-bottom">
+        <thead>
+        <tr>
+            <th colspan="2" class="px-2">Pro Type
+                <span class="ml-auto"><a up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href='/pros/view/<?= $record->uid ?>/ACTION_setProType' title='Change?optimised=1'class='mx-2 font-weight-normal text-primary text-xs'><i class='fa fa-circle'></i>&nbsp;<span>Change</span></a></span>
+            </th>
+        </tr>
+        </thead>
+        <tbody>
+            <tr><td class="w-25 px-2 text-secondary border-right">Pro Type</td><td class="w-75 px-2 font-weight-bold"><?= $record->pro_type ?></td></tr>
+        </tbody>
+    </table>
+</div>
+
+<div class="table-responsive p-0 bg-white table-sm mb-3">
     <table class="table table-hover text-nowrap table-striped border-left border-right border-bottom">
         <thead>
         <tr>

+ 7 - 0
resources/views/layouts/generated-links.blade.php

@@ -1,3 +1,10 @@
+<li class='nav-item'>
+	<a href='/leads' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'leads') === 0 ? 'active' : '') }} '>
+		<i class='nav-icon fa fa-meteor'></i>
+		<p>Leads</p>
+	</a>
+</li>
+
 <li class='nav-item'>
 	<a href='/clients' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'clients') === 0 ? 'active' : '') }} '>
 		<i class='nav-icon fa fa-user-injured'></i>

+ 52 - 0
resources/views/pro/leads/index.blade.php

@@ -0,0 +1,52 @@
+@extends('layouts.pro-logged-in')
+@section('content')
+
+    <h3 class="d-flex my-3 px-3 stag-heading stag-heading-index">
+        <div>Leads: List</div>
+        <div class="ml-auto">
+            
+        </div>
+    </h3>
+
+    <div class="table-responsive p-0 bg-white border stag-table stag-table-index">
+        <table class="table table-hover text-nowrap table-striped">
+            <thead>
+            <tr>
+<th>&nbsp;</th>
+<th>Program</th>
+<th>Name First</th>
+<th>Name Last</th>
+<th>Dob</th>
+<th>Mcn</th>
+<th>Is Mcn Valid</th>
+<th>Client Id</th>
+<th>Full Lead Form Data</th>
+<th>Full Eligible Api Response</th>
+<th>Created At</th>
+<th>Created By Session Id</th>
+<th>Type</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($records as $record)
+                <tr>
+<td><a href="/leads/view/<?= $record->uid ?>"><i class="fas fa-share-square"></i></a></td>
+<td><?= $record->program ?></td>
+<td><?= $record->name_first ?></td>
+<td><?= $record->name_last ?></td>
+<td><?= $record->dob ?></td>
+<td><?= $record->mcn ?></td>
+<td><?= $record->is_mcn_valid ?></td>
+<td><?= $record->client_id ?></td>
+<td><?= $record->full_lead_form_data ?></td>
+<td><?= $record->full_eligible_api_response ?></td>
+<td><?= friendly_date_time($record->created_at) ?></td>
+<td><?= $record->created_by_session_id ?></td>
+<td><?= $record->type ?></td>
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+
+@endsection

+ 6 - 0
routes/generated.php

@@ -2,6 +2,11 @@
 
 use Illuminate\Support\Facades\Route;
 
+// --- pro: leads --- //
+Route::prefix('/leads')->group(function () {
+	Route::get('', 'leads_Controller@index')->name('leads-index');
+});
+
 // --- pro: clients --- //
 Route::prefix('/clients')->group(function () {
 	Route::get('', 'clients_Controller@index')->name('clients-index');
@@ -362,6 +367,7 @@ Route::prefix('/pros/view/{uid}')->group(function () {
 	Route::get('ACTION_setIsDriverLicenseCompleteToFalse', 'pros_SINGLE_Controller@ACTION_setIsDriverLicenseCompleteToFalse')->name('pros_SINGLE-ACTION_setIsDriverLicenseCompleteToFalse');
 	Route::get('ACTION_setIsSsnCompleteToTrue', 'pros_SINGLE_Controller@ACTION_setIsSsnCompleteToTrue')->name('pros_SINGLE-ACTION_setIsSsnCompleteToTrue');
 	Route::get('ACTION_setIsSsnCompleteToFalse', 'pros_SINGLE_Controller@ACTION_setIsSsnCompleteToFalse')->name('pros_SINGLE-ACTION_setIsSsnCompleteToFalse');
+	Route::get('ACTION_setProType', 'pros_SINGLE_Controller@ACTION_setProType')->name('pros_SINGLE-ACTION_setProType');
 	Route::get('SUB_dashboard', 'pros_SINGLE_Controller@SUB_dashboard')->name('pros_SINGLE-SUB_dashboard');
 	Route::get('SUB_pro_rates', 'pros_SINGLE_Controller@SUB_pro_rates')->name('pros_SINGLE-SUB_pro_rates');
 	Route::get('SUB_clients', 'pros_SINGLE_Controller@SUB_clients')->name('pros_SINGLE-SUB_clients');