public function __construct() { parent::__construct(); // $this->pM = D('Product'); // $this->bM = D('Brand'); // $this->sM = D('Store'); }
function _initialize() { parent::_initialize(); $this->url_path = dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); $this->theme = isset($_REQUEST['theme']) && $_REQUEST['theme'] != '' ? trim($_REQUEST['theme']) : 'default'; cookie('think_template', $this->theme); }
public function __construct() { parent::__construct(); if (empty($_SESSION['info']['a_name'])) { $this->redirect('Login/index'); } }
public function review() { $uid = intval($_GET['uid']); if ($uid == '') { parent::error404(); } //分配根据GET传过来的uid用户的信息 $objUser = M('user'); $userMessage = $objUser->where('id=' . $uid)->field('id,username,face,introduce,point,exp')->find(); $userMessage = deep_htmlspecialchars_decode($userMessage); if ($userMessage == '') { parent::error404(); } $this->assign('userMessage', $userMessage); //分配该用户的评论 $objComment = M('comment'); import('ORG.Util.Page'); //导入分页类 $count = $objComment->where(array('comment_uid' => $uid))->count(); $page = new page($count, 20); $page->setConfig('theme', '%upPage% %first% %prePage% %linkPage% %downPage%'); $commentList = $objComment->where(array('comment_uid' => $uid))->field('aid,time,comment')->order('time desc')->limit($page->firstRow . ',' . $page->listRows)->select(); foreach ($commentList as $k1 => $v1) { $commentList[$k1]['url'] = '__APP__/List/detail/id/' . $v1['aid'] . '.html'; } $commentList = deep_htmlspecialchars_decode($commentList); $show = $page->show(); $this->assign('page', $show); $this->assign('commentList', $commentList); //分配Pagetitle $this->pageTitle = $userMessage['username'] . '的个人主页_支招网'; $this->display(); }
public function index() { $data = parent::index(true); if ($_GET["mergeSameRows"] && $_GET["batch"] === "all") { $tmp = array(); foreach ($data as $row) { $k = $row["factory_code_all"] . "|" . $row["repository_id"]; if (!$tmp[$k]) { $tmp[$k] = $row; $tmp[$k]["stocks"][] = $row["stock_name"]; } else { $tmp[$k]["num"] += $row["num"]; if (!in_array($row["stock_name"], $tmp[$k]["stocks"])) { $tmp[$k]["stocks"][] = $row["stock_name"]; } } } foreach ($tmp as $k => $v) { $tmp[$k]["stock_name"] = implode(",", $v["stocks"]); unset($tmp[$k]["stocks"]); } $this->response(reIndex($tmp)); } else { $this->response($data); } }
function __construct() { parent::__construct(); $this->db = D("Model"); $this->field_db = D("ModelField"); $this->type_db = D("ModelType"); }
public function add() { $this->assign("newsort", M(MODULE_NAME)->max("sort") + 1); $cate_tree = M("Forum")->where('parent_id = 0')->order('sort asc,fid asc')->findAll(); $this->assign("cate_tree", $cate_tree); parent::add(); }
public function singleEdit() { $id = intval($_GET['id']); $objSingle = M('single'); if (IS_POST) { $POST = deep_htmlspecialchars($_POST); parent::checkField('title', $POST['title'], 'require', '单页标题不能为空'); parent::checkField('content', $POST['content'], 'require', '内容不能为空'); $data = array(); $data['id'] = $POST['id']; $data['title'] = $POST['title']; $data['status'] = $POST['status']; $data['content'] = $POST['content']; $result = $objSingle->save($data); if ($result) { $this->success('修改成功...', U(APP_NAME . '/Single/singlelist')); } else { $this->error('修改失败,请稍后再试'); } } else { $data = $objSingle->where('id=' . $id)->find(); $data = deep_htmlspecialchars_decode($data); $this->assign('data', $data); $this->display(); } }
public function edit() { $user_model = M("User"); $sell_list = $user_model->where("user_sort=2")->field("id,username")->select(); $this->assign('sell_list', $sell_list); parent::edit(); }
public function add() { $cate_list = D('NavCategory')->where('status = 1')->order('sort ASC,id ASC')->findAll(); $cate_list = D('NavCategory')->toFormatTree($cate_list, 'name', 'id'); $this->assign("cate_list", $cate_list); parent::add(); }
public function read() { if (!$_GET["includeRows"] or $_GET['workflow']) { return parent::read(); } $formData = parent::read(true); $formData["inputTime"] = $formData["dateline"] * 1000; $rowModel = D("ReturnsDetailView"); $rows = $rowModel->where("ReturnsDetail.returns_id=" . $formData["id"])->select(); // echo $rowModel->getLastSql();exit; $modelIds = array(); $rowData = array(); foreach ($rows as $v) { $tmp = explode(DBC("goods.unique.separator"), $v["factory_code_all"]); //根据factory_code_all factory_code - standard - version $factory_code = array_shift($tmp); $modelIds = array_merge($modelIds, $tmp); $v["modelIds"] = $tmp; $v["goods_id"] = sprintf("%s_%s_%s", $factory_code, $v["goods_id"], $v["goods_category_id"]); // factory_code, id, catid $v["goods_id_label"] = sprintf("%s", $v["goods_name"]); $v["unit_price"] = $v["price"]; $v["amount"] = $v["num"]; $rowData[$v["id"]] = $v; } // array_flip(array_flip($modelIds)); $formData["customer_id_label"] = $formData["customer"]; $dataModel = D("DataModelDataView"); $rowData = $dataModel->assignModelData($rowData, $modelIds); $formData["rows"] = reIndex($rowData); $this->response($formData); }
public function read() { if (!$_GET["includeRows"] or $_GET['workflow']) { return parent::read(); } $formData = parent::read(true); $formData["start_time"] = $formData["start_time"] * 1000; $formData["end_time"] = $formData["end_time"] * 1000; $rowModel = D("ProducePlanDetailView"); $rows = $rowModel->where("ProducePlanDetail.plan_id=" . $formData["id"])->select(); // echo $rowModel->getLastSql();exit; $modelIds = array(); $rowData = array(); foreach ($rows as $v) { $tmp = explode(DBC("goods.unique.separator"), $v["factory_code_all"]); //根据factory_code_all factory_code - standard - version $factory_code = array_shift($tmp); $modelIds = array_merge($modelIds, $tmp); $v["modelIds"] = $tmp; $v["stock"] = $v["stock_id"]; $v["stock_label"] = $v["stock_name"]; $v["goods_id"] = sprintf("%s_%s_%s", $factory_code, $v["goods_id"], $v["goods_category_id"]); // factory_code, id, catid $v["goods_id_label"] = sprintf("%s", $v["goods_name"]); $rowData[$v["id"]] = $v; } // array_flip(array_flip($modelIds)); $params = array($rowData, $modelIds); tag("assign_dataModel_data", $params); $formData["rows"] = reIndex($params[0]); $this->response($formData); }
public function index() { if (strim($_REQUEST['order_sn']) != '') { $condition['order_id'] = M("DealOrder")->where("order_sn='" . strim($_REQUEST['order_sn']) . "'")->getField("id"); } if (strim($_REQUEST['notice_sn']) != '') { $condition['notice_sn'] = $_REQUEST['notice_sn']; } if (strim($_REQUEST['user_name']) != '') { $condition['user_id'] = M("User")->where("user_name='" . strim($_REQUEST['user_name']) . "'")->getField("id"); } if (strim($_REQUEST['begin_time']) != '') { $start_time = strtotime($_REQUEST['begin_time'] . ' 00:00:00'); $end_time = strtotime($_REQUEST['begin_time'] . ' 23:59:59'); $condition['s_create_time'] = $start_time; //开始时间 $condition['e_create_time'] = $end_time; //结束时间 } $condition['is_payment_list'] = 1; if (intval($_REQUEST['payment_id']) == 0) { unset($_REQUEST['payment_id']); } $this->assign("default_map", $condition); $this->assign("payment_list", M("Payment")->findAll()); parent::index(); }
public function editDetails() { $objLinkTxt = M('linktxt'); $id = intval($_GET['id']); if ($_POST) { $POST = deep_htmlspecialchars($_POST); parent::checkField('link_name', $POST['link_name'], 'require', '友情链接名称不能为空'); parent::checkField('link_url', $POST['link_url'], 'require', '友情链接地址不能为空'); parent::checkField('explain', $POST['explain'], 'require', '友情链接备注不能为空'); $data = array(); $data['id'] = $POST['id']; $data['link_name'] = $POST['link_name']; $data['status'] = $POST['status']; $data['link_url'] = $POST['link_url']; $data['explain'] = $POST['explain']; $result = $objLinkTxt->data($data)->save(); if ($result) { $this->success('修改成功', U(GROUP_NAME . '/Link/detailslist')); } else { $this->error('修改失败'); } } else { $data = $objLinkTxt->where('id=' . $id)->find(); $data = deep_htmlspecialchars_decode($data); $this->assign('data', $data); $this->display(); } }
public function __construct() { parent::__construct(); $this->server = DBC("remote.service.uri") . "Update/"; $this->local = ENTRY_PATH . "/Data/Updates/"; $this->currentVersion = DBC("system.version"); }
public function index() { $this->assign("parent_region", M("DeliveryRegion")->where("id=" . intval($_REQUEST['pid']))->find()); $condition['pid'] = intval($_REQUEST['pid']); $this->assign("default_map", $condition); parent::index(); }
function _initialize() { //预处理 $this->permissions = array("1" => "Article", "2" => "Gropus", "3" => "Albums", "4" => "Events", "5" => "Cityguide"); if (!$this->_is_login()) { $arr = array('/cid/3', '/cid/2', '/cid/1', '/cid/4', '/cid/0', '/1.html', '/0.html', '/2.html', '/3.html', '/4.html', '.html', '/index.php?s=', '/Public/select_city'); $url = str_replace($arr, '', $_SERVER["REQUEST_URI"]); $url = $url == '/' ? '/Index/index' : $url; $url = myencode($url); redirect("/Public/login/to/{$url}"); } parent::_initialize(); $rudao = D("RoleUser"); $condition = array("user_id" => $this->user['uid']); $data = array(); $data = $rudao->where($condition)->find(); //dump($rudao->getlastsql()); if (count($data) > 0) { $data['per'] = unserialize($data['permissions']); $this->user_per = $data; $this->assign("permissions", $this->permissions); $this->assign("per", $data); } import("ORG.Util.Page"); $this->assign('pmnum', $this->ckh_pm()); }
public function add_sms() { //输出会员组 $group_list = M("UserGroup")->findAll(); $this->assign("group_list", $group_list); parent::index(); }
/** * 构造函数,父类 * @Title: __construct * @Description: todo(基础构造函数) * * @author quqiang * @date 2015年5月12日 下午4:37:55 * @throws * */ public function __construct() { parent::__construct(); // 加载基础配置信息 $dir = CONF_PATH; $configDir = $dir . 'desing.php'; if (!file_exists($configDir)) { $msg = '文件 ' . $configDir . ' 不存在!'; throw new NullDataExcetion($msg); } require $configDir; $this->default = $desing_default; $this->controls = $desing_controll; // 合并组件配置元素 if ($this->controls && $this->default) { unset($temp); foreach ($this->controls as $k => $v) { $array = array_merge($this->default, $v['property']); sortArray($array, 'sort'); $temp[$k] = $array; } $this->controlsConfig = $temp; } $this->assign('config', $this->controlsConfig); $this->assign('control', $this->controls); $this->assign('tagIndentity', $this->tagIndentity); $this->assign('propertyTagType', $this->propertyTagType); }
public function read() { if (!$_GET["includeRows"] or $_GET['workflow']) { return parent::read(); } // $this->readModel = "PurchaseView"; // $formData = parent::read(true); $formData = D("PurchaseView")->find($_GET['id']); $formData["inputTime"] = $formData["dateline"] * 1000; // $formData["total_amount"] = $formData["total_price"]; // $formData["total_amount_real"] = $formData["total_price_real"]; // $formData["total_num"] = $formData["quantity"]; $rowModel = D("PurchaseDetailView"); $rows = $rowModel->where("PurchaseDetail.purchase_id=" . $formData["id"])->select(); // echo $rowModel->getLastSql();exit; $modelIds = array(); $rowData = array(); foreach ($rows as $v) { $tmp = explode(DBC("goods.unique.separator"), $v["factory_code_all"]); //根据factory_code_all factory_code - standard - version $factory_code = array_shift($tmp); $modelIds = array_merge($modelIds, $tmp); $v["modelIds"] = $tmp; $v["goods_id"] = sprintf("%s_%s_%s", $factory_code, $v["goods_id"], $v["goods_category_id"]); // factory_code, id, catid $v["goods_id_label"] = sprintf("%s", $v["goods_name"]); // $v["amount"] = $v["price"]; $rowData[$v["id"]] = $v; } // array_flip(array_flip($modelIds)); $formData["customer_id_label"] = $formData["customer"]; $params = array($rowData, $modelIds); tag("assign_dataModel_data", $params); $formData["rows"] = reIndex($params[0]); /* * 相关单据 * **/ $relateItem = array(); $id = abs(intval($_GET["id"])); if (isAppLoaded("store")) { $tmp = D("Stockin")->toRelatedItem("Purchase", $id); if ($tmp) { $relateItem = array_merge($relateItem, $tmp); } } if (isAppLoaded("finance")) { $tmp = D("FinancePayPlan")->toRelatedItem("Purchase", $id); if ($tmp) { $relateItem = array_merge($relateItem, $tmp); } } if ($formData["source_model"] == "ProducePlan" && $formData["source_id"] && isAppLoaded("produce")) { $tmp = D("ProducePlan")->getRelatedItem($formData["source_id"]); if ($tmp) { $relateItem[] = $tmp; } } $formData["relatedItems"] = $relateItem; $this->response($formData); }
public function _initialize() { parent::_initialize(); $model = D('FlowType'); $where['is_del'] = 0; //$this -> _flow_type = $model -> where($where) -> getField('id,name'); }
public function editAdmin() { $objAdmin = M('admin'); $id = intval($_GET['id']); if ($_POST) { $POST = deep_htmlspecialchars($_POST); parent::checkField('password', $POST['password'], 'require', '旧密码不能为空'); parent::checkField('newpassword', $POST['newpassword'], 'require', '新密码不能为空'); $password = $objAdmin->where('id=' . $POST['id'])->find(); if ($password['password'] != md5($POST['password'])) { $this->error('旧密码不正确,请重试'); } $result = $objAdmin->where('id=' . $POST['id'])->save(array('id' => $POST['ID'], 'password' => md5($POST['newpassword']))); if ($result) { $this->success('密码修改成功', U(APP_NAME . '/Admin/adminlist')); } else { $this->error('密码修改失败'); } } else { $data = $objAdmin->where(array('id' => $id))->find(); $data = deep_htmlspecialchars_decode($data); $this->assign('data', $data); $this->display(); } }
public function __construct() { parent::__construct(); $this->db = Db::getInstance(); $this->max_size = 800000; //每卷800左右 }
protected function display() { $model = M("AdminMenu"); $list = $model->field("id,title")->select(); $this->assign("menu_lsit", $list); parent::display(); }
public function _initialize() { if (!isset($_COOKIE[$this->session_name])) { session_id($_REQUEST[$this->session_name]); session_start(); } parent::_initialize(); }
function __construct() { parent::__construct(); $this->db = D('Position'); $this->data_db = D('PositionData'); $this->model_db = D('Model'); $this->type_db = D('ModelType'); }
function __construct() { parent::__construct(); $this->db = D("Content"); $this->model_db = D("Model"); $this->category_db = D("Category"); // $this->categorys = D('Category')->where("siteid = %d", $this->siteid)->select(); }
public function index() { //输出团购城市 $city_list = M("DealCity")->where('is_delete = 0')->findAll(); $city_list = D("DealCity")->toFormatTree($city_list, 'name'); $this->assign("city_list", $city_list); parent::index(); }
protected function _initialize() { $search_hot_list = D("Search_hot")->get_list(12, 1); //add $this->assign("search_hot_list", $search_hot_list); //add parent::_initialize(); }
function _initialize() { //预处理 /*if (!$this->_is_login()){ $this->redirect("/Public/login"); }*/ parent::_initialize(); }