本文整理汇总了PHP中CDate::setMonth方法的典型用法代码示例。如果您正苦于以下问题:PHP CDate::setMonth方法的具体用法?PHP CDate::setMonth怎么用?PHP CDate::setMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDate
的用法示例。
在下文中一共展示了CDate::setMonth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
if (<?php
if ($_GET["b"] == 1) {
echo '1';
} else {
echo '0';
}
?>
== 1) window.opener.porciento(parseInt(idate));
window.close();
}
</script>
<table border="0" cellspacing="0" cellpadding="3" width="100%">
<tr>
<?php
for ($i = 0; $i < 12; $i++) {
$this_month->setMonth($i + 1);
echo "\n\t<td width=\"8%\">" . "<a href=\"index.php?m=public&a=calendar&dialog=1&callback={$callback}&date=" . $this_month->format(FMT_TIMESTAMP_DATE) . "&uts={$prev_date}\" class=\"\">" . substr($this_month->format('%b'), 0, 1) . "</a>" . "</td>";
}
?>
</tr>
<tr>
<?php
echo "\n\t<td colspan=\"6\" align=\"left\">";
echo "<a href=\"index.php?m=public&a=calendar&dialog=1&callback={$callback}&date=" . $cal->prev_year->format(FMT_TIMESTAMP_DATE) . "&uts={$prev_date}\" class=\"\">" . $cal->prev_year->getYear() . "</a>";
echo "</td>";
echo "\n\t<td colspan=\"6\" align=\"right\">";
echo "<a href=\"index.php?m=public&a=calendar&dialog=1&callback={$callback}&date=" . $cal->next_year->format(FMT_TIMESTAMP_DATE) . "&uts={$prev_date}\" class=\"\">" . $cal->next_year->getYear() . "</a>";
echo "</td>";
?>
</tr>
</table>
示例2: CDate
$current_date = new CDate();
$AppUI->setState('TimecardMonthlyMonth', $current_date->getMonth());
}
$month = $AppUI->getState('TimecardMonthlyMonth');
if ($show_other_worksheets) {
if (isset($_GET['user_id'])) {
$AppUI->setState('TimecardMonthlyUserId', $_GET['user_id']);
} else {
$AppUI->setState('TimecardMonthlyUserId', $AppUI->user_id);
}
$user_id = $AppUI->getState('TimecardMonthlyUserId') ? $AppUI->getState('TimecardMonthlyUserId') : 0;
} else {
$user_id = $AppUI->user_id;
}
$start_report = new CDate();
$start_report->setMonth($month);
$start_report->setYear($year);
$start_report->setDay(1);
$start_report->setTime(0, 0, 0);
$end_report = new CDate();
$end_report->copy($start_report);
$end_report->addMonths(1);
$end_report->addDays(-1);
$end_report->setTime(23, 59, 59);
//Get hash of users
$sql = "SELECT user_id, contact_email, concat(contact_last_name,' ',contact_first_name) as name FROM users LEFT JOIN contacts AS c ON users.user_contact = contact_id ORDER BY contact_last_name, contact_first_name;";
$result = db_loadList($sql);
$people = array();
// users list
foreach ($result as $row) {
$people[$row['user_id']] = $row;
示例3: clickWeek
window.location = './index.php?m=calendar&a=day_view&date='+uts;
}
function clickWeek( uts, fdate ) {
window.location = './index.php?m=calendar&a=week_view&date='+uts;
}
</script>
<?php
// establish the focus 'date'
if (!$date) {
$date = new CDate();
} else {
$date = new CDate($date);
}
$date->setDay(1);
$date->setMonth(1);
$prev_year = $date->format(FMT_TIMESTAMP_DATE);
$prev_year = (int) ($prev_year - 10000);
$next_year = $date->format(FMT_TIMESTAMP_DATE);
$next_year = (int) ($next_year + 10000);
?>
<table class="std" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<table width="100%" cellspacing="0" cellpadding="4">
<tr>
<td colspan="20" valign="top">
<table border="0" cellspacing="1" cellpadding="2" width="100%" class="motitle">
<tr>
<td>
<a href="<?php