本文整理汇总了PHP中CDate::setDay方法的典型用法代码示例。如果您正苦于以下问题:PHP CDate::setDay方法的具体用法?PHP CDate::setDay怎么用?PHP CDate::setDay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDate
的用法示例。
在下文中一共展示了CDate::setDay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CDate
}
$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;
$users[$row['user_id']] = $row['name'];
}
示例2: clickWeek
function clickWeek( uts, fdate ) {
window.location = './index.php?m=calendar&a=week_view&date='+uts;
}
</script>
<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
<?php
// establish the focus 'date'
$date = new CDate($date);
// prepare time period for 'events'
$first_time = new CDate($date);
$first_time->setDay(1);
$first_time->setTime(0, 0, 0);
$first_time->subtractSeconds(1);
$last_time = new CDate($date);
$last_time->setDay($date->getDaysInMonth());
$last_time->setTime(23, 59, 59);
$links = array();
// assemble the links for the tasks
require_once dPgetConfig('root_dir') . "/modules/calendar/links_tasks.php";
getTaskLinks($first_time, $last_time, $links, 20, $company_id);
// assemble the links for the events
require_once dPgetConfig('root_dir') . "/modules/calendar/links_events.php";
getEventLinks($first_time, $last_time, $links, 20);
// create the main calendar
$cal = new CMonthCalendar($date);
$cal->setStyles('motitle', 'mocal');
$cal->setLinkFunctions('clickDay', 'clickWeek');
$cal->setEvents($links);
echo $cal->show();
//echo '<pre>';print_r($cal);echo '</pre>';
示例3: clickDay
function clickDay( uts, fdate ) {
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>
示例4: CDate
$minical->showWeek = false;
$minical->clickMonth = true;
$minical->setLinkFunctions('clickDay');
$first_time = new CDate($cal->prev_month);
$first_time->setDay(1);
$first_time->setTime(0, 0, 0);
$last_time = new CDate($cal->prev_month);
$last_time->setDay($cal->prev_month->getDaysInMonth());
$last_time->setTime(23, 59, 59);
$links = array();
getTaskLinks($first_time, $last_time, $links, 20, $company_id, true);
getEventLinks($first_time, $last_time, $links, 20);
$minical->setEvents($links);
echo '<table class="std" cellspacing="0" cellpadding="0" border="0" width="100%"><tr>';
echo '<td valign="top" align="center" width="220">' . $minical->show() . '</td>';
echo '<td valign="top" align="center" width="75%"> </td>';
$minical->setDate($cal->next_month);
$first_time = new CDate($cal->next_month);
$first_time->setDay(1);
$first_time->setTime(0, 0, 0);
$last_time = new CDate($cal->next_month);
$last_time->setDay($cal->next_month->getDaysInMonth());
$last_time->setTime(23, 59, 59);
$links = array();
getTaskLinks($first_time, $last_time, $links, 20, $company_id, true);
getEventLinks($first_time, $last_time, $links, 20, true);
$minical->setEvents($links);
echo '<td valign="top" align="center" width="220">' . $minical->show() . '</td>';
echo '</tr></table>';
?>
</td></tr></table>