} } } } } } echo $script_days; ?> <?php //営業日 $business_days = 0; list( $yy, $mm, $dd ) = wc2_get_today(); $business = ( isset($general['business_days'][$yy][$mm][$dd]) ) ? $general['business_days'][$yy][$mm][$dd] : 1; while( $business != 1 ) { $business_days++; list( $yy, $mm, $dd ) = wc2_get_nextday( $yy, $mm, $dd ); $business = $general['business_days'][$yy][$mm][$dd]; } ?> var business_days = "<?php echo $business_days; ?>"; selected_delivery_time = "<?php echo esc_js($entry_data['order']['delivery_time']); ?>"; <?php $script_delivery_time = ' var delivery_time = []; delivery_time[0] = [];'; foreach( (array)$delivery['delivery_method'] as $dmid => $dm ) { $lines = explode("\n", $dm['time']); $script_delivery_time .= ' delivery_time[' . $dm['id'] . '] = [];'; foreach( (array)$lines as $line ) { if( trim($line) != '' ) {
function setCalendarData() { $day = 1; // 当月開始日に設定 $firstw = wc2_get_week($this->_year, $this->_month, $day); // 当月開始日の曜日 $lastday = wc2_get_lastday($this->_year, $this->_month); // 当月最終日 $lastw = wc2_get_week($this->_year, $this->_month, $lastday); // 当月最終日の曜日 // 1週目 for ($d = 0; $d <= 6; $d++) { if ($firstw == $d) { $this->_date[0][$d] = sprintf("%04d-%02d-%02d", $this->_year, $this->_month, $day); $this->_datetext[0][$d] = $day; } elseif ($firstw < $d) { list($this->_year, $this->_month, $day) = wc2_get_nextday($this->_year, $this->_month, $day); $this->_date[0][$d] = sprintf("%04d-%02d-%02d", $this->_year, $this->_month, $day); $this->_datetext[0][$d] = $day; } else { $this->_date[0][$d] = ""; $this->_datetext[0][$d] = ""; } } // 2~4週目 for ($d = 0; $d <= 6; $d++) { list($this->_year, $this->_month, $day) = wc2_get_nextday($this->_year, $this->_month, $day); $this->_date[1][$d] = sprintf("%04d-%02d-%02d", $this->_year, $this->_month, $day); $this->_datetext[1][$d] = $day; } for ($d = 0; $d <= 6; $d++) { list($this->_year, $this->_month, $day) = wc2_get_nextday($this->_year, $this->_month, $day); $this->_date[2][$d] = sprintf("%04d-%02d-%02d", $this->_year, $this->_month, $day); $this->_datetext[2][$d] = $day; } for ($d = 0; $d <= 6; $d++) { list($this->_year, $this->_month, $day) = wc2_get_nextday($this->_year, $this->_month, $day); $this->_date[3][$d] = sprintf("%04d-%02d-%02d", $this->_year, $this->_month, $day); $this->_datetext[3][$d] = $day; } // 5週目 for ($d = 0; $d <= 6; $d++) { if ($lastday == $day) { break; } else { list($this->_year, $this->_month, $day) = wc2_get_nextday($this->_year, $this->_month, $day); $this->_date[4][$d] = sprintf("%04d-%02d-%02d", $this->_year, $this->_month, $day); $this->_datetext[4][$d] = $day; } } if (0 < $d && $d <= 6) { while ($d <= 6) { $this->_date[4][$d] = ""; $this->_datetext[4][$d] = ""; $d++; } } elseif ($d !== 0) { // 6週目 for ($d = 0; $d <= 6; $d++) { if ($lastday == $day) { break; } else { list($this->_year, $this->_month, $day) = wc2_get_nextday($this->_year, $this->_month, $day); $this->_date[5][$d] = sprintf("%04d-%02d-%02d", $this->_year, $this->_month, $day); $this->_datetext[5][$d] = $day; } } if ($d > 0) { while ($d <= 6) { $this->_date[5][$d] = ""; $this->_datetext[5][$d] = ""; $d++; } } } $this->_row = count($this->_date); }