本文整理汇总了PHP中StringUtil::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::getId方法的具体用法?PHP StringUtil::getId怎么用?PHP StringUtil::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtil
的用法示例。
在下文中一共展示了StringUtil::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEdit
public function actionEdit()
{
if (EnvUtil::submitCheck("emailSubmit")) {
$setting = array();
foreach ($this->_fields as $field) {
if (array_key_exists($field, $_POST)) {
$setting[$field] = intval($_POST[$field]);
} else {
$setting[$field] = 0;
}
}
$roles = array();
if (isset($_POST["role"])) {
foreach ($_POST["role"] as $role) {
if (!empty($role["positionid"]) && !empty($role["size"])) {
$positionId = StringUtil::getId($role["positionid"]);
$roles[implode(",", $positionId)] = intval($role["size"]);
}
}
}
$setting["emailroleallocation"] = serialize($roles);
foreach ($setting as $key => $value) {
Setting::model()->updateSettingValueByKey($key, $value);
}
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
}
示例2: actionSave
public function actionSave()
{
if (EnvUtil::submitCheck("formhash")) {
$data =& $_POST;
if (isset($data["type"])) {
foreach ($data["type"] as $id => $type) {
if (empty($data["uid"][$id]) || empty($data["remindtime"][$id])) {
continue;
}
$type = intval($type);
$attr = array("type" => intval($type));
if (!in_array($type, array(1, 5))) {
$attr["reminddate"] = $data["reminddate"][$id];
}
$attr["remindtime"] = $data["remindtime"][$id];
if (substr($id, 0, 1) == "n") {
$uid = StringUtil::getId($data["uid"][$id]);
$attr["uid"] = implode(",", $uid);
$attr["flowid"] = $this->flowid;
FlowTimer::model()->add($attr);
} else {
FlowTimer::model()->modify($id, $attr);
}
}
}
if (!empty($data["delid"])) {
$id = StringUtil::filterStr($data["delid"]);
FlowTimer::model()->deleteAll("FIND_IN_SET(tid,'{$id}')");
}
$this->ajaxReturn(array("isSuccess" => true));
}
exit;
}
示例3: actionPostFeed
public function actionPostFeed()
{
if (EnvUtil::submitCheck("formhash")) {
$return = array("isSuccess" => true, "data" => "");
$d["content"] = isset($_POST["content"]) ? StringUtil::filterDangerTag($_POST["content"]) : "";
$d["body"] = $_POST["body"];
$d["rowid"] = isset($_POST["rowid"]) ? intval($_POST["rowid"]) : 0;
foreach ($_POST as $key => $val) {
$_POST[$key] = StringUtil::filterCleanHtml($_POST[$key]);
}
$uid = Ibos::app()->user->uid;
$user = User::model()->fetchByUid($uid);
if (isset($_POST["view"])) {
$_POST["view"] = $d["view"] = intval($_POST["view"]);
if ($_POST["view"] == WbConst::SELFDEPT_VIEW_SCOPE) {
$d["deptid"] = $user["deptid"];
}
if ($_POST["view"] == WbConst::CUSTOM_VIEW_SCOPE) {
$scope = StringUtil::getId($_POST["viewid"], true);
if (isset($scope["u"])) {
$d["userid"] = implode(",", $scope["u"]);
}
if (isset($scope["d"])) {
$d["deptid"] = implode(",", $scope["d"]);
}
if (isset($scope["p"])) {
$d["positionid"] = implode(",", $scope["p"]);
}
}
}
$d["source_url"] = isset($_POST["source_url"]) ? urldecode($_POST["source_url"]) : "";
$d["body"] = preg_replace("/#[\\s]*([^#^\\s][^#]*[^#^\\s])[\\s]*#/is", "#" . trim("\${1}") . "#", $d["body"]);
if (isset($_POST["attachid"])) {
$d["attach_id"] = trim(StringUtil::filterCleanHtml($_POST["attachid"]));
if (!empty($d["attach_id"])) {
$d["attach_id"] = explode(",", $d["attach_id"]);
array_map("intval", $d["attach_id"]);
}
}
$type = StringUtil::filterCleanHtml($_POST["type"]);
$table = isset($_POST["table"]) ? StringUtil::filterCleanHtml($_POST["table"]) : "feed";
$module = isset($_POST["module"]) ? StringUtil::filterCleanHtml($_POST["module"]) : "weibo";
$data = Feed::model()->put(Ibos::app()->user->uid, $module, $type, $d, $d["rowid"], $table);
if (!$data) {
$return["isSuccess"] = false;
$return["data"] = Feed::model()->getError("putFeed");
$this->ajaxReturn($return);
}
UserUtil::updateCreditByAction("addweibo", Ibos::app()->user->uid);
$data["from"] = EnvUtil::getFromClient($data["from"], $data["module"]);
$lang = Ibos::getLangSources();
$return["data"] = $this->renderPartial("feedlist", array("list" => array($data), "lang" => $lang), true);
$return["feedid"] = $data["feedid"];
FeedTopic::model()->addTopic(html_entity_decode($d["body"], ENT_QUOTES, "UTF-8"), $data["feedid"], $type);
$this->ajaxReturn($return);
}
}
示例4: processAddRequestData
public static function processAddRequestData()
{
$fieldArr = array("avatarid" => "", "realname" => "", "gender" => 0, "birthday" => 0, "birthplace" => "", "workyears" => "", "education" => "", "residecity" => "", "zipcode" => "", "idcard" => "", "height" => "", "weight" => "", "maritalstatus" => 0, "mobile" => "", "email" => "", "telephone" => "", "qq" => "", "msn" => "", "beginworkday" => "", "positionid" => 0, "expectsalary" => "", "workplace" => "", "recchannel" => "", "workexperience" => "", "projectexperience" => "", "eduexperience" => "", "langskill" => "", "computerskill" => "", "professionskill" => "", "trainexperience" => "", "selfevaluation" => "", "relevantcertificates" => "", "socialpractice" => "", "status" => 0, "attachmentid" => "");
foreach ($_POST as $key => $value) {
if (in_array($key, array_keys($fieldArr))) {
$fieldArr[$key] = $value;
}
}
$fieldArr["positionid"] = implode(",", StringUtil::getId($fieldArr["positionid"]));
return $fieldArr;
}
示例5: beforeSave
protected function beforeSave()
{
$viewExtFields = StringUtil::filterStr($_POST["viewextfields"]);
$sumFields = StringUtil::filterStr($_POST["sumfields"]);
$flowConditions = array("flowquerytype" => $_POST["flow_query_type"], "beginuser" => StringUtil::getId($_POST["begin_user"]), "runname" => StringUtil::filterCleanHtml($_POST["run_name"]), "flowstatus" => $_POST["flow_status"], "time1" => $_POST["time1"], "time2" => $_POST["time2"], "time3" => $_POST["time3"], "time4" => $_POST["time4"], "attachname" => StringUtil::filterCleanHtml($_POST["attach_name"]));
$groupbyFields = array("field" => $_POST["group_field"], "order" => $_POST["group_sort"]);
$name = StringUtil::filterCleanHtml($_POST["tplname"]);
$sid = intval(EnvUtil::getRequest("sid"));
$data = array("flowid" => $this->flowid, "uid" => $this->uid, "tplname" => $this->tplNameExists($name, $sid) ? $name . StringUtil::random(3) : $name, "viewextfields" => $viewExtFields, "sumfields" => $sumFields, "flowconditions" => serialize($flowConditions), "groupbyfields" => serialize($groupbyFields), "condformula" => $_POST["condformula"]);
return $data;
}
示例6: processAddOrEditData
public static function processAddOrEditData($data)
{
$inverviewArr = array("interviewtime" => 0, "interviewer" => 0, "method" => "", "type" => "", "process" => "");
foreach ($data as $k => $v) {
if (in_array($k, array_keys($inverviewArr))) {
$inverviewArr[$k] = $v;
}
}
$interviewer = implode(",", StringUtil::getId($inverviewArr["interviewer"]));
$inverviewArr["interviewer"] = empty($interviewer) ? Ibos::app()->user->uid : $interviewer;
if ($inverviewArr["interviewtime"] != 0) {
$inverviewArr["interviewtime"] = strtotime($inverviewArr["interviewtime"]);
} else {
$inverviewArr["interviewtime"] = TIMESTAMP;
}
return $inverviewArr;
}
示例7: actionConfirmPost
public function actionConfirmPost()
{
if (EnvUtil::submitCheck("formhash")) {
$key = EnvUtil::getRequest("key");
$param = WfCommonUtil::param($key, "DECODE");
$runId = intval($param["runid"]);
$processId = intval($param["processid"]);
$flowId = intval($param["flowid"]);
$flowProcess = intval($param["flowprocess"]);
$opflag = intval($_POST["opflag"]);
$oldUid = intval($_POST["oldUid"]);
$this->checkRunAccess($runId);
$this->checkEntrustType($flowId);
$referer = EnvUtil::referer();
$frp = FlowRunProcess::model()->fetchRunProcess($runId, $processId, $flowProcess, $oldUid);
if ($frp) {
$parent = $frp["parent"];
$topflag = $frp["topflag"];
}
$toid = implode(",", StringUtil::getId($_POST["prcs_other"]));
$tempFRP = FlowRunProcess::model()->fetchRunProcess($runId, $processId, $flowProcess, $toid);
if (!$tempFRP) {
$data = array("runid" => $runId, "processid" => $processId, "uid" => $toid, "flag" => 1, "flowprocess" => $flowProcess, "opflag" => $opflag, "topflag" => $topflag, "parent" => $parent, "createtime" => TIMESTAMP);
FlowRunProcess::model()->add($data);
} else {
if ($tempFRP["opflag"] == 0 && $opflag == 1) {
FlowRunProcess::model()->updateAll(array("opflag" => 1, "flag" => 2), sprintf("runid = %d AND processid = %d AND flowprocess = %d AND uid = %d", $runId, $processId, $flowProcess, $toid));
} else {
$name = User::model()->fetchRealnameByUid($toid);
$this->error(Ibos::lang("Already are opuser", "", array("{name}" => $name)), $referer);
}
}
FlowRunProcess::model()->updateProcessTime($runId, $processId, $flowProcess, $oldUid);
FlowRunProcess::model()->updateAll(array("flag" => 4, "opflag" => 0, "delivertime" => TIMESTAMP), "runid = :runid AND processid = :prcsid AND flowprocess = :fp AND uid = :uid", array(":runid" => $runId, ":prcsid" => $processId, ":fp" => $flowProcess, ":uid" => $oldUid));
$toName = User::model()->fetchRealnameByUid($toid);
$userName = User::model()->fetchRealnameByUid($oldUid);
$content = Ibos::lang("Entrust to desc", "", array("{username}" => $userName, "{toname}" => $toName));
WfCommonUtil::runlog($runId, $processId, $flowProcess, $this->uid, 2, $content, $toid);
$message = StringUtil::filterCleanHtml($_POST["message"]);
if (!empty($message)) {
Notify::model()->sendNotify($toid, "workflow_entrust_notice", array("{message}" => $message));
}
$this->redirect($referer);
}
}
示例8: processAddOrEditData
public static function processAddOrEditData($data)
{
$contactArr = array("upuid" => 0, "inputtime" => 0, "contact" => "", "purpose" => "", "detail" => "");
foreach ($data as $k => $v) {
if (in_array($k, array_keys($contactArr))) {
$contactArr[$k] = $v;
}
}
$input = implode(",", StringUtil::getId($contactArr["upuid"]));
$contactArr["input"] = empty($input) ? Ibos::app()->user->uid : $input;
if ($contactArr["inputtime"] != 0) {
$contactArr["inputtime"] = strtotime($contactArr["inputtime"]);
} else {
$contactArr["inputtime"] = TIMESTAMP;
}
unset($contactArr["upuid"]);
return $contactArr;
}
示例9: handleEmailBody
public function handleEmailBody($data)
{
$data["toids"] = implode(",", StringUtil::getId($data["toids"]));
$data["sendtime"] = TIMESTAMP;
$data["isneedreceipt"] = isset($data["isneedreceipt"]) ? 1 : 0;
if (empty($data["isOtherRec"])) {
$data["copytoids"] = $data["secrettoids"] = "";
} else {
$data["copytoids"] = implode(",", StringUtil::getId($data["copytoids"]));
$data["secrettoids"] = implode(",", StringUtil::getId($data["secrettoids"]));
}
if (empty($data["isWebRec"])) {
$data["towebmail"] = "";
}
if (!isset($data["fromwebmail"])) {
$data["fromwebmail"] = "";
}
!empty($data["attachmentid"]) && ($data["attachmentid"] = StringUtil::filterStr($data["attachmentid"]));
$data["size"] = EmailUtil::getEmailSize($data["content"], $data["attachmentid"]);
return $data;
}
示例10: actionCategory
public function actionCategory()
{
if (EnvUtil::submitCheck("formhash")) {
if (isset($_POST["name"])) {
foreach ($_POST["name"] as $id => $val) {
if (!empty($val)) {
$data = array("name" => StringUtil::filterCleanHtml($val), "sort" => intval($_POST["sort"][$id]), "deptid" => !empty($_POST["deptid"][$id]) ? implode(",", StringUtil::getId($_POST["deptid"][$id])) : "");
FlowCategory::model()->modify(intval($id), $data);
}
}
}
if (isset($_POST["newname"])) {
foreach ($_POST["newname"] as $id => $val) {
if (!empty($val)) {
$data = array("name" => StringUtil::filterCleanHtml($val), "sort" => intval($_POST["newsort"][$id]), "deptid" => !empty($_POST["newdeptid"][$id]) ? implode(",", StringUtil::getId($_POST["newdeptid"][$id])) : "");
FlowCategory::model()->add($data);
}
}
}
if (!empty($_POST["delid"])) {
$id = StringUtil::filterStr($_POST["delid"]);
if (!FlowCategory::model()->del($id)) {
$this->error(Ibos::lang("Category delete require"));
}
}
$this->success(Ibos::lang("Operation succeed", "message"));
} else {
$categorys = FlowCategory::model()->fetchAll(array("order" => "sort ASC"));
foreach ($categorys as $key => &$cat) {
if ($cat["deptid"] !== "") {
$cat["deptid"] = StringUtil::wrapId($cat["deptid"], "d");
}
$cat["flownums"] = FlowType::model()->countByAttributes(array("catid" => $cat["catid"]));
$cat["formnums"] = FlowFormType::model()->countByAttributes(array("catid" => $cat["catid"]));
}
$this->render("category", array("list" => $categorys));
}
}
示例11: beforeSave
protected function beforeSave()
{
$users = $_POST["users"];
$_POST["uid"] = $_POST["deptid"] = $_POST["positionid"] = "";
$allIds = StringUtil::getId($users, true);
foreach ($allIds as $prefix => $ids) {
$id = implode(",", $ids);
if ($prefix == "c") {
$_POST["deptid"] = "alldept";
}
if ($prefix == "d") {
$_POST["deptid"] = $id;
}
if ($prefix == "p") {
$_POST["positionid"] = $id;
}
if ($prefix == "u") {
$_POST["uid"] = $id;
}
}
if ($_POST["scope"] === "custom") {
$_POST["scope"] = implode(",", StringUtil::getId($_POST["scopedept"]));
}
}
示例12: handleSaveData
protected function handleSaveData($post)
{
$ret = array("name" => $post["name"], "level" => $post["level"], "level1" => implode(",", StringUtil::getId($post["level1"])), "level2" => implode(",", StringUtil::getId($post["level2"])), "level3" => implode(",", StringUtil::getId($post["level3"])), "level4" => implode(",", StringUtil::getId($post["level4"])), "level5" => implode(",", StringUtil::getId($post["level5"])), "free" => implode(",", StringUtil::getId($post["free"])), "desc" => $post["desc"]);
return $ret;
}
示例13: actionManager
public function actionManager()
{
$data = array();
$type = EnvUtil::getRequest("type");
$inSearch = false;
if ($type == "search") {
$inSearch = true;
$condition = "1";
$keyword = EnvUtil::getRequest("keyword");
if (!empty($keyword)) {
$keyword = StringUtil::filterCleanHtml($keyword);
$condition .= " AND content LIKE '%{$keyword}%'";
}
$searchType = EnvUtil::getRequest("searchtype");
if (!empty($searchType)) {
$returnStatus = array();
if (StringUtil::findIn($searchType, 1)) {
$returnStatus[] = 1;
}
if (StringUtil::findIn($searchType, 0)) {
$returnStatus[] = 0;
}
$condition .= sprintf(" AND return IN ('%s')", implode(",", $returnStatus));
}
$begin = EnvUtil::getRequest("begin");
$end = EnvUtil::getRequest("end");
if (!empty($begin) && !empty($end)) {
$condition .= sprintf(" AND ctime BETWEEN %d AND %d", strtotime($begin), strtotime($end));
} elseif (!empty($begin)) {
$condition .= sprintf(" AND ctime > %d", strtotime($begin));
} elseif (!empty($end)) {
$condition .= sprintf(" AND ctime < %d", strtotime($end));
}
$sender = EnvUtil::getRequest("sender");
if (!empty($sender)) {
$realSender = implode(",", StringUtil::getId($sender));
$condition .= sprintf(" AND uid = %d", intval($realSender));
}
$recNumber = EnvUtil::getRequest("recnumber");
if (!empty($recNumber)) {
$condition .= sprintf(" AND mobile = %d", sprintf("%d", $recNumber));
}
$content = EnvUtil::getRequest("content");
if (!empty($content) && empty($keyword)) {
$content = StringUtil::filterCleanHtml($content);
$condition .= " AND content LIKE '%{$content}%'";
}
$type = "manager";
} else {
$condition = "";
}
$count = NotifySms::model()->count($condition);
$pages = PageUtil::create($count, 20);
if ($inSearch) {
$pages->params = array("keyword" => $keyword, "searchtype" => $searchType, "begin" => $begin, "end" => $end, "sender" => $sender, "recnumber" => $recNumber, "content" => $content);
}
$data["list"] = NotifySms::model()->fetchAll(array("condition" => $condition, "order" => "ctime DESC"));
$data["count"] = $count;
$data["pages"] = $pages;
$data["search"] = $inSearch;
$this->render("manager", $data);
}
示例14: getListData
protected function getListData()
{
if (EnvUtil::submitCheck("formhash")) {
$runid = intval(EnvUtil::getRequest("runid"));
$flowid = intval(EnvUtil::getRequest("flowid"));
$userType = EnvUtil::getRequest("usertype");
$runName = StringUtil::filterCleanHtml(EnvUtil::getRequest("runname"));
$toid = !empty($_POST["toid"]) ? implode(",", StringUtil::getId($_POST["toid"])) : "";
} else {
$runid = 0;
$userType = $runName = $toid = "";
$flowid = "all";
}
$flowIds = WfQueryUtil::getMyFlowIDs($this->uid);
if (empty($flowIds)) {
$flowIds = array(0);
}
$condition = array("and", "fr.delflag = 0", array("in", "fr.flowid", $flowIds), array("in", "frp.flag", array(1, 2)), "(frp.opflag = 1 OR frp.topflag = 2)");
$field = "frp.runid,frp.processid,frp.uid,frp.flag,frp.processtime,frp.flowprocess,fr.attachmentid,fr.focususer,ft.freeother";
if ($flowid !== "all") {
$condition[] = "ft.flowid = " . $flowid;
}
if (!empty($runid)) {
$condition[] = "fr.runid = " . $runid;
}
if (!empty($runName)) {
$condition[] = " fr.name LIKE '%{$runName}%'";
}
if ($toid != "") {
if ($userType == "opuser") {
$condition[] = "frp.uid = {$toid}";
} else {
$condition[] = "fr.beginuser = {$toid}";
}
}
$lang = Ibos::getLangSource("workflow.default");
$count = Ibos::app()->db->createCommand()->select("count(fr.runid)")->from("{{flow_run}} fr")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->leftJoin("{{flow_run_process}} frp", "fr.runid = frp.runid")->where($condition)->queryScalar();
$pages = PageUtil::create($count, $this->getListPageSize());
$list = Ibos::app()->db->createCommand()->select($field)->from("{{flow_run}} fr")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->leftJoin("{{flow_run_process}} frp", "fr.runid = frp.runid")->where($condition)->group("frp.runid")->order("frp.runid DESC")->limit($pages->getLimit())->offset($pages->getOffset())->queryAll();
foreach ($list as $k => &$rec) {
$temp = Ibos::app()->db->createCommand()->select("ft.flowid,ft.freeother,fr.name as runName,ft.name as typeName,ft.type,ft.sort")->from("{{flow_type}} ft")->leftJoin("{{flow_run}} fr", "fr.flowid = ft.flowid")->where("fr.runid = " . $rec["runid"])->queryRow();
if ($temp) {
$rec = array_merge($rec, $temp);
} else {
continue;
}
if ($temp["type"] == 1) {
$fp = FlowProcess::model()->fetchProcess($temp["flowid"], $rec["flowprocess"]);
if ($fp) {
$rec["stepname"] = $fp["name"];
} else {
$rec["stepname"] = $lang["Process steps already deleted"];
}
} else {
$rec["stepname"] = Ibos::lang("Step", "", array("{step}" => $rec["processid"]));
}
if ($rec["flag"] == FlowConst::PRCS_UN_RECEIVE) {
$deliverTime = FlowRunProcess::model()->fetchDeliverTime($rec["runid"], $rec["flowprocess"]);
if ($deliverTime) {
$prcsBeginTime = $deliverTime;
}
} else {
$prcsBeginTime = $rec["processtime"];
}
if (!isset($prcsBeginTime) || $prcsBeginTime == 0) {
$prcsBeginTime = TIMESTAMP;
}
$usedTime = TIMESTAMP - $prcsBeginTime;
$rec["timestr"] = WfCommonUtil::getTime($usedTime, "dhi");
if (!empty($rec["attachmentid"])) {
$rec["attachdata"] = AttachUtil::getAttachData($rec["attachmentid"]);
}
$rec["focus"] = StringUtil::findIn($this->uid, $rec["focususer"]);
$rec["user"] = User::model()->fetchByUid($rec["uid"]);
$rec["key"] = WfCommonUtil::param(array("flowid" => $rec["flowid"], "runid" => $rec["runid"], "processid" => $rec["processid"], "flowprocess" => $rec["flowprocess"]));
if (empty($rec["user"])) {
unset($list[$k]);
}
}
return array("list" => $list, "pages" => $pages);
}
示例15: actionSave
public function actionSave()
{
$uid = Ibos::app()->user->uid;
$originalPlan = $planOutside = "";
if (array_key_exists("originalPlan", $_POST)) {
$originalPlan = $_POST["originalPlan"];
}
if (array_key_exists("planOutside", $_POST)) {
$planOutside = array_filter($_POST["planOutside"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
}
if (!empty($originalPlan)) {
foreach ($originalPlan as $key => $value) {
DiaryRecord::model()->modify($key, array("schedule" => $value));
}
}
$shareUidArr = isset($_POST["shareuid"]) ? StringUtil::getId($_POST["shareuid"]) : array();
$diary = array("uid" => $uid, "diarytime" => strtotime($_POST["todayDate"]), "nextdiarytime" => strtotime($_POST["plantime"]), "addtime" => TIMESTAMP, "content" => $_POST["diaryContent"], "shareuid" => implode(",", $shareUidArr), "readeruid" => "", "remark" => "", "attention" => "");
$diaryId = Diary::model()->add($diary, true);
if (!empty($planOutside)) {
DiaryRecord::model()->addRecord($planOutside, $diaryId, strtotime($_POST["todayDate"]), $uid, "outside");
}
$plan = array_filter($_POST["plan"], create_function("\$v", "return !empty(\$v[\"content\"]);"));
DiaryRecord::model()->addRecord($plan, $diaryId, strtotime($_POST["plantime"]), $uid, "new");
UserUtil::updateCreditByAction("adddiary", $uid);
$this->ajaxReturn($diaryId, "JSONP");
}