本文整理汇总了PHP中PageUtil::create方法的典型用法代码示例。如果您正苦于以下问题:PHP PageUtil::create方法的具体用法?PHP PageUtil::create怎么用?PHP PageUtil::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageUtil
的用法示例。
在下文中一共展示了PageUtil::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
$catId = intval(EnvUtil::getRequest("catid"));
if (EnvUtil::submitCheck("search")) {
$key = $_POST["keyword"];
$list = Position::model()->fetchAll("`posname` LIKE '%{$key}%'");
} else {
$catContidion = empty($catId) ? "" : "catid = {$catId}";
$count = Position::model()->count($catContidion);
$pages = PageUtil::create($count);
$list = Position::model()->fetchAllByCatId($catId, $pages->getLimit(), $pages->getOffset());
$data["pages"] = $pages;
}
foreach ($list as $k => $pos) {
$list[$k]["num"] = User::model()->count("positionid = :positionid AND status != 2", array(":positionid" => $pos["positionid"]));
}
$data["catid"] = $catId;
$catData = PositionUtil::loadPositionCategory();
$data["catData"] = $catData;
$data["list"] = $list;
$data["category"] = StringUtil::getTree($catData, $this->selectFormat);
$this->setPageTitle(Ibos::lang("Position manager"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Organization"), "url" => $this->createUrl("department/index")), array("name" => Ibos::lang("Position manager"))));
$this->render("index", $data, false, array("category"));
}
示例2: actionIndex
public function actionIndex()
{
if (isset($_GET["pagesize"])) {
$this->setListPageSize($_GET["pagesize"]);
}
$key = StringUtil::filterCleanHtml(EnvUtil::getRequest("keyword"));
$fields = array("frp.runid", "frp.processid", "frp.flowprocess", "frp.flag", "frp.opflag", "frp.processtime", "ft.freeother", "ft.flowid", "ft.name as typeName", "ft.type", "ft.listfieldstr", "fr.name as runName", "fr.beginuser", "fr.begintime", "fr.endtime", "fr.focususer");
$sort = "frp.processtime";
$group = "frp.runid";
$condition = array("and", "fr.delflag = 0", "frp.childrun = 0", sprintf("frp.uid = %d", $this->uid), sprintf("FIND_IN_SET(fr.focususer,'%s')", $this->uid));
if ($key) {
$condition[] = array("like", "fr.runid", "%{$key}%");
$condition[] = array("or like", "fr.name", "%{$key}%");
}
$count = Ibos::app()->db->createCommand()->select("count(*) as count")->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->group($group)->queryScalar();
$pages = PageUtil::create($count, $this->getListPageSize());
if ($key && $count) {
$pages->params = array("keyword" => $key);
}
$offset = $pages->getOffset();
$limit = $pages->getLimit();
$list = Ibos::app()->db->createCommand()->select($fields)->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->order($sort)->group($group)->offset($offset)->limit($limit)->queryAll();
$data = array_merge(array("pages" => $pages), $this->handleList($list));
$this->setPageTitle(Ibos::lang("My focus"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang(Ibos::lang("My focus")), "url" => $this->createUrl("focus/index")), array("name" => Ibos::lang("List"))));
$this->render("index", $data);
}
示例3: fetchCommentList
public function fetchCommentList()
{
$count = $this->getCommentCount();
$limit = $this->getAttributes("limit");
$pages = PageUtil::create($count, $limit);
$this->setAttributes(array("offset" => $pages->getOffset(), "limit" => $pages->getLimit()));
$var = array("list" => $this->getCommentList(), "lang" => Ibos::getLangSources(array("message.default")), "count" => $count, "limit" => $limit, "rowid" => $this->getAttributes("rowid"), "moduleuid" => $this->getAttributes("moduleuid"), "showlist" => $this->getAttributes("showlist"), "pages" => $pages);
$content = $this->render("application.modules.weibo.views.comment.loadreply", $var, true);
return $content;
}
示例4: actionList
public function actionList()
{
$uid = Yii::app()->user->uid;
$unreadCount = MessageContent::model()->countUnreadList($uid);
$pageCount = MessageContent::model()->countMessageListByUid($uid, array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT));
$pages = PageUtil::create($pageCount);
$list = MessageContent::model()->fetchAllMessageListByUid($uid, array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT), $pages->getLimit(), $pages->getOffset());
$data = array("datas" => $list, "pages" => $pages, "unreadCount" => $unreadCount);
$this->ajaxReturn($data, "JSONP");
}
示例5: actionIndex
public function actionIndex()
{
$count = EmailWeb::model()->countByAttributes(array("uid" => $this->uid));
$pages = PageUtil::create($count, $this->getListPageSize());
$list = EmailWeb::model()->fetchByList($this->uid, $pages->getOffset(), $pages->getLimit());
$data = array("pages" => $pages, "list" => $list);
$this->setPageTitle(Ibos::lang("Web email"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Email center"), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang("Web email"))));
$this->render("index", $data);
}
示例6: setPages
protected function setPages()
{
$dataReader = Ibos::app()->db->createCommand()->select("count(*)")->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($this->getCondition())->group($this->getQueryGroup())->query();
$count = $dataReader->count();
$pages = PageUtil::create($count, $this->getPageSize());
if ($this->getKeyword() != "" && $count) {
$pages->params = array("keyword" => $this->getKeyword());
}
$this->setOffset($pages->getOffset());
$this->setLimit($pages->getLimit());
$this->_var["pages"] = $pages;
}
示例7: actionDetail
public function actionDetail()
{
$uid = Yii::app()->user->uid;
$module = EnvUtil::getRequest("module");
$pageCount = Yii::app()->db->createCommand()->select("count(id)")->from("{{notify_message}}")->where("uid={$uid} AND module = '{$module}'")->group("module")->queryScalar();
$pages = PageUtil::create($pageCount);
$list = NotifyMessage::model()->fetchAllDetailByTimeLine($uid, $module, $pages->getLimit(), $pages->getOffset());
$data = array("list" => $list, "pages" => $pages);
NotifyMessage::model()->setReadByModule($uid, $module);
$this->setPageTitle(Ibos::lang("Detail notify"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Message center"), "url" => $this->createUrl("mention/index")), array("name" => Ibos::lang("Notify"), "url" => $this->createUrl("notify/index")), array("name" => Ibos::lang("Detail notify"))));
$this->render("detail", $data);
}
示例8: actionIndex
public function actionIndex()
{
$uid = Yii::app()->user->uid;
MessageUser::model()->setMessageIsRead($uid, EnvUtil::getRequest("id"), 1);
$unreadCount = MessageContent::model()->countUnreadList($uid);
$pageCount = MessageContent::model()->countMessageListByUid($uid, array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT));
$pages = PageUtil::create($pageCount);
$list = MessageContent::model()->fetchAllMessageListByUid($uid, array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT), $pages->getLimit(), $pages->getOffset());
$data = array("list" => $list, "pages" => $pages, "unreadCount" => $unreadCount);
$this->setPageTitle(Ibos::lang("PM"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Message center"), "url" => $this->createUrl("mention/index")), array("name" => Ibos::lang("PM"))));
$this->render("index", $data);
}
示例9: actionIndex
public function actionIndex()
{
$uid = Ibos::app()->user->uid;
$unreadAtMe = UserData::model()->countUnreadAtMeByUid($uid);
$pageCount = Atme::model()->countByAttributes(array("uid" => $uid));
$pages = PageUtil::create($pageCount);
$atList = Atme::model()->fetchAllAtmeListByUid($uid, $pages->getLimit(), $pages->getOffset());
$feedIds = ConvertUtil::getSubByKey($atList, "feedid");
$diggArr = FeedDigg::model()->checkIsDigg($feedIds, $uid);
$data = array("unreadAtmeCount" => $unreadAtMe, "list" => $atList, "pages" => $pages, "digg" => $diggArr);
$this->setPageTitle(Ibos::lang("Mention me"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Message center"), "url" => $this->createUrl("mention/index")), array("name" => Ibos::lang("Mention me"))));
$this->render("index", $data);
}
示例10: search
public static function search($conditions, $tableDriver, $countOnly = false, $length = 20)
{
global $page;
$list = array();
$tableId = $conditions["sourcetableid"] ? $conditions["sourcetableid"] : 0;
$sql = $tableDriver["mainTable"]::model()->getSplitSearchContdition($conditions);
$count = $tableDriver["mainTable"]::model()->countBySplitCondition($tableId, $sql);
if ($countOnly) {
return $count;
} else {
$page = PageUtil::create($count, $length);
$list = $tableDriver["mainTable"]::model()->fetchAllBySplitCondition($tableId, $sql, $page->getOffset(), $page->getLimit());
}
return $list;
}
示例11: actionIndex
public function actionIndex()
{
$fields = "ft.name as typeName,fr.name as runName,fr.*";
$sort = "fr.runid DESC";
$sql = sprintf(" AND beginuser = %d", $this->uid);
$condition = array("and", sprintf("delflag = 1%s", $sql));
$count = Ibos::app()->db->createCommand()->select("count(*) as count")->from("{{flow_run}} fr")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->queryScalar();
$pages = PageUtil::create($count, $this->getListPageSize());
$offset = $pages->getOffset();
$limit = $pages->getLimit();
$list = Ibos::app()->db->createCommand()->select($fields)->from("{{flow_run}} fr")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->order($sort)->offset($offset)->limit($limit)->queryAll();
$data = array_merge(array("pages" => $pages), $this->handleList($list));
$this->setPageTitle(Ibos::lang("Work recycle"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang(Ibos::lang("Work recycle")), "url" => $this->createUrl("recycle/index")), array("name" => Ibos::lang("List"))));
$this->render("index", $data);
}
示例12: actionSetup
public function actionSetup()
{
$formSubmit = EnvUtil::submitCheck("announcementSubmit");
if ($formSubmit) {
$sort = $_POST["sort"];
foreach ($sort as $id => $value) {
Announcement::model()->modify($id, array("sort" => $value));
}
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$data = array();
$count = Announcement::model()->count(array("select" => "id"));
$pages = PageUtil::create($count);
$list = Announcement::model()->fetchAllOnList($pages->getLimit(), $pages->getOffset());
$data["list"] = $list;
$data["pages"] = $pages;
$this->render("setup", $data);
}
}
示例13: search
private function search($kw)
{
$search["keyword"] = $kw;
$condition = array();
$condition = EmailUtil::mergeSearchCondition($search, Yii::app()->user->uid);
$conditionStr = base64_encode(serialize($condition));
if (empty($condition)) {
$this->error(Ibos::lang("Request tainting", "error"), $this->createUrl("list/index"));
}
$emailData = Email::model()->fetchAllByArchiveIds("*", $condition["condition"], $condition["archiveId"], array("e", "eb"), null, null, SORT_DESC, "emailid");
$count = count($emailData);
$pages = PageUtil::create($count, 10, false);
$pages->params = array("condition" => $conditionStr);
$list = array_slice($emailData, $pages->getOffset(), $pages->getLimit(), false);
foreach ($list as $index => &$mail) {
$mail["fromuser"] = $mail["fromid"] ? User::model()->fetchRealnameByUid($mail["fromid"]) : "";
}
$return = array("datas" => $list, "pages" => array("pageCount" => $pages->getPageCount(), "page" => $pages->getCurrentPage(), "pageSize" => $pages->getPageSize()));
$this->ajaxReturn($return, "JSONP");
}
示例14: getListData
private function getListData($operation)
{
$data["op"] = $operation;
$data["fid"] = $this->fid;
$data["webId"] = $this->webId;
$data["folders"] = $this->folders;
$data["archiveId"] = $this->archiveId;
$data["allowRecall"] = Yii::app()->setting->get("setting/emailrecall");
$uid = $this->uid;
if ($operation == "archive") {
if (!in_array($this->subOp, array("in", "send"))) {
$this->subOp = "in";
}
}
$data["subOp"] = $this->subOp;
$count = Email::model()->countByListParam($operation, $uid, $data["fid"], $data["archiveId"], $data["subOp"]);
$pages = PageUtil::create($count, $this->getListPageSize());
$data["pages"] = $pages;
$data["unreadCount"] = Email::model()->countUnreadByListParam($operation, $uid, $data["fid"], $data["archiveId"], $data["subOp"]);
$data["list"] = Email::model()->fetchAllByListParam($operation, $uid, $data["fid"], $data["archiveId"], $pages->getLimit(), $pages->getOffset(), $data["subOp"]);
return $data;
}
示例15: actionIndex
public function actionIndex()
{
$this->catid = intval(EnvUtil::getRequest("catid"));
$this->category = FlowCategory::model()->fetchAllByUserPurv($this->uid);
$catId = $this->getCatId();
$keyword = EnvUtil::getRequest("keyword");
if (!empty($keyword)) {
$keyword = StringUtil::filterCleanHtml($keyword);
} else {
$keyword = "";
}
if (EnvUtil::getRequest("inajax") == "1") {
$limit = intval(EnvUtil::getRequest("limit"));
$offset = intval(EnvUtil::getRequest("offset"));
$condition = $catId ? "ff.catid = " . intval($catId) : "1";
if (!empty($keyword)) {
$condition .= " AND ff.formname LIKE '%{$keyword}%'";
}
$list = FlowFormType::model()->fetchAllByList($condition, $offset, $limit);
$list = $this->handleFormData($list);
$count = count($list);
$this->ajaxReturn(array("count" => $count, "list" => $list));
} else {
if (isset($_GET["pagesize"])) {
$this->setListPageSize($_GET["pagesize"]);
}
$condition = $catId ? "catid = " . intval($catId) : "1";
if (!empty($keyword)) {
$condition .= " AND t.formname LIKE '%{$keyword}%'";
}
$count = FlowFormType::model()->countByCondition($condition);
$pages = PageUtil::create($count, $this->getListPageSize());
$data = array("limit" => $pages->getLimit(), "offset" => $pages->getOffset(), "pageSize" => $this->getListPageSize(), "keyword" => $keyword, "pages" => $pages, "count" => $count, "category" => $this->category, "catId" => $this->catid);
$this->setPageTitle(Ibos::lang("Form library manager"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang("Form library manager"), "url" => $this->createUrl("formtype/index")), array("name" => Ibos::lang("List"))));
$this->render("index", $data);
}
}