|
@@ -99,6 +99,17 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<p class="mb-2 mt-3 font-weight-bold">Mailing Address</p>
|
|
<p class="mb-2 mt-3 font-weight-bold">Mailing Address</p>
|
|
|
|
+ <label class="d-flex align-items-center">
|
|
|
|
+ @php
|
|
|
|
+ $isSame = ($patient->home_address_line1 == $patient->mailing_address_line1 &&
|
|
|
|
+ $patient->home_address_line2 == $patient->mailing_address_line2 &&
|
|
|
|
+ $patient->home_address_city == $patient->mailing_address_city &&
|
|
|
|
+ $patient->home_address_state == $patient->mailing_address_state &&
|
|
|
|
+ $patient->home_address_zip == $patient->mailing_address_zip);
|
|
|
|
+ @endphp
|
|
|
|
+ <input type="checkbox" onchange="copyHomeToMailingAndReadOnly(this.checked)" {{ $isSame ? 'checked' : '' }}>
|
|
|
|
+ <span class="ml-2">Same as home addess</span>
|
|
|
|
+ </label>
|
|
<div class="mb-2">
|
|
<div class="mb-2">
|
|
<input type="text" class="form-control form-control-sm" name="mailingAddressLine1" placeholder="Address Line 1" value="{{ $patient->mailing_address_line1 }}">
|
|
<input type="text" class="form-control form-control-sm" name="mailingAddressLine1" placeholder="Address Line 1" value="{{ $patient->mailing_address_line1 }}">
|
|
</div>
|
|
</div>
|
|
@@ -115,7 +126,7 @@
|
|
<input type="text" class="form-control form-control-sm" name="mailingAddressZip" placeholder="ZIP" value="{{ $patient->mailing_address_zip }}">
|
|
<input type="text" class="form-control form-control-sm" name="mailingAddressZip" placeholder="ZIP" value="{{ $patient->mailing_address_zip }}">
|
|
</div>
|
|
</div>
|
|
<div class="mb-2">
|
|
<div class="mb-2">
|
|
- <textarea type="text" class="form-control form-control-sm" name="mailingAddressMemo" placeholder="ZIP">{{ $patient->mailing_address_memo }}</textarea>
|
|
|
|
|
|
+ <textarea type="text" class="form-control form-control-sm" name="mailingAddressMemo" placeholder="Memo">{{ $patient->mailing_address_memo }}</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<div>
|
|
@@ -194,4 +205,29 @@
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</form>
|
|
</span>
|
|
</span>
|
|
|
|
+
|
|
|
|
+ <script>
|
|
|
|
+ window.copyHomeToMailingAndReadOnly = function(_same) {
|
|
|
|
+ if(_same) {
|
|
|
|
+ $('[name="mailingAddressLine1"]').val($('[name="homeAddressLine1"]').val()).prop('readonly', true);
|
|
|
|
+ $('[name="mailingAddressLine2"]').val($('[name="homeAddressLine2"]').val()).prop('readonly', true);
|
|
|
|
+ $('[name="mailingAddressCity"]').val($('[name="homeAddressCity"]').val()).prop('readonly', true);
|
|
|
|
+ $('[name="mailingAddressState"]').val($('[name="homeAddressState"]').val()).prop('readonly', true);
|
|
|
|
+ $('[name="mailingAddressZip"]').val($('[name="homeAddressZip"]').val()).prop('readonly', true);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $('[name="mailingAddressLine1"]').prop('readonly', false);
|
|
|
|
+ $('[name="mailingAddressLine2"]').prop('readonly', false);
|
|
|
|
+ $('[name="mailingAddressCity"]').prop('readonly', false);
|
|
|
|
+ $('[name="mailingAddressState"]').prop('readonly', false);
|
|
|
|
+ $('[name="mailingAddressZip"]').prop('readonly', false);
|
|
|
|
+ $('[name="mailingAddressLine1"]').focus();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ @if($isSame)
|
|
|
|
+ addMCInitializer('copy-mailing-address', function() {
|
|
|
|
+ copyHomeToMailingAndReadOnly(true);
|
|
|
|
+ });
|
|
|
|
+ @endif
|
|
|
|
+ </script>
|
|
@endsection
|
|
@endsection
|