I need to change dates
In fact I have inputs with datepicker class
I have also dates recorded in my database as strike days
What I need to do is to check if the date in the input is one of this strikedays if the date is one of this strikedays, I need to put the next day
the same things, if the date is sunday, because it is a closed day.
I've tried something like that
<script type="text/javascript">
$(document).ready(function(){
$('.datepicker').change(function(){
//Définition des jours interdits :
<?php
$query = "SELECT `date`, `date2` FROM `jours_feries`";
$result = mysql_query($query);
while ($date = mysql_fetch_assoc($result)):
?>
alert($(this).val());
if($(this).val()=='<?php echo date('d-m-Y',strtotime($date['date'] ))?>'){
$(this).val(<?php echo date('d-m-Y',strtotime($date['date2'])) ?>)
}
<?php endwhile; ?>
})
})
</script>
which give to me (printed source)
<script type="text/javascript">
$(document).ready(function(){
$('.datepicker').change(function(){
//Définition des jours interdits :
alert($(this).val());
if($(this).val()=='25-12-2013'){
$(this).val(26-12-2013)
}
})
})
I do not know how to proceed to go on for the sunday, to check it
I also would like to replace dates (onload, onblur, on what so ever event can change it)
Anykind of help will be much appreciated