本文整理汇总了PHP中CommonAction::_initalize方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonAction::_initalize方法的具体用法?PHP CommonAction::_initalize怎么用?PHP CommonAction::_initalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonAction
的用法示例。
在下文中一共展示了CommonAction::_initalize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shangchuan
/**
* 上传图片
*/
public function shangchuan()
{
parent::_initalize();
$info = $this->upload("./Uploads/edit/");
$filename = $this->systemConfig["SITE_INFO"]['url'] . "Uploads/edit/" . $info[0]['savename'];
$callback = $_GET['CKEditorFuncNum'];
echo "<scripttype=\"text/javascript\">";
echo "window.parent.CKEDITOR.tools.callFunction(" . $callback . ",'" . $filename . "','')";
echo "</script>";
}
示例2: index
/**
* 加盟列表
*/
public function index()
{
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$citymod = new CityModel();
$province = $_GET['province'];
$city = $_GET['city'];
$where = "1";
if ($this->getqx($_SESSION['my_info']['role']) == 0) {
//非地区管理员
$pro_list = $citymod->getprovince(1);
$this->assign("pro_list", $pro_list);
if (!empty($province)) {
$where .= " and Zixun.p_id=" . $province;
}
if (!empty($city)) {
$where .= " and Zixun.c_id=" . $city;
}
$this->assign("is_qx", $this->getqx($_SESSION['my_info']['role']));
$this->assign("province", $province);
$this->assign("city", $city);
$cityname = $citymod->getname($city);
$this->assign("cityname", $cityname);
} else {
$where .= " and p_id=" . $_SESSION['my_info']['proid'];
$where .= " and c_id=" . $_SESSION['my_info']['cityid'];
$this->assign("is_qx", $this->getqx($_SESSION['my_info']['role']));
}
$keys = $_GET['keys'];
$keys = $keys == "请输入关键字" ? "" : $keys;
$uid = $_GET['uid'];
if (!empty($keys)) {
$where .= " and Zixun.name like '%" . $keys . "%'";
}
$this->assign("keys", $keys);
$M = D("ZixunView");
$cou = $M->where($where)->count();
import("ORG.Util.Page");
$p = new Page($cou, 10);
$list = $M->where($where)->limit($p->firstRow . "," . $p->listRows)->order("Zixun.addtime desc")->select();
$arr = array("未审核", "已审核");
foreach ($list as $k => $v) {
$list[$k]['status_f'] = $arr[$v['status']];
$list[$k]['addtime_f'] = date("Y-m-d", $v['addtime']);
}
$this->assign("list", $list);
$this->assign("page", $p->show());
$this->display();
}
示例3: index
public function index()
{
//导航
parent::_initalize();
$systemConfig = $this->systemConfig;
$this->assign("systemConfig", $systemConfig);
//列表
import("ORG.Util.Page");
$pumod = M("Zxrj");
$count = $pumod->where($map)->count();
$page = new Page($count, 12);
$showpage = $page->show();
$list = $pumod->where($map)->order("id desc")->select();
$this->assign("list", $list);
$this->assign("page", $showpage);
$this->display();
}
示例4: index
/**
* 意见反馈列表
*/
public function index()
{
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
@import("ORG.Util.Page");
$where = "1";
if ($is_qx == 0) {
//非地区管理员
$p_id = $_GET['p_id'];
$c_id = $_GET['c_id'];
//省
$mcity = new CityModel();
$plist = $mcity->getprovince(1);
$this->assign("plist", $plist);
$this->assign("p_id", $p_id);
$this->assign("c_id", $c_id);
$this->assign("c_name", $mcity->getname($c_id));
} else {
$p_id = $_SESSION['my_info']['proid'];
$c_id = $_SESSION['my_info']['cityid'];
}
if (!empty($p_id)) {
$where .= " and Yijian.p_id=" . $p_id;
}
if (!empty($c_id)) {
$where .= " and Yijian.c_id=" . $c_id;
}
$keys = trim($_GET['keys']);
$keys = $keys == "请输入关键字" ? "" : $keys;
$where .= " and Yijian.content like '%" . $keys . "%'";
$this->assign("keys", $keys);
$yjv = D("YijianView");
$totalRows = $yjv->where($where)->count();
$pm = new Page($totalRows, 10);
$list = $yjv->where($where)->order("Yijian.addtime desc")->limit($pm->firstRow . "," . $pm->listRows)->select();
$islx = array("0" => "未联系", "1" => "已联系");
foreach ($list as $k => $v) {
$list[$k]['addtimef'] = date("Y-m-d H:i:s", $v['addtime']);
$list[$k]['islxf'] = $islx[$v['is_lx']];
}
$this->assign("list", $list);
$this->assign("page", $pm->show());
#echo $yjv->getLastSql();
#省
$this->display();
}
示例5: editys
/**
* 编辑预算
*/
public function editys()
{
if (IS_POST) {
$id = $_POST['id'];
$name = trim($_POST['name']);
$mod = M("Yusuan");
$res = $mod->where("ysid=" . $id)->save(array("name" => $name));
if ($res) {
$this->success("编辑成功!", U("Yusuan/index"));
} else {
$this->error("编辑失败!");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$id = $_GET['id'];
$mod = M("Yusuan");
$info = $mod->where("ysid=" . $id)->find();
$this->assign("info", $info);
$this->display("addys");
}
示例6: editfgcategory
/**
* 编辑风格
*/
public function editfgcategory()
{
$m = M("Fgcategory");
if (IS_POST) {
$id = $_POST['id'];
$name = trim($_POST['name']);
if (empty($name)) {
$this->error("名称不能为空!");
exit;
}
$res = $m->where("id=" . $id)->save(array("name" => $name));
if ($res) {
$this->success("操作成功!", U("Fgcategory/index"));
} else {
$this->error("操作失败!");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$id = $_GET['id'];
$info = $m->where("id=" . $id)->find();
$this->assign("info", $info);
$this->display("addfgcategory");
}
示例7: ins
/**
* 查看详情
*/
public function ins()
{
parent::_initalize();
$systemConfig = $this->systemConfig;
$this->assign("systemConfig", $systemConfig);
$aid = $_GET['aid'];
$amod = new Admininfo1Model();
$inf = $amod->getinfo($aid, 1);
$citymod = new CityModel();
$inf['province'] = $citymod->getproname($inf['cityid']);
$inf['city'] = $citymod->getname($inf['cityid']);
$this->assign("info", $inf);
$this->display();
}
示例8: yuyuelfjl
/**
* 施工动态 预约
*/
public function yuyuelfjl()
{
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$this->assign("sglist", $this->getsgdt());
#施工动态列表
$where = "1";
import("ORG.Util.Page");
$M = D("YuyuelfjlView");
$sg_id = $_GET['sg_id'];
if (!empty($sg_id)) {
$where .= " and Yuyuelfjl.sgid=" . $sg_id;
}
$keys = $_GET['keys'];
$keys = $keys == "请输入关键字" ? "" : $keys;
if (!empty($keys)) {
$where .= " and Yuyuelfjl.name like '%" . $keys . "%'";
}
$this->assign("keys", $keys);
$this->assign("sg_id", $sg_id);
$cou = $M->where($where)->count();
$p = new Page($cou, 10);
$list = $M->where($where)->limit($p->firstRow . "," . $p->listRows)->order("Yuyuelfjl.addtime desc")->select();
$arr = array("未审核", "已审核");
foreach ($list as $k => $v) {
$list[$k]['addtime_f'] = date("Y-m-d H:i", $v['addtime']);
$list[$k]['status_f'] = $arr[$v['status']];
}
$this->assign("list", $list);
$this->assign("page", $p->show());
$this->display();
}
示例9: editad
/**
* 编辑广告
*/
public function editad()
{
if (IS_POST) {
$id = $_POST['id'];
$M = M("Adview");
$info = $M->where("id=" . $id)->find();
$title = trim($_POST['title']);
$link = trim($_POST['link']);
$weizhi = $_POST['weizhi'];
$p_id = $_POST['p_id'];
$c_id = $_POST['c_id'];
if (empty($title)) {
$this->error("名称不能为空!");
exit;
}
if (empty($weizhi)) {
$this->error("请选择位置!");
exit;
}
if ($this->getqx($_SESSION['my_info']['role']) == 0) {
//非地区管理员
if (empty($p_id)) {
$this->error("请选省!");
exit;
}
if (empty($c_id)) {
$this->error("请选市!");
exit;
}
} else {
$p_id = $_SESSION['my_info']['proid'];
$c_id = $_SESSION['my_info']['cityid'];
if (empty($p_id)) {
$this->error("该管理员没有选择省!");
exit;
}
if (empty($c_id)) {
$this->error("该管理员没有选择市!");
exit;
}
}
if (!empty($_FILES['img']['name'])) {
$imgsrc = $this->upload("./Uploads/ad/");
if (empty($imgsrc[0]['savename'])) {
$img = "";
} else {
$img = "/Uploads/ad/" . $imgsrc[0]['savename'];
}
if (!empty($info['img'])) {
unlink($info['img']);
}
}
$data = array();
if (!empty($img)) {
$data['img'] = $img;
}
if (!empty($link)) {
$data['link'] = $link;
}
if (!empty($title)) {
$data['title'] = $title;
}
if (!empty($weizhi)) {
$data['weizhi'] = $weizhi;
}
if (!empty($p_id)) {
$data['p_id'] = $p_id;
}
if (!empty($c_id)) {
$data['c_id'] = $c_id;
}
$data['addtime'] = time();
$data['adduid'] = $_SESSION['my_info']['a_id'];
$res = M("Ad")->where("id=" . $id)->save($data);
if ($res) {
$this->success("操作成功", U("Ad/adlist"));
} else {
$this->error("操作失败");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$id = $_GET['id'];
$M = M("Adview");
$info = $M->where("id=" . $id)->find();
//位置
$wzm = M("Adweizhi");
$wzlist = $wzm->where("1")->order("addtime desc")->select();
$this->assign("wzlist", $wzlist);
//省
if ($this->getqx($_SESSION['my_info']['role']) == 0) {
//非地区管理员
$mcity = new CityModel();
$plist = $mcity->getprovince(1);
$this->assign("plist", $plist);
$this->assign("c_id", $info['c_id']);
//.........这里部分代码省略.........
示例10: setjw
/**
* 设置经纬度
*/
public function setjw()
{
$m = M("Area");
if (IS_POST) {
$id = $_POST['id'];
$pid = $_POST['pid'];
$jingdu = trim($_POST['jingdu']);
$weidu = trim($_POST['weidu']);
$res = $m->where("region_id=" . $id)->save(array("jingdu" => $jingdu, "weidu" => $weidu));
if ($res) {
$this->success("操作成功!", U("Index/city", array("id" => $pid)));
} else {
$this->error("操作失败!");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$id = $_GET['id'];
$pid = $_GET['pid'];
$this->assign("pid", $pid);
$this->assign("id", $id);
$info = $m->where("region_id=" . $id)->find();
$this->assign("info", $info);
$this->display();
}
示例11: edit_webpage
/**
* 编辑单页面
*/
public function edit_webpage()
{
if (IS_POST) {
$name = trim($_POST['name']);
$ywname = trim($_POST['ywname']);
$p_id = trim($_POST['p_id']);
$c_id = trim($_POST['c_id']);
$contents = trim($_POST['contents']);
$id = $_POST['id'];
$M = M("Webpages");
$data = array("name" => $name, "contents" => $contents, "ywname" => $ywname, "p_id" => $p_id, "c_id" => $c_id);
$rs = $M->where("id=" . $id)->save($data);
if ($rs) {
$this->success("操作成功!", U("Webpages/index"));
} else {
$this->error("操作失败!");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$id = $_GET['id'];
$wmod = M("Webpages");
$info = $wmod->where("id=" . $id)->find();
$this->assign("info", $info);
#-------------------------------------------------------------省start
$is_qx = $this->getqx($_SESSION['my_info']['role']);
if ($is_qx == 0) {
#省
$citymod = new CityModel();
$plist = $citymod->getprovince(1);
$this->assign("plist", $plist);
} else {
$p_id = $_SESSION['my_info']['proid'];
$c_id = $_SESSION['my_info']['cityid'];
}
$p_id = $info['p_id'];
$c_id = $info['c_id'];
$c_name = $citymod->getname($c_id);
$this->assign("p_id", $p_id);
$this->assign("c_id", $c_id);
$this->assign("c_name", $c_name);
#-------------------------------------------------------------省end
$this->display("add_webpage");
}
示例12: map
/**
* 地图
*/
public function map()
{
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$nodelist = $this->get_menu(1);
$str = "<ul>";
foreach ($nodelist as $K => $v) {
$str .= "<li><a href='" . $v['url'] . "'>" . $v['title'] . "</a>";
$str .= "<ul>";
$nodelist2 = $this->get_menu($v['id']);
foreach ($nodelist2 as $k1 => $v1) {
$str .= "<li><a href='" . U(ucfirst($v['name']) . '/' . $v1['name']) . "'>" . $v1['title'] . "</a></li>";
}
$str .= "</ul>";
$str .= "</li>";
}
$str .= "</ul>";
$this->assign("str", $str);
$this->display();
}
示例13: edit_hy
/**
* 编辑
* 合影
*/
public function edit_hy()
{
if (IS_POST) {
$id = $_POST['id'];
$M = M("Heying");
$info = $M->where("id=" . $id)->find();
$gzid = $_POST['gzid'];
$pc = $this->getprovcity($gzid);
$name = trim($_POST['name']);
if (empty($name)) {
$this->error("合影名称不能为空!");
exit;
}
$is_tj = $_POST['is_tj'];
$status = $_POST['status'];
$imgf = $this->upload();
if (!empty($imgf[0]['savename'])) {
$img = "/Uploads/product/" . $imgf[0]['savename'];
unlink($info['img']);
}
$data = array();
$data['uid'] = $gzid;
$data['adduid'] = $_SESSION['my_info']['a_id'];
$data['img'] = $img;
$data['name'] = $name;
$data['is_tj'] = $is_tj;
$data['p_id'] = $pc[p_id];
$data['c_id'] = $pc[c_id];
$data['addtime'] = time();
$data['status'] = $status;
$rs = $M->where("id=" . $id)->save($data);
if ($rs) {
$this->success("操作成功!", U("Heying/index"));
} else {
$this->error("操作失败!");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$id = $_GET['id'];
$M = M("Heying");
$info = $M->where("id=" . $id)->find();
$this->assign("info", $info);
$this->assign("gzlist", $this->getgzh());
$this->display("add_hy");
}
示例14: editfirendlink
/**
* 编辑友情链接
*/
public function editfirendlink()
{
$m = M("Firendlink");
if (IS_POST) {
$id = $_POST['id'];
$name = trim($_POST['name']);
if (empty($name)) {
$this->error("名称不能为空!");
exit;
}
if ($_FILES['logo']['name'] != '') {
$imginfo = $this->upload('./Uploads/fl/');
if (!empty($imginfo[0]['savename'])) {
$logo = "/Uploads/fl/" . $imginfo[0]['savename'];
} else {
$logo = "";
}
}
$link = trim($_POST['link']);
$orders = trim($_POST['orders']);
$is_tj = $_POST['is_tj'];
$p_id = $_POST['p_id'];
$c_id = $_POST['c_id'];
$data = array();
if (!empty($name)) {
$data['name'] = $name;
}
if (!empty($logo)) {
$data['logo'] = $logo;
}
if (!empty($link)) {
$data['link'] = $link;
}
if (!empty($orders)) {
$data['orders'] = $orders;
}
if (!empty($is_tj)) {
$data['is_tj'] = $is_tj;
}
if (!empty($p_id)) {
$data['p_id'] = $p_id;
}
if (!empty($c_id)) {
$data['c_id'] = $c_id;
}
$res = $m->where("id=" . $id)->save($data);
if ($res) {
$this->success("操作成功!", U("Firendlink/index"));
} else {
$this->error("操作失败!");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$id = $_GET['id'];
$info = $m->where("id=" . $id)->find();
$this->assign("info", $info);
if ($this->getqx($_SESSION['my_info']['role']) == 0) {
#读取省
$mcity = new CityModel();
$plist = $mcity->getprovince(1);
$this->assign("plist", $plist);
$this->assign("c_id", $info['c_id']);
$this->assign("c_name", $mcity->getname($info['c_id']));
}
$this->assign("is_qx", $this->getqx($_SESSION['my_info']['role']));
$this->display("addfriendlink");
}
示例15: casecomments
/**
* 装修案例 评论
*/
public function casecomments()
{
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
import("ORG.Util.Page");
$where = "typeid=3";
$is_hf = $_GET['is_hf'];
$this->assign("is_hf", $is_hf);
$uid = $_GET['uid'];
$this->assign("uid", $uid);
if (!empty($is_hf)) {
$is_hf = $is_hf == 2 ? 0 : $is_hf;
$where .= " and ishf=" . $is_hf;
}
if (!empty($uid)) {
$where .= " and arid=" . $uid;
}
$M = M("Comments");
$totalRows = $M->where($where)->count();
$p = new Page($totalRows, 10);
$list = $M->where($where)->order("addtime desc")->limit($p->firstRow . "," . $p->listRows)->select();
$arrhf = array("未回复", "已回复");
$arrs = array("未审核", "已审核");
foreach ($list as $k => $v) {
$list[$k]['is_hf_f'] = $arrhf[$v['ishf']];
$list[$k]['status_f'] = $arrs[$v['status']];
}
$this->assign("list", $list);
$this->assign("page", $p->show());
$rjlist = $this->getcase();
#获取装修日记列表
$this->assign("rjlist", $rjlist);
$this->display();
}