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


PHP DateModules::CompareDate方法代码示例

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


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

示例1: save

function save()
{
    $obj = new manage_professor_exe_posts();
    PdoDataAccess::FillObjectByArray($obj, $_POST);
    $postObj = new manage_posts($obj->post_id);
    if ($postObj->post_id == "") {
        echo Response::createObjectiveResponse(false, "کد پست وارد شده معتبر نمی باشد.");
        die;
    }
    if ($postObj->validity_start != "" && $postObj->validity_start != '0000-00-00' && DateModules::CompareDate($postObj->validity_start, str_replace("/", "-", DateModules::shamsi_to_miladi($obj->from_date))) > 0 || $postObj->validity_end != "" && $postObj->validity_end != '0000-00-00' && ($obj->to_date != "" && $obj->to_date != "0000-00-00") && DateModules::CompareDate($postObj->validity_end, str_replace("/", "-", DateModules::shamsi_to_miladi($obj->to_date))) < 0) {
        echo Response::createObjectiveResponse(false, "پست انتخابی از نظر تاریخ اعتبار و تاریخ های شروع و پایان وارد شده معتبر نمی باشد.");
        die;
    }
    if (empty($obj->row_no)) {
        $return = $obj->ADD();
    } else {
        $return = $obj->Edit();
    }
    if (!$return) {
        echo Response::createObjectiveResponse($return, ExceptionHandler::GetExceptionsToString());
        die;
    }
    if (isset($_POST["assign_post"])) {
        $return = $obj->assign_post();
    } else {
        $return = $obj->release_post();
    }
    echo Response::createObjectiveResponse($return, ExceptionHandler::GetExceptionsToString());
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:30,代码来源:exe_posts.data.php

示例2: duty_year_month_day

function duty_year_month_day($staff_id = "", $personID = "", $toDate) {
    if ($staff_id == "" && $personID = "") {
        PdoDataAccess::PushException("يکي از دو پارامتر staff_id و PersonID بايد فرستاده شود");
        return false;                
    }
    $query = "select w.execute_date,
						w.contract_start_date ,
						w.contract_end_date ,
						w.person_type ,
						w.onduty_year ,
						w.onduty_month ,
						w.onduty_day ,
						w.annual_effect
			from writs as w";

    if ($personID != "")
        $query .= " join staff as s using(staff_id) where s.PersonID=" . $personID;

    else if ($staff_id != "")
        $query .= " where w.staff_id = $staff_id";

    $query .= " AND (w.history_only != " . HISTORY_ONLY . " OR w.history_only is null) AND w.execute_date <= '$toDate'
						order by w.execute_date DESC,w.writ_id DESC,w.writ_ver DESC
						limit 1";

    $temp = PdoDataAccess::runquery($query);

    if (count($temp) == 0)
        return array("year" => 0, "month" => 0, "day" => 0);

    $writ_rec = $temp[0];

    $temp_duration = 0;

    if (DateModules::CompareDate($toDate, $writ_rec['execute_date']) >= 0)
        $temp_duration = DateModules::GDateMinusGDate($toDate, $writ_rec['execute_date']);

    if ($writ_rec['annual_effect'] == HALF_COMPUTED)
        $temp_duration *= 0.5;
    else if ($writ_rec['annual_effect'] == DOUBLE_COMPUTED)
        $temp_duration *= 2;
    else if ($writ_rec['annual_effect'] == NOT_COMPUTED)
        $temp_duration = 0;

    $prev_writ_duration = DateModules::ymd_to_days($writ_rec['onduty_year'], $writ_rec['onduty_month'], $writ_rec['onduty_day']);

    $duration = $prev_writ_duration + $temp_duration;
    
       
    $return = array();
    DateModules::day_to_ymd($duration, $return['year'], $return['month'], $return['day']);

    return $return;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:54,代码来源:EmpGradReport.php

示例3: 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

示例4: InsertData


//.........这里部分代码省略.........
            $PayItmObj->staff_id = $WritWrkRes['staff_id'];
            $PayItmObj->salary_item_type_id = $key;
            $PayItmObj->pay_value = $value;
            $PayItmObj->get_value = 0;
            $PayItmObj->param1 = $WritWrkRes['work_time'];
            $PayItmObj->param2 = $param2;
            $PayItmObj->cost_center_id = $WritWrkRes['cost_center_id'];
            $PayItmObj->payment_type = HANDSEL_PAYMENT;
            if ($PayItmObj->Add() === false) {
                $log_obj->make_unsuccess_rows($WritWrkRes['staff_id'], "-", "خطا در ثبت اقلام پرداختی");
                $unsuccess_count++;
                continue;
            }
            //..........................محاسبه مالیات مربوط به عیدی و پاداش ...................
            if (empty($WritWrkRes['tax_include'])) {
                continue;
            }
            $handsel_key = $key;
            if ($WritWrkRes['person_type'] == 1) {
                $TaxKey = 146;
            } elseif ($WritWrkRes['person_type'] == 2) {
                $TaxKey = 147;
            } elseif ($WritWrkRes['person_type'] == 3) {
                $TaxKey = 148;
            } elseif ($WritWrkRes['person_type'] == 5) {
                $TaxKey = 747;
            }
            $handsel_value = $value;
            $tax = 0;
            //متغيري جهت نگهداري ماليات
            reset($taxTable);
            foreach ($taxTable[$WritWrkRes['tax_table_type_id']] as $tax_table_row) {
                $pay_mid_month_date = DateModules::shamsi_to_miladi($PayYear . "/12/15");
                if (DateModules::CompareDate($pay_mid_month_date, $tax_table_row['from_date']) != -1 && DateModules::CompareDate($pay_mid_month_date, $tax_table_row['to_date']) != 1) {
                    if ($handsel_value >= $tax_table_row['from_value'] && $handsel_value <= $tax_table_row['to_value']) {
                        $tax += ($handsel_value - $tax_table_row['from_value']) * $tax_table_row['coeficient'];
                    } else {
                        if ($handsel_value > $tax_table_row['to_value']) {
                            $tax += ($tax_table_row['to_value'] - $tax_table_row['from_value']) * $tax_table_row['coeficient'];
                        }
                    }
                }
            }
            if ($tax > 0) {
                $PayItmObj->pay_year = $PayYear;
                $PayItmObj->pay_month = 12;
                $PayItmObj->staff_id = $WritWrkRes['staff_id'];
                $PayItmObj->salary_item_type_id = $TaxKey;
                $PayItmObj->pay_value = 0;
                $PayItmObj->get_value = $tax;
                $PayItmObj->param1 = $handsel_value;
                $PayItmObj->param2 = $WritWrkRes['tax_table_type_id'];
                $PayItmObj->cost_center_id = $WritWrkRes['cost_center_id'];
                $PayItmObj->payment_type = HANDSEL_PAYMENT;
                if ($PayItmObj->Add() === false) {
                    $log_obj->make_unsuccess_rows($WritWrkRes['staff_id'], "-", "خطا در ثبت اقلام پرداختی");
                    $unsuccess_count++;
                    continue;
                }
            }
        }
        //End For
        $log_obj->finalize();
        $st = preg_replace('/\\r\\n/', "", $log_obj->make_result("UploadPayFilesObj.expand();"));
        if ($unsuccess_count > 0) {
            $pdo->rollBack();
开发者ID:jafarkhani,项目名称:rtfund,代码行数:67,代码来源:non_salary_import.data.php

示例5: round

            $d = round($total - $y * 365.25 - $m * 30.4375);
            $history .= "<td align=right colspan=3>سنوات غير قابل قبول : " . $y . " سال و " . $m . " ماه و " . $d . " روز" . "</td></tr>";
            //----------------------------------------------
            $tags = array('<!--history-->' => $history);
            $content = str_replace(array_keys($tags), array_values($tags), $content);
            echo $content;
            if (!isset($data[$i])) {
                break;
            }
            echo "<div class='pageBreak'></div>";
        }
        $prof1 = $prof2 = "";
        if ($data[$i][person_type] == HR_PROFESSOR) {
            $prof1 = '<tr><td style="background-color:#F0F3FF">مرتبه :</td><td style="font-weight:bold">' . $data[$i][science_level_title] . '</td>
						  <td style="background-color:#F0F3FF">پايه :</td><td style="font-weight:bold">' . $data[$i][base] . '</td></tr>';
            if ($data[$i][exe_to_date] == "" || $data[$i][exe_to_date] == "0000-00-00" || DateModules::CompareDate($data[$i][exe_to_date], DateModules::Now()) > 0) {
                $prof2 = '<tr><td style="background-color:#F0F3FF">سمت اجرايي :</td><td style="font-weight:bold">' . $data[$i][exe_post_title] . '</td>
							  <td style="background-color:#F0F3FF">تاريخ سمت اجرايي :</td><td style="font-weight:bold">' . DateModules::miladi_to_shamsi($data[$i][exe_from_date]) . '</td></tr>';
            } else {
                $prof2 = '<tr><td style="background-color:#F0F3FF">سمت اجرايي :</td><td style="font-weight:bold"></td>
							  <td style="background-color:#F0F3FF">تاريخ سمت اجرايي :</td><td style="font-weight:bold"></td></tr>';
            }
        }
        $tags = array('<!--post_title-->' => $data[$i][person_type] == HR_WORKER ? 'عنوان شغل' : 'عنوان پست', '<!--fname-->' => $data[$i][pfname], '<!--lname-->' => $data[$i][plname], '<!--father_name-->' => $data[$i][father_name], '<!--staff_id-->' => $data[$i][staff_id], '<!--birth_date-->' => DateModules::miladi_to_shamsi($data[$i][birth_date]), '<!--birth_place-->' => $data[$i][birth_place], '<!--idcard_no-->' => $data[$i][idcard_no], '<!--national_code-->' => $data[$i][national_code], '<!--prof1-->' => $prof1, '<!--worktime_type-->' => $data[$i][worktime_type_title], '<!--military_type-->' => $data[$i][military_type_title], '<!--education_level-->' => $data[$i][education_level_title], '<!--field_title-->' => $data[$i][sf_sb_title], '<!--doc_date-->' => DateModules::miladi_to_shamsi($data[$i][doc_date]), '<!--studyPlace-->' => $data[$i][study_palce], '<!--razm-->' => $data[$i][razmAmount], '<!--janbaz-->' => $data[$i][janbazAmount], '<!--unit-->' => $data[$i][unitName], '<!--emp_state-->' => $data[$i][emp_state_title], '<!--post_no-->' => $data[$i][post_no], '<!--last_post_title-->' => $data[$i][post_title], '<!--prof2-->' => $prof2, '<!--now-->' => DateModules::shNow());
        // مشخص کردن فایل template  مربوط به خلاصه پرونده
        $content = file_get_contents("../../reports/summary_doc.htm");
        $content = str_replace(array_keys($tags), array_values($tags), $content);
        $cur_staff = $data[$i][staff_id];
        $index = $i;
        $row_index = $i;
        $history = "";
开发者ID:jafarkhani,项目名称:rtfund,代码行数:31,代码来源:employment_history.php

示例6: compute_salary_item2_13

	private function compute_salary_item2_13($writ_rec) {

		//param1 : ضريب فوق العاده جذب : input
		//param2 : مضروب فيه (حقوق مبنا + افزايش سنواتي + فوق العاده شغل +  + حداقل دريافتي + فوق العاده شغل برجسته )

		if (in_array($writ_rec['person_type'], array(1, 2, 3))) {
			$this->param2 = manage_writ_item::compute_writ_items_sum($writ_rec["writ_id"], $writ_rec["writ_ver"], $writ_rec["staff_id"], '( ' . SIT_STAFF_BASE_SALARY . ' , ' . SIT_STAFF_ANNUAL_INC . ' , ' .
							SIT_STAFF_JOB_EXTRA . ' , ' . SIT_STAFF_DOMINANT_JOB_EXTRA . ' , ' .
							SIT_STAFF_MIN_PAY . ' , ' . SIT_STAFF_ADAPTION_DIFFERENCE . ',' .
							SIT_STAFF_DEVOTION_ANNUAL_INC . ')');
		}
		// //از تاريخ 1/1/85 به بعد روش محاسبه اين قلم تغيير كرده است
		elseif (in_array($writ_rec['person_type'], array(5, 6)) &&
				DateModules::CompareDate($writ_rec['execute_date'], '2006-03-21') == -1) {
			//حقوق مبنا + افزايش سنواتي + حداقل دريافتي +
			//فوق العاده شغل + فوق العاده شغل برجسته
			$this->param2 = manage_writ_item::compute_writ_items_sum(
							$writ_rec["writ_id"], $writ_rec["writ_ver"], $writ_rec["staff_id"], '( ' . SIT5_STAFF_BASE_SALARY . ' , ' . SIT5_STAFF_ANNUAL_INC . ' , ' .
							SIT5_STAFF_JOB_EXTRA . ' , ' . SIT5_STAFF_DOMINANT_JOB_EXTRA . ' , ' .
							SIT5_STAFF_MIN_PAY . ' )');
		} elseif (in_array($writ_rec['person_type'], array(5, 6)) &&
				DateModules::CompareDate($writ_rec['execute_date'], '2006-03-21') != -1) {
			//(حقوق مبنا + افزايش سنواتي + فوق العاده شغل +  حداقل دريافتي
			//+ فوق العاده شغل برجسته + تفاوت تطبيق + تفاوت همترازي)
			$this->param2 = manage_writ_item::compute_writ_items_sum($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec['staff_id'], '( ' . SIT5_STAFF_BASE_SALARY . ' , ' . SIT5_STAFF_ANNUAL_INC . ' , ' .
							SIT5_STAFF_JOB_EXTRA . ' , ' . SIT5_STAFF_DOMINANT_JOB_EXTRA . ' , ' .
							SIT5_STAFF_MIN_PAY . ' , ' . SIT5_STAFF_ADAPTION_DIFFERENCE . ')');
		}
		//چون به کساني که تفاوت تطبيق مي گيرند حداقل دريافتي تعلق نمي گيرد
		//بنابراين جمع چهار قلم
		//حقوق مبنا + افزايش سنواتي + فوق العاده شغل + فوق العاده شغل برجسته
		//ممکن است از حداقل حقوق کمترشود که در اين موارد بايد از حداقل حقوق استفاده شود.

		$min_salary = manage_salary_params::get_salaryParam_value("", $writ_rec["person_type"].",101", SPT_MIN_SALARY, $writ_rec['execute_date']);

		if ($this->param2 < $min_salary)
			$this->param2 = $min_salary;

		$value = $this->param1 * $this->param2;
		if (!($value > 0)) {
			parent::PushException(ABSORB_ITEM_CALC_ERR);
			return 0;
		}
		return $value;
	}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:45,代码来源:writ_item.class.php

示例7: get_retired_coef

 private function get_retired_coef()
 {
     $coefficient = 1;
     //init
     if ($this->staffRow['last_retired_pay'] != NULL && $this->staffRow['last_retired_pay'] != '0000-00-00' && DateModules::CompareDate($this->staffRow['last_retired_pay'], $this->month_start) == -1) {
         $coefficient = 0;
     } elseif ($this->staffRow['last_retired_pay'] != NULL && $this->staffRow['last_retired_pay'] != '0000-00-00' && DateModules::CompareDate($this->staffRow['last_retired_pay'], $this->month_end) != 1) {
         $coefficient = (round(DateModules::GDateMinusGDate($this->staffRow['last_retired_pay'], $this->month_start)) + 1) / $this->__MONTH_LENGTH;
     }
     return $coefficient;
 }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:11,代码来源:arrear_pay_calculation.class.php

示例8: elseif

                if ($valid_writs[$k][all_annual_effect] == "3") {
                    $total_non_year += $year;
                    $total_non_month += $month;
                    $total_non_day += $day;
                } else {
                    $total_year += $year;
                    $total_month += $month;
                    $total_day += $day;
                }
            }
            //......................................
            $prof1 = $prof2 = "";
            if ($valid_writs[$k - 1][person_type] == HR_PROFESSOR) {
                $prof1 = '<tr><td style="background-color:#F0F3FF">مرتبه :</td><td style="font-weight:bold">' . $valid_writs[$k - 1][science_level_title] . '</td>
						  <td style="background-color:#F0F3FF">پايه :</td><td style="font-weight:bold">' . $valid_writs[$k - 1][base] . '</td></tr>';
                if ($valid_writs[$k - 1][exe_to_date] == "" || $valid_writs[$k - 1][exe_to_date] == "0000-00-00" || DateModules::CompareDate($valid_writs[$k - 1][exe_to_date], DateModules::Now()) > 0) {
                    $prof2 = '<tr><td style="background-color:#F0F3FF">سمت اجرايي :</td><td style="font-weight:bold">' . $valid_writs[$k - 1][exe_post_title] . '</td>
							  <td style="background-color:#F0F3FF">تاريخ سمت اجرايي :</td><td style="font-weight:bold">' . DateModules::miladi_to_shamsi($valid_writs[$k - 1][exe_from_date]) . '</td></tr>';
                } else {
                    $prof2 = '<tr><td style="background-color:#F0F3FF">سمت اجرايي :</td><td style="font-weight:bold"></td>
							  <td style="background-color:#F0F3FF">تاريخ سمت اجرايي :</td><td style="font-weight:bold"></td></tr>';
                }
            }
            $ptitle = "";
            if ($valid_writs[$k - 1][person_type] == HR_WORKER) {
                $ptitle = 'عنوان شغل';
            } elseif ($valid_writs[$k - 1][person_type] == HR_PROFESSOR) {
                $ptitle = 'عنوان پست';
            } elseif ($valid_writs[$k - 1][person_type] == HR_EMPLOYEE) {
                $ptitle = 'عنوان حکم';
            }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:31,代码来源:summary_doc.php

