本文整理汇总了PHP中PdoDataAccess::GetLastID方法的典型用法代码示例。如果您正苦于以下问题:PHP PdoDataAccess::GetLastID方法的具体用法?PHP PdoDataAccess::GetLastID怎么用?PHP PdoDataAccess::GetLastID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdoDataAccess
的用法示例。
在下文中一共展示了PdoDataAccess::GetLastID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: WritTypeSave
function WritTypeSave()
{
if (empty($_POST["wstid"])) {
$wtid = PdoDataAccess::GetLastID("HRM_writ_subtypes", "writ_subtype_id", " person_type=:PT", array(":PT" => $_POST['pt']));
$wtid++;
$query = "insert into HRM_writ_subtypes(person_type,writ_type_id,writ_subtype_id,title,print_title,description,\r\n\t\t\temp_state , emp_mode , worktime_type)\r\n values('" . $_POST["pt"] . "',1," . $wtid . ",'" . $_POST["title"] . "','" . $_POST["print_title"] . "','',0,0,0)";
PdoDataAccess::runquery($query);
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $_POST['pt'] . "-" . $wtid;
$daObj->TableName = "HRM_writ_types";
$daObj->execute();
echo Response::createObjectiveResponse("true", $_POST['pt'] . "-" . $wtid);
} else {
$query = "update writ_types set title = '" . $_POST["title"] . "'\r\n where person_type=" . $_POST['pt'] . " and writ_type_id=" . $_POST['id'];
PdoDataAccess::runquery($query);
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_update;
$daObj->MainObjectID = $_POST['pt'] . "-" . $_POST['id'];
$daObj->TableName = "job_category";
$daObj->execute();
echo Response::createObjectiveResponse("true", $_POST['pt'] . "-" . $_POST['id']);
}
die;
}
示例2: Add
function Add()
{
$masterID = parent::GetLastID("mission_list_items", "list_row_no", "list_id=" . $this->list_id);
$this->list_row_no = $masterID + 1;
$query = " select person_type from staff \r\n\t where staff_id = " . $this->staff_id;
$res = parent::runquery($query);
if ($res[0]['person_type'] == HR_PROFESSOR) {
$this->salary_item_type_id = 42;
} else {
if ($res[0]['person_type'] == HR_EMPLOYEE) {
$this->salary_item_type_id = 43;
} else {
if ($res[0]['person_type'] == HR_CONTRACT) {
$this->salary_item_type_id = 643;
}
}
}
$result = parent::insert("mission_list_items", $this);
if ($result === false) {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $this->list_id;
$daObj->SubObjectID = $this->list_row_no;
$daObj->TableName = "mission_list_items";
$daObj->execute();
return true;
}
示例3: AddGroup
function AddGroup()
{
$InfoID = PdoDataAccess::GetLastID("BaseInfo", "InfoID", "TypeID=1");
PdoDataAccess::runquery("insert into BaseInfo(TypeID,InfoID, InfoDesc) \r\n\t\tvalues(1,?,?)", array($InfoID + 1, $_POST["GroupDesc"]));
echo Response::createObjectiveResponse(true, "");
die;
}
示例4: AddTaxItem
function AddTaxItem()
{
$this->row_no = parent::GetLastID("HRM_tax_table_items", "row_no", " tax_table_id =" . $this->tax_table_id) + 1;
$result = parent::insert("HRM_tax_table_items", $this);
if ($result === false) {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $this->tax_table_id;
$daObj->SubObjectID = $this->row_no;
$daObj->TableName = "HRM_tax_table_items";
$daObj->execute();
return true;
}
示例5: AddList
function AddList()
{
$lastid = parent::GetLastID("evaluation_lists", "list_id");
$this->list_id = $lastid + 1;
$return = parent::insert("evaluation_lists", $this);
if ($return === false) {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $this->list_id;
$daObj->TableName = "evaluation_lists";
$daObj->execute();
return true;
}
示例6: AddWST
function AddWST()
{
$wsid = PdoDataAccess::GetLastID("writ_subtypes", "writ_subtype_id", "person_type = :PT and writ_type_id = :WTI ", array(":PT" => $this->person_type, ":WTI" => $this->writ_type_id));
$wsid++;
$this->writ_subtype_id = $wsid;
$return = parent::insert("writ_subtypes", $this);
if ($return === false) {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $this->person_type . "-" . $this->writ_type_id . "-" . $this->writ_subtype_id;
$daObj->TableName = "writ_subtypes";
$daObj->execute();
return true;
}
示例7: AddTax
function AddTax()
{
$tax_table_type_id = parent::GetLastID("HRM_tax_table_types", "tax_table_type_id");
$tax_table_type_id++;
$this->tax_table_type_id = $tax_table_type_id;
$result = parent::insert("HRM_tax_table_types", $this);
if ($result === false) {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $this->tax_table_type_id;
$daObj->TableName = "HRM_tax_table_types";
$daObj->execute();
return true;
}
示例8: Add
function Add()
{
$masterID = parent::GetLastID("pay_get_list_items", "list_row_no", "list_id=" . $this->list_id);
$this->list_row_no = $masterID + 1;
$result = parent::insert("pay_get_list_items", $this);
if ($result === false) {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $this->list_id;
$daObj->SubObjectID = $this->list_row_no;
$daObj->TableName = "pay_get_list_items";
$daObj->execute();
return true;
}
示例9: Add
function Add()
{
$this->bank_id = parent::GetLastID("banks", "bank_id") + 1;
if ($this->branch_code == 0 || $this->branch_code == null) {
$this->branch_code = PDONULL;
}
$return = parent::insert("banks", $this);
if ($return === false) {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_add;
$daObj->MainObjectID = $this->bank_id;
$daObj->TableName = "banks";
$daObj->execute();
return true;
}
示例10: Add
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;
}
示例11: LastID
public static function LastID($pdo = null)
{
return PdoDataAccess::GetLastID(static::TableName, static::TableKey, "", array(), $pdo) + 1;
}
示例12: SaveLetter
function SaveLetter($dieing = true)
{
$Letter = new OFC_letters();
pdoDataAccess::FillObjectByArray($Letter, $_POST);
if ($Letter->RefLetterID != "") {
$obj = new OFC_letters($Letter->RefLetterID);
if (empty($obj->LetterID)) {
Response::createObjectiveResponse(false, "شماره نامه عطف قابل بازیابی نمی باشد");
die;
}
}
if ($Letter->LetterID == '') {
$Letter->PersonID = $_SESSION["USER"]["PersonID"];
$Letter->LetterDate = PDONOW;
$Letter->RegDate = PDONOW;
$res = $Letter->AddLetter();
} else {
$res = $Letter->EditLetter();
}
if (!empty($_FILES["PageFile"]["tmp_name"])) {
$st = preg_split("/\\./", $_FILES['PageFile']['name']);
$extension = strtolower($st[count($st) - 1]);
if (in_array($extension, array("jpg", "jpeg", "gif", "png", "pdf")) === false) {
Response::createObjectiveResponse(false, "فرمت فایل ارسالی نامعتبر است");
die;
}
$dt = DMS_documents::SelectAll("ObjectType='letter' AND ObjectID=?", array($Letter->LetterID));
if (count($dt) == 0) {
$obj = new DMS_documents();
$obj->DocType = 0;
$obj->ObjectType = "letter";
$obj->ObjectID = $Letter->LetterID;
$obj->AddDocument();
$DocumentID = $obj->DocumentID;
} else {
$DocumentID = $dt[0]["DocumentID"];
}
//..............................................
$obj2 = new DMS_DocFiles();
$obj2->DocumentID = $DocumentID;
$obj2->PageNo = PdoDataAccess::GetLastID("DMS_DocFiles", "PageNo", "DocumentID=?", array($DocumentID)) + 1;
$obj2->FileType = $extension;
$obj2->FileContent = substr(fread(fopen($_FILES['PageFile']['tmp_name'], 'r'), $_FILES['PageFile']['size']), 0, 200);
$obj2->AddPage();
$fp = fopen(getenv("DOCUMENT_ROOT") . "/storage/documents/" . $obj2->RowID . "." . $extension, "w");
fwrite($fp, substr(fread(fopen($_FILES['PageFile']['tmp_name'], 'r'), $_FILES['PageFile']['size']), 200));
fclose($fp);
}
if ($dieing) {
Response::createObjectiveResponse($res, $Letter->GetExceptionCount() != 0 ? $Letter->popExceptionDescription() : $Letter->LetterID);
die;
}
return true;
}
示例13: importStudent
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;
}
示例14: LastID
static function LastID($pdo = "")
{
return PdoDataAccess::GetLastID("HRM_writs", "writ_id", "", array(), $pdo);
}
示例15: LastID
public static function LastID()
{
return PdoDataAccess::GetLastID("wfm_forms", "LetterID");
}