$where_brand[1] = " brand_buy=1 "; $sql_today_mather = $comm . " AND " . $where_start_time['lt'] . " AND " . $where_end_time['gt'] . " and group_buy_type=0 and brand_buy=0 AND " . $comm2; // $today_mather = group_buy_list($sql_today_mather); $sql_today_baby = $comm . " AND " . $where_start_time['lt'] . " AND " . $where_end_time['gt'] . " and group_buy_type=1 and brand_buy=0 AND " . $comm2; $today_baby = group_buy_list($sql_today_baby); $sql_brand_mum = $comm . " AND " . $where_start_time['lt'] . " AND " . $where_end_time['gt'] . " and group_buy_type=0 and brand_buy=1 AND " . $comm2; $brand_mum = group_buy_list($sql_brand_mum); $sql_brand_baby = $comm . " AND " . $where_start_time['lt'] . " AND " . $where_end_time['gt'] . " and group_buy_type=1 and brand_buy=1 AND " . $comm2; $brand_baby = group_buy_list($sql_brand_baby); $sql_notStart_mum = $comm . " AND b.start_time > '{$now}' AND b.end_time > '{$now}' and group_buy_type=0 AND " . $comm2; $notStart_mum = group_buy_list($sql_notStart_mum); $sql_notStart_baby = $comm . " AND b.start_time > '{$now}' AND b.end_time > '{$now}' and group_buy_type=1 AND " . $comm2; $notStart_baby = group_buy_list($sql_notStart_baby); $notStart_mum = addDate($notStart_mum); $notStart_baby = addDate($notStart_baby); $smarty->assign('today_mather', $today_mather); $smarty->assign('today_baby', $today_baby); $smarty->assign('brand_mum', $brand_mum); $smarty->assign('brand_baby', $brand_baby); $smarty->assign('notStart_mum', $notStart_mum); $smarty->assign('notStart_baby', $notStart_baby); } /* 模板赋值 */ $smarty->assign('cfg', $_CFG); assign_template(); $position = assign_ur_here(); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置
if (isset($existing[$d . $j . $t])) { $service->events->delete($calId, $id); } else { $existing[$d . $j . $t] = $id; } } $pageToken = $calendarList->getNextPageToken(); if ($pageToken) { $optParams = array('pageToken' => $pageToken); $calendarList = $service->events->ListEvents($calId, $optParams); } else { break; } } foreach ($dates as $date) { addDate($date); } foreach ($existing as $id) { $service->events->delete($calId, $id); continue; $event = $service->events->get($calId, $id); $j = $event->getSummary(); $j = substr($j, 0, 2); $event->setSummary("{$j} - (empty)"); $event = $service->events->update($calId, $id, $event); } #print_r($existing); //addDate('2014-12-26', 12); function addDate($date) { global $service;
<div id="options"> Options: <label><input id="chkBox0" name="chkBox" type="radio" value="0" onClick="modDay0();" checked="checked" />Reset</label> <label><input id="chkBox1" name="chkBox" type="radio" value="1" onClick="modDay1();" />+1 Day</label> <label><input id="chkBox2" name="chkBox" type="radio" value="2" onClick="modDay2();" />+2 Days</label> </div> <?php function addDate($date, $day) { $sum = strtotime(date("Y-m-d", strtotime("{$date}")) . " +{$day} days"); $dateTo = date('Y-m-d', $sum); return $dateTo; } $plusOne = addDate($returndateSQL, 1); $plusTwo = addDate($returndateSQL, 2); $plusThree = addDate($returndateSQL, 3); ?> <input type="hidden" id="plusNone" name="plusNone" value="<?php echo date("D", strtotime($returndateSQL)); ?> "> <input type="hidden" id="plusOne" name="plusOne" value="<?php echo date("D", strtotime($plusOne)); ?> "> <input type="hidden" id="plusOneDate" name="plusOneDate" value="<?php echo date("Y-m-d", strtotime($plusOne)) . " " . $dueHours; ?> "> <input type="hidden" id="plusTwo" name="plusTwo" value="<?php echo date("D", strtotime($plusTwo));