示例9: get_writ_edit_state

 private static function get_writ_edit_state($Gexecute_date = "", $person_type = "", $writ_id = "", $writ_ver = "", $staff_id = "")
 {
     $stage1_end_date = OPEN_WRIT_WITHOUT_CALC_END_DATE;
     $stage2_end_date = OPEN_WRIT_WITH_CALC_END_DATE;
     if ($Gexecute_date == "") {
         if ($writ_ver == "") {
             $query = "SELECT MAX(writ_ver) writ_ver\n\t\t\t\t\t  FROM HRM_writs\n\t\t\t\t\t  WHERE writ_id = :wid AND staff_id = :stid";
             $temp = PdoDataAccess::runquery($query, array(":wid" => $writ_id, ":stid" => $staff_id));
             $writ_ver = $temp[0][0];
         }
         $query = "SELECT execute_date,person_type\n\t\t\t\t\tFROM HRM_writs\n\t\t\t\t\tWHERE writ_id = :wid AND writ_ver = :wver AND staff_id = :stid";
         $temp = PdoDataAccess::runquery($query, array(":wid" => $writ_id, ":wver" => $writ_ver, ":stid" => $staff_id));
         echo PdoDataAccess::GetLatestQueryString();
         die;
         $Gexecute_date = $temp[0]["execute_date"];
         $person_type = $temp[0]["person_type"];
     }
     if ($person_type == "") {
         //echo " نوع فرد مشخص نشده است .";
         return null;
     }
     if ($person_type == HR_PROFESSOR && DateModules::CompareDate($Gexecute_date, $stage1_end_date) >= 0 || $person_type == HR_WORKER && DateModules::CompareDate($Gexecute_date, $stage1_end_date) >= 0 || $person_type == HR_EMPLOYEE && DateModules::CompareDate($Gexecute_date, $stage1_end_date) >= 0 || $person_type == HR_CONTRACT && DateModules::CompareDate($Gexecute_date, $stage1_end_date) >= 0 || $person_type == HR_RETIRED) {
         $is_auto_writ = true;
     } else {
         $is_auto_writ = false;
     }
     if ($person_type == HR_PROFESSOR && DateModules::CompareDate($Gexecute_date, $stage2_end_date) >= 0 || $person_type == HR_WORKER && DateModules::CompareDate($Gexecute_date, $stage2_end_date) >= 0 || $person_type == HR_EMPLOYEE && DateModules::CompareDate($Gexecute_date, $stage2_end_date) >= 0 || $person_type == HR_CONTRACT && DateModules::CompareDate($Gexecute_date, $stage2_end_date) >= 0) {
         $is_new_writ = true;
     } else {
         $is_new_writ = false;
     }
     if (!$is_auto_writ && !$is_new_writ) {
         return 0;
     }
     if (!$is_auto_writ && $is_new_writ) {
         return 1;
     }
     if ($is_auto_writ && !$is_new_writ) {
         return 2;
     }
     if ($is_auto_writ && $is_new_writ) {
         return 3;
     }
 }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:44,代码来源:writ.class.php

