Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="x_content">
- <div class="well" style="overflow: auto">
- <div class="col-md-4">
- <div id="reportrange_right" class="pull-left" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
- <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
- <span></span> <b class="caret"></b>
- </div>
- </div>
- </div>
- </div>
- <?php
- echo "<script>document.writeln(startdate)</script>";
- echo "<script>document.writeln(enddate)</script>";
- ?>
- $('#reportrange_right').on('apply.daterangepicker', function(ev, picker) {
- console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
- var startdate = picker.startDate.format('MMMM D, YYYY');
- var enddate = picker.endDate.format('MMMM D, YYYY');
- console.log(startdate);
- console.log(enddate);
- console.log(picker.startDate.format('MMMM D, YYYY'));
- $.post('date2.php', {_startdate:startdate, _enddate:enddate}).done(function(){});
- location.href = '../production/date2.php';
- });
- <?php
- //date2.php
- if($_POST{'_startDate']){
- //Strictly speaking you don't need to make these in to new variables
- //It's just easier to use them later.
- $startDate = $_POST['_startDate'];
- $endDate = $_POST['_endDate'];
- //Now you can put the posted variables where you need them.
- }
- ?>
- <!-- You can also just write in the variables anywhere you like -->
- <p><?php echo $startDate;?></p> <!-- for example -->
- <div class="x_content">
- <div class="well" style="overflow: auto">
- <div class="col-md-4">
- <div id="reportrange_right" class="pull-left" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
- <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
- <span></span> <b class="caret"></b>
- </div>
- </div>
- </div>
- </div>
- <script>
- var startDate = '<?php echo $startDate; ?>';
- var endDate = '<?php echo $endDate; ?>';
- console.log(startDate + " : " + endDate);
- document.writeIn(startDate);
- document.writeIn(endDate);
- </script>
Add Comment
Please, Sign In to add comment