예제 #1
0
 function AddEmp()
 {
     $this->row_no = manage_person_employment::LastID($this->PersonID) + 1;
     $this->OnBeforeInsert();
     if (PdoDataAccess::insert("person_employments", $this) === false) {
         return false;
     }
     $daObj = new DataAudit();
     $daObj->ActionType = DataAudit::Action_add;
     $daObj->RelatedPersonType = DataAudit::PersonType_staff;
     $daObj->RelatedPersonID = $this->PersonID;
     $daObj->MainObjectID = $this->row_no;
     $daObj->TableName = "person_employments";
     $daObj->execute();
     return true;
 }
예제 #2
0
             $total_year += $year;
             $total_month += $month;
             $total_day += $day;
         }
     }
     //....................... سربازی .......................................
     $query = " select military_from_date , military_to_date , military_duration\n\t\t\t\t\t\tfrom persons where PersonID = " . $res[$i]['PersonID'];
     $Mrow = PdoDataAccess::runquery($query);
     if (isset($Mrow[0]["military_duration"]) && $Mrow[0]["military_duration"] > 0) {
         $total_year += floor($Mrow[0]["military_duration"] / 12);
         $total_month += $Mrow[0]["military_duration"] - floor($Mrow[0]["military_duration"] / 12) * 12;
         $total_day += 0;
     }
     //.......................... سابقه کاری ......................
     require_once "../../../personal/persons/class/employment.class.php";
     $temp = manage_person_employment::GetAllEmp("PersonID=" . $res[$i]['PersonID']);
     for ($k = 0; $k < count($temp); $k++) {
         if ($temp[$k]["retired_duration_year"] != 0 || $temp[$k]["retired_duration_month"] != 0 || $temp[$k]["retired_duration_day"] != 0) {
             $total_year += $temp[$k]["retired_duration_year"];
             $total_month += $temp[$k]["retired_duration_month"];
             $total_day += $temp[$k]["retired_duration_day"];
         }
     }
     //..........................................................
     $TotalDay = DateModules::ymd_to_days($total_year, $total_month, $total_day);
     //DateModules::day_to_ymd($TotalDay, $Tyear, $Tmonth, $Tday);
     //................ ذخیره مقدارنهایی
     $query = " insert into YearRedemption (PersonID,duration,value,year,writ_id,writ_ver) values \n\t\t\t               (" . $res[$i]['PersonID'] . "," . round($TotalDay / 360, 2) . "," . $res[$i]['sv'] . " ," . $_REQUEST['pay_year'] . "," . $res2[$j - 1]['writ_id'] . "," . $res2[$j - 1]['writ_ver'] . "); ";
 }
 PdoDataAccess::runquery($query);
 //.....................................................................
예제 #3
0
     continue;
 }
 $row_index = $i;
 $valid_writs[] = $data[$i];
 //if($i == $index && $data[$i][all_annual_effect] == 3 && $data[$i][all_show_in_summary_doc] == 0)
 //	continue;
 if ($index == $i) {
     if ($data[$i][military_from_date] != "" && $data[$i][military_to_date] != "" && $data[$i][military_duration] != "") {
         $history_row[DateModules::miladi_to_shamsi($data[$i][military_from_date]) . "_1"] = "<tr>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($data[$i][military_from_date]) . "</td>\n\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($data[$i][military_to_date]) . "</td>\n\t\t\t\t\t<td>" . floor($data[$i][military_duration] / 12) . "</td>\n\t\t\t\t\t<td>" . ($data[$i][military_duration] - floor($data[$i][military_duration] / 12) * 12) . "</td>\n\t\t\t\t\t<td>0</td>\n\t\t\t\t\t<td>قابل قبول</td>\n\t\t\t\t\t<td>سربازی</td>\n\t\t\t\t\t<td>سربازی</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>";
         $total_year += floor($data[$i][military_duration] / 12);
         $total_month += $data[$i][military_duration] - floor($data[$i][military_duration] / 12) * 12;
         $total_day += 0;
     }
     //......................................................................
     require_once "../../personal/persons/class/employment.class.php";
     $temp = manage_person_employment::GetAllEmp("PersonID=" . $data[$i][PersonID]);
     $history2 = "";
     for ($j = 0; $j < count($temp); $j++) {
         if ($temp[$j]["retired_duration_year"] != 0 || $temp[$j]["retired_duration_month"] != 0 || $temp[$j]["retired_duration_day"] != 0) {
             $history_row[DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "_2"] = "<tr>\n\t\t\t\t\t\t<td>" . $temp[$j]["title"] . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["to_date"]) . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["retired_duration_year"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["retired_duration_month"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["retired_duration_day"] . "</td>\n\t\t\t\t\t\t<td>قابل قبول</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["organization"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["empstateTitle"] . "</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t</tr>";
             $total_year += $temp[$j]["retired_duration_year"];
             $total_month += $temp[$j]["retired_duration_month"];
             $total_day += $temp[$j]["retired_duration_day"];
         }
         //------------------------------------------------------------------
         $year = floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25);
         $month = floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"]) - floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25) * 365.25) / 30.4375);
         $day = ($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"]) - floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25) * 365.25 - round(floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"]) - floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25) * 365.25) / 30.4375) * 30.4375);
         if ($year != 0 || $month != 0 || $day != 0) {
             $history_row[DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "_3"] = "<tr>\n\t\t\t\t\t\t<td>" . $temp[$j]["title"] . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["to_date"]) . "</td>\n\t\t\t\t\t\t<td>" . $year . "</td>\n\t\t\t\t\t\t<td>" . $month . "</td>\n\t\t\t\t\t\t<td>" . round($day) . "</td>\n\t\t\t\t\t\t<td>غیر قابل قبول</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["organization"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["empstateTitle"] . "</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t</tr>";
             $total_non_year += $year;
