vendredi 28 septembre 2018

Laravel post request doesnt give right data

My form is not updating the information when i manually change the textbox fields. When i get a confirmation email i get the wrong calculation in this example. When i process the information in my controllers it gets put correct in the database but incorrect in the email to my custommer. even though it uses the same information.

$('#two-inputs').dateRangePicker(
    {
        separator : ' tot ',
        startDate: '',
        endDate: '',
        beforeShowDay: function(date){
            var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
            return [ disabled.indexOf(string) == -1 ]
        },
        getValue: function()
        {
            if ($('#date-range200').val() && $('#date-range201').val() )
                return $('#date-range200').val() + ' to ' + $('#date-range201').val();
            else
                return '';
        },
        setValue: function(s,s1,s2)
        {
            var total = 0;
            var temp_s1 = s1.split("-");
            var temp_s2 = s2.split("-");
            $('#date-range200').val(temp_s1[2] + "-" + temp_s1[1] + "-" + temp_s1[0]);
            $('#date-range201').val(temp_s2[2] + "-" + temp_s2[1] + "-" + temp_s2[0]);
            var start_date = s1;
            var s1 = s1.split('-');
            var s1 = new Date(s1[0], s1[1] - 1, s1[2]);
            var s2 = s2.split('-');
            var s2 = new Date(s2[0], s2[1] - 1, s2[2]);
            //alert(datediff(s1, s2));
            if(obj[$('#date-range200').val()] == null){
                var prijs = ;
            } else {
                var prijs = obj[$('#date-range200').val()];
            }

            var extra_kosten = ;
            total += extra_kosten;
            total += datediff(s1, s2)*prijs;

            $("#aantal_nachten").val(datediff(s1, s2));
            $("#prijs_per_nacht").val(prijs);
            $("#totaal_prijs_nachten").val(total);
            $("#prijs").html(prijs);
            $("#nachten").html(datediff(s1, s2));
            $("#prijs_nachten").html(datediff(s1, s2)*prijs);
            $("#extra_kosten").html(extra_kosten);
            $("#totaal_prijs").html(total);
            //alert(start_date);
            //alert(obj[$('#date-range200').val()]);
            $("#prijstable").slideDown( "slow");

        }
    });

Screenshot of the input fields This is the form inputs i used for this item.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2R505lR
via IFTTT

Aucun commentaire:

Enregistrer un commentaire