/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $arrary = array(); $id = $request->id; if (!is_numeric($id) || $id < 1) { return array('status' => '-5', 'msg' => '参数错误'); } $pageConfig = $_POST['pageConfig']; $pageItem = $_POST['pageItem']; $letter = array(); $letter['pageConfig'] = $pageConfig; $letter['pageItem'] = $pageItem; Sp_Letter_Letter::save($id, $letter); return array('status' => 0, 'msg' => '保存成功'); } else { $id = $request->id; if (!is_numeric($id) || $id < 1) { $this->show404(); } $letter = Sp_Letter_Letter::getLetterById($id); if (empty($letter)) { $this->show404(); } $active = Sp_Active_Active::getActiveById($letter['active_id'], $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign("id", $id); $view->assign("active", $active); $view->display("active/lettereditor.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { $id = $request->id; if (empty($id)) { header("Location: " . SP_URL_HOME); exit; } $data = Sp_Account_Attendee::getAttendeeBySn($id); if (empty($data)) { header("Location: " . SP_URL_HOME); exit; } if ($request->type == 'code') { include LIB_ROOT . 'third/phpqrcode/qrlib.php'; $errorCorrectionLevel = "L"; $matrixPointSize = "6"; QRcode::png($id, false, $errorCorrectionLevel, $matrixPointSize); } else { $active = Sp_Active_Active::getActiveById($data['activeId']); if (empty($active)) { $this->show404(); } $data['sn'] = $this->formatSn($data['signId']); $view = new Sp_View(); $view->assign('data', $data); $view->assign('active', $active); $view->display("attendee/code.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $user = Sp_Account_User::current(); $aid = $request->id; if (!is_numeric($aid)) { $data = array(); $data['status'] = '-1'; $data['msg'] = '提交数据有误'; return $data; } // 当前页数 $nowPage = $request->page; empty($nowPage) && ($nowPage = 1); $limitRow = ($nowPage - 1) * self::PAGE_SIZE; // 分页数据 $array = Sp_Letter_Letter::getListByUser($user->id, $aid, $limitRow, self::PAGE_SIZE); $total = Sp_Letter_Letter::getTotalByUser($user->id, $aid); if (is_array($array) && count($array)) { $cry = new Util_Crypt3Des(); foreach ($array as $key => $value) { $id = $cry->encrypt($value['id']); $id = base64_encode($id); $array[$key]['sid'] = $id; } } // 分页 $pager = new Util_Pager($total, $nowPage, self::PAGE_SIZE); $pageString = $pager->renderNav(true); $data = array(); if (is_array($array)) { $data['status'] = '0'; $data['data'] = $array; $data['msg'] = ''; $data['pageString'] = $pageString; $data['nowtime'] = time(); } else { $data['status'] = '-1'; $data['data'] = array(); $data['msg'] = ''; } return $data; } else { $aid = $request->id; if (!is_numeric($aid)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($aid, $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign('active', $active); $view->assign('select', 'letter'); $view->display("letter/index.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $arrary = array(); return $array; } else { $view = new Sp_View(); $view->display("active/index.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { global $priv; if ($request->format == 'json') { } else { $view = new Sp_View(); $view->assign("action", $priv); $view->display("account/emailSuccess.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { global $priv; if ($request->format == 'json') { $arrary = array(); return $array; } else { $view = new Sp_View(); $view->assign("action", $priv); $view->display("account/emailAuth.html"); } }
public function execute($request) { global $priv; $user = Sp_Account_User::current(); $user = Sp_Account_User::getUser($user->id, array('name', 'face', 'gender', 'province', 'city', 'area')); $uploadInfo = Util_FileUpload::getUpfileKey('huitong'); $view = new Sp_View(); $view->assign('user', $user); $view->assign('action', $priv); $view->assign('uploadInfo', $uploadInfo); $view->display("account/password.html"); }
/** * function description * * @param * @return void */ public function execute($request) { //echo "导出参会人"; $this->getTemplate(); exit; if ($request->format == 'json') { $arrary = array(); return $array; } else { $view = new Sp_View(); $view->display("active/index.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { /*$total = 90; $page = 8; $size = 10; $pager = new Util_Pager($total, $page, $size, "?page=%d&activeId=19"); $offset = $pager->getOffset(); $pager->setTotal($total); echo $pager->renderNav();*/ $model = new Sp_Account_Attendee(); $activeId = $request->activeId; $header = $model->GetTableHeaderByActiveId($activeId); if (false == $header) { $showHeader = $this->headers; } else { $showHeader = $this->getShowHeader($header); $showHeader = $model->getColumnFormArr($showHeader, 'title', 'field'); } $columns = array_keys($showHeader); array_push($columns, 'id'); $columns[] = 'status'; $columns[] = 'checkStatus'; $dataProvide = $model->AttendeeList($activeId, $columns); if ($request->format == 'json') { $arrary = array(); return $array; } else { /*$user = Sp_Account_User::current(); $user = Sp_Account_User::load($user->id);*/ $aid = $request->activeId; if (!is_numeric($aid)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($aid, $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign('active', $active); $view->assign('data', $dataProvide[1]); $view->assign('page', $dataProvide[0]); $view->assign('header', $showHeader); $view->assign('headerSet', json_encode($header)); $view->assign('activeId', $activeId); $view->assign('uploadInfo', $uploadInfo); $view->display("attendee/index.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $activeId = $_POST['activeId']; unset($_POST['activeId']); $data = $this->dataFormat($_POST, $activeId); $model = new Sp_Account_Attendee(); if ($model->setTableHeader($data)) { $return = array('status' => 1, 'msg' => '表头设置成功'); } else { $return = array('status' => 0, 'msg' => '表头设置失败'); } return $return; } else { $view = new Sp_View(); $view->display("active/index.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { global $priv; if ($request->format == 'json') { if ($request->action == 'sendCode') { return $this->sendCode($request->mobile); } else { if ($request->action == 'authCode') { return $this->authCode($request->mobile, $request->code); } } return array('status' => 123, 'msg' => '参数错误'); } else { $view = new Sp_View(); $view->assign("action", $priv); $view->display("account/phoneAuth.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { return array(); } else { $id = $request->id; if (!is_numeric($id) || $id < 1) { $this->show404(); } $letter = Sp_Letter_Letter::getLetterById($id); if (empty($letter)) { $this->show404(); } $view = new Sp_View(); $view->assign("letter", $letter); $view->display("letter/createsuccess.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $id = $request->id; if (!is_numeric($id)) { return array('status' => '-1', 'msg' => '参数错误'); } $letter = Sp_Letter_Letter::getLetterById($id); if (is_array($letter) && count($letter) > 0) { $letter['pageConfig'] = json_decode($letter['pageConfig'], TRUE); $letter['pageItem'] = json_decode($letter['pageItem'], TRUE); } if (!empty($letter)) { $active = Sp_Active_Active::getActiveById($letter['active_id']); if (empty($active)) { return array('status' => '-1', 'msg' => '数据有误'); } } return array('status' => '0', 'msg' => '获取成功', 'data' => $letter); } else { $jssdk = new Util_Jssdk("wx91f7f41fce0885bc", "YjlcfXNkdBYjlcfXNkdBYjlcfXNkdBYj"); $signPackage = $jssdk->GetSignPackage(); $id = $request->id; $id = base64_decode($id); $cry = new Util_Crypt3Des(); $id = $cry->decrypt($id); if (!is_numeric($id)) { $this->show404(); } $letter = Sp_Letter_Letter::getLetterById($id); if (empty($letter)) { $this->show404(); } $active = Sp_Active_Active::getActiveById($letter['active_id']); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign("letter", $letter); $view->assign('active', $active); $view->assign('signPackage', $signPackage); $view->display("letter/show.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { return array(); } else { $id = $request->id; if (empty($id) || !is_numeric($id)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($id, $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign("active", $active); $view->display("active/createsuccess.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { $url = $request->url; if (!empty($url)) { // $cry = new Util_Crypt3Des(); // $id = $cry->encrypt($id); // $id = base64_encode($id); // // include LIB_ROOT."third/phpqrcode/phpqrcode.php"; // // // 纠错级别:L、M、Q、H // $level = 'L'; // // 点的大小:1到10,用于手机端4就可以了 // $size = 4; // // 下面注释了把二维码图片保存到本地的代码,如果要保存图片,用$fileName替换第二个参数fal // QRcode::png($url, false, $level, $size); $view = new Sp_View(); $view->display("letter/demo.html"); } else { $this->show404(); } }
public function execute($request) { global $priv; $user = Sp_Account_User::current(); $uploadInfo = Util_FileUpload::getUpfileKey('huitong'); $province = Sp_City_City::getProvince(); $view = new Sp_View(); $userInfo = Sp_Account_User::getUser($user->id, array('name', 'face', 'gender', 'province', 'city', 'area', 'mobile_status', 'email_status')); $auth = array('mobile_status' => $userInfo['mobile_status'], 'email_status' => $userInfo['email_status']); $view->assign('province', $province); $view->assign('action', $priv); $view->assign('auth', $auth); if (!empty($userInfo['province'])) { $city = Sp_City_City::getChlidById($userInfo['province']); $view->assign('city', $city); } if (!empty($userInfo['city'])) { $arrea = Sp_City_City::getChlidById($userInfo['city']); $view->assign('arrea', $arrea); } $view->assign('uploadInfo', $uploadInfo); $view->display("account/index.html"); }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $action = $request->action; if ($action == 'add') { return $this->addAttendee(); } else { if ($action == 'signIn') { return $this->signIn($_POST['dataId']); } else { if ($action == 'signOut') { return $this->signOut($_POST['dataId']); } else { if ($action == 'delete') { return $this->attendeeDelete($_POST['dataId']); } } } } } else { $view = new Sp_View(); $view->display("active/index.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $id = $request->id; $activit_end = $request->activit_end; //活动结束时间 $activit_start = $request->activit_start; //活动开始时间 $address = $request->address; //详细地址 $arrea = $request->arrea; //区域 $city = $request->city; //城市 $enroll_end = $request->enroll_end; $enroll_start = $request->enroll_start; $is_audit = $request->is_audit; $is_enroll = $request->is_enroll; //是否需要审核 $province = $request->province; //省份 $title = $request->title; //标题 $thumbnail = $request->thumbnail; $enroll_num = $request->enroll_num; if (!is_numeric($id) || empty($title) || empty($activit_end) || empty($activit_end) || empty($address) || empty($province) || empty($city)) { return array('status' => '-5', 'msg' => '参数错误'); } if (!empty($is_enroll) && (empty($is_audit) || empty($enroll_start) || empty($enroll_end))) { return array('status' => '-5', 'msg' => '完善活动时间选项'); } if (strtotime($activit_end) < strtotime($activit_start)) { return array('status' => '-5', 'msg' => '举办结束日期不能小于开始日期'); } $user = Sp_Account_User::current(); $active = array(); $active['activit_end'] = strtotime($activit_end); $active['activit_start'] = strtotime($activit_start); $active['address'] = $address; $active['arrea'] = empty($arrea) ? 0 : $arrea; $active['city'] = $city; $active['province'] = $province; $active['title'] = $title; $active['user_id'] = $user->id; $active['thumbnail'] = $thumbnail; if (!empty($is_audit)) { if (strtotime($enroll_end) < strtotime($enroll_start)) { return array('status' => '-5', 'msg' => '报名结束日期不能小于开始日期'); } if (!is_numeric($enroll_num)) { return array('status' => '-5', 'msg' => '人数不能为空'); } $active['is_audit'] = 1; $active['is_enroll'] = 1; $active['enroll_start'] = strtotime($enroll_start); $active['enroll_end'] = strtotime($enroll_end); $active['enroll_num'] = $enroll_num; } else { $active['is_audit'] = 0; $active['is_enroll'] = 0; $active['enroll_start'] = 0; $active['enroll_end'] = 0; $active['enroll_num'] = 0; } $user = Sp_Account_User::current(); $ret = Sp_Active_Active::updateById($id, $active, $user->id); return array('status' => '0', 'msg' => '修改成功'); // if($ret){ // // }else{ // return array('status'=>'-1','msg'=>'修改失败'); // } } else { $aid = $request->id; if (!is_numeric($aid)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($aid, $user->id); if (empty($active)) { $this->show404(); } $province = Sp_City_City::getProvince(); $city = Sp_City_City::getChlidById($active['province']); $arrea = Sp_City_City::getChlidById($active['city']); $view = new Sp_View(); $uploadInfo = Util_FileUpload::getUpfileKey('huitong'); $view->assign('province', $province); $view->assign('city', $city); $view->assign('arrea', $arrea); $view->assign('uploadInfo', $uploadInfo); $view->assign('option', 'edit'); $view->assign('active', $active); $view->display("active/create.html"); } }
//最多取8个分类的商品,并且每个分类下的产品数量要大于4 $step = count($category) < 8 ? count($category) : 8; $category = array_slice($category, 0, $step); $catids = ""; foreach ($category as $key => $value) { if ($value['count'] > 4) { $catids .= $value['category_id'] . ','; } } $category = Sp_Taobao_Goods::getItemcats($catids); if (!is_array(@$category[0])) { $cat[] = $category; $category = $cat; } //取每个分类的商品 foreach ($category as $key => $value) { $goods = Sp_Taobao_Goods::getShopItems($nick, $value['cid'], 1, 40); //从40个商品中随机取8个 shuffle($goods['item_search']['items']['item']); $goods['item_search']['items']['item'] = array_slice($goods['item_search']['items']['item'], 0, 8); $category[$key]['items'] = $goods['item_search']['items']['item']; } $shop["shop"] = array('items' => $category, 'info' => $shop_info['shop']); //print_r($shop); Config::load($shop); $sp_view->setConfig(Config::get()); $sp_view->addStyle('shop.css'); $sp_view->setTitle(strip_tags($shop_info['shop']['title'])); //print_r($sp_view); $sp_view->display("shop.html");
$a['sales'] = Config::get('huodongarray'); print_r($a); //$new_file = DATA_CURRENT . 'index_temp.php'; $new_file = DATA_CURRENT . 'index_hot_sales.php'; file_put_contents($new_file, '<?php return ' . var_export($a, true) . ';'); die(); */ //装载页面数据 Config::load(DATA_CURRENT . 'index_hot_categores.php'); Config::load(DATA_CURRENT . 'index_hot_focus.php'); Config::load(DATA_CURRENT . 'index_hot_brands.php'); Config::load(DATA_CURRENT . 'index_hot_sales.php'); Config::load(DATA_CURRENT . 'index_categores.php'); //TODO 改为从数据文件中读取默认值 foreach (Config::get('index_categores') as $key => $category) { $goods = Sp_Taobao_Goods::getCategoryItems($category['catid'], 40, Config::get('taoke.pid_short')); //从40个商品中随机取8个 shuffle($goods['taobaoke_items']['taobaoke_item']); $goods['taobaoke_items']['taobaoke_item'] = array_slice($goods['taobaoke_items']['taobaoke_item'], 0, 8); $category = array_merge($category, $goods); Config::set('index_categores.' . $key, $category); } $sp_view = new Sp_View('utf-8'); $sp_view->addStyle('index.css'); //$sp_view->setTitle("测试"); $sp_view->setConfig(Config::get()); $sp_view->display("index.html"); //$url = "http://more.handlino.com/sentences.json?n=10&corpus="; //$result = file_get_contents($url); //print_r(json_decode($result));
//淘宝客点击url $url = Sp_Taobao_Taobaoke::getItemConvert($num_iid, Config::get('taoke.pid_short')); $cid = $goods_detail["item"]['cid']; $props = $goods_detail["item"]['props']; //商品属性 $props = Sp_Taobao_Goods::getItemPropValues($cid, $props); //商品分类信息 $catgory = Sp_Taobao_Goods::getItemcats($cid); //当前分类的推荐商品 $cat_goods = Sp_Taobao_Goods::getCategoryItems($cid, 40, Config::get('taoke.pid_short')); //从40个商品中随机取8个 shuffle($cat_goods['taobaoke_items']['taobaoke_item']); $cat_goods['taobaoke_items']['taobaoke_item'] = array_slice($cat_goods['taobaoke_items']['taobaoke_item'], 0, 8); //商品的评价信息 $rates = Sp_Taobao_Goods::getItemsTraderates($goods_detail['item']['num_iid'], $goods_detail['item']['nick']); if ($rates['total_results'] > 0) { $rates = $rates['trade_rates']['trade_rate']; } else { $rates = null; } $goods["goods"] = array("item" => $goods_detail['item'], "cat_items" => $cat_goods['taobaoke_items']['taobaoke_item'], "taobaoke" => $url["taobaoke_items"]["taobaoke_item"], "props" => $props, "category" => $catgory, "rates" => $rates); Config::load($goods); $sp_view->setConfig(Config::get()); $sp_view->addStyle('goods.css'); $sp_view->setTitle($goods_detail['item']['title']); $sp_view->caching = true; $sp_view->cache_lifetime = 86400; $sp_view->cache_id = $cache_id; } $sp_view->display("goods.html", $cache_id);
} } /* Array ( [catid] => 1801 [sortnum] => 0 [sp] => 1 [ep] => 10000 [sq] => w!bEpA [page] => 2 ) */ //如果cid为0,不返回类目信息 $parent_cats = null; $current_cats = null; if ($cid != 0) { $parent_cats = Sp_Taobao_Goods::getItemParentCats($cid); $current_cats = Sp_Taobao_Goods::getItemcats($cid); //print_r($parent_cats); } $params = array('keyword' => $keyword, 'page_no' => $page_no); $goods = Sp_Taobao_Goods::getCategoryItems($cid, $page_size, Config::get('taoke.pid_short'), $params); if ($goods) { $pager = new Sp_Pager($goods['total_results'], $page_no, $page_size, $url_format); $goods = $goods['taobaoke_items']['taobaoke_item']; } $list['list'] = array('categores' => $parent_cats, 'curr_cat' => $current_cats, 'goods' => $goods, 'keyword' => $keyword, 'pager' => isset($pager) ? $pager : null); Config::load($list); //print_r(Config::get()); $sp_view->addStyle('list.css'); $sp_view->addStyle('pager.css'); $sp_view->setConfig(Config::get()); $sp_view->caching = false; //$sp_view->cache_lifetime = 86400; //$sp_view->cache_id = $cache_id; } $sp_view->display("list.html", $cache_id);