예제 #4
0
     $row_index_all_annual_effect = $row[all_annual_effect];
     continue;
 }
 $row_index = $i;
 $row_index_all_annual_effect = $row[all_annual_effect];
 $valid_writs[$cwrt] = $row;
 if ($index == $i) {
     if ($row[military_from_date] != "" && $row[military_from_date] != "0000-00-00" && ($row[military_to_date] != "" && $row[military_to_date] != "0000-00-00") && ($row[military_duration] != "" && $row[military_duration] != "0000-00-00")) {
         $history_row[DateModules::miladi_to_shamsi($row[military_from_date]) . "_1"] = "<tr>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($row[military_from_date]) . "</td>\n\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($row[military_to_date]) . "</td>\n\t\t\t\t\t<td>" . floor($row[military_duration] / 12) . "</td>\n\t\t\t\t\t<td>" . ($row[military_duration] - floor($row[military_duration] / 12) * 12) . "</td>\n\t\t\t\t\t<td>0</td>\n\t\t\t\t\t<td>قابل قبول</td>\n\t\t\t\t\t<td>سربازی</td>\n\t\t\t\t\t<td>سربازی</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>";
         $total_year += floor($row[military_duration] / 12);
         $total_month += $row[military_duration] - floor($row[military_duration] / 12) * 12;
         $total_day += 0;
     }
     //......................................................................
     require_once "../../personal/persons/class/employment.class.php";
     $temp = manage_person_employment::GetAllEmp("PersonID=" . $row[PersonID]);
     for ($j = 0; $j < count($temp); $j++) {
         if ($temp[$j]["retired_duration_year"] != 0 || $temp[$j]["retired_duration_month"] != 0 || $temp[$j]["retired_duration_day"] != 0) {
             $history_row[DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "_2"] = "<tr>\n\t\t\t\t\t\t<td>" . $temp[$j]["title"] . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["to_date"]) . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["retired_duration_year"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["retired_duration_month"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["retired_duration_day"] . "</td>\n\t\t\t\t\t\t<td>قابل قبول</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["organization"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["empstateTitle"] . "</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t</tr>";
             $total_year += $temp[$j]["retired_duration_year"];
             $total_month += $temp[$j]["retired_duration_month"];
             $total_day += $temp[$j]["retired_duration_day"];
         }
         //------------------------------------------------------------------
         $year = floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25);
         $month = floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"]) - floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25) * 365.25) / 30.4375);
         $day = ($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"]) - floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25) * 365.25 - round(floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"]) - floor((($temp[$j]["duration_year"] - $temp[$j]["retired_duration_year"]) * 365.25 + ($temp[$j]["duration_month"] - $temp[$j]["retired_duration_month"]) * 30.4375 + ($temp[$j]["duration_day"] - $temp[$j]["retired_duration_day"])) / 365.25) * 365.25) / 30.4375) * 30.4375);
         if ($year != 0 || $month != 0 || $day != 0) {
             $history_row[DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "_3"] = "<tr>\n\t\t\t\t\t\t<td>" . $temp[$j]["title"] . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["from_date"]) . "</td>\n\t\t\t\t\t\t<td>" . DateModules::miladi_to_shamsi($temp[$j]["to_date"]) . "</td>\n\t\t\t\t\t\t<td>" . $year . "</td>\n\t\t\t\t\t\t<td>" . $month . "</td>\n\t\t\t\t\t\t<td>" . round($day) . "</td>\n\t\t\t\t\t\t<td>غیر قابل قبول</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["organization"] . "</td>\n\t\t\t\t\t\t<td>" . $temp[$j]["empstateTitle"] . "</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t</tr>";
             $total_non_year += $year;
             $total_non_month += $month;
예제 #5
0
function DelEmp()
{
    $return = manage_person_employment::RemoveEmp($_POST['PersonID'], $_POST['row_no']);
    if ($return !== true) {
        echo $return;
        die;
    }
    echo Response::createObjectiveResponse("true", $_POST['PersonID']);
    die;
}
예제 #6
0
                $total_not_rasmi_year += $year;
                $total_not_rasmi_month += $month;
                $total_not_rasmi_day += $day;
                
            }
        }

        //..........................................................................
        $total_not_rasmi_year += floor($temp[$i]['military_duration'] / 12);
        $total_not_rasmi_month += ($temp[$i]['military_duration'] - (floor($temp[$i]['military_duration'] / 12) * 12));
        $total_not_rasmi_day += 0;
             
        //..........................................................................
        require_once $address_prefix . "/HumanResources/personal/persons/class/employment.class.php";
        //	$temp[$i]['PersonID'] = '100000' ; 
        $empRes = manage_person_employment::GetAllEmp("PersonID=" . $temp[$i]['PersonID']);

        for ($j = 0; $j < count($empRes); $j++) {
            if ($empRes[$j]["retired_duration_year"] != 0 || $empRes[$j]["retired_duration_month"] != 0 ||
                    $empRes[$j]["retired_duration_day"] != 0) {
                if ($empRes[$j]["emp_state"] == 3 || $empRes[$j]["emp_state"] == 4) {

                    $total_year += $empRes[$j]["retired_duration_year"];
                    $total_month += $empRes[$j]["retired_duration_month"];
                    $total_day += $empRes[$j]["retired_duration_day"];
                   
                } /*else {

                    $total_not_rasmi_year += $empRes[$j]["retired_duration_year"];
                    $total_not_rasmi_month += $empRes[$j]["retired_duration_month"];
                    $total_not_rasmi_day += $empRes[$j]["retired_duration_day"];