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


PHP PdoDataAccess::FillObjectByObject方法代码示例

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


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

示例1: IssueWritAction

 /**
  * تنها با استفاده از اين تابع مي توان حکم جديد صادر کرد
  * @return boolean : قرار مي دهد  ExceptionHandler اگر صدور حکم با موفقيت انجام نشود توضيح خطا را در
  */
 private function IssueWritAction($indiv = NULL)
 {
     $temp = parent::runquery("select last_writ_id,last_writ_ver,staff_id,PersonID,person_type from HRM_staff\n   \t\t\t\t\t\t\t\t\t\t\twhere staff_id=" . $this->staff_id . " and person_type =" . $this->person_type);
     if (count($temp) == 0) {
         parent::PushException(ERROR_STAFF_ID_NOT_FOUND);
         return false;
     }
     $staff_rec = $temp[0];
     $PersonID = $staff_rec['PersonID'];
     //___________________________________________________________
     //در صورتي که روال ناتمام اصلاح وجود دارد
     if ($this->correct_is_not_completed($this->staff_id)) {
         parent::PushException(ERROR_CORRECT_IS_NOT_COMPLETED);
         return false;
     }
     //___________________________________________________________
     //در صورتي که حکم خودکار است کنترلهاي زير اعمال شود
     $is_auto = $this->is_auto_writ($this->execute_date, $this->person_type);
     if ($is_auto) {
         //___________________________________________________________
         $lastWritObj = manage_writ::GetLastWrit($this->staff_id);
         $writ_subtype_obj = new manage_writ_subType($this->person_type, $this->writ_type_id, $this->writ_subtype_id);
         //.........................................................................................
         if (($this->person_type == 5 || $writ_subtype_obj->emp_state == 2) && $this->contract_start_date != NULL && substr(DateModules::miladi_to_shamsi($this->execute_date), 0, 4) != substr(DateModules::miladi_to_shamsi($this->contract_start_date), 0, 4)) {
             parent::PushException(ER_CONTRACT_DATE);
             return false;
         }
         //.........................................................................................
         //..... در صورتی که فرد بازنشسته باشد ولی آزاده باشد امکان صدور حکم برای فرد میسر می باشد ................
         //.... جانباز نیز بهمین صورت...................................................................
         $Azadegi = manage_person_devotion::get_person_devotions($PersonID, "(2,3)");
         //...................................................................................................
         //کنترل مي کند که در صورتي که شخص بازنشسته شده باشد براي او حکمي صادر نشود.
         if (!empty($lastWritObj->writ_id) && $lastWritObj->execute_date < $this->execute_date && !$this->history_only) {
             if (($lastWritObj->emp_mode == EMP_MODE_RETIRE && $Azadegi[0]['amount'] <= 0 || $lastWritObj->emp_mode == EMP_MODE_RE_BUY || $lastWritObj->emp_mode == EMP_MODE_RUSTICATION || $lastWritObj->emp_mode == EMP_MODE_PERMANENT_BREAK || $lastWritObj->emp_mode == EMP_MODE_BREAKAWAY || $lastWritObj->emp_mode == EMP_MODE_CONVEYANCE && $writ_subtype_obj->emp_mode != 16) && $this->corrective_writ_id == PDONULL) {
                 parent::PushException(ERROR_FOR_RETIRED_PERSONS_CAN_NOT_ISSUE_WRIT);
                 return false;
             }
         }
         //___________________________________________________________
     }
     if (!empty($lastWritObj->writ_id)) {
         parent::FillObjectByObject($lastWritObj, $this);
         //--------بررسی مجدد تیک مربوط به سرپرست خانواده ----------------------------
         $query = "select family_responsible from HRM_writs\n\t\t\t\t\t\twhere staff_id=:stfid and (history_only != " . HISTORY_ONLY . " OR history_only IS NULL)\n\t\t\t\t\t\t\torder by execute_date DESC,writ_id DESC,writ_ver DESC ";
         $whereParam = array(":stfid" => $this->staff_id);
         $resResponsible = parent::runquery($query, $whereParam);
         $this->family_responsible = $resResponsible[0]['family_responsible'];
         //--------------------------------------------------------------------------
         //اگر حكم قبلي در محاسبه حقوق استفاده شده باشد و يا در وضعيت مياني باشد
         //اين حكم كه اطلاعات حكم قبلي را كپي مي كند نبايد مقدار وضعيت آن را نيز كپي كند
         $this->state = 1;
         if (!$this->corrective_writ_id && !$this->corrective_writ_ver || $this->corrective_writ_id == PDONULL && $this->corrective_writ_ver == PDONULL) {
             $this->correct_completed = 0;
         }
         //___________________________________________________________
         //در صورتي که حکم يکي از شرايط زير را داشته باشد مي تواند بدون
         // رعايت توالي تاريخي صادر شود :
         // خودکار نباشد - حکم اصلاحي و يا در حال اصلاح باشد - حکم فقط ثبت سابقه باشد
         if ($this->is_new_writ($this->execute_date, $this->person_type) && !$this->corrective && $this->corrective_writ_id == PDONULL && !$this->history_only) {
             if ($this->execute_date < $lastWritObj->execute_date && $indiv == NULL) {
                 parent::PushException(EXECUTE_DATE_OF_NORMAL_WRIT_CANT_BEFORE_LAST_ONE_ERR);
                 return false;
             }
         }
         //__________________________________________________________
         // محاسبه سنوات خدمت فرد
         $duty_duration = $this->duty_year_month_day($this->staff_id, "", $this->execute_date);
         $this->onduty_year = !empty($duty_duration['year']) ? $duty_duration['year'] : 0;
         $this->onduty_month = !empty($duty_duration['month']) ? $duty_duration['month'] : 0;
         $this->onduty_day = !empty($duty_duration['day']) ? $duty_duration['day'] : 0;
         /*  if( $this->person_type != HR_CONTRACT ){
              $related_duty_duration = $this->related_duty_years($this->staff_id, $this->execute_date, $this->post_id, "INSERT");
              $this->related_onduty_year   = !empty($related_duty_duration['year']) ? $related_duty_duration['year'] : 0;
              $this->related_onduty_month  = !empty($related_duty_duration['month']) ? $related_duty_duration['month'] : 0;
              $this->related_onduty_day    = !empty($related_duty_duration['day']) ? $related_duty_duration['day'] : 0;
             } */
         if ($this->person_type == HR_EMPLOYEE || $this->person_type == HR_CONTRACT) {
             /*if($lastWritObj->execute_date > '2014-03-20')
             		   $this->base = $lastWritObj->base ; 
             		else {*/
             $Pqry = " select sex , military_duration_day ,military_duration  \n\t\t\t\t\t\t\t\t\tfrom HRM_persons p inner join HRM_staff s on p.personid = s.personid \n\t\t\t\t\t\t\t\t\t\t\twhere s.staff_id=" . $this->staff_id;
             $Pres = parent::runquery($Pqry);
             if ($Pres[0]["sex"] == 1 && $this->person_type == 2 && ($Pres[0]["military_duration_day"] > 0 || $Pres[0]["military_duration"] > 0)) {
                 $totalDayWrt = DateModules::ymd_to_days($this->onduty_year, $this->onduty_month, $this->onduty_day);
                 $totalDaySar = DateModules::ymd_to_days(0, $Pres[0]["military_duration"], $Pres[0]["military_duration_day"]);
                 $resDay = $totalDayWrt - $totalDaySar;
                 $Vyear = 0;
                 $Vmonth = $Vday = 0;
                 DateModules::day_to_ymd($resDay, $Vyear, $Vmonth, $Vday);
                 $Vyear = $Vyear;
             } else {
                 /*$totalDayWrt = DateModules::ymd_to_days($this->onduty_year, $this->onduty_month , $this->onduty_day ) ; 							
                 
                 							$diffYear = DateModules::getDateDiff(DateModules::Now(),'2014-03-21');
                 
//.........这里部分代码省略.........
开发者ID:jafarkhani,项目名称:rtfund,代码行数:101,代码来源:writ.class.php

示例2: merging

function merging($main,$sub){
	
	$dtmain = PdoDataAccess::runquery("select PersonID,concat_ws(' ',fname,lname,CompanyName) fullname from BSC_persons where PersonID=?",array($main));
	$dtsub = PdoDataAccess::runquery("select PersonID,concat_ws(' ',fname,lname,CompanyName) fullname from BSC_persons where PersonID=?",array($sub));
	
	if(count($dtmain) == 0 || count($dtsub) == 0)
	{
		echo "یکی از کد ها نا معتبر است";
	}
	else
	{
		$PersonID1 = $main; 
		$PersonID2 = $sub;
		echo $dtmain[0]["fullname"] . "<br>" . $dtsub[0]["fullname"] . "<br>";
				
		PdoDataAccess::runquery("update LON_requests set LoanPersonID=? where LoanPersonID=?", 	array($PersonID1, $PersonID2));
		echo "update LON_requests : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update BSC_OrgSigners set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update BSC_OrgSigners : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update BSC_PersonExpertDomain set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update BSC_PersonExpertDomain : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update BSC_licenses set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update BSC_licenses : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update CNT_contracts set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update CNT_contracts : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update DMS_packages set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update DMS_packages : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update PLN_experts set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update PLN_experts : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update PLN_plans set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update PLN_plans : " . PdoDataAccess::AffectedRows() . "<br>";
		PdoDataAccess::runquery("update DataAudit set PersonID=? where PersonID=?", array($PersonID1, $PersonID2));
		echo "update DataAudit : " . PdoDataAccess::AffectedRows() . "<br>";
		
		PdoDataAccess::runquery("update DMS_documents set ObjectID=? where ObjectType='person' AND ObjectID=?", array($PersonID1, $PersonID2));
		echo "update DMS_documents : " . PdoDataAccess::AffectedRows() . "<br>";
		
		require_once 'framework/person/persons.class.php';
		$obj = new BSC_persons($PersonID1);
		$obj2 = new BSC_persons($PersonID2);
		PdoDataAccess::FillObjectByObject($obj, $obj2);
		$obj->PersonID = $PersonID1;
		$result = $obj->EditPerson();
		echo "copy persons properties : " . ($result ? "true" : "false") . "<br>";
				
		PdoDataAccess::runquery("delete from BSC_persons where PersonID=?", array($PersonID2));
			echo "delete BSC_persons : " . PdoDataAccess::AffectedRows() . "<br>";

		
		$TafsiliID1 = PdoDataAccess::runquery("select * from ACC_tafsilis where TafsiliType=1 AND ObjectID=?",array($main));
		$TafsiliID2 = PdoDataAccess::runquery("select * from ACC_tafsilis where TafsiliType=1 AND ObjectID=?",array($sub));
		if(count($TafsiliID1) == 0 || count($TafsiliID2) == 0)
		{
			echo "یکی از کد ها فاقد تفصیلی است";
		}
		else
		{
			$TafsiliID1 = $TafsiliID1[0]["TafsiliID"];
			$TafsiliID2 = $TafsiliID2[0]["TafsiliID"];
			
			
			PdoDataAccess::runquery("update ACC_DocItems set TafsiliID=? where TafsiliID=?", 
				array($TafsiliID1, $TafsiliID2));
			echo "update ACC_DocItems : " . PdoDataAccess::AffectedRows() . "<br>";
			PdoDataAccess::runquery("update ACC_DocItems set TafsiliID2=? where TafsiliID2=?", 
				array($TafsiliID1, $TafsiliID2));		
			echo "update ACC_DocItems : " . PdoDataAccess::AffectedRows() . "<br>";
			PdoDataAccess::runquery("delete from ACC_tafsilis where TafsiliID=?", array($TafsiliID2));
			echo "delete ACC_tafsilis : " . PdoDataAccess::AffectedRows() . "<br>";
		}
		
		print_r(ExceptionHandler::PopAllExceptions());
	}
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:74,代码来源:changes.php

示例3: SaveLoanRequest

function SaveLoanRequest()
{
    $obj = new LON_requests();
    PdoDataAccess::FillObjectByArray($obj, $_POST);
    $obj->AgentGuarantee = isset($_POST["AgentGuarantee"]) ? "YES" : "NO";
    $obj->guarantees = array();
    $arr = array_keys($_POST);
    foreach ($arr as $index) {
        if (strpos($index, "guarantee") !== false) {
            $obj->guarantees[] = str_replace("guarantee_", "", $index);
        }
    }
    $obj->guarantees = implode(",", $obj->guarantees);
    $obj->IsFree = isset($_POST["IsFree"]) ? "YES" : "NO";
    //------------------------------------------------------
    if (isset($_SESSION["USER"]["portal"])) {
        if ($_SESSION["USER"]["IsAgent"] == "YES" || $_SESSION["USER"]["IsSupporter"] == "YES") {
            $obj->ReqPersonID = $_SESSION["USER"]["PersonID"];
            if (isset($_POST["sending"]) && $_POST["sending"] == "true") {
                $obj->StatusID = 10;
            } else {
                $obj->StatusID = 1;
            }
            $obj->LoanID = Default_Agent_Loan;
        }
        if ($_SESSION["USER"]["IsCustomer"] == "YES") {
            if (!isset($obj->LoanPersonID)) {
                $obj->LoanPersonID = $_SESSION["USER"]["PersonID"];
            }
            $obj->StatusID = 10;
        }
    } else {
        if (empty($obj->RequestID)) {
            $obj->LoanID = Default_Agent_Loan;
            $obj->StatusID = 1;
        }
    }
    if (empty($obj->RequestID)) {
        $obj->AgentGuarantee = isset($_POST["AgentGuarantee"]) ? "YES" : "NO";
        $result = $obj->AddRequest();
        if ($result) {
            ChangeStatus($obj->RequestID, $obj->StatusID, "", true);
        } else {
            echo Response::createObjectiveResponse(false, ExceptionHandler::GetExceptionsToString());
            die;
        }
        $loanObj = new LON_loans($obj->LoanID);
        $PartObj = new LON_ReqParts();
        PdoDataAccess::FillObjectByObject($loanObj, $PartObj);
        $PartObj->RequestID = $obj->RequestID;
        $PartObj->PartDesc = "شرایط اولیه";
        $PartObj->FundWage = $loanObj->CustomerWage;
        $PartObj->PartAmount = $obj->ReqAmount;
        $PartObj->PartDate = PDONOW;
        $PartObj->AddPart();
    } else {
        $result = $obj->EditRequest();
        if ($result) {
            ChangeStatus($obj->RequestID, $obj->StatusID, "", true);
        } else {
            echo Response::createObjectiveResponse(false, ExceptionHandler::GetExceptionsToString());
            die;
        }
    }
    //print_r(ExceptionHandler::PopAllExceptions());
    echo Response::createObjectiveResponse($result, $obj->RequestID);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:68,代码来源:request.data.php


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