當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CDate::subtractSpan方法代碼示例

本文整理匯總了PHP中CDate::subtractSpan方法的典型用法代碼示例。如果您正苦於以下問題:PHP CDate::subtractSpan方法的具體用法?PHP CDate::subtractSpan怎麽用?PHP CDate::subtractSpan使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CDate的用法示例。


在下文中一共展示了CDate::subtractSpan方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Cezpdf

    $pname = db_loadResult($sql);
} else {
    $pname = $AppUI->_('All Projects');
}
$font_dir = $dPconfig['root_dir'] . "/lib/ezpdf/fonts";
$temp_dir = $dPconfig['root_dir'] . "/files/temp";
$base_url = $dPconfig['base_url'];
require $AppUI->getLibraryClass('ezpdf/class.ezpdf');
$pdf =& new Cezpdf($paper = 'A4', $orientation = 'landscape');
$pdf->ezSetCmMargins(1, 2, 1.5, 1.5);
$pdf->selectFont("{$font_dir}/Helvetica.afm");
$pdf->ezText(dPgetConfig('company_name'), 12);
$date = new CDate();
$pdf->ezText("\n" . $date->format($df), 8);
$last_week = new CDate($date);
$last_week->subtractSpan(new Date_Span(array(7, 0, 0, 0)));
$pdf->selectFont("{$font_dir}/Helvetica-Bold.afm");
$pdf->ezText("\n" . $AppUI->_('Project Completed Task Report'), 12);
$pdf->ezText("{$pname}", 15);
$pdf->ezText($AppUI->_('Tasks Completed Since') . " " . $last_week->format($df), 10);
$pdf->ezText("\n");
$pdf->selectFont("{$font_dir}/Helvetica.afm");
$title = null;
$options = array('showLines' => 2, 'showHeadings' => 1, 'fontSize' => 9, 'rowGap' => 4, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '750', 'shaded' => 0, 'cols' => array(0 => array('justification' => 'left', 'width' => 250), 1 => array('justification' => 'left', 'width' => 95), 2 => array('justification' => 'center', 'width' => 75), 3 => array('justification' => 'center', 'width' => 75), 4 => array('justification' => 'center', 'width' => 75)));
$hasResources = $AppUI->isActiveModule('resources');
$perms =& $AppUI->acl();
if ($hasResources) {
    $hasResources = $perms->checkModule('resources', 'view');
}
// Build the data to go into the table.
$pdfdata = array();
開發者ID:n2i,項目名稱:xvnkb,代碼行數:31,代碼來源:completed.php

示例2: CDate

        $days = $period_value;
    } else {
        if ($day_word == $AppUI->_("Week")) {
            $days = 7 * $period_value;
        } else {
            if ($day_word == $AppUI->_("Month")) {
                $days = 30 * $period_value;
            }
        }
    }
    $start_date = new CDate($ts);
    $end_date = new CDate($ts);
    if ($sign > 0) {
        $end_date->addSpan(new Date_Span("{$days},0,0,0"));
    } else {
        $start_date->subtractSpan(new Date_Span("{$days},0,0,0"));
    }
    $do_report = 1;
} else {
    // create Date objects from the datetime fields
    $start_date = intval($list_start_date) ? new CDate($list_start_date) : new CDate();
    $end_date = intval($list_end_date) ? new CDate($list_end_date) : new CDate();
}
if (!$list_start_date) {
    $start_date->subtractSpan(new Date_Span("14,0,0,0"));
}
$end_date->setTime(23, 59, 59);
?>
<script language="javascript">
Calendar.enabled = true;
</script>
開發者ID:n2i,項目名稱:xvnkb,代碼行數:31,代碼來源:tasklist.php


注:本文中的CDate::subtractSpan方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。