public function index() { $uid = session('user.id'); getMsgStatu($uid); $post = I('post.'); //dump($post); $order = "updatetime desc"; //排序方式 $project = D('project'); if (!empty($post['search'])) { //搜索 $search = '%' . $post['search'] . "%"; //搜索条件1 $where['pname|intro'] = array('like', $search); //搜索条件2 $count = $project->where($where)->order($order)->count(); $page = PAGE($count); $show = $page->show(); $data = $project->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select(); for ($i = 0; $i != count($data); $i++) { //改变搜索结果颜色 $data[$i]['intro'] = str_replace($post['search'], "<span style='color:red'>{$post['search']}</span>", $data[$i]['intro']); } //dump($data); // } elseif (!empty($post['ptype'])) { //筛选 } elseif (!empty($post['stage'])) { //筛选 $where = array(); if ($post['ptype'] !== "热门" && !empty($post['ptype'])) { $where['ptype'] = $post['ptype']; } if ($post['province'] !== "不限") { $where['location'] = $post['province'] . ' ' . $post['city']; } if ($post['stage'] !== "不限") { $where['stage'] = $post['stage']; } $count = $project->where($where)->order($order)->count(); $page = PAGE($count); $show = $page->show(); $data = $project->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select(); //dump($data); } else { //全部 $count = $project->order($order)->count(); $page = PAGE($count); $show = $page->show(); $data = $project->order($order)->limit($page->firstRow . ',' . $page->listRows)->select(); //dump($data); } for ($i = 0; $i != count($data); $i++) { //添加年龄段 $data[$i]['updatetime'] = $this->createTime(strtotime($data[$i]['updatetime'])); //创建日期转换 } $this->assign('project', $data); $this->assign('page', $show); // 赋值分页输出 $this->display(); }
public function index() { $uid = session('user.id'); getMsgStatu($uid); $post = I('post.'); $order = "posttime desc"; //排序方式 $field = "id,name,logo,rise,province,city,type,favourpolicy,condition"; $incubator = D("incubator"); if (!empty($post['search'])) { //搜索 $search = '%' . $post['search'] . "%"; //搜索条件1 $where['name|address|city|province'] = array('like', $search); //搜索条件2 $count = $incubator->where($where)->count(); // 查询满足要求的总记录数 $page = PAGE($count); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = $incubator->field($field)->where($where)->limit($page->firstRow . ',' . $page->listRows)->order($order)->select(); $cou = count($data); for ($i = 0; $i != $cou; $i++) { //改变搜索结果颜色 $data[$i]['name'] = str_replace($post['search'], "<span style='color:red'>{$post['search']}</span>", $data[$i]['name']); } } elseif (!empty($post['type'])) { //筛选 $where = array(); if ($post['type'] !== "不限") { $where['type'] = $post['type']; } if ($post['province'] !== "不限") { $where['province'] = $post['province']; } if ($post['city'] !== "不限") { $where['city'] = $post['city']; } $count = $incubator->where($where)->count(); // 查询满足要求的总记录数 $page = PAGE($count); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = $incubator->field($field)->where($where)->limit($page->firstRow . ',' . $page->listRows)->order($order)->select(); } else { $count = $incubator->field($field)->count(); // 查询满足要求的总记录数 $page = PAGE($count); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = $incubator->field($field)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select(); } $this->assign("page", $show); $this->assign("incubator", $data); $this->display(); }
public function getBlogs() { $count = M("")->table('blog b,user u')->field('b.id,b.uid,b.content,b.type,b.view,b.rise,b.posttime,b.statu,b.tag,b.title,u.username,u.headpic')->where('b.uid=u.id')->order('b.posttime desc')->count(); // 查询满足要求的总记录数 $page = PAGE($count); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = M("")->table('blog b,user u')->field('b.id,b.uid,b.content,b.type,b.view,b.rise,b.posttime,b.statu,b.tag,b.title,u.username,u.headpic')->where('b.uid=u.id')->order('b.posttime desc')->limit($page->firstRow . ',' . $page->listRows)->select(); $this->assign('blogs', $data); $this->assign("page", $show); }
echo InstallFetchmail(); exit; } if (isset($_GET["UserRules"])) { LoadUserRules(); exit; } if (isset($_GET["LoadFetchMailRuleFromUser"])) { LoadFetchMailRuleFromUser(); exit; } if (isset($_GET["ChangeFetchMailUser"])) { ChangeFetchMailUser(); exit; } PAGE(); function PAGE() { $LocalFetchMailRc = LocalFetchMailRc(); $fetchmail_explain = "<div style='padding:2px;margin:5px'>\n<table>\n<tr>\n<td valign='top'>\n<img src='img/fetchmail_explain.png'>\n</td>\n<td valign='top'><div class=explain>{fetchmail_explain}</div></td>\n</tr>\n</table>"; $return = RoundedLightGreen("<table style='width:100%'>\n\t<tr><td width=1%>" . imgtootltip('restore-on.png', '{go_back}', "MyHref('artica.wizard.php')") . "</td>\n\t<td><H5>{return_to} {artica_wizard}</H5></td>\n\t</tr></table>"); $html = "\n<table style='width:100%'>\n<tr>\n<td width=50% valign='top'>\n\t<span id='fetchmailbuttons'>{$LocalFetchMailRc}</span>\n\t<br>\n\t<div id='left'></div>\n\t</td>\n<td width=50% valign='top'>{$return}<br>" . applysettings("fetch") . "{$fetchmail_explain}<br>" . RightMenu() . "</td>\n</tr>\n</table>\n"; $CFG["JS"][] = 'js/wizard.fetchmail.js'; $tpl = new template_users('{get_mails_isp}', $html, 0, 0, 0, 0, $CFG); echo $tpl->web_page; } function ssl_fingerprint_js() { $rule = $_GET["LdapRules"]; $uid = $_GET["uid"]; $page = CurrentPageName();
public function follow() { $this->identity(); //加载左侧菜单 $pageNum = self::$pageNum; //每页显示条目 $frag = I('get.frag', 'follow'); if ($frag == "follow") { //首页面跳转 $this->redirect("follow?frag=followfounder"); } if ($frag == 'followfounder') { //关注的合伙人 $rela = "follow.followid=user.id and user.id=founder.uid"; $where['follow.uid'] = session('user.id'); $count = M()->table('user user,follow_man follow,user_founder founder')->where($rela)->where($where)->count(); // 查询满足要求的总记录数 $page = PAGE($count, $pageNum); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = M()->table('user user,follow_man follow,user_founder founder')->where($rela)->where($where)->limit($page->firstRow . ',' . $page->listRows)->select(); for ($i = 0; $i != count($data); $i++) { $data[$i]['agegroup'] = ageGroup($data[$i]['birthday_time']); //年龄转换 调用founder内静态方法 } //dump($data); $this->assign('founder', $data); } elseif ($frag == 'followinvestor') { //关注的投资人 $rela = "follow.followid=user.id and user.id=investor.uid"; $where['follow.uid'] = session('user.id'); $count = M()->table('user user,follow_man follow,user_investor investor')->where($rela)->where($where)->count(); // 查询满足要求的总记录数 $page = PAGE($count, $pageNum); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = M()->table('user user,follow_man follow,user_investor investor')->where($rela)->where($where)->limit($page->firstRow . ',' . $page->listRows)->select(); for ($i = 0; $i != count($data); $i++) { $data[$i]['agegroup'] = ageGroup($data[$i]['birthday_time']); //年龄转换 调用founder内静态方法 } $this->assign('investor', $data); } elseif ($frag == 'followproject') { //关注的项目 $rela = "follow.projectid=project.id"; $where['follow.uid'] = session('user.id'); $count = M()->table('follow_project follow,project project')->where($rela)->where($where)->count(); // 查询满足要求的总记录数 $page = PAGE($count, $pageNum); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = M()->table('follow_project follow,project project')->where($rela)->where($where)->limit($page->firstRow . ',' . $page->listRows)->select(); for ($i = 0; $i != count($data); $i++) { $arr = explode(" ", $data[$i]['location']); $data[$i]['province'] = $arr[0]; $data[$i]['city'] = $arr[1]; } $this->assign('project', $data); } $frag = 'frag' . $frag; //加前缀 $this->assign('frag', $frag); $this->assign('page', $show); $this->display(); }
public function search() { $search = I('get.search'); $article = M('article'); $where['title'] = array('like', '%' . $search . '%'); $count = $article->where($where)->count(); $page = PAGE($count, PAGENUM, PATH . '/search'); $data = $article->where($where)->order("posttime desc")->limit($page->firstRow . ',' . $page->listRows)->select(); //搜索结果 $empty = "<h1 class='text-center' style='color:#d9534f'>搜索结果为空</h1>"; //推荐数据 $recommendData = $article->where(array('recommend' => '1'))->limit('0,5')->order("posttime desc")->select(); $this->assign('recommend', $recommendData); $this->assign('empty', $empty); $this->assign('searchList', $data); $this->assign('page', $page->show()); $this->display(); }
public function index() { $uid = session('user.id'); getMsgStatu($uid); $post = I('post.'); $order = "user.last_login_time desc"; //排序方式 if (!empty($post['search'])) { //搜索 $search = '%' . $post['search'] . "%"; //搜索条件1 $where['user.username|founder.intro'] = array('like', $search); //搜索条件2 $count = M()->table('user user,user_founder founder')->where("user.id = founder.uid")->where($where)->count(); // 查询满足要求的总记录数 $page = PAGE($count); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = M()->table('user user,user_founder founder')->where("user.id = founder.uid")->where($where)->limit($page->firstRow . ',' . $page->listRows)->order($order)->select(); for ($i = 0; $i != count($data); $i++) { //改变搜索结果颜色 $data[$i]['intro'] = str_replace($post['search'], "<span style='color:red'>{$post['search']}</span>", $data[$i]['intro']); } //dump($data); } elseif (!empty($post['type'])) { //筛选 $where = array(); if ($post['type'] !== "不限") { $where['founder.type'] = $post['type']; } if ($post['province'] !== "不限") { $where['user.province'] = $post['province']; } if ($post['city'] !== "不限") { $where['user.city'] = $post['city']; } if ($post['agegroup'] !== "不限") { $date = ageGroupReverse($post['agegroup']); $where['birthday_time'] = array("between", "{$date['start']},{$date['end']}"); } $count = M()->table('user user,user_founder founder')->where("user.id = founder.uid")->where($where)->count(); $page = PAGE($count); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = M()->table('user user,user_founder founder')->where("user.id = founder.uid")->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select(); //dump($data); } else { //全部 $count = M()->table('user user,user_founder founder')->where("user.id = founder.uid")->order($order)->count(); $page = PAGE($count); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $page->show(); // 分页显示输出 $data = M()->table('user user,user_founder founder')->where("user.id = founder.uid")->order($order)->limit($page->firstRow . ',' . $page->listRows)->select(); //dump($data); } for ($i = 0; $i != count($data); $i++) { $data[$i]['agegroup'] = ageGroup($data[$i]['birthday_time']); //年龄转换 $data[$i]['reg_time'] = regTime($data[$i]['reg_time']); //注册时间转换 $data[$i]['last_login_time'] = loginTime($data[$i]['last_login_time']); //登录时间转换 if (strlen($data[$i]['username']) >= 12) { // 用户名判断截取 $data[$i]['username'] = substr($data[$i]['username'], 0, 10) . '..'; } } $this->assign('founder', $data); $this->assign('page', $show); // 赋值分页输出 $this->display(); }