<script>
    
    function makeSale(){
        var route_link = '/make-a-sale';

        $('#edit_dialog_content').html('<div style="text-align: center; margin: 20px 0 20px 0;"><img src="<?php echo e(asset('images/loads/loader.gif')); ?>" border=0></div>')
            .load(encodeURI(route_link))
            .dialog({
                modal: true,
                width: 900,
                title: "Make a New Sale",
                buttons: [
                    {
                        text: "Proceed to Make Sale",
                        icon: "ui-icon-check",
                        id: "make-a-sale-button",
                        click: function(e) {
                            if(confirm('Are you sure to Save Entered Details?')){
                                e.preventDefault();
                                $("#make-a-sale-button").attr('disabled', true).text('Please Wait...');
                                var datas = $('#make-a-sale-function').serializeArray();
                                $.ajax({
                                    method: "POST",
                                    url: route_link,
                                    data: datas,
                                    success: function (res){
                                        if(res == 'success'){
                                            alert('Sale Made Successfully.');
                                            location.reload();
                                        }else if(res == 'error'){
                                            alert('An Error occurred and System is unable to perform the requested action. Try again');
                                            location.reload();
                                        }else{
                                            alert(res);
                                            location.reload();
                                        }
                                    }
                                });
                            }
                            return false;
                        }
                    }
                ],
                open: function() {
                    $(this).parent().css({'top': 100});
                }
            });
    }
</script>

<div class="headers">
    <script>
        $('#dash').css('left', 0);
    </script>
    <div class="control_headers" id="control_headers">
        <div class="dropdown">
            <a href="<?php echo e(url('underwriting')); ?>" class="guestDetails_links inner" ><b>Home</b></a>
        </div>
    </div>
</div>
<?php /**PATH C:\xampp\htdocs\edwulp_chemist\resources\views/headers/dash-header.blade.php ENDPATH**/ ?>