function MakeUsrID() { $_OBJECT =& $this->APPObj; $mCodeval = array("%UsrCO%", "USR", '1', '3', '0', ''); $mCodeval[0] = str_replace("%UsrCO%", $_OBJECT["US"]->Getvar("UsrCO"), $mCodeval); $mCodeval[0] = str_replace("%UsrCO%", $_OBJECT["US"]->Getvar("UsrDP"), $mCodeval); $mCodeval[0] = str_replace("%UsrCO%", $_OBJECT["US"]->Getvar("UsrWK"), $mCodeval); $mCodeval[0] = $mCodeval[0] == "" ? "@" : $mCodeval[0]; $mCode =& $mCodeval; return str_replace("-", "", Vic_Code($mCode[0], $mCode[1], $mCode[2], $mCode[3], $mCode[4], $mCode[5])); }
function Check($iIx) { $_OBJECT =& $this->APPObj; $_IMPORT =& $this->IMPORT; $_RESULT =& $this->Result; $mFile = $this->APPCls->Getvar("Surface"); $mPath = "/" . $this->APPCls->Getvar("RunPath") . "/Tml/"; $mPath = Vic_Dir_Search($mFile . ".INI", $mPath, 1, "F"); if ($mPath == "") { return -1; } $mVals = parse_ini_file($mPath, true); for ($i = 0; $i < sizeof($mVals); $i++) { $mOKay = true; $mOKay = $mOKay && array_key_exists("Caption", $mVals[$i]); $mOKay = $mOKay && array_key_exists("CKField", $mVals[$i]); $mOKay = $mOKay && array_key_exists("Message", $mVals[$i]); if (!$mOKay) { continue; } $mMessage =& $mVals[$i]["Message"]; $mCaption =& $mVals[$i]["Caption"]; $mCKField =& $mVals[$i]["CKField"]; $mFormula = array_key_exists("Formula", $mVals[$i]) ? $mVals[$i]["Formula"] : ""; $mPrimary = array_key_exists("Primary", $mVals[$i]) ? $mVals[$i]["Primary"] : ""; $mMin = array_key_exists("Min", $mVals[$i]) ? $mVals[$i]["Min"] : ""; $mMax = array_key_exists("Max", $mVals[$i]) ? $mVals[$i]["Max"] : ""; $mCodeval = array_key_exists("Codeval", $mVals[$i]) ? $mVals[$i]["Codeval"] : ""; $mCodeval = explode("||", $mCodeval); if (strpos(":" . $mMessage, "@")) { $mMessage = Vicmsg::ParseArray(substr($mMessage, 1)); } $mMessage = str_replace("[Min]", $mMin, $mMessage); $mMessage = str_replace("[Max]", $mMax, $mMessage); $mMessage = str_replace("[Caption]", $mMax, $mMessage); $mMessage .= "[^]" . $mCKField; $mRowvals = $_RESULT->GetField($mCKField, $iIx); //生成编号 if (sizeof($mCodeval) == 6 && $_RESULT->GetField("RowST", $iIx) == "I") { $mCodeval[0] = str_replace("%UsrCO%", $_OBJECT["US"]->Getvar("UsrCO"), $mCodeval); $mCodeval[0] = str_replace("%UsrCO%", $_OBJECT["US"]->Getvar("UsrDP"), $mCodeval); $mCodeval[0] = str_replace("%UsrCO%", $_OBJECT["US"]->Getvar("UsrWK"), $mCodeval); $mCodeval[0] = $mCodeval[0] == "" ? "@" : $mCodeval[0]; $mCode =& $mCodeval; $mRowvals = Vic_Code($mCode[0], $mCode[1], $mCode[2], $mCode[3], $mCode[4], $mCode[5]); $_RESULT->SetField($mCKField, $mRowvals, $iIx); } //长度检查 if ($mMin != "" && $mMax != "" && (mb_strlen($mRowvals, "utf8") < $mMin || mb_strlen($mRowvals, "utf8") > $mMax)) { trigger_error($mMessage, NOTIC); continue; } //格式检查 if ($mFormula != "" && $mRowvals != "" && preg_match($mFormula, $mRowvals) <= 0) { trigger_error($mMessage, NOTIC); continue; } //主键检查 if ($mPrimary == "@") { $mPrimary = "{~}" . $mCKField . "{_}=={_}[" . $mCKField . "]"; } if ($mPrimary != "" && $this->ReKey($iIx < 0 ? 0 : $iIx, $mPrimary) >= 1) { trigger_error($mMessage, NOTIC); continue; } } }