當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonAction::_initalize方法代碼示例

本文整理匯總了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>";
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:13,代碼來源:EuploadAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:52,代碼來源:ZixunAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:17,代碼來源:ZxglAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:49,代碼來源:YijianAction.class.php

示例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");
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:25,代碼來源:YusuanAction.class.php

示例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");
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:28,代碼來源:FgcategoryAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:17,代碼來源:AccessAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:35,代碼來源:YuyueAction.class.php

示例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']);
//.........這裏部分代碼省略.........
開發者ID:snowtl,項目名稱:tanglang,代碼行數:101,代碼來源:AdAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:29,代碼來源:IndexAction.class.php

示例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");
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:48,代碼來源:WebpagesAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:23,代碼來源:MyInfoAction.class.php

示例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");
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:51,代碼來源:HeyingAction.class.php

示例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");
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:72,代碼來源:FirendlinkAction.class.php

示例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();
 }
開發者ID:snowtl,項目名稱:tanglang,代碼行數:37,代碼來源:GongzhangAction.class.php


注:本文中的CommonAction::_initalize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。