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


PHP DateModules::GetDiffInMonth方法代码示例

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


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

示例1: ComputeWageOfSHekoofa

function ComputeWageOfSHekoofa($partObj)
{
    $payments = LON_payments::Get(" AND RequestID=? order by PayDate", array($partObj->RequestID));
    $payments = $payments->fetchAll();
    //--------------- 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 = 0;
    $wages = array();
    foreach ($payments as $row) {
        $wages[] = array();
        $wageindex = count($wages) - 1;
        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);
            $jdiff = DateModules::GDateMinusGDate($installmentDate, $row["PayDate"]);
            $wage = round($row["PayAmount"] / $partObj->InstallmentCount * $jdiff * $partObj->CustomerWage / 36500);
            $wages[$wageindex][] = $wage;
            $totalWage += $wage;
        }
    }
    return $totalWage;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:27,代码来源:compute.inc.php

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