Browse Source

Training request

Samson Mutunga 2 năm trước cách đây
mục cha
commit
05b386e74b

+ 35 - 0
app/Http/Controllers/PhysiciansController.php

@@ -2,11 +2,17 @@
 
 namespace App\Http\Controllers;
 
+use App\Http\Traits\StringGeneratorTrait;
+use Ramsey\Uuid\Uuid;
+
 use Illuminate\Http\Request;
 
+use App\Models\TrainingRequest;
+
 class PhysiciansController extends Controller
 {
  
+  use StringGeneratorTrait;
 
     public function index(Request $request) {
       return view('app.physicians.index');
@@ -30,5 +36,34 @@ class PhysiciansController extends Controller
     public function reimbursementGuide(Request $request){
       return view('app.physicians.reimbursement-guide');
     }
+
+    public function submitTrainingRequest(Request $request) {
+      $request->validate([
+        'name_first' => 'required|string',
+        'name_last' => 'required|string',
+        'practice_name' => 'required|string',
+        'email' => 'required|email',
+        'phone' => 'required|string',
+        'zip' => 'required|string',
+        'training_type' => 'required|string',
+        'training_format' => 'required|string',
+      ]);
+      
+      $record = new TrainingRequest;
+      $record->iid = $this->makeIID();
+      $record->uid = Uuid::uuid6();
+      $record->name_first = $request->get('name_first');
+      $record->name_last = $request->get('name_last');
+      $record->practice_name = $request->get('practice_name');
+      $record->email = $request->get('email');
+      $record->phone = $request->get('phone');
+      $record->zip = $request->get('zip');
+      $record->training_type = $request->get('training_type');
+      $record->training_format = $request->get('training_format');
+      $record->notes = $request->get('notes');
+
+      $record->save();
+      return redirect()->back()->with('success', 'Your request has been submitted!');
+    }
     
 }

+ 11 - 0
app/Models/TrainingRequest.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+use App\Models\Base\BaseModel;
+use Illuminate\Database\Eloquent\Model;
+
+class TrainingRequest extends BaseModel
+{
+    protected $table = 'training_request';
+}

+ 43 - 0
database/migrations/2022_11_15_075223_create_training_request_table.php

@@ -0,0 +1,43 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateTrainingRequestTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('training_request', function (Blueprint $table) {
+            $table->id();
+            $table->string('uid')->unique();
+            $table->string('iid')->unique();
+            $table->string('name_first');
+            $table->string('name_last');
+            $table->string('practice_name')->nullable();
+            $table->string('email')->nullable();
+            $table->string('phone')->nullable();
+            $table->string('zip')->nullable();
+            $table->string('training_type')->nullable();
+            $table->string('training_type_other')->nullable();
+            $table->string('training_format')->nullable();
+            $table->longText('notes')->nullable();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('training_request');
+    }
+}

+ 127 - 21
resources/views/app/physicians/get-trained.blade.php

@@ -2,32 +2,138 @@
 @section('content')
 
 <div class="bg-light">
-    <div class="container pt-3">
-        <nav class="mb-0">
-            <ol class="breadcrumb">
-                <li class="breadcrumb-item"><a href="{{route('index')}}"><u>Home</u></a></li>
-                <li class="breadcrumb-item"><a href="{{route('physicians.index')}}"><u>Physicians</u></a></li>
-                <li class="breadcrumb-item active" aria-current="page">Get Trained</li>
-            </ol>
-        </nav>
-    </div>
-</div>
-<div class="bg-grey py-5">
-  <div class="container py-lg-4">
-    <div class="row justify-content-center">
-      <div class="col-lg-7 text-center">
-        <h5 class="subtitle">Get Trained</h5>
-        <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Dolore repellat dolorem accusantium similique quae temporibus molestias cupiditate. Adipisci deleniti magni quisquam quibusdam asperiores repudiandae, cumque, dolore maxime nam cum velit.</p>
-      </div>
-    </div>
+  <div class="container pt-3">
+    <nav class="mb-0">
+      <ol class="breadcrumb">
+        <li class="breadcrumb-item"><a href="{{route('index')}}"><u>Home</u></a></li>
+        <li class="breadcrumb-item"><a href="{{route('physicians.index')}}"><u>Physicians</u></a></li>
+        <li class="breadcrumb-item active" aria-current="page">Get Trained</li>
+      </ol>
+    </nav>
   </div>
 </div>
-<div class="container py-5">
+<div class="container py-5 my-4">
   <div class="row">
-    <div class="col-md-12">
+    <div class="col-lg-5">
+      <h5 class="subtitle">“Schedule a Training” OR “Access Clinical and Staff Training”</h5>
+      <p>We’re excited that your practice is interested in offering the Snyder HemBand system to your patients. To provide the best in patient care, we have a number of training modules for physicians, clinical staff, and office staff available to support our practice partners. Our in-person and online module options have been created with the help of leading gastroenterologists.</p>
+      
+      <div class="row mt-5">
+        <div class="col-sm-6 mb-4">
+          <h5 class="header m-0">Our Office</h5>
+          <hr class="w-100 my-3">
+          <div class="">
+            258 Chapman Road, <br>
+            Suite 101-A, <br>
+            Newark, DE 19702
+          </div>
+        </div>
+        <div class="col-sm-6 mb-4">
+          <h5 class="header m-0">Contact</h5>
+          <hr class="w-100 my-3">
+          <h5 class="mb-2">General questions</h5>
+          <div class="mb-4">
+            <a class="text-dark" href="mailto:info@snyderhemband.com">info@snyderhemband.com</a> <br>
+            <a class="text-dark" href="tel:+1-833-444-8448">+1-833-444-8448</a>
+          </div>
+          <h5 class="mb-2">For physicians</h5>
+          <div class="mb-4">
+            <a class="text-dark" href="mailto:phy@snyderhemband.com">phy@snyderhemband.com</a> <br>
+            <a class="text-dark" href="tel:+1-833-444-8448">+1-833-444-8448</a>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="col-lg-6 bg-grey p-lg-5 p-4 mb-4 offset-lg-1" style="border-bottom:7px solid var(--pry-color);">
+      <h4 class="subtitle">Schedule a Training</h4>
+      <p class="mb-4">Fill out the form below to schedule a personalized training session with our team of experts. </p>
+      <form class="" action="{{ route('physicians.submit-training-request') }}" method="post">
+        @csrf
+        <div class="row">
+          <div class="col-lg-6 form-group mb-4">
+            <input type="text" class="form-control rounded-0 py-3" name="name_first" placeholder="First Name" value="{{ old('name_first') }}" />
+            @error('name_first')
+            <small class="text-warning">{{$message}}</small>
+            @enderror
+          </div>
+          <div class="col-lg-6 form-group mb-4">
+            <input type="text" class="form-control rounded-0 py-3" name="name_last" placeholder="Last Name" value="{{ old('name_last') }}" />
+            @error('name_last')
+            <small class="text-warning">{{$message}}</small>
+            @enderror
+          </div>
+          <div class="col-lg-12 form-group mb-4">
+            <input type="text" class="form-control rounded-0 py-3" name="practice_name" placeholder="Practice Name" value="{{ old('practice_name') }}" />
+            @error('practice_name')
+            <small class="text-warning">{{$message}}</small>
+            @enderror
+          </div>
+        </div>
+        <div class="row">
+          <div class="col-lg-6 form-group mb-4">
+            <input type="email" class="form-control rounded-0 py-3" name="email" placeholder="Contact Email" value="{{ old('email') }}" />
+            @error('email')
+            <small class="text-warning">{{$message}}</small>
+            @enderror
+          </div>
+          <div class="col-lg-6 form-group mb-4">
+            <input type="text" class="form-control rounded-0 py-3" name="phone" placeholder="Contact Phone Number" value="{{ old('phone') }}" />
+            @error('phone')
+            <small class="text-warning">{{$message}}</small>
+            @enderror
+          </div>
+        </div>
         
+        <div class="form-group mb-4">
+          <input type="text" class="form-control rounded-0 py-3" name="zip" placeholder="Zip Code" value="{{ old('zip') }}" />
+          @error('zip')
+          <small class="text-warning">{{$message}}</small>
+          @enderror
+        </div>
+        <div class="row">
+          <div class="col-lg-6 form-group mb-4">
+            <select class="form-control rounded-0 py-3" name="training_type">
+              <option value="">Training Type</option>
+              <option value="Clinical Training">Clinical Training</option>
+              <option value="Staff Training">Staff Training</option>
+              <option value="Other">Other</option>
+            </select>
+            @error('training_type')
+            <small class="text-warning">{{$message}}</small>
+            @enderror
+          </div>
+          <div class="col-lg-6 form-group mb-4">
+          <select class="form-control rounded-0 py-3" name="training_format">
+              <option value="">Training Format</option>
+              <option value="In-person">In-person</option>
+              <option value="Online">Online</option>
+            </select>
+            @error('training_format')
+            <small class="text-warning">{{$message}}</small>
+            @enderror
+          </div>
+        </div>
+
+        <div class="form-group mb-4">
+          <textarea name="notes" class="form-control rounded-0" placeholder="Other Notes" rows="6">{{ old('notes') }}</textarea>
+          @error('notes')
+              <small class="text-warning">{{$message}}</small>
+            @enderror
+        </div>
+
+        @if($errors->any())
+        <div class="alert alert-danger fade show" role="alert">
+          There were errors found!
+        </div>
+        @endif
+        @if(session('success'))
+        <div class="alert alert-success fade show" role="alert">
+          {{session('success')}}
+        </div>
+        @endif
+        <button type="submit" class="btn btn-pry w-100 py-3">Submit</button>
+      </form>
     </div>
   </div>
 </div>
-
 @endsection

+ 1 - 0
routes/web.php

@@ -34,5 +34,6 @@ Route::prefix('/physicians/')->name('physicians.')->group(function () {
     Route::get('/contact-us', [PhysiciansController::class, 'contactUs'])->name('contact-us');
 
     Route::get('/get-trained', [PhysiciansController::class, 'getTrained'])->name('get-trained');
+    Route::post('/submit-training-request', [PhysiciansController::class, 'submitTrainingRequest'])->name('submit-training-request');
     Route::get('/reimbursement-guide', [PhysiciansController::class, 'reimbursementGuide'])->name('reimbursement-guide');
 });