当前位置: 首页>>代码示例>>PHP>>正文


PHP CDate::getDate方法代码示例

本文整理汇总了PHP中CDate::getDate方法的典型用法代码示例。如果您正苦于以下问题:PHP CDate::getDate方法的具体用法?PHP CDate::getDate怎么用?PHP CDate::getDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDate的用法示例。


在下文中一共展示了CDate::getDate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

    $graph->Add($bar);
}
if (is_array($projects)) {
    foreach ($projects as $p) {
        if ($locale_char_set == 'utf-8' && function_exists('utf8_decode')) {
            $name = mb_strlen(utf8_decode($p['project_name'])) > 25 ? mb_substr(utf8_decode($p['project_name']), 0, 22) . '...' : utf8_decode($p['project_name']);
        } else {
            //while using charset different than UTF-8 we need not to use utf8_deocde
            $name = mb_strlen($p['project_name']) > 25 ? mb_substr($p['project_name'], 0, 22) . '...' : $p['project_name'];
        }
        //using new jpGraph determines using Date object instead of string
        $start = $p['project_start_date'] > '0000-00-00 00:00:00' ? $p['project_start_date'] : date('Y-m-d H:i:s');
        $end_date = $p['project_end_date'] > '0000-00-00 00:00:00' ? $p['project_end_date'] : date('Y-m-d H:i:s', time());
        $end_date = new CDate($end_date);
        //$end->addDays(0);
        $end = $end_date->getDate();
        $start = new CDate($start);
        //$start->addDays(0);
        $start = $start->getDate();
        $progress = $p['project_percent_complete'] + 0;
        $caption = '';
        if (!$start || $start == '0000-00-00 00:00:00') {
            $start = !$end ? date('Y-m-d') : $end;
            $caption .= $AppUI->_('(no start date)');
        }
        if (!$end) {
            $end = $start;
            $caption .= ' ' . $AppUI->_('(no end date)');
        } else {
            $cap = '';
        }
开发者ID:kilivan,项目名称:dotproject,代码行数:31,代码来源:gantt.php

示例2: arraySelect

<form name="frmCompanySelect" action="" method="get">
	<input type="hidden" name="m" value="timecard">
	<input type="hidden" name="report_type" value="weekly_by_user">
	<input type="hidden" name="tab" value="<?php 
echo $tab;
?>
">
	<table cellspacing="1" cellpadding="2" border="0" width="100%">
	<tr>
		<td width="95%"><?php 
echo arraySelect($companies, 'company_id', 'size="1" class="text" id="medium" onchange="document.frmCompanySelect.submit()"', $company_id);
?>
</td>
                <?php 
$prev_url = "?m=timecard&tab={$tab}&report_type=weekly_by_user&start_date=" . urlencode($start_day->getDate());
$next_url = "?m=timecard&tab={$tab}&report_type=weekly_by_user&start_date=" . urlencode($next_day->getDate());
?>
		<td width="1%" nowrap="nowrap"><a href="<?php 
echo $prev_url;
?>
"><img src="./images/prev.gif" width="16" height="16" alt="<?php 
echo $AppUI->_('previous');
?>
" border="0"></a></td>
		<td width="1%" nowrap="nowrap"><a href="<?php 
echo $prev_url;
?>
"><?php 
echo $AppUI->_('previous');
?>
 <?php 
开发者ID:slawekmikula,项目名称:dotproject,代码行数:31,代码来源:vw_weekly_by_user.php

示例3: substr

     $caption = substr($caption, 0, strlen($caption) - 1);
     /*		if (function_exists('iconv') && function_exists('mb_detect_encoding')) {
     			$caption = iconv(mb_detect_encoding($caption." "), 'UTF-8', $caption);
     		}
     */
     $caption = strUTF8Decode($caption);
     //		if (function_exists('utf8_decode')) {
     //			$caption = utf8_decode($caption);
     //		}
 }
 if ($flags == 'm') {
     // if hide milestones is ticked this bit is not processed//////////////////////////////////////////
     if ($showNoMilestones != '1') {
         $start_date_mile = new CDate($start_date);
         $start_date_mile->setTime(0);
         $start_mile = $start_date_mile->getDate();
         $s = $start_date->format($df);
         $today_date = date('m/d/Y');
         $today_date_stamp = strtotime($today_date);
         $mile_date = $start_date->format("%m/%d/%Y");
         $mile_date_stamp = strtotime($mile_date);
         // honour the choice to show task names only///////////////////////////////////////////////////
         if ($showTaskNameOnly == '1') {
             if ($caller == 'todo') {
                 $milestone_label_array = array($name);
             } else {
                 $milestone_label_array = array($name);
             }
             $bar = new MileStone($row++, $milestone_label_array, $start_mile, $s);
             if ($monospacefont) {
                 $bar->title->SetFont(FF_DEJAVUMONO, FS_NORMAL, 10);
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:gantt.php

示例4: urlencode

echo urlencode($prev_date->getDate());
?>
"><img src="images/prev.gif" title="<?php 
echo $AppUI->_('Previous');
?>
"></a></td>
			<td nowrap="nowrap"><b>
			<?php 
echo $start_day->getDayName(false) . ' ' . $start_day->format($df) . ' - ' . $end_day->getDayName(false) . ' ' . $end_day->format($df);
?>
			</b></td>
			<td><a href="?m=timecard&user_id=<?php 
echo $user_id;
?>
&start_date=<?php 
echo urlencode($next_date->getDate());
?>
"><img src="images/next.gif" title="<?php 
echo $AppUI->_('Next');
?>
"></a></td>
	<?php 
if ($show_other_worksheets) {
    ?>
			<td align="right" width="100%">
				<select name="user_id" onChange="document.user_select.submit();">
		<?php 
    $sql = 'SELECT user_id,contact_first_name,contact_last_name
					FROM users
					INNER JOIN contacts on contact_id = user_contact
					WHERE users.user_id <> ' . $AppUI->user_id . ' AND users.user_id <> 1
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:vw_timecard.php

示例5:

	<td>
		<select name="task_log_help_desk_id" class="text" style="width:250px"></select>
		<input type="hidden" name="task_log_name" value="">
	</td>
</tr>
<?php 
//	}
?>
<tr>
	<td align="right" nowrap="nowrap"><?php 
echo $AppUI->_('Date');
?>
* :</td>
	<td>
		<input id="idDateLog" type="hidden" name="task_log_date" value="<?php 
echo $date->getDate();
?>
">
		<input id="idDateLogD" type="text" name="date" value="<?php 
echo $date->format($df);
?>
" class="text" disabled="disabled">
		<img id="idDateLogB" src="images/calendar.gif" width="24" height="12" alt="<?php 
echo $AppUI->_('Calendar');
?>
" border="0">
	</td>
</tr>
<tr>
	<td align="right" nowrap="nowrap"><?php 
echo $AppUI->_('Hours');
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:vw_newhelpdesklog.php

示例6: while

 // Select tasks without children (sub tasks)
 $sql = "select a.*, !a.task_dynamic AS fixed FROM tasks AS a " . "LEFT JOIN tasks AS b ON a.task_id = b.task_parent AND a.task_id != b.task_id " . "WHERE (b.task_id IS NULL or b.task_id = b.task_parent) " . "AND (a.task_project = {$project_id}) " . "ORDER BY a.task_priority desc, a.task_order desc";
 $dtrc = mysql_query($sql);
 while ($row = mysql_fetch_array($dtrc, MYSQL_ASSOC)) {
     // check durations
     // OBS: agregue if (task_end_date)
     if (!$row["task_duration"] && $row["task_end_date"] == $NO_DATE) {
         log_error("Task " . task_link($row) . " has no duration.", "Please enter the expected duration: " . "<input class=input type=text name='set_duration[" . $row["task_id"] . "]' size=3>" . "<select name='dayhour[" . $row["task_id"] . "]'>" . "<option value='1'>hour(s)</option>" . "<option value='24'>day(s)</option>" . "</select>");
         $errors = true;
     }
     // calculate or set blank task_end_date if unset
     if (!$row["task_dynamic"] && $row["task_end_date"] == $NO_DATE) {
         $end_date = new CDate($row["task_start_date"]);
         $durn = convert2days($row["task_duration"], $row["task_duration_type"]);
         $end_date->addDays($durn);
         $row["task_end_date"] = $end_date->getDate();
         if ($do == "ask" && $option_no_end_date_warning) {
             log_warning("Task " . task_link($row) . " has no end date. Using tasks duration instead.", '<input type="checkbox" name="set_end_date[' . $row['task_id'] . ']" id="set_end_date[' . $row['task_id'] . ']" value="1" /> ' . '<label for="set_end_date[' . $row['task_id'] . ']">Set end date to ' . $row["task_end_date"] . '</label>');
         }
     }
     // check delayed tasks
     if ($do == "ask") {
         if (!$row["task_dynamic"] && $row["task_percent_complete"] == 0) {
             // nothing has be done yet
             $end_time = new CDate(db_dateTime2unix($row["task_end_date"]));
             if ($end_time < time()) {
                 if ($option_check_delayed_tasks) {
                     log_warning("Task " . task_link($row) . " started on " . $row["task_start_date"] . " and ended on " . formatTime($end_time) . ".", '<input type="checkbox" name="set_dynamic[' . $row["task_id"] . ']" id="set_dynamic[' . $row["task_id"] . ']" value="1" checked="checked" /> <label for="set_dynamic[' . $row["task_id"] . ']">Set as dynamic task and reorganize</label><br />' . '<input type="checkbox" name="set_priority[' . $row["task_id"] . ']" id="set_priority[' . $row["task_id"] . ']" value="1" checked="checked" /> <label for="set_priority[' . $row["task_id"] . ']">Set priority to high</label><br />');
                 }
             }
         }
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:organizer.php

示例7: check

 public function check()
 {
     // ensure changes to check boxes and select lists are honoured
     $this->event_private = intval($this->event_private);
     $this->event_type = intval($this->event_type);
     $this->event_cwd = intval($this->event_cwd);
     //If the event recurs then set the end date day to be equal to the start date day and keep the hour:minute of the end date
     //so that the event starts recurring from the start day onwards n times after the start date for the period given
     //Meaning: The event end date day is useless as far as recurring events are concerned.
     if ($this->event_recurs) {
         $start_date = new CDate($this->event_start_date);
         $end_date = new CDate($this->event_end_date);
         $hour = $end_date->getHour();
         $minute = $end_date->getMinute();
         $end_date->setDate($start_date->getDate());
         $end_date->setHour($hour);
         $end_date->setMinute($minute);
         $this->event_end_date = $end_date->format(FMT_DATETIME_MYSQL);
     }
     return null;
 }
开发者ID:joly,项目名称:web2project,代码行数:21,代码来源:calendar.class.php

示例8: arraySelect

echo $tab;
?>
">
	<table cellspacing="1" cellpadding="2" border="0" width="100%">
	<tr>
		<td width="1%" valign="top" nowrap="nowrap"><?php 
echo arraySelect($companies, 'company_id', 'size="1" class="text" id="medium" onchange="document.frmSelect.submit()"', $company_id);
echo arraySelect($users, 'user_id', 'size="1" class="text" id="medium" onchange="document.frmSelect.submit()"', $user_id);
?>
</td>
		<td width="98%" align="right" valign="top">
			<table cellpadding="0" cellspacing="0" width="1%">
				<tr>
					<?php 
$prev_url = "?m=timecard&tab={$tab}&report_type=weekly_by_project&start_date=" . urlencode($start_day->getDate()) . "&browse=1";
$next_url = "?m=timecard&tab={$tab}&report_type=weekly_by_project&start_date=" . urlencode($next_day->getDate()) . "&browse=1";
?>
					<td width="95%">&nbsp;</td>
					<td width="1%"><a href="<?php 
echo $prev_url;
?>
"><img src="./images/prev.gif" width="16" height="16" alt="<?php 
echo $AppUI->_('previous');
?>
" border="0"></a></td>
					<td width="1%" nowrap="nowrap" style="padding-left:5px"><a href="<?php 
echo $prev_url;
?>
"><?php 
echo $AppUI->_('previous');
?>
开发者ID:slawekmikula,项目名称:dotproject,代码行数:31,代码来源:vw_weekly_by_project.php


注:本文中的CDate::getDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。