<?php
$i=0;
$gethistory = $getdata->my_sql_select(NULL,"logs,user","user.user_key=logs.log_user AND (logs.log_date BETWEEN '".(addslashes($_POST['logs_date1']))." 00:00:00' AND '".(addslashes($_POST['logs_date2']))." 23:59:59') ORDER BY logs.log_date");
while($showhistory = mysql_fetch_object($gethistory)){
$i++;
?>
$(document).ready(function() {
//CHANGE DATE FORMAT
format: "dd-mm-yyyy" //results in a syntax error
var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
var checkin = $('#dpd1').datepicker({
changeMonth: true,
changeYear: true,
onRender: function(date) {
return date.valueOf() < now.valueOf() ? 'disabled' : '';
}
}).on('changeDate', function(ev) {
if (ev.date.valueOf() > checkout.date.valueOf()) {
var newDate = new Date(ev.date)
newDate.setDate(newDate.getDate() + 1);
checkout.setValue(newDate);
}
checkin.hide();
$('#dpd2')[0].focus();
}).data('datepicker');
var checkout = $('#dpd2').datepicker({
onRender: function(date) {
return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : '';
}
}).on('changeDate', function(ev) {
checkout.hide();
}).data('datepicker');
})
Code (PHP)
<?php
$i=0;
$gethistory = $getdata->my_sql_select(NULL,"logs,user","user.user_key=logs.log_user AND (logs.log_date BETWEEN '".changeDateFormat(addslashes($_POST['logs_date1']))." 00:00:00' AND '".changeDateFormat(addslashes($_POST['logs_date2']))." 23:59:59') ORDER BY logs.log_date");
while($showhistory = mysql_fetch_object($gethistory)){
$i++;
?>