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


PHP DateModules::AddToJDate方法代码示例

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


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

示例1: get_arrear_document


//.........这里部分代码省略.........
        //..........................................................................
        $TotalsumDiff = $TotalMainVal = $TotalRowTax = $TotalRowIns = $TotalRowRet = $TotalPay = 0;
        for ($t = $_POST['from_pay_year']; $t < $_POST['to_pay_year'] + 1; $t++) {
            $retCoef = 1;
            $qry = " select max(arrear_ver) MV\r\n\t\t\t\t\tfrom  corrective_payment_writs \r\n\t\t\t\t\t\twhere staff_id = " . $SID . " and pay_year = " . $t . "\r\n\t\t       ";
            $MaxVer = PdoDataAccess::runquery($qry);
            if (count($MaxVer) == 0 || $MaxVer[0]['MV'] == 0) {
                continue;
            }
            $res = PdoDataAccess::runquery(" select * \r\n\t\t\t\t\t\t\t\t\t\tfrom compare_arrear_writs \r\n\t\t\t\t\t\t\t\t\t\t\twhere staff_id = " . $SID . " and pay_year =" . $t . " and arrear_ver = " . $MaxVer[0]['MV']);
            $prior_execute_date = $current_execute_date = $prior_writ_type = $current_writ_type = '';
            $current_writ_items = $prior_writ_items = array();
            $sdate = "";
            for ($i = 0; $i < count($res); $i++) {
                if ($res[$i]['current_writ_id'] == $res[$i]['prev_writ_id'] && $res[$i]['current_writ_ver'] == $res[$i]['prev_writ_ver']) {
                    continue;
                }
                if (!empty($LD[$t]['lastDate'])) {
                    $toDate = $LD[$t]['lastDate'];
                } else {
                    if ($LastDate == '0000-00-00') {
                        $toDate = $t . "/12/30";
                    } else {
                        $toDate = DateModules::CompareDate(str_replace("/", "-", DateModules::shamsi_to_miladi($t . "/12/30")), str_replace("/", "-", DateModules::shamsi_to_miladi($LastDate))) >= 0 ? $LastDate : $t . "/12/30";
                    }
                }
                /* if ($sdate != "" && $sdate > '0000-00-00')
                       $Row .= "<td>" . $sdate . "</td>";
                   else
                       $Row .= "<td>" .DateModules::miladi_to_shamsi($res[$i]['current_execute_date']). "</td>";
                   */
                if ($res[$i]['current_execute_date'] == $res[$i + 1]['current_execute_date']) {
                    //$Row .= "<td>" . DateModules::AddToJDate($toDate, 1) . "</td>";
                    $sdate = DateModules::AddToJDate($toDate, 1);
                }
                /*else if ($sdate != "" && $sdate > '0000-00-00' && empty($res[$i + 1]['current_execute_date']))
                                $Row .= "<td>" . $t . "/12/29" . "</td>";
                            elseif($res[$i + 1]['current_execute_date'] !='0000-00-00' && DateModules::CompareDate(DateModules::miladi_to_shamsi($res[$i + 1]['current_execute_date']),$LAST_PAY_DATE) == 1  )
                            {
                                  $Row .= "<td>" . $LAST_PAY_DATE . "</td>";
                                
                            }
                            else
                                $Row .= "<td>" . ( empty($res[$i + 1]['current_execute_date']) ? $toDate : DateModules::miladi_to_shamsi($res[$i + 1]['current_execute_date']) ) . "</td>";
                */
                if (!empty($LD[$t]['lastDate'])) {
                    $toDate2 = DateModules::shamsi_to_miladi(DateModules::AddToJDate($LD[$t]['lastDate'], 1));
                } else {
                    if ($LastDate == '0000-00-00') {
                        $toDate2 = DateModules::shamsi_to_miladi($t + 1 . "/01/01");
                    } else {
                        $toDate2 = DateModules::CompareDate(str_replace("/", "-", DateModules::shamsi_to_miladi($t . "/12/30")), str_replace("/", "-", DateModules::shamsi_to_miladi($LastDate))) >= 0 ? DateModules::AddToJDate($LastDate, 1) : DateModules::shamsi_to_miladi($t + 1 . "/01/01");
                    }
                }
                $endDate = empty($res[$i + 1]['current_execute_date']) ? $toDate2 : $res[$i + 1]['current_execute_date'];
                if ($res[$i]['current_execute_date'] == $res[$i + 1]['current_execute_date']) {
                    $endDate = $toDate2;
                }
                if ($sdate != "" && $sdate > '0000-00-00' && empty($res[$i + 1]['current_execute_date'])) {
                    $endDate = $t + 1 . "/1/01";
                    if ($resPerInfo[0]['person_type'] == 3) {
                        $DayNo = round(DateModules::GDateMinusGDate(DateModules::shamsi_to_miladi($endDate), DateModules::shamsi_to_miladi($sdate)));
                        $DayNo2 = calculate_duration($sdate, $endDate);
                    } else {
                        $DayNo = calculate_duration($sdate, $endDate);
                    }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:67,代码来源:salary_utils.inc.php

示例2: SplitYears

function SplitYears($startDate, $endDate, $TotalAmount)
{
    if (substr($startDate, 0, 1) == 2) {
        $startDate = DateModules::miladi_to_shamsi($startDate);
    }
    if (substr($endDate, 0, 1) == 2) {
        $endDate = DateModules::miladi_to_shamsi($endDate);
    }
    $arr = preg_split('/[\\-\\/]/', $startDate);
    $StartYear = $arr[0] * 1;
    $totalDays = 0;
    $yearDays = array();
    $newStartDate = $startDate;
    while (DateModules::CompareDate($newStartDate, $endDate) < 0) {
        $arr = preg_split('/[\\-\\/]/', $newStartDate);
        $LastDayOfYear = DateModules::lastJDateOfYear($arr[0]);
        if (DateModules::CompareDate($LastDayOfYear, $endDate) > 0) {
            $LastDayOfYear = $endDate;
        }
        $yearDays[$StartYear] = DateModules::JDateMinusJDate($LastDayOfYear, $newStartDate) + 1;
        $totalDays += $yearDays[$StartYear];
        $StartYear++;
        $newStartDate = DateModules::AddToJDate($LastDayOfYear, 1);
    }
    $TotalDays = DateModules::JDateMinusJDate($endDate, $startDate) + 1;
    $sum = 0;
    foreach ($yearDays as $year => $days) {
        $yearDays[$year] = round($days / $TotalDays * $TotalAmount);
        $sum += $yearDays[$year];
        //echo  $year . " " . $days . " " . $yearDays[$year] . "\n";
    }
    if ($sum != $TotalAmount) {
        $yearDays[$year] += $TotalAmount - $sum;
    }
    return $yearDays;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:36,代码来源:compute.inc.php

示例3: ComputeInstallmentsShekoofa

function ComputeInstallmentsShekoofa($RequestID = "", $returnMode = false)
{
    $RequestID = empty($RequestID) ? $_REQUEST["RequestID"] : $RequestID;
    $partObj = LON_ReqParts::GetValidPartObj($RequestID);
    $payments = LON_payments::Get(" AND RequestID=? order by PayDate", array($RequestID));
    $payments = $payments->fetchAll();
    if (count($payments) == 0) {
        return true;
    }
    //--------------- total pay months -------------
    $firstPay = DateModules::miladi_to_shamsi($payments[0]["PayDate"]);
    $LastPay = DateModules::miladi_to_shamsi($payments[count($payments) - 1]["PayDate"]);
    $paymentPeriod = DateModules::GetDiffInMonth($firstPay, $LastPay);
    //----------------------------------------------
    $totalWage = ComputeWageOfSHekoofa($partObj);
    $pdo = PdoDataAccess::getPdoObject();
    $pdo->beginTransaction();
    for ($i = 0; $i < $partObj->InstallmentCount; $i++) {
        $monthplus = $paymentPeriod + $partObj->DelayMonths * 1 + ($i + 1) * $partObj->PayInterval * 1;
        $installmentDate = DateModules::miladi_to_shamsi($payments[0]["PayDate"]);
        $installmentDate = DateModules::AddToJDate($installmentDate, 0, $monthplus);
        $installmentDate = DateModules::shamsi_to_miladi($installmentDate);
        $obj2 = new LON_installments();
        $obj2->RequestID = $RequestID;
        $obj2->InstallmentDate = $installmentDate;
        $obj2->InstallmentAmount = round($partObj->PartAmount / $partObj->InstallmentCount) + round($totalWage / $partObj->InstallmentCount);
        if (!$obj2->AddInstallment($pdo)) {
            $pdo->rollBack();
            echo Response::createObjectiveResponse(false, "");
            die;
        }
    }
    $pdo->commit();
    if ($returnMode) {
        return true;
    }
    echo Response::createObjectiveResponse(true, "");
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:39,代码来源:request.data.php


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