Receive string data from the Date Range Picker to PHP plugin

1

I have a Date Range Picker in jQuery , it works well for me, the problem is that I could not manipulate the dates that I select in my PHP , since being JS and being on the client's side, no I capture that data in the input where the dates given by JS ( Date Range Picker ) are shown.

I also have a simple datepicker , which if I can manipulate the data because that input is filled with php, and jQuery only gives me the design. But in my Date Range Picker , the input data is transmitted to me by javascript.

HTML:

<form action="reporte.php" method="GET" class="form-inline" id="formConsulta">
<div class="form-group">
<div style="width:150%;"><input id="reportrange" name= "reportrange"></div></div><input name="consultar" type"submit" value"consultar" ></form>

JAVA SCRIPT

<script type="text/javascript">
$(function() {

    var start = moment().subtract(29, 'days');
    var end = moment();

    function cb(start, end) {
        $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
    }

    $('#reportrange').daterangepicker({
        startDate: start,
        endDate: end,
        ranges: {
           'Today': [moment(), moment()],
           'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
           'Last 7 Days': [moment().subtract(6, 'days'), moment()],
           'Last 30 Days': [moment().subtract(29, 'days'), moment()],
           'This Month': [moment().startOf('month'), moment().endOf('month')],
           'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
        }
    }, cb);

    cb(start, end);

});
</script>

In PHP it is not possible any: $capturarRango=$_GET['#reportrange'];

I have tried some method with AJAX but it does not run. Any ideas?

    
asked by carlos muñoz 09.08.2017 в 19:23
source

0 answers