本文整理汇总了PHP中StringUtil::iImplode方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::iImplode方法的具体用法?PHP StringUtil::iImplode怎么用?PHP StringUtil::iImplode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtil
的用法示例。
在下文中一共展示了StringUtil::iImplode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: increase
public function increase($uids, $creditArr)
{
$uids = StringUtil::iIntval((array) $uids, true);
$sql = array();
$allowKey = array("extcredits1", "extcredits2", "extcredits3", "extcredits4", "extcredits5", "oltime", "attachsize");
foreach ($creditArr as $key => $value) {
if (($value = intval($value)) && $value && in_array($key, $allowKey)) {
$sql[] = "`{$key}`=`{$key}`+'{$value}'";
}
}
if (!empty($sql)) {
$sqlText = "UPDATE %s SET %s WHERE uid IN (%s)";
return Yii::app()->db->createCommand()->setText(sprintf($sqlText, $this->tableName(), implode(",", $sql), StringUtil::iImplode($uids)))->execute();
}
}
示例2: fetchAllByRealnames
public function fetchAllByRealnames($realnames)
{
$usersData = array();
if (!empty($realnames)) {
$users = UserUtil::loadUser();
$criteria = array("select" => "*", "condition" => sprintf("realname IN (%s)", StringUtil::iImplode($realnames)));
$list = $this->fetchAll($criteria);
foreach ($list as $user) {
if (isset($users[$user["uid"]])) {
$usersData[$user["uid"]] = $users[$user["uid"]];
} else {
$usersData[$user["uid"]] = UserUtil::wrapUserInfo($user);
}
}
}
return $usersData;
}
示例3: actionIndex
public function actionIndex()
{
$op = EnvUtil::getRequest("op");
$id = intval(EnvUtil::getRequest("id"));
if (EnvUtil::submitCheck("formhash")) {
if ($op == "edit") {
$dayNew = $_POST["weekdaynew"] != -1 ? -1 : $_POST["daynew"];
if (strpos($_POST["minutenew"], ",") !== false) {
$minuteNew = explode(",", $_POST["minutenew"]);
foreach ($minuteNew as $key => $val) {
$minuteNew[$key] = $val = intval($val);
if ($val < 0 || 59 < $val) {
unset($minuteNew[$key]);
}
}
$minuteNew = array_slice(array_unique($minuteNew), 0, 12);
$minuteNew = implode("\t", $minuteNew);
} else {
$minuteNew = intval($_POST["minutenew"]);
$minuteNew = 0 <= $minuteNew && $minuteNew < 60 ? $minuteNew : "";
}
$cronfile = $this->getRealCronFile($_POST["type"], $_POST["filenamenew"], $_POST["module"]);
if (preg_match("/[\\\\\\/\\:\\*\\?\"\\<\\>\\|]+/", $_POST["filenamenew"])) {
$this->error(Ibos::lang("Crons filename illegal"));
} elseif (!is_readable($cronfile)) {
$this->error(Ibos::lang("Crons filename invalid", "", array("{cronfile}" => $cronfile)));
} else {
if ($_POST["weekdaynew"] == -1 && $dayNew == -1 && $_POST["hournew"] == -1 && $minuteNew === "") {
$this->error(Ibos::lang("Crons time invalid"));
}
}
$data = array("weekday" => $_POST["weekdaynew"], "day" => $dayNew, "hour" => $_POST["hournew"], "minute" => $minuteNew, "filename" => trim($_POST["filenamenew"]));
$id && Cron::model()->modify($id, $data);
Ibos::app()->cron->run($id);
} elseif ($op == "delete") {
if (!empty($_POST["delete"])) {
$ids = StringUtil::iImplode($_POST["delete"]);
Cron::model()->deleteAll(sprintf("cronid IN (%s) AND type='user'", $ids));
}
} else {
if (isset($_POST["namenew"]) && !empty($_POST["namenew"])) {
foreach ($_POST["namenew"] as $id => $name) {
$newCron = array("name" => StringUtil::filterCleanHtml($_POST["namenew"][$id]), "available" => isset($_POST["availablenew"][$id]) ? 1 : 0);
if (isset($_POST["availablenew"][$id]) && empty($_POST["availablenew"][$id])) {
$newCron["nextrun"] = "0";
}
Cron::model()->modify($id, $newCron);
}
}
if (!empty($_POST["newname"])) {
$data = array("name" => StringUtil::ihtmlSpecialChars($_POST["newname"]), "type" => "user", "available" => "0", "weekday" => "-1", "day" => "-1", "hour" => "-1", "minute" => "", "nextrun" => TIMESTAMP);
Cron::model()->add($data);
}
$list = Cron::model()->fetchAll(array("select" => "cronid,filename,type,module"));
foreach ($list as $cron) {
$cronFile = $this->getRealCronFile($cron["type"], $cron["filename"], $cron["module"]);
if (!file_exists($cronFile)) {
Cron::model()->modify($cron["cronid"], array("available" => 0, "nextrun" => 0));
}
}
CacheUtil::update("setting");
}
$this->success(Ibos::lang("Crons succeed"), $this->createUrl("cron/index"));
} else {
if ($op && in_array($op, array("edit", "run"))) {
$cron = Cron::model()->fetchByPk($id);
if (!$cron) {
$this->error("Cron not found");
}
$cron["filename"] = str_replace(array("..", "/", "\\"), array("", "", ""), $cron["filename"]);
if ($op == "edit") {
$this->render("edit", array("cron" => $cron));
} elseif ($op == "run") {
$file = $this->getRealCronFile($cron["type"], $cron["filename"], $cron["module"]);
if (!file_exists($file)) {
$this->error(Ibos::lang("Crons run invalid", "", array("{cronfile}" => $file)));
} else {
Ibos::app()->cron->run($cron["cronid"]);
$this->success(Ibos::lang("Crons run succeed"), $this->createUrl("cron/index"));
}
}
} else {
$list = Cron::model()->fetchAll(array("order" => "type desc"));
$this->handleCronList($list);
$this->render("index", array("list" => $list));
}
}
}
示例4: actionConfirm
public function actionConfirm()
{
$key = EnvUtil::getRequest("key");
if ($key) {
$param = WfCommonUtil::param($key, "DECODE");
$runId = intval($param["runid"]);
$processId = intval($param["processid"]);
$flowId = intval($param["flowid"]);
$flowProcess = intval($param["flowprocess"]);
$manager = EnvUtil::getRequest("manager");
$this->checkRunPermission($runId);
!$manager && $this->checkAgentInTodo($runId, $processId);
$this->checkEntrustType($flowId);
$this->checkRunDel($runId);
$nextId = $this->getNextProcessID($flowId, $processId);
if ($manager) {
$rp = FlowRunProcess::model()->fetchOpUserByUniqueID($runId, $processId, $flowProcess);
} else {
$rp = FlowRunProcess::model()->fetchRunProcess($runId, $processId, $flowProcess, $this->uid);
}
$prcsUser = WfHandleUtil::getEntrustUser($flowId, $runId, $processId, $nextId);
$data = array("runName" => FlowRun::model()->fetchNameByRunID($runId), "opflag" => $rp["opflag"], "processID" => $processId, "flowProcess" => $flowProcess, "oldUid" => $rp["uid"], "runID" => $runId, "key" => $key, "lang" => Ibos::getLangSources(), "prcsUser" => sprintf("[%s]", !empty($prcsUser) ? StringUtil::iImplode($prcsUser) : ""));
$data = array_merge($data, $this->handleList($flowId, $runId, $processId));
$this->renderPartial("confirm", $data);
} else {
exit(Ibos::lang("Parameters error", "error"));
}
}
示例5: foreach
<?php
foreach ($stamp->getSeries() as $series) {
?>
<?php
$count = explode(",", trim($series["count"], ","));
?>
{
name:'<?php
echo $series["name"];
?>
',
type:'bar',
stack: '总量',
itemStyle : dataStyle,
data:[<?php
echo StringUtil::iImplode($count);
?>
]
},
{
name:'<?php
echo $series["name"];
?>
',
type:'bar',
stack: '总量',
itemStyle: placeHoledStyle,
data:[
<?php
foreach ($count as $number) {
?>
示例6: makeUserSelect
protected function makeUserSelect($runId, $index, $process, $name, $flowId, $processId)
{
$lang = Ibos::getLangSource("workflow.default");
$tablestr = "";
if ($index) {
$display = "none;";
} else {
$display = "";
}
if ($process["childflow"] != 0) {
$flow = FlowType::model()->fetchByPk($process["childflow"]);
if ($flow) {
$type = $flow["type"];
}
if ($type == 2) {
$process["prcs_id_next"] = "";
}
$subfp = FlowProcess::model()->fetchProcess($process["childflow"], 1);
if ($subfp) {
$prcsuser = WfHandleUtil::getPrcsUser($process["childflow"], $processId);
} else {
$prcsuser = "";
}
$prcsuser = sprintf("[%s]", !empty($prcsuser) ? StringUtil::iImplode($prcsuser) : "");
if (empty($subfp["uid"]) && empty($subfp["deptid"]) && empty($subfp["positionid"])) {
$nopriv = $lang["Not set step permissions"];
}
$tablestr = " <div style='display:{$display};' id='user_select_{$index}'>\r\n <div class=\"control-group first-group\">\r\n <label class=\"control-label\">{$lang["Host"]}</label>\r\n <div class=\"controls\">\r\n <strong>{$name} {$nopriv}</strong>\r\n <input type=\"hidden\" name=\"topflag{$index}\" value=\"0\">\r\n <input id=\"prcs_user_op{$index}\" name=\"prcs_user_op{$index}\" type=\"text\" />\r\n </div>\r\n </div>\r\n <div class=\"control-group\">\r\n <label class=\"control-label\">{$lang["Agent"]}</label>\r\n <div class=\"controls\">\r\n <input id=\"prcs_user{$index}\" name=\"prcs_user{$index}\" type=\"text\" />\r\n </div>\r\n </div>\r\n </div>\r\n <script>\r\n\t\t\t\t\$(function(){\r\n\t\t\t\t\tvar prcsData{$index} = {$prcsuser};\r\n\t\t\t\t\t\$('#prcs_user_op{$index}').userSelect({\r\n\t\t\t\t\t\tbox:\$('<div id=\"prcs_user_op_box{$index}\"></div>').appendTo(document.body),\r\n\t\t\t\t\t\tdata:Ibos.data.includes(prcsData{$index}),\r\n\t\t\t\t\t\ttype:'user',\r\n\t\t\t\t\t\tmaximumSelectionSize:'1'\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\$('#prcs_user{$index}').userSelect({\r\n\t\t\t\t\t\tbox:\$('<div id=\"prcs_user_box{$index}\"></div>').appendTo(document.body),\r\n\t\t\t\t\t\tdata:Ibos.data.includes(prcsData{$index}),\r\n\t\t\t\t\t\ttype:'user'\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t</script>";
} else {
if (empty($process["uid"]) && empty($process["deptid"]) && empty($process["positionid"])) {
$nopriv = $lang["Not set step permissions"];
}
$prcsOpUser = $prcsUserAuto = "";
$deptArr = DepartmentUtil::loadDepartment();
if ($process["autotype"] == 1) {
$uid = FlowRun::model()->fetchBeginUserByRunID($runId);
$prcsuser = User::model()->fetchByUid($uid);
if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $prcsuser["uid"]) || StringUtil::findIn($process["deptid"], $prcsuser["alldeptid"]) || StringUtil::findIn($process["positionid"], $prcsuser["allposid"])) {
$prcsOpUser = $prcsuser["uid"];
$prcsUserAuto = $prcsuser["uid"] . ",";
}
} elseif (in_array($process["autotype"], array(2, 4, 5, 6))) {
if ($process["autobaseuser"] != 0) {
$baseUid = FlowRunProcess::model()->fetchBaseUid($runId, $process["autobaseuser"]);
$baseuser = User::model()->fetchByUid($baseUid);
$autodept = $baseuser["deptid"];
} else {
$autodept = Ibos::app()->user->deptid;
}
if (0 < intval($autodept)) {
if ($process["autotype"] == 2) {
$tmpdept = $autodept;
} else {
if ($process["autotype"] == 4 || $process["autotype"] == 6) {
$tmpdept = $deptArr[$autodept]["pid"] == 0 ? $autodept : $deptArr[$autodept]["pid"];
} elseif ($process["autotype"] == 5) {
$deptStr = Department::model()->queryDept($autodept, true);
$temp = explode(",", $deptStr);
$count = count($temp);
$dept = isset($temp[$count - 2]) ? $temp[$count - 2] : $autodept;
if ($deptArr[$dept]["pid"] != 0) {
$tmpdept = $deptArr[$dept]["deptid"];
} else {
$tmpdept = $autodept;
}
}
}
$manager = $deptArr[$tmpdept]["manager"];
if ($process["autotype"] == 4 || $process["autotype"] == 6) {
$leader = $deptArr[$autodept]["leader"];
$subleader = $deptArr[$autodept]["subleader"];
if ($leader != "0" && $process["autotype"] == 4) {
$manager = $leader;
}
if ($subleader != "0" && $process["autotype"] == 6) {
$manager = $subleader;
}
}
if (!empty($manager)) {
$muser = User::model()->fetchByUid($manager);
if (!empty($muser)) {
if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $muser["uid"]) || StringUtil::findIn($process["deptid"], $muser["alldeptid"]) || StringUtil::findIn($process["positionid"], $muser["allposid"])) {
$prcsUserAuto = $muser["uid"] . ",";
}
if ($prcsUserAuto != "") {
$prcsOpUser = strtok($prcsUserAuto, ",");
}
}
} else {
$userPerMax = "";
foreach (User::model()->fetchAllOtherManager($tmpdept) as $user) {
$user = User::model()->fetchByUid($user["uid"]);
$uid = $user["uid"];
$position = $user["allposid"];
if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $uid) || StringUtil::findIn($process["deptid"], $user["alldeptid"]) || StringUtil::findIn($process["positionid"], $position)) {
if ($userPerMax == "") {
$prcsOpUser = $uid;
$prcsUserAuto .= $uid . ",";
$userPerMax = $position;
} elseif ($position == $userPerMax) {
//.........这里部分代码省略.........
示例7: getStampName
public function getStampName()
{
$name = StringUtil::iImplode($this->getCounter()->getStampName());
return $name;
}