Преглед изворни кода

Merge branch 'master' of rav.triplestart.com:Petermuturi/snyder

Samson Mutunga пре 2 година
родитељ
комит
41d2140860

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

@@ -43,6 +43,9 @@ class PhysiciansController extends Controller
     public function orderProductsLigators(Request $request){
       return view('app.physicians.order-products.ligators');
     }
+    public function orderProductsSamples(Request $request){
+      return view('app.physicians.order-products.samples');
+    }
     public function orderProductsMarketing(Request $request){
       return view('app.physicians.order-products.marketing');
     }
@@ -163,7 +166,30 @@ class PhysiciansController extends Controller
       ]);
       return redirect()->back()->with('success', 'Your request has been submitted!');
     }
+    public function submitRequestSamples(Request $request){
+      $request->validate([
+        'company_name' => 'required|string',
+        'order_phyisician_name' => 'required|string',
+        'phone_number' => 'required|string',
+        'purchasing_contact_name' => 'required|string',
+        'email' => 'required|email',
+        'state' => 'required|string',
+        'city' => 'required|string',
+        'zip' => 'required|string',
+        'shipping_address' => 'required|string',
+        'g-recaptcha-response' => 'required|recaptcha'
+      ]);
 
+      $request['form_name'] = 'physician_request_sample';
+      $record = $this->saveWebForm($request);
+      //
+      $this->sendWebsiteEmailNotification([
+        'template' => 'physician-request-sample',
+        'subject' => 'Physician Request Sample',
+        'data' => (object) $request->all()
+      ]);
+      return redirect()->back()->with('orderIID', $record->iid)->with('success', 'Your sample has been submitted!');
+    }
     public function submitOrderLigators(Request $request){
       $request->validate([
         'order_date' => 'required|string',

+ 6 - 0
public/css/style.css

@@ -43,6 +43,9 @@ a {
 p {
   font-size: 17px;
 }
+.pointer {
+  cursor: pointer;
+}
 .text-pry {
   color: var(--pry-color);
 }
@@ -499,6 +502,9 @@ p {
   .btn-pry, .btn-outline-pry{
     font-size: 16px
   }
+  .btn-fw button {
+    width: 100%;
+  }
   .top {
     background-image: none !important;
     /* min-height: auto; */

+ 5 - 5
resources/views/app/physicians/order-products/forms/place-order.blade.php

@@ -184,8 +184,8 @@
             <p class="mb-2">Delivery Options</p>
             <div class="form-check">
                 <label class="ms-2 mb-2 pointer">
-                    <input type="radio" required class="form-check-input" name="delivery_option" value="FedEx Standard Overnight (Next business day by 3PM) - FREE OF CHARGE">
-                    <span>FedEx Standard Overnight (Next business day by 3PM) - FREE OF CHARGE</span>
+                    <input type="radio" required class="form-check-input" name="delivery_option" value="FedFedEx Standard Overnight (Next business day by 3PM) - FREE OF CHARGE">
+                    <span>FedFedEx Standard Overnight (Next business day by 3PM) - FREE OF CHARGE</span>
                 </label>
                 <label class="ms-2 mb-2 pointer">
                     <input type="radio" required class="form-check-input" name="delivery_option" value="FedEx Priority Overnight (Next business day by 10AM) - $40.00">
@@ -214,9 +214,9 @@
             <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
             @enderror
         </div>
-        <div class="">
-            <button type="button" class="btn btn-outline-pry px-5 py-2 me-3" data-bs-toggle="modal" data-bs-target="#confirmClearForm">Clear Form</button>
-            <button type="submit" class="btn btn-pry px-5 py-2">Submit Order</button>
+        <div class="d-sm-flex btn-fw">
+            <button type="button" class="btn btn-outline-pry px-5 py-2 me-sm-3 mb-sm-0 mb-3 d-block" data-bs-toggle="modal" data-bs-target="#confirmClearForm">Clear Form</button>
+            <button type="submit" class="btn btn-pry px-5 py-2 d-block">Submit Order</button>
         </div>
         <div class="modal fade" id="confirmClearForm" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="confirmClearFormLabel" aria-hidden="true">
             <div class="modal-dialog modal-dialog-centered">

+ 215 - 0
resources/views/app/physicians/order-products/samples.blade.php

@@ -0,0 +1,215 @@
+@extends('layouts.physicians')
+@section('content')
+
+<div class="bg-light d-lg-block d-none">
+  <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"><a href="{{route('physicians.order-products')}}"><u>Order Products</u></a></li>
+        <li class="breadcrumb-item active" aria-current="page">Request Samples</li>
+      </ol>
+    </nav>
+  </div>
+</div>
+
+<div class="bg-grey py-5">
+  <div class="container">
+    <div class="row justify-content-center">
+      <div class="col-lg-7 text-center">
+        <h5 class="title m-0">Request Samples</h5>
+      </div>
+    </div>
+  </div>
+</div>
+
+<div class="container py-5">
+  <div class="row">
+    <div class="col-lg-3 d-lg-block d-none">
+      @include('app.physicians.order-products.sidenav')
+    </div>
+    <div class="col-lg-8">
+      <div class="d-flex flex-column">
+        <div class="order-lg-1 order-2">
+          <h4 class="header">Order Snyder HemBand Samples Today!</h4>
+          <p class="mt-3 mb-4">If you are a licensed healthcare practitioner in the United States, you’re eligible to request Snyder HemBand samples using this online form. You may also email us at <u><a href="mailto:support@hemband.com">support@hemband.com</a></u> for assistance.</p>
+        </div>
+        <div class="mb-4 order-lg-2 order-1">
+            <img src="{{asset('img/snyder.png')}}" class="w-100" alt="">
+        </div>
+      </div>
+      <div class="bg-light border p-4 mb-4" id="formComponent">
+          <form class="" action="{{ route('physicians.submit-request-samples') }}" method="post" autocomplete="off">
+              @csrf
+              <div class="row">
+                  <div class="col-12">
+                      @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">
+                      <p class="mb-1">Thank you. We have received your request.</p>
+
+                      <p class="mb-1">Your request # is: {{ session('orderIID') }}</p>
+                    </div>
+                    @endif
+
+
+                  </div>
+              </div>
+              <div class="row">
+                  <div class="col-lg-6 form-group mb-4">
+                      <label>Company name: <span class="text-danger">*</span></label>
+                      <input type="text" class="form-control rounded-0 py-3" name="company_name" required value="{{ old('company_name') }}">
+                      @error('company_name')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+                  <div class="col-lg-6 form-group mb-4">
+                      <label>Group NPI:</label>
+                      <input type="text" class="form-control rounded-0 py-3" name="group_npi" value="{{ old('group_npi') }}">
+                      @error('group_npi')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+              </div>
+              <div class="row">
+                  <div class="col-lg-6 form-group mb-4">
+                      <label>Order physician name: <span class="text-danger">*</span></label>
+                      <input type="text" class="form-control rounded-0 py-3" name="order_phyisician_name" required value="{{ old('order_phyisician_name') }}">
+                      @error('order_phyisician_name')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+                  <div class="col-lg-6 form-group mb-4">
+                      <label>Physician NPI:</label>
+                      <input type="text" class="form-control rounded-0 py-3" name="physician_npi" value="{{ old('physician_npi') }}">
+                      @error('physician_npi')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+              </div>
+              <div class="row">
+                  <div class="col-lg-5 form-group mb-4">
+                      <label>Purchasing contact name: <span class="text-danger">*</span></label>
+                      <input type="text" class="form-control rounded-0 py-3" name="purchasing_contact_name" required value="{{ old('purchasing_contact_name') }}">
+                      @error('purchasing_contact_name')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+                  <div class="col-lg-3 form-group mb-4">
+                      <label>Phone Number: <span class="text-danger">*</span></label>
+                      <input type="tel" class="form-control rounded-0 py-3 phone" required name="phone_number" value="{{ old('phone_number') }}">
+                      @error('phone_number')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+                  <div class="col-lg-4 form-group mb-4">
+                      <label>Email: <span class="text-danger">*</span></label>
+                      <input type="email" class="form-control rounded-0 py-3" required name="email" value="{{ old('email') }}">
+                      @error('email')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+              </div>
+              <div class="row">
+                  <div class="col-lg-6 form-group mb-4">
+                      <label>Shipping Address: <span class="text-danger">*</span></label>
+                      <input type="text" class="form-control rounded-0 py-3" name="shipping_address" required value="{{ old('shipping_address') }}">
+                      @error('shipping_address')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+                  <div class="col-lg-6 form-group mb-4">
+                      <label>Line 2:</label>
+                      <input type="text" class="form-control rounded-0 py-3" name="line_2" value="{{ old('line_2') }}">
+                      @error('line_2')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+              </div>
+              <div class="row">
+                  <div class="col-lg-5 form-group mb-4">
+                      <label>City: <span class="text-danger">*</span></label>
+                      <input type="text" class="form-control rounded-0 py-3" name="city" required value="{{ old('city') }}">
+                      @error('city')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+                  <div class="col-lg-3 form-group mb-4">
+                      <label>State: <span class="text-danger">*</span></label>
+                      <input type="text" class="form-control rounded-0 py-3" name="state" value="{{ old('state') }}">
+                      @error('state')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+                  <div class="col-lg-4 form-group mb-4">
+                      <label>Zip: <span class="text-danger">*</span></label>
+                      <input type="text" class="form-control rounded-0 py-3 zip" name="zip" value="{{ old('zip') }}">
+                      @error('zip')
+                        <small class="text-warning">{{$message}}</small>
+                      @enderror
+                  </div>
+              </div>
+              <div class="mb-4 table-responsive">
+                  <p class="mb-1">Item(s) Ordered</p>
+                  <table class="table table-bordered table-sm">
+                      <thead class="bg-info bg-opacity-10">
+                          <tr>
+                              <th>Ref No</th>
+                              <th>Item</th>
+                          </tr>
+                      </thead>
+                      <tbody>
+                          <tr>
+                              <td class="p-3 v-center">DS905727</td>
+                              <td class="p-3 v-center">
+                                  <div class="">
+                                      <p>Snyder HemBand<sup>TM</sup> disposable hemorrhoidal ligator with integrated obturator.</p>
+                                      <p>1 individual package.</p>
+                                      <p>Includes 3 latex bands. Latex-free bands available upon request.</p>
+                                  </div>
+                              </td>
+                          </tr>
+                      </tbody>
+                  </table>
+              </div>
+              <div class="form-check mb-4">
+                  <label class="form-check-label pointer">
+                    <input class="form-check-input" type="checkbox" name="agrees_to_terms" required />
+                      By submitting this request, I confirm that I am a physician or otherwise duly licensed healthcare practitioner authorized to provide hemorrhoid ligation treatment services in the United States.
+                  </label>
+              </div>
+              <div class="form-group mb-4">
+                  {!! htmlFormSnippet() !!}
+                  @error('g-recaptcha-response')
+                  <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+                  @enderror
+              </div>
+              <div class="d-sm-flex btn-fw">
+                  <button type="button" class="btn btn-outline-pry px-5 py-2 me-sm-3 mb-sm-0 mb-3 d-block" data-bs-toggle="modal" data-bs-target="#confirmClearForm">Clear Form</button>
+                  <button type="submit" class="btn btn-pry px-5 py-2 d-block">Submit Order</button>
+              </div>
+              <div class="modal fade" id="confirmClearForm" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="confirmClearFormLabel" aria-hidden="true">
+                  <div class="modal-dialog modal-dialog-centered">
+                      <div class="modal-content">
+                          <div class="modal-body">
+                              <p>Are you sure you want to clear this form?</p>
+                              <div class="">
+                                  <button type="button" class="btn btn-outline-dark me-2 px-4" data-bs-dismiss="modal">No</button>
+                                  <a href="{{route('physicians.order-products-ligators')}}" class="btn btn-danger px-4">Yes</a>
+                              </div>
+                          </div>
+                      </div>
+                  </div>
+              </div>
+          </form>
+      </div>
+    </div>
+  </div>
+</div>
+@endsection

+ 1 - 0
resources/views/app/physicians/order-products/sidenav.blade.php

@@ -2,6 +2,7 @@
 $segment = Request::segment(3);
  ?>
 <div class="mt-lg-4">
+  <p><a class="sublinks {{$segment == 'request-samples' ? 'active' : ''}}" href="{{route('physicians.order-products-samples')}}">- REQUEST SAMPLES</a></p>
   <p><a class="sublinks {{!$segment ? 'active' : ''}}" href="{{route('physicians.order-products')}}">- ORDER PRODUCTS</a></p>
   <p><a class="sublinks {{$segment == 'ligators' ? 'active' : ''}}" href="{{route('physicians.order-products-ligators')}}">- LIGATORS</a></p>
   <p><a class="sublinks {{$segment == 'marketing-materials' ? 'active' : ''}}" href="{{route('physicians.order-products-marketing')}}">- MARKETING MATERIALS</a></p>

+ 27 - 0
resources/views/emails/physician-request-sample.blade.php

@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>{{ $details['subject'] }}</title>
+</head>
+<body>
+    <?php
+        $data = $details['data'];
+    ?>
+
+    <div><b>Company Name:</b>{{ $data->company_name }}</div>
+    <div><b>Group Npi:</b>{{ $data->group_npi }}</div>
+    <div><b>Order Phyisician Name:</b>{{ $data->order_phyisician_name }}</div>
+    <div><b>Physician Npi:</b>{{ $data->physician_npi }}</div>
+    <div><b>Purchasing Contact Name:</b>{{ $data->purchasing_contact_name }}</div>
+    <div><b>Phone Number:</b>{{ $data->phone_number }}</div>
+    <div><b>Email:</b>{{ $data->email }}</div>
+    <div><b>Shipping Address:</b>{{ $data->shipping_address }}</div>
+    <div><b>Line 2:</b>{{ $data->line_2 }}</div>
+    <div><b>City:</b>{{ $data->city }}</div>
+    <div><b>State:</b>{{ $data->state }}</div>
+    <div><b>Zip:</b>{{ $data->zip }}</div>
+    <div><b>Agrees To Terms:</b>{{ $data->agrees_to_terms }}</div>
+
+
+</body>
+</html>

+ 2 - 2
resources/views/layouts/physicians.blade.php

@@ -18,7 +18,7 @@
                 </a>
                 <div>
                     <div class="d-flex align-items-center">
-                      <a class="d-lg-none d-inline btn rounded-0 btn-pry px-3 py-2" href="{{ route('physicians.order-products-ligators') }}">Order Now</a>
+                      <a class="d-lg-none d-inline btn rounded-0 btn-pry px-3 py-2" href="{{ route('physicians.order-products-samples') }}">Samples</a>
                       <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navBar" aria-controls="navBar" aria-expanded="false" aria-label="Toggle navigation">
                           <i class="fas fa-bars"></i>
                       </button>
@@ -44,7 +44,7 @@
                               <a class="nav-link" href="{{ route('physicians.contact-us') }}">Contact Us</a>
                             </li>
                             <li class="nav-item d-lg-block d-none">
-                                <a class="btn px-4 py-2 rounded-0 btn-pry" href="{{ route('physicians.order-products-ligators') }}">Order Now</a>
+                                <a class="btn px-4 py-2 rounded-0 btn-pry" href="{{ route('physicians.order-products-samples') }}">Request Samples</a>
                             </li>
                         </ul>
                     </div>

+ 2 - 0
routes/web.php

@@ -38,6 +38,8 @@ Route::prefix('/physicians/')->name('physicians.')->group(function () {
     Route::get('/practice-support/directory-listing', [PhysiciansController::class, 'practiceSupportDirectoryListing'])->name('practice-support-directory');
     Route::post('/practice-support/submit-directory-listing', [PhysiciansController::class, 'submitPracticeSupportDirectoryListing'])->name('submit-practice-support-directory-listing-request');
     Route::get('/order-products', [PhysiciansController::class, 'orderProducts'])->name('order-products');
+    Route::get('/order-products/request-samples', [PhysiciansController::class, 'orderProductsSamples'])->name('order-products-samples');
+    Route::post('/submit-request-samples', [PhysiciansController::class, 'submitRequestSamples'])->name('submit-request-samples');
     Route::get('/order-products/ligators', [PhysiciansController::class, 'orderProductsLigators'])->name('order-products-ligators');
     Route::post('/submit-order-ligators', [PhysiciansController::class, 'submitOrderLigators'])->name('submit-order-ligators');
     Route::get('/order-products/marketing-materials', [PhysiciansController::class, 'orderProductsMarketing'])->name('order-products-marketing');