/
var
/
www
/
html
/
gnet
/
resources
/
views
/
edit
/
Upload File
HOME
<style> .primary__btn { font-weight: 600; display: inline-block; font-size: 1.5rem; line-height: 3.4rem; height: 3.4rem; padding: 0 1.5rem; letter-spacing: 0.2px; border-radius: 0.3rem; background: var(--secondary-color); color: var(--white-color); border: 0; } .primary__btn:hover { background: var(--primary-color); color: var(--white-color); } @media only screen and (min-width: 768px) { .primary__btn { line-height: 4rem; height: 4rem; padding: 0 2.2rem; } } @media only screen and (min-width: 992px) { .primary__btn { font-size: 1.6rem; line-height: 4.5rem; height: 4.5rem; padding: 0 2.5rem; } } </style> <form id="form_edit" class="form_edit" method="post" action="{{ route('branch.update', $branch->id) }}"> @csrf @method('PUT') <div class="form-group"> <label for="branch_name">Branch Name:</label> <input class="form-input" type="text" id="branch_name" name="branch_name" value="{{ $branch->branch_name }}" required> </div> <div class="form-group"> <label for="address">Address:</label> <input class="form-input" type="text" id="address" name="address" value="{{ $branch->address }}" required> </div> <div class="form-group"> <label for="no_telp">Phone Number:</label> <input class="form-input" type="text" id="no_telp" name="no_telp" value="{{ $branch->no_telp }}" required> </div> <div class="form-group"> <label for="no_wa">WhatsApp Number:</label> <input class="form-input" type="text" id="no_wa" name="no_wa" value="{{ $branch->no_wa }}" required> </div> <div class="form-group"> <label for="maps_url">Maps URL:</label> <input class="form-input" type="text" id="maps_url" name="maps_url" value="{{ $branch->maps_url }}" required> </div> <div class="form-group"> <label for="province">Province:</label> <input class="form-input" type="text" id="province" name="province" value="{{ $branch->province }}" required> </div> <div class="form-group"> <label for="city">City:</label> <input class="form-input" type="text" id="city" name="city" value="{{ $branch->city }}" required> </div> <div class="text-end mt-3"> <input id="btn-save" type="submit" class="primary__btn" > </div> </form> <script> $(".form_edit").submit(function(e){ e.preventDefault(); var formData = $(this).serialize(); $.ajax({ url: $(this).attr('action'), type: 'PUT', data: formData, dataType: 'json', success: function(response) { swal.fire({ type: 'success', icon: 'success', title: `${response.message}`, showConfirmButton: false, timer: 3000 }); $('#modal-edit').modal('hide'); $('.table').DataTable().ajax.reload(); location.reload(); }, error: function(xhr, textStatus, errorThrown) { console.error(errorThrown); } }); }); </script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>