function ADD() { if (parent::insert("management_extra_bylaw", $this) === false) { return false; } $this->bylaw_id = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = PdoDataAccess::InsertID(); $daObj->TableName = "management_extra_bylaw"; $daObj->execute(); return true; }
function Add() { if (parent::insert("bases", $this) === false) { return false; } $this->RowID = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->RowID; $daObj->TableName = "bases"; $daObj->execute(); return true; }
function Add() { if (parent::insert("study_fields", $this) === false) { return false; } $this->sfid = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = PdoDataAccess::InsertID(); $daObj->TableName = "study_fields"; $daObj->execute(); return true; }
function AddList() { $result = parent::insert("pay_get_lists", $this); if ($result === false) { return false; } $this->list_id = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->list_id; $daObj->TableName = "pay_get_lists"; $daObj->execute(); return true; }
function AddDocument() { $this->RegPersonID = $_SESSION["USER"]["PersonID"]; if (!parent::insert("DMS_documents", $this)) { return false; } $this->DocumentID = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->DocumentID; $daObj->TableName = "DMS_documents"; $daObj->execute(); return true; }
function Add() { $this->sbid = manage_study_branch::LastID($this->sfid) + 1; if (parent::insert("study_branchs", $this) === false) { return false; } $this->sfid = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = PdoDataAccess::InsertID(); $daObj->TableName = "study_branchs"; $daObj->execute(); return true; }
function AddSub($DB = "") { $result = parent::insert($DB . "person_subtracts", $this); if ($result === false) { return false; } $this->subtract_id = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->subtract_id; $daObj->TableName = "person_subtracts"; $daObj->execute(); return true; }
function AddTax() { if (!$this->date_overlap()) { return false; } $result = parent::insert("HRM_tax_tables", $this); if ($result === false) { return false; } $this->tax_table_id = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->tax_table_id; $daObj->TableName = "HRM_tax_tables"; $daObj->execute(); return true; }
function AddLoan() { if (!parent::insert("LON_loans", $this)) { return false; } $this->LoanID = parent::InsertID(); $blockObj = new ACC_blocks(); $blockObj->BlockCode = $this->LoanID; $blockObj->BlockDesc = $this->LoanDesc; $blockObj->LevelID = "2"; $blockObj->AddBlock(); $this->BlockID = $blockObj->BlockID; $this->EditLoan(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->LoanID; $daObj->TableName = "LON_loans"; $daObj->execute(); return true; }
function Add() { $pdo = parent::getPdoObject(); /*@var $pdo PDO*/ $pdo->beginTransaction(); $this->row_no = parent::GetLastID("HRM_person_dependent_supports", "row_no", "PersonID=:pid and master_row_no=:mrno", array(":pid" => $this->PersonID, ":mrno" => $this->master_row_no)) + 1; $result = parent::insert("HRM_person_dependent_supports", $this); if ($result === false) { $pdo->rollBack(); return false; } $this->row_no = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->RelatedPersonID = $this->PersonID; $daObj->RelatedPersonType = 3; $daObj->MainObjectID = $this->row_no; $daObj->TableName = "HRM_person_dependent_supports"; $daObj->execute(); $pdo->commit(); return true; }
function InsertCheque($pdo = null) { if (parent::insert("ACC_ChequeBooks", $this, $pdo) === false) { return false; } $this->ChequeBookID = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->ChequeBookID; $daObj->TableName = "ACC_ChequeBooks"; $daObj->execute($pdo); return true; }
function AddRow($pdo = null) { if (!parent::insert("PLN_PlanSurvey", $this, $pdo)) { return false; } $this->RowID = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->RowID; $daObj->TableName = "PLN_PlanSurvey"; $daObj->execute($pdo); return true; }
public function Add($pdo = null) { if (!parent::insert(static::TableName, $this, $pdo)) { ExceptionHandler::PushException(self::ERR_Add); return false; } $this->{static::TableKey} = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->{static::TableKey}; $daObj->TableName = static::TableName; $daObj->execute(); return true; }
function Add() { if (empty($this->tempFlow)) { $this->tempFlow = 0; } if (parent::insert("person_subtract_flows", $this) === false) { return false; } $this->row_no = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->subtract_id; $daObj->SubObjectID = $this->row_no; $daObj->TableName = "person_subtract_flows"; $daObj->execute(); return true; }
function AddPerson($staffObject, $pic = "") { $pdo = PdoDataAccess::getPdoObject(); if ($pdo->beginTransaction()) { if ($this->military_from_date != NULL || $this->military_from_date != '0000-00-00') { $Vyear = 0; $Vmonth = $Vday = 0; $resDay = DateModules::GDateMinusGDate($this->military_to_date, $this->military_from_date); DateModules::day_to_ymd($resDay, $Vyear, $Vmonth, $Vday); $mm = $Vyear * 12 + $Vmonth; $dd = $Vday; $this->military_duration = $mm; $this->military_duration_day = $dd; } if (parent::insert("HRM_persons", $this, $pdo) === false) { parent::PushException(ER_PERSON_DONT_SAVE); $pdo->rollBack(); return false; } $this->PersonID = parent::InsertID(); $staffObject->PersonID = $this->PersonID; $staffObject->person_type = $this->person_type; $return = $staffObject->AddStaff($pdo); if (!$return) { parent::PushException(ER_PERSON_DONT_SAVE); $pdo->rollBack(); return false; } if ($return) { $pdo->commit(); } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->PersonID; $daObj->TableName = "HRM_persons"; $daObj->execute(); return true; } else { return false; } }
function AddTask() { $result = PdoDataAccess::insert("FRW_tasks", $this); if ($result === false) { return false; } $this->TaskID = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->TaskID; $daObj->TableName = "FRW_tasks"; $daObj->execute(); return true; }
function AddFlowRow($StepID, $pdo = null) { if (!parent::insert("WFM_FlowRows", $this, $pdo)) { return false; } $this->UpdateSourceStatus($StepID); $this->RowID = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->RowID; $daObj->TableName = "WFM_FlowRows"; $daObj->execute($pdo); return true; }
static function baseinfoAssign($personID, $post_id, $date, $desc) { //------------------ baseinfo update --------------------------- $temp = PdoDataAccess::runquery("select * from baseinfo.posts where PersonID=" . $personID); if (count($temp) != 0) { $dt = PdoDataAccess::runquery("select * from position where post_id=" . $post_id); PdoDataAccess::runquery("update baseinfo.posts\r\n\t\t\t\tset PostStatus='APPROVED', PostNumber=" . $post_id . " , title='" . $dt[0]["title"] . "'\r\n\t\t\t\twhere PersonID=" . $personID); PdoDataAccess::runquery("insert into baseinfo.PostAssignHistory (PersonID, PostID, AssignDate)\r\n\t\t\tvalues(" . $personID . "," . $temp[0]["PostID"] . ",'" . $date . "')"); } else { PdoDataAccess::runquery("insert into baseinfo.posts(title,ouid,sub_ouid,PostStatus,PersonID,PostNumber)\r\n\t\t\t\tselect pp.title,pp.ouid,pp.ouid,'APPROVED'," . $personID . ",pp.post_id\r\n\t\t\t\tfrom position pp\r\n\t\t\t\twhere pp.post_id=" . $post_id); $PostID = PdoDataAccess::InsertID(); PdoDataAccess::runquery("insert into baseinfo.PostAssignHistory (PersonID, PostID, AssignDate)\r\n\t\t\tvalues(" . $personID . "," . $PostID . "," . $date . ")"); } $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_update; $daObj->RelatedPersonID = $personID; if (count($temp) != 0) { $daObj->SubObjectID = $temp[0]["PostID"]; } $daObj->MainObjectID = $post_id; $daObj->TableName = " baseinfo.posts"; $daObj->description = $desc; $daObj->execute(); //-------------------------------------------------------------- }
function check_to_run() { if ($this->backpay_recurrence > 1) { return true; } $tmp_rs = parent::runquery('SELECT * FROM payment_runs WHERE time_stamp >= :expireDate', array(":expireDate" => time() - $this->expire_time)); //هيچ اجراي فعالي وجود ندارد if ($tmp_rs->recordCount() == 0) { parent::runquery('INSERT INTO payment_runs(time_stamp,uname) VALUES(?,?)', array(time(), $_SESSION["UserID"])); $this->run_id = parent::InsertID(); return true; } parent::PushException(strstr(ER_CAN_NOT_RUN_PAYMENT_CALC, array("%0%" => $temp[0]["uname"], "%1%" => $this->expire_time))); return false; }
function AddDomain($pdo = null) { if (parent::insert("BSC_ActDomain", $this, $pdo) === false) { return false; } $this->DomainID = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->DomainID; $daObj->TableName = "BSC_ActDomain"; $daObj->execute($pdo); return true; }
public function AddStep() { if (empty($this->ordering)) { $order = PdoDataAccess::GetLastID("FGR_steps", "ordering", "FormID=?", array($this->FormID)); $this->ordering = $order + 1; } if (!PdoDataAccess::insert("FGR_steps", $this)) { return false; } $this->StepID = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->StepID; $daObj->SubObjectID = $this->FormID; $daObj->TableName = "FGR_steps"; $daObj->execute(); return true; }
function AddParam() { if ($this->date_overlap()) { return false; } $pdo = parent::getPdoObject(); $pdo->beginTransaction(); $result = parent::insert("HRM_salary_params", $this); if ($result === false) { $pdo->rollBack(); return false; } $this->param_id = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->RelatedPersonType = 3; $daObj->MainObjectID = $this->param_id; $daObj->TableName = "HRM_salary_params"; $daObj->execute(); $pdo->commit(); return true; }
function AddLicense($pdo = null) { if (parent::insert("BSC_licenses", $this, $pdo) === false) { return false; } $this->LicenseID = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->LicenseID; $daObj->SubObjectID = $this->PersonID; $daObj->TableName = "BSC_licenses"; $daObj->execute($pdo); return true; }
function AddFolder($pdo = null) { if (parent::insert("OFC_archive", $this, $pdo) === false) { return false; } $this->FolderID = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->FolderID; $daObj->TableName = "OFC_archive"; $daObj->execute($pdo); return true; }
function importStudent() { $dt = PdoDataAccess::runquery("select * from StudentPersonMap where StNo=?", array($_POST["StNo"])); if (count($dt) > 0) { echo Response::createObjectiveResponse(false, "Duplicate"); die; } $pdo = PdoDataAccess::getPdoObject(); $pdo->beginTransaction(); $query = "insert into \n\t\tpersons(person_type,pfname,plname,efname,elname,father_name,idcard_no,birth_date,national_code,\n\t\t\t\tsex,address1,home_phone1,mobile_phone,email,comment)\n\t\tselect " . $_POST["person_type"] . ",PFName,PLName,EFName,ELName,DadName,BCN,BirthDate,NID,\n\t\t\t\tsex,address1,PhoneNo,mobile,EMail,concat('انتقال اطلاعات دانشجو با شماره دانشجویی', StNo)\n\t\tfrom students where StNo=?"; PdoDataAccess::runquery($query, array($_POST["StNo"]), $pdo); if (ExceptionHandler::GetExceptionCount() > 0) { $pdo->rollBack(); echo Response::createObjectiveResponse(false, "1"); //print_r(ExceptionHandler::PopAllExceptions()); die; } //-------------------------------------------------------------------------- $personID = PdoDataAccess::InsertID(); $staff_id = PdoDataAccess::GetLastID("staff", "staff_id", "", array(), $pdo) + 1; PdoDataAccess::runquery("insert into staff(staff_id,PersonID,person_type) \n\t\t\tvalues({$staff_id}, {$personID}, " . $_POST["person_type"] . ")", array(), $pdo); if (ExceptionHandler::GetExceptionCount() > 0) { $pdo->rollBack(); echo Response::createObjectiveResponse(false, "2"); //print_r(ExceptionHandler::PopAllExceptions()); die; } //-------------------------------------------------------------------------- $query = "insert into StudentPersonMap\tvalues({$personID}," . $_POST["StNo"] . ")"; PdoDataAccess::runquery($query, array(), $pdo); if (ExceptionHandler::GetExceptionCount() > 0) { $pdo->rollBack(); //print_r(ExceptionHandler::PopAllExceptions()); echo Response::createObjectiveResponse(false, "5"); die; } //-------------------------------------------------------------------------- $query = "select RFID from educ.StudentSpecs where StNo=?"; $dt = PdoDataAccess::runquery($query, array($_POST["StNo"]), $pdo); if (ExceptionHandler::GetExceptionCount() > 0) { $pdo->rollBack(); echo Response::createObjectiveResponse(false, "3"); //print_r(ExceptionHandler::PopAllExceptions()); die; } if (count($dt) > 0 && $dt[0][0] != "") { $id = PdoDataAccess::GetLastID("pas.PersonSettings", "PersonSettingsID"); $query = "insert into pas.PersonSettings(PersonSettingsID,PersonID,CardStatus,CardNumber,WorkGroupID,CalendarID)\n\t\t\tvalues(" . ($id + 1) . ",{$personID},'ENABLE',NULL,0,0)"; PdoDataAccess::runquery($query, array(), $pdo); if (ExceptionHandler::GetExceptionCount() > 0) { $pdo->rollBack(); print_r(ExceptionHandler::PopAllExceptions()); echo Response::createObjectiveResponse(false, "4"); die; } } //-------------------------------------------------------------------------- $pdo->commit(); $result = ExceptionHandler::GetExceptionCount() == 0 ? "true" : "false"; echo Response::createObjectiveResponse($result, ""); die; }
function AddUnit() { $this->RegDate = date("Y-m-d"); $return = parent::insert("org_new_units", $this); if ($return === false) { return false; } $this->ouid = parent::InsertID(); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->ouid; $daObj->TableName = "org_new_units"; $daObj->execute(); return true; }
function Add($pdo = null) { if (!parent::insert("LON_BackPays", $this, $pdo)) { return false; } $this->BackPayID = parent::InsertID($pdo); $daObj = new DataAudit(); $daObj->ActionType = DataAudit::Action_add; $daObj->MainObjectID = $this->BackPayID; $daObj->TableName = "LON_BackPays"; $daObj->execute($pdo); return true; }