I have custom app that uses a form to send data to Quickbooks to create an invoice. A php file on C-panel contains the code for the form. The code is posted below.
@extends('layout.mainlayout')
@section('content')
<div class="container py-5">
<div class="row">
<div class="col-lg-7 mx-auto">
<div class="bg-white rounded-lg shadow-sm p-3">
<!-- Credit card form content -->
<div class="tab-content">
<!-- credit card info-->
<div id="nav-tab-card" class="tab-pane fade show active">
<div class="text-center pt-5">
<img src="https://i.ibb.co/8cDgdFX/Logo.png" alt="network-logo" width="72" height="72" />
<h4 class="card-title mt-3 text-center">Submit Day</h4>
</div>
@if(session('success'))
<h6 class="alert alert-success">
{{ session('success') }}
</h6>
@endif
@if(session('danger'))
<h6 class="alert alert-danger">
{{ session('danger') }}
</h6>
@endif
<form action="{{ url('/invoice-submit') }}" method="POST" role="form">
{{ csrf_field() }}
<div class="form-group">
<label for="ofiicename">Office Name</label>
<select name="officename" id="ofiicename" class="form-control @error('officename') is-invalid @enderror">
<option value="">Select Office</option>
<option value="Office1”>Office 1</option>
<option value="Office2”>Office 2</option>
<option value="Office3”>Office 3</option>
<option value="Office4”>Office 4</option>
</select>
</div>
<div class="form-group">
<label for="workdate">Work Date</label>
<input type="text" name="workdate" id="workdate" class="form-control @error('workdate') is-invalid @enderror">
</div>
<div class="form-group">
<label for="patientComplete">Number of patients completed:</label>
<input type="text" name="patientCompleted" id="patientComplete" placeholder="" class="form-control @error('patientCompleted') is-invalid @enderror">
</div>
<div class="form-group">
<label for="selfpay">Number of self-pay patients completed</label>
<input type="text" name="selfpaypatient" placeholder="" id="selfpay" class="form-control @error('selfpaypatient') is-invalid @enderror">
</div>
<button type="submit" class="subscribe btn btn-primary btn-block rounded-pill shadow-sm"> Submit </button>
</form>
</div>
<!-- End -->
</div>
<!-- End -->
</div>
</div>
</div>
</div>
<script>
$('#workdate').datepicker({ dateFormat: 'mm-dd-yy' }).val();
</script>
@endsection`
I currently scan a QR code and it pulls up a page with the form on it. However I want the form to be on a particular WordPress page. How do I create a shortcode to place this form a specific WordPress page?
I tried using the following in the theme’s function.php file and in the current location of the form’s php file.
function custom_function_for_your_page() { return (form php code inserted); } add_shortcode( 'custom_functionality', 'custom_function_for_your_page' );
R E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.