Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将价格添加到单元格日期选择器并显示_Php_Jquery_Datepicker - Fatal编程技术网

Php 将价格添加到单元格日期选择器并显示

Php 将价格添加到单元格日期选择器并显示,php,jquery,datepicker,Php,Jquery,Datepicker,我正在使用Calendars Datepicker,我想根据下面的php查询在Datepicker单元格中显示价格,在每个单元格中显示不同的价格。我该怎么做 $('#popupDatepicker').calendarsPicker({ onDate: function(date) { return {content: date.day() + '<br><sub>' + <?php $

我正在使用Calendars Datepicker,我想根据下面的php查询在Datepicker单元格中显示价格,在每个单元格中显示不同的价格。我该怎么做

$('#popupDatepicker').calendarsPicker({

    onDate: function(date) { 
        return {content: date.day() + '<br><sub>' +
            <?php  
            $PropertyNumber=53;
            $Date= 'date.toString()';

            $res2 = $dbh->prepare("select * from property_price where PropertyNumber=:PropertyNumber and Date=:Date  ");
            $res2->execute(array(':PropertyNumber'=>$PropertyNumber,':Date'=>$Date));
            $row = $res2->fetch(PDO::FETCH_ASSOC);
            if ($res2 ) {
                echo $row['Price'] ;
            }

            ?>

            + '</sub>', 

        }; 
    } 
});
$('popdatepicker').calendarsPicker({
onDate:函数(日期){
返回{content:date.day()+'
'+ + '', }; } });
所以我可以解决这个问题,现在我想在用户选择保留日期上的范围日期和在类似日期选择器的鼠标上使用日期时显示错误

  <?php  
$PropertyNumber=53;

        $res2 = $dbh->prepare("select * from property_price where      PropertyNumber=:PropertyNumber   ");
          $res2->execute(array(':PropertyNumber'=>$PropertyNumber));
while ( $row = $res2->fetch(PDO::FETCH_ASSOC)) {
$myVarValue[]=$row;
};
echo json_encode($myVarValue);




                ?>

    <script>
    var pausecontent = <?php echo json_encode($myVarValue); ?>;


  $(function() {
    var g=<?php echo json_encode($myVarValue); ?>;
  $('#popupDatepicker').calendarsPicker({                rangeSelect:true,minDate:0,changeMonth:false,

    onDate: function(date) { 
    for (var i = pausecontent.length - 1; i >= 0; i--) {

    if (date.toString()==pausecontent[i].Date ) {
    return {content: date.day() + '<br><sub>' + 
      pausecontent[i].Price + '$</sub>',
      dateClass: 'showDoY' ,

        }; 
}}




       return {content: date.day() + '<br><sub>' + 
        0 + '$</sub>', 
        dateClass: 'showDoY'}; 


 },





});
});


</script>

var pausecontent=;
$(函数(){
var g=;
$('popupDatepicker').calendarsPicker({rangeSelect:true,minDate:0,changeMonth:false,
onDate:函数(日期){
对于(变量i=pausecontent.length-1;i>=0;i--){
if(date.toString()==pausecontent[i].date){
返回{content:date.day()+'
'+ pausecontent[i]。价格+“$”, dateClass:'showDoY', }; }} 返回{content:date.day()+'
'+ 0 + '$', dateClass:'showDoY'}; }, }); });
可能重复的内容您可能还想阅读该内容,以了解为什么您不能按您尝试的方式执行此操作:知道如何将date.toString()传递给$date吗?