示例10: get_arrear_document

    public static function get_arrear_document($staff_id, $pay_year, $pay_month)
    {
        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;
            }
            $qry = " select  cpw.staff_id , cpw.writ_id ,  cpw.writ_ver , cpw.arrear_ver , w.execute_date, w.send_letter_no , w.salary_pay_proc\r\n\t\t\r\n\t\t\t\t from corrective_payment_writs cpw inner join  writs w \r\n\t\t\t                                         on cpw.staff_id = w.staff_id and \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcpw.writ_id = w.writ_id and \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcpw.writ_ver = w.writ_ver \r\n\r\n\t\t\t where cpw.pay_year = " . $t . " and cpw.staff_id = " . $SID . " and arrear_ver = " . $MaxVer[0]['MV'] . " and cpw.pay_month = 12 \r\n\t\t\t order by  w.execute_date ";
            $res1 = PdoDataAccess::runquery($qry);
            //............................. پیدا کردن آخرین ماهی که فیش حقوقی در آن محاسبه شده است ................
            $qry = " select max(pay_month) PM from payment_writs where staff_id = " . $SID . " AND pay_year= " . $t;
            $MaxMonth = PdoDataAccess::runquery($qry);
            if ($MaxMonth[0]['PM'] > 0 && $MaxMonth[0]['PM'] < 7) {
                $LastDate = $t . "/" . $MaxMonth[0]['PM'] . "/31";
            } else {
                if ($MaxMonth[0]['PM'] > 6 && $MaxMonth[0]['PM'] < 12) {
                    $LastDate = $t . "/" . $MaxMonth[0]['PM'] . "/30";
                } else {
                    if ($MaxMonth[0]['PM'] == 12) {
                        $LastDate = $t . "/" . $MaxMonth[0]['PM'] . "/29";
                    } else {
                        $LastDate = '0000-00-00';
                    }
                }
            }
            $LAST_PAY_DATE = date('Y-m-d', strtotime(DateModules::shamsi_to_miladi($LastDate) . "+1 days"));
            $LAST_PAY_DATE = DateModules::miladi_to_shamsi($LAST_PAY_DATE);
            if ($res1[count($res1) - 1]['salary_pay_proc'] == 1) {
                $LastDate = DateModules::miladi_to_shamsi($res1[count($res1) - 1]['execute_date']);
                $arr = preg_split('/\\//', $LastDate);
                $NewDate = date('Y-m-d', strtotime(DateModules::shamsi_to_miladi($LastDate) . "-1 days"));
                $LastDate = DateModules::miladi_to_shamsi($NewDate);
                $arr = preg_split('/\\//', $LastDate);
            }
            $LD = array();
            //.................................................................................................
            for ($i = 0; $i < count($res1); $i++) {
                if ($LastDate != '0000-00-00' && DateModules::CompareDate($res1[$i]['execute_date'], str_replace("/", "-", DateModules::shamsi_to_miladi($LastDate))) >= 0) {
                    $LD[$t]['lastDate'] = $LastDate;
                    break;
                }
                $CDate = DateModules::miladi_to_shamsi($res1[$i]['execute_date']);
                $arr2 = preg_split('/\\//', $CDate);
                if (intval($arr2[1]) <= intval($MaxMonth[0]['PM'])) {
                    $qry = " select t.staff_id,max_execute_date ,SUBSTRING(max_execute_date,1,10) execute_date ,\r\n\t\t\t\t\t\tSUBSTRING_INDEX(SUBSTRING(max_execute_date,11),'.',1) writ_id,\r\n\t\t\t\t\t\tSUBSTRING_INDEX(max_execute_date,'.',-1) writ_ver\r\n\r\n\t\t\t\t\tfrom (\r\n\t\t\t\t\t\t\tselect w.staff_id,max( CONCAT(w.execute_date,w.writ_id,'.',w.writ_ver) ) max_execute_date\r\n\r\n\t\t\t\t\t\t\tfrom payment_writs cpw inner join  writs w\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton  cpw.staff_id = w.staff_id and\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcpw.writ_id = w.writ_id and\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcpw.writ_ver = w.writ_ver\r\n\t\t\t\t\t\t\twhere cpw.pay_year = " . $t . " and cpw.staff_id = " . $SID . " and\r\n\t\t\t\t\t\t\t      /*cpw.pay_month = 12 and*/ execute_date <= '" . $res1[$i]['execute_date'] . "'\r\n\r\n\t\t\t\t\t\t\tgroup by w.staff_id\r\n\t\t\t\t\t\t) t\r\n\t\t\t\t\t\t\t";
                    // پرس و جو بالا هم بایستی union شود با ورژن های قبلی پرداخت تا احکام آنها هم دیده شود .
                    $res2 = PdoDataAccess::runquery($qry);
                    if (count($res2) == 0) {
                        $res2[0]['execute_date'] = '0000-00-00';
                        $res2[0]['writ_id'] = 0;
                        $res2[0]['writ_ver'] = 0;
                    }
                } else {
                    $res2[0]['execute_date'] = '0000-00-00';
                    $res2[0]['writ_id'] = 0;
                    $res2[0]['writ_ver'] = 0;
                }
                /* PdoDataAccess::runquery(" insert compare_arrear_writs (staff_id ,current_execute_date , current_writ_id , current_writ_ver, 
                															   prev_execute_date , prev_writ_id , prev_writ_ver , arrear_ver , pay_year ) values 
                															  (" . $res1[$i]['staff_id'] . ",'" . $res1[$i]['execute_date'] . "'," . $res1[$i]['writ_id'] . "," .
                                    $res1[$i]['writ_ver'] . ",'" . $res2[0]['execute_date'] . "'," . $res2[0]['writ_id'] . "," .
                                    $res2[0]['writ_ver'] . "," . $res1[$i]['arrear_ver'] . "," . $t . " ) ");
                			*/
                if ($res1[$i]['writ_id'] == $res2[0]['writ_id'] && $res1[$i]['writ_ver'] == $res2[0]['writ_ver']) {
                    continue;
                }
                $writNo++;
            }
            //..................اگر برج 12 در دیون محاسبه می شود ولی در قبلی نبوده است بایستی به جدول compare افزوده شود..............................
            /*   if ($res1[(count($res1) - 1)]['salary_pay_proc'] != 1 && $MaxMonth[0]['PM'] < 12) {
            
            
            
                        $qry = " select staff_id , execute_date , writ_id , writ_ver 
                            from writs 
                             where  staff_id = " . $SID . " and salary_pay_proc = 1 and 
                                    execute_date >= '" . DateModules::shamsi_to_miladi($t . '/01/01') . "' and 
                                    execute_date <= '" . DateModules::shamsi_to_miladi($t . '/12/29') . "' and 
                                    issue_date >= '" . $res1[$i - 1]['execute_date'] . "' and state = 3 ";
            
                        $res3 = PdoDataAccess::runquery($qry);
            
                        PdoDataAccess::runquery(" insert compare_arrear_writs ( staff_id ,current_execute_date , current_writ_id , current_writ_ver, 
                                                                    prev_execute_date , prev_writ_id , prev_writ_ver , arrear_ver , pay_year ) values 
                                                                  (" . $SID . ",'" . $res1[$i - 1]['execute_date'] . "'," . $res1[$i - 1]['writ_id'] . "," .
                                $res1[$i - 1]['writ_ver'] . ",'" . $res3[0]['execute_date'] . "'," . $res3[0]['writ_id'] . "," .
                                $res3[0]['writ_ver'] . "," . $res1[$i - 1]['arrear_ver'] . "," . $t . " ) ");
                    } */
            //....................we need this part......................
            $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']);
            for ($i = 0; $i < count($res); $i++) {
                $writsWhereClause .= ' (wsi.writ_id=' . $res[$i]['current_writ_id'] . ' AND wsi.writ_ver=' . $res[$i]['current_writ_ver'] . ' AND wsi.staff_id=' . $res[$i]['staff_id'] . ') OR 
							 (wsi.writ_id=' . $res[$i]['prev_writ_id'] . ' AND wsi.writ_ver=' . $res[$i]['prev_writ_ver'] . ' AND wsi.staff_id=' . $res[$i]['staff_id'] . ' ) OR  ';
                $PrewritsWhereClause .= ' (wsi.writ_id=' . $res[$i]['prev_writ_id'] . ' AND wsi.writ_ver=' . $res[$i]['prev_writ_ver'] . ' AND wsi.staff_id=' . $res[$i]['staff_id'] . ' ) OR  ';
                $CurrwritsWhereClause .= ' (wsi.writ_id=' . $res[$i]['current_writ_id'] . ' AND wsi.writ_ver=' . $res[$i]['current_writ_ver'] . ' AND wsi.staff_id=' . $res[$i]['staff_id'] . ') OR ';
            }
            //.............................................................
        }
//.........这里部分代码省略.........
开发者ID:jafarkhani,项目名称:rtfund,代码行数:101,代码来源:salary_utils.inc.php

示例11: generateReport

function generateReport($transcript_no)
{
    global $equal_payment_system_gdate;
    $fileNames = array();
    $last_writ = isset($_GET["last_writ_flag"]) || isset($_POST["last_writ_view"]) ? "1" : "";
    $dt = writ_print_list($transcript_no, $last_writ);
    if ($dt->rowCount() == 0) {
        echo "گزارش هیچ نتیجه ایی در بر ندارد.";
        return;
    }
    $current_staff_id = "";
    $cnt = $dt->rowCount();
    for ($i = 0; $i < $cnt; $i++) {
        $row = $dt->fetch();
        if ($current_staff_id != $row["staff_id"]) {
            $writForm = PrintWrit($row);
            $current_staff_id = $row["staff_id"];
        }
        if ($row['person_type'] == HR_PROFESSOR) {
            // نسخه هيات علمي
            $transcripts_title = $transcript_no == "all" ? $row['transcripts_title'] : 'عضو هيات علمي';
        } else {
            // نسخه استخدام كشوري
            //$transcripts_title = ($transcript_no == "all") ? $row['transcripts_title'] : 'مستخدم';
            $transcripts_title = $transcript_no == "all" ? $row['transcripts_title'] : ' کارگزینی';
        }
        $tags = array('<!--transcripts_title-->' => $transcripts_title);
        echo str_replace(array_keys($tags), array_values($tags), $writForm);
        echo "<div class=noprint><br><br></div>";
        if ($i == $cnt - 1 && $row['corrective'] == 1) {
            echo "<div class='pageBreak'></div>";
            // موارد مربوط به پشت حكم اصلاحي
            $corrective_detail = corrective_writ_detail($row['writ_id'], $row['writ_ver'], $row['staff_id'], $row['execute_date']);
            $tags = array('<!--CORRECTIVE_DETAIL-->' => $corrective_detail);
            $corrective_detail = str_replace(array_keys($tags), array_values($tags), $corrective_detail);
            if ($row['person_type'] == HR_PROFESSOR || DateModules::CompareDate($row['execute_date'], $equal_payment_system_gdate) < 0) {
                echo '<div class="report_header" style="font-size:medium"><B>اصلاحات احکام کارگزيني</B><br></div>
					<table cellpadding="0" cellspacing="0" class="big_corrective money" style="text-align:center">';
            } else {
                echo '<div class="report_header" style="font-size:medium"><B>اصلاحات احکام کارگزيني</B><br></div>
					<table cellpadding="0" cellspacing="0" class="report money" style="text-align:center">';
            }
            echo $corrective_detail;
            echo "</table>";
        }
        //$fileNames[] = PrintWrit($row, $transcript_no);
        if ($i != $cnt - 1) {
            echo "<div class='pageBreak'></div>";
        }
    }
    return $fileNames;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:52,代码来源:print_writ.php

示例12: validate_salary_item_type_id

 function validate_salary_item_type_id($validity_start_date, $validity_end_date, $date)
 {
     if (DateModules::CompareDate($validity_start_date, $date) != 1 && (DateModules::CompareDate($validity_end_date, $date) != -1 || $validity_end_date == null || $validity_end_date == '0000-00-00')) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:8,代码来源:salary_item_types.class.php

示例13:

" class="x-form-text x-form-field"> روز
		</td>
		<td></td>
		<td></td>
	</tr>
	<?}if($objWrt->person_type == HR_PROFESSOR){?>
	<tr>
		<td>عنوان دانشگاهي :</td>
		<td><?php 
echo $drp_science_level;
?>
</td>
		<td>پايه :</td>
		<?if(($objWrt->emp_state == EMP_STATE_SOLDIER_CONTRACTUAL ||
            $objWrt->emp_state == EMP_STATE_CONTRACTUAL || $objWrt->emp_state == EMP_STATE_ONUS_SOLDIER_CONTRACTUAL) &&
			DateModules::CompareDate($objWrt->execute_date, DateModules::shamsi_to_miladi('1389/07/01')) < 0){?>

		<td class="bluText"><?php 
echo $objWrt->base;
?>
</td>
		<?}else{?>
		<td><input type="text" id="base" name="base" class="x-form-text x-form-field" value="<?php 
echo $objWrt->base;
?>
"></td>
		<?}?>
	</tr>
	<?}?>
	<tr>
		<td>وضعيت استخدامي :</td>
开发者ID:jafarkhani,项目名称:rtfund,代码行数:31,代码来源:writ_form_1.php


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