function EditWST() { parent::update("writ_subtypes", $this, " person_type = :PT and writ_type_id = :WTI and writ_subtype_id = :WSTID ", array(":PT" => $this->person_type, ":WTI" => $this->writ_type_id, ":WSTID" => $this->writ_subtype_id)); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->person_type . "-" . $this->writ_type_id . "-" . $this->writ_subtype_id; $daObj->TableName = "writ_subtypes"; $daObj->execute(); return true; }
function EditDocument() { if (parent::update("DMS_documents", $this, " DocumentID=:l", array(":l" => $this->DocumentID)) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->DocumentID; $daObj->TableName = "DMS_documents"; $daObj->execute(); return true; }
function Edit() { $result = parent::update("priority", $this, "PriorityID=" . $this->PriorityID); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->PriorityID; $daObj->TableName = "priority"; $daObj->execute(); return true; }
function EditTax($tax_table_type_id) { $result = parent::update("HRM_tax_table_types", $this, "tax_table_type_id=:ti ", array(":ti" => $this->tax_table_type_id)); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->tax_table_type_id; $daObj->TableName = "HRM_tax_table_types"; $daObj->execute(); return true; }
function Edit() { $whereParams = array(); $whereParams[":sfid"] = $this->sfid; if (parent::update("study_fields", $this, " sfid=:sfid", $whereParams) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->sfid; $daObj->TableName = "study_fields"; $daObj->execute(); return true; }
function EditTaxItem($tax_table_id, $row_no) { $result = parent::update("HRM_tax_table_items", $this, "tax_table_id=:tid and row_no=:rid ", array(":tid" => $this->tax_table_id, ":rid" => $this->row_no)); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->tax_table_id; $daObj->SubObjectID = $this->row_no; $daObj->TableName = "HRM_tax_table_items"; $daObj->execute(); return true; }
function EditParam($param_id) { $result = parent::update("HRM_salary_param_types", $this, "param_type=:ptp and person_type =:pt ", array(":ptp" => $this->param_type, ":pt" => $this->person_type)); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->param_type; $daObj->SubObjectID = $this->person_type; $daObj->TableName = "HRM_salary_param_types"; $daObj->execute(); return true; }
function Edit() { $whereParams = array(); $whereParams[":sid"] = $this->SalaryItemReportID; $result = parent::update("SalaryItemReport", $this, " SalaryItemReportID=:sid ", $whereParams); if (!$result) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->SalaryItemReportID; $daObj->TableName = "SalaryItemReport"; $daObj->execute(); return true; }
function Edit() { $result = parent::update("HRM_person_dependent_supports", $this, "PersonID=:psid and master_row_no=:mrowno and row_no=:rowNo", array(":psid" => $this->PersonID, ":mrowno" => $this->master_row_no, ":rowNo" => $this->row_no)); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->RelatedPersonType = 3; $daObj->RelatedPersonID = $this->PersonID; $daObj->MainObjectID = $this->row_no; $daObj->TableName = "person_dependent_supports"; $daObj->execute(); return true; }
function Edit() { $whereParams = array(); $whereParams[":ccid"] = $this->cost_center_id; $result = parent::update("cost_centers", $this, "cost_center_id=:ccid", $whereParams); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->cost_center_id; $daObj->TableName = "cost_centers"; $daObj->execute(); return true; }
function Edit() { $whereParams = array(); //$whereParams[":pid"] = $this->PersonID; $whereParams[":sid"] = $this->staff_id; if (PdoDataAccess::update("staff_details", $this, " staff_id =:sid ", $whereParams) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->staff_id; $daObj->TableName = "staff_details"; $daObj->execute(); return true; }
function EditList() { $whereParams = array(); $whereParams[":lid"] = $this->list_id; $result = parent::update("evaluation_lists", $this, " list_id=:lid", $whereParams); if (!$result) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->list_id; $daObj->TableName = "evaluation_lists"; $daObj->execute(); return true; }
function Edit() { $whereParams = array(); $whereParams[":sid"] = $this->SalaryItemTypeID; $whereParams[":ccid"] = $this->CostCenterID; $result = parent::update("CostCenterException", $this, " SalaryItemTypeID=:sid and CostCenterID =:ccid ", $whereParams); if (!$result) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->SalaryItemTypeID; $daObj->TableName = "CostCenterException"; $daObj->execute(); return true; }
function Edit() { if ($this->branch_code == 0 || $this->branch_code == null) { $this->branch_code = PDONULL; } $result = parent::update("banks", $this, "bank_id=" . $this->bank_id); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->bank_id; $daObj->TableName = "banks"; $daObj->execute(); return true; }
function EditLoan() { if (parent::update("LON_loans", $this, " LoanID=:l", array(":l" => $this->LoanID)) === false) { return false; } $obj = new LON_loans($this->LoanID); $blockObj = new ACC_blocks($obj->BlockID); $blockObj->BlockDesc = $this->LoanDesc; $blockObj->EditBlock(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->LoanID; $daObj->TableName = "LON_loans"; $daObj->execute(); return true; }
function EditDependency() { $whereParams = array(); $whereParams[":pid"] = $this->PersonID; $whereParams[":rowid"] = $this->row_no; if (parent::update("HRM_person_dependents", $this, " PersonID=:pid and row_no=:rowid", $whereParams) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->row_no; $daObj->RelatedPersonType = 5; $daObj->RelatedPersonID = $this->PersonID; $daObj->TableName = "HRM_person_dependents"; $daObj->execute(); return true; }
function EditMiscDoc() { $whereParams = array(); $whereParams[":pid"] = $this->PersonID; $whereParams[":rowid"] = $this->row_no; if (PdoDataAccess::update("person_misc_docs", $this, " PersonID=:pid and row_no=:rowid ", $whereParams) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->RelatedPersonType = DataAudit::PersonType_staff; $daObj->RelatedPersonID = $this->PersonID; $daObj->MainObjectID = $this->row_no; $daObj->TableName = "person_misc_docs"; $daObj->execute(); return true; }
function EditJobHistory() { $whereParams = array(); $whereParams[":pid"] = $this->PersonID; $whereParams[":rowid"] = $this->RowNO; if (PdoDataAccess::update("PersonJobs", $this, " PersonID=:pid and RowNO=:rowid ", $whereParams) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->RelatedPersonType = DataAudit::PersonType_staff; $daObj->RelatedPersonID = $this->PersonID; $daObj->MainObjectID = $this->RowNO; $daObj->TableName = "PersonJobs"; $daObj->execute(); return true; }
function Edit($PID) { if (!$this->date_overlap($PID)) { return false; } $result = parent::update("staff_include_history", $this, " staff_id = :SID and include_history_id = :ID ", array(":SID" => $this->staff_id, ":ID" => $this->include_history_id)); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->RelatedPersonType = DataAudit::PersonType_staff; $daObj->RelatedPersonID = $this->staff_id; $daObj->MainObjectID = $this->include_history_id; $daObj->TableName = "staff_include_history"; $daObj->execute(); return true; }
function Edit() { $whereParams = array(); $whereParams[":lid"] = $this->list_id; $whereParams[":sid"] = $this->staff_id; $whereParams[":lrn"] = $this->list_row_no; $result = parent::update("pay_get_list_items", $this, " list_id=:lid and staff_id =:sid and list_row_no =:lrn ", $whereParams); if (!$result) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->list_id; $daObj->SubObjectID = $this->list_row_no; $daObj->TableName = "pay_get_list_items"; $daObj->execute(); return true; }
function Edit($pdo = "", $DB = "") { /*$qry = "select person_type from staff where staff_id =".$this->staff_id ; $res = parent::runquery($qry) ; if($res[0]['person_type'] == 1 || $res[0]['person_type'] == 2 || $res[0]['person_type'] == 3 ) $DB = "hrms." ; else $DB = "hrms_sherkati."; */ $result = parent::update($DB . "payment_items", $this, " pay_year=" . $this->pay_year . " and pay_month=" . $this->pay_month . " and \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t staff_id=" . $this->staff_id . " and payment_type =" . $this->payment_type, array(), $pdo); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->staff_id; $daObj->TableName = "payment_items"; $daObj->execute($pdo); return true; }
function Edit() { $whereParams = array(); $whereParams[":sid"] = $this->SalaryItemTypeID; $whereParams[":ptype"] = $this->PersonType; $whereParams[":FD"] = DateModules::shamsi_to_miladi($this->FromDate); $result = parent::update("SubtractItemInfo", $this, " SalaryItemTypeID=:sid AND PersonType=:ptype AND FromDate=:FD ", $whereParams); if (!$result) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->SalaryItemTypeID; $daObj->SubObjectID = $this->PersonType; $daObj->TableName = "SubtractItemInfo"; $daObj->execute(); return true; }
function EditStaffTaxHistory($PID) { if (!$this->date_overlap($PID)) { return false; } $whereParams = array(); $whereParams[":sid"] = $this->staff_id; $whereParams[":taxid"] = $this->tax_history_id; if (PdoDataAccess::update("HRM_staff_tax_history", $this, " staff_id=:sid and tax_history_id = :taxid ", $whereParams) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->RelatedPersonType = 3; $daObj->RelatedPersonID = $this->staff_id; $daObj->TableName = "staff_tax_history"; $daObj->execute(); return true; }
function EditUnit() { $db = parent::getPdoObject(); $db->beginTransaction(); parent::runquery("insert into org_units_history select *,'EDIT',now() from org_new_units where ouid=:ouid", array(":ouid" => $this->ouid)); $return = parent::update("org_new_units", $this, " ouid=:ouid", array(":ouid" => $this->ouid)); if ($return === false) { $db->rollBack(); return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->ouid; $daObj->TableName = "org_new_units"; $daObj->execute(); $db->commit(); return true; }
function AddMilitaryBase($PID) { $qry = " select * \r\n\t\t\t from bases \r\n\t\t\t\twhere baseType = 1 and baseValue = 1 and personid =" . $PID; $resRec = parent::runquery($qry); $query = "\tselect personid ,\r\n\t\t\t\tif ((military_duration > (DATEDIFF( military_to_date ,military_from_date))/30.4375 ) ,military_duration , (DATEDIFF( military_to_date ,military_from_date))/30.4375 ) duration\r\n\r\n\t\t\t from persons\r\n\t\t\t\twhere sex = 1 and person_type in (2,3,5) and personid = " . $PID; $res = parent::runquery($query); if ($res[0]['duration'] / 12 > 1 && count($resRec) == 0) { $this->PersonID = $PID; $this->BaseType = 1; $this->BaseValue = 1; $this->RegDate = DateModules::Now(); $this->ExecuteDate = DateModules::Now(); $this->BaseMode = 'SYSTEM'; $this->ExtraInfo = $res[0]['duration']; $this->BaseStatus = 'NORMAL'; $result = parent::insert($query, $this); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->PersonID; $daObj->SubObjectID = $this->BaseType; $daObj->TableName = "bases"; $daObj->execute(); return true; } else { if ($res[0]['duration'] / 12 < 1 && count($resRec) == 1) { $this->BaseStatus = 'DELETED'; $result = parent::update("bases", $this, "BaseType = 1 and BaseValue =1 and personid =" . $PID); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->PersonID; $daObj->SubObjectID = $this->BaseStatus; $daObj->TableName = "bases"; $daObj->execute(); return true; } else { if ($res[0]['duration'] / 12 > 1 && count($resRec) == 1) { if ($resRec[0]['BaseStatus'] == 'DELETED') { $this->BaseStatus = 'NORMAL'; $result = parent::update("bases", $this, "BaseType = 1 and BaseValue =1 and personid =" . $PID); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->PersonID; $daObj->SubObjectID = $this->BaseStatus; $daObj->TableName = "bases"; $daObj->execute(); return true; } else { return true; } } } } }
function EditFolder($pdo = null) { if (parent::update("OFC_archive", $this, "FolderID=:s", array(":s" => $this->FolderID), $pdo) === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->FolderID; $daObj->TableName = "OFC_archive"; $daObj->execute($pdo); return true; }
function EditPost() { $whereParams = array(); $whereParams[":post_id"] = $this->post_id; $db = PdoDataAccess::getPdoObject(); /*@var $db PDO*/ $db->beginTransaction(); parent::runquery("insert into position_history select *,'EDIT',now() from position where post_id=:post_id", $whereParams); $return = parent::update("position", $this, " post_id=:post_id", $whereParams); if ($return === false) { $db->rollBack(); return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->MainObjectID = $this->post_id; $daObj->TableName = "position"; $daObj->execute(); $db->commit(); $this->OnAfterUpdate(); return true; }
function EditParam($param_id) { if ($this->date_overlap()) { return false; } $result = parent::update("HRM_salary_params", $this, "param_id=:pid ", array(":pid" => $this->param_id)); if ($result === false) { return false; } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->RelatedPersonType = 3; $daObj->MainObjectID = $this->param_id; $daObj->TableName = "HRM_salary_params"; $daObj->execute(); return true; }
function Edit() { return parent::update("rpt_columns", $this, "column_id=" . $this->column_id); }
function EditWritItem() { $return = $this->OnBeforeUpdate(); if ($return === false) return false; $where = "writ_id=:wid AND writ_ver=:wver AND staff_id = :stid AND salary_item_type_id=:sid"; $return = parent::update("writ_salary_items", $this, $where, array(":wid" => $this->writ_id, ":wver" => $this->writ_ver, ":stid" => $this->staff_id, ":sid" => $this->salary_item_type_id)); if (!$return) return false; /* $ret = $this->OnAfterUpdate(); if(!$ret) return false ; */ $obj = new DataAudit(); $obj->MainObjectID = $this->writ_id . '-' . $this->writ_ver; $obj->SubObjectID = $this->salary_item_type_id; $obj->TableName = "writ_salary_items"; $obj->ActionType = DataAudit::Action_update; $obj->RelatedPersonType = DataAudit::PersonType_staff; $obj->RelatedPersonID = $this->staff_id; $obj->execute(); return true; }