public function thirdlist() { $data = input::get(); $third = app::get('sysshop')->model('service'); $thirdinfo = $third->getRow('*', array('article_id' => $data['article_id'], "ifput" => true)); $this->setLayoutFlag('third'); if (!$thirdinfo) { $pagedata["isfb"] = "0"; //不存在文章 return $this->page('topc/third/third.html', $pagedata); } else { if ($thirdinfo["ifpub"] == false) { $pagedata["isfb"] = "1"; //文章下架 return $this->page('topc/third/third.html', $pagedata); } else { $pagedata["isfb"] = "2"; //正常显示 } } $oldthird = $thirdinfo; $thirdinfo['count'] += 1; try { $third->update($thirdinfo, $oldthird); } catch (Exception $e) { $msg = $e->getMessage(); return $this->splash('error', null, $msg); } $pagedata['thirdinfo'] = $thirdinfo; return $this->page('topc/third/third.html', $pagedata); }
public function confirm($action = '') { // Do we have necessary data? if (input::get('oauth_token') && input::get('oauth_verifier')) { // Get temporary access token $this->initialize(session::item('twitter', 'remote_connect', 'token'), session::item('twitter', 'remote_connect', 'secret')); $access = $this->twitter->getAccessToken(input::get('oauth_verifier')); // Do we have temporary token? if ($access) { // Get saved token $token = $this->getToken(0, $access['user_id']); // Do we have saved token or are we logging in? if ($token || $action == 'login' && $token) { $this->users_model->login($token['user_id']); router::redirect(session::item('slug') . '#home'); } elseif (!$token || $action == 'signup') { // Get user data $this->initialize($access['oauth_token'], $access['oauth_token_secret']); $user = $this->getUser($access['user_id']); // Do we have user data? if ($user && isset($user->id)) { $connection = array('name' => 'twitter', 'twitter_id' => $user->id, 'token' => $access['oauth_token'], 'secret' => $access['oauth_token_secret']); session::set(array('connection' => $connection), '', 'remote_connect'); $account = array('username' => isset($user->name) ? $user->name : ''); session::set(array('account' => $account), '', 'signup'); router::redirect('users/signup#account'); } } } } router::redirect('users/login'); }
public function doCreateRate() { $params['tid'] = input::get('tid'); $params['tally_score'] = input::get('tally_score'); $params['attitude_score'] = input::get('attitude_score'); $params['delivery_speed_score'] = input::get('delivery_speed_score'); $params['logistics_service_score'] = input::get('logistics_service_score'); $anony = input::get('anony'); foreach (input::get('rate_data') as $key => $row) { $rateData[$key] = $row; if ($row['rate_pic']) { $rateData[$key]['rate_pic'] = implode(',', $row['rate_pic']); } $rateData[$key]['anony'] = $anony == 'true' ? 1 : 0; } $params['rate_data'] = json_encode($rateData); try { $result = app::get('topm')->rpcCall('rate.add', $params, 'buyer'); } catch (\LogicException $e) { $result = false; $msg = $e->getMessage(); } if (!$result) { return $this->splash('error', $url, $msg, true); } $url = url::action('topm_ctl_member_trade@index'); $msg = '评价提交成功'; return $this->splash('success', $url, $msg, true); }
public function add() { $data = array('id' => "", 'link' => input::get('link'), 'menu' => input::get('menu'), 'icon' => input::get('icon'), 'status' => input::get('status')); $save = DB::table('tab_sidebar')->insert($data); $link = DB::table('tab_sidebar')->get(); return view('sidebar_view')->with('link', $link); }
/** * 资讯保存 **/ public function saveInfo() { $userId = userAuth::id(); //$postData =utils::_filter_input(input::get()); $postData = input::get(); $postData['user_id'] = $userId; $postData['modified'] = time(); $postData['pubtime'] = time(); $postData['ifpub'] = 0; $postData["platform"] = 'pc'; $userName = app::get('sysuser')->model('account'); $infoName = $userName->getList(login_account, array('user_id' => $userId)); $postData['source'] = $infoName[0]['login_account']; $postData["article_logo"] = $postData["article_logo"][0]; try { $userMdlAddr = app::get('sysinfo')->model('article'); $userMdlAddr->save($postData); } catch (Exception $e) { $msg = $e->getMessage(); return $this->splash('error', null, $msg); } catch (\LogicException $e) { $msg = $e->getMessage(); return $this->splash('error', null, $msg); } $url = url::action('topc_ctl_member_info@publishInfo'); $msg = app::get('topc')->_('添加成功'); return $this->splash('success', $url, $msg); }
public function create() { $literaryid = input::get('literary_id'); //var_dump($literaryid); if ($literaryid) { $literaryInfo = app::get('sysexpert')->model('literary')->getRow("*", array("literary_id" => $literaryid)); //后台维护数据时,编辑后,选择框字段显示上次保存专家和类型值! $expert = app::get('sysexpert')->model('expert'); $name = $expert->getRow('name', array('expert_id' => $literaryInfo['expert_id'])); $literaryInfo['name'] = $name['name']; $literarycat = app::get('sysexpert')->model('literarycat'); $cat = $literarycat->getRow('literarycat', array('literarycat_id' => $literaryInfo['literarycat_id'])); $literaryInfo['literarycat'] = $cat['literarycat']; $pagedata['literaryInfo'] = $literaryInfo; } //$expertInfo=app::get("sysexpert")->model("expert")->getList("*"); //查询语句<==> $sql = "select * from sysexpert_expert"; $expertInfo = app::get("base")->database()->executeQuery($sql)->fetchAll(); $pagedata["expertList"] = $expertInfo; $literarycatList = app::get("sysexpert")->model("literarycat")->getList("*"); //取sysexpert>dbschema>literarycat所有值赋给变量$expertInfo $pagedata["literarycatList"] = $literarycatList; //再将数组$expertInfo的值赋值给数组$pagedata。 //var_dump($pagedata); return $this->page('sysexpert/admin/adminaddliterary/addLiterary.html', $pagedata); }
public function setAddrDef() { $postData = input::get(); $addritem = app::get('sysshoppubt')->model('deliveryaddr'); try { $sql = "update sysshoppubt_deliveryaddr set def_addr = 0 where uniqid = '" . $postData['uniqid'] . "'"; app::get('sysshoppubt')->database()->executeUpdate($sql); $sql = "update sysshoppubt_deliveryaddr set def_addr = 1 where deliveryaddr_id = '" . $postData['deliveryaddr_id'] . "'"; app::get('sysshoppubt')->database()->executeUpdate($sql); $filter['uniqid'] = $postData['uniqid']; $userAddrList = $addritem->getList('*', $filter); foreach ($userAddrList as &$addr) { list($regions, $region_id) = explode(':', $addr['area']); $addr['region_id'] = str_replace('/', ',', $region_id); } $pagedata['userAddrList'] = $userAddrList; $msg = view::make('topc/member/shoppubt/add_edit.html', $pagedata)->render(); return $this->splash('success', null, $msg, true); } catch (Exception $e) { $msg = $e->getMessage(); return $this->splash('error', null, $msg); } catch (\LogicException $e) { $msg = $e->getMessage(); return $this->splash('error', null, $msg); } }
public function getPromotionItem() { $filter = input::get(); $promotionInfo = app::get('topc')->rpcCall('promotion.promotion.get', array('promotion_id' => $filter['promotion_id'])); if ($promotionInfo['valid']) { if (!$filter['pages']) { $filter['pages'] = 1; } $pageSize = 20; $params = array('page_no' => $pageSize * ($filter['pages'] - 1), 'page_size' => $pageSize, 'fields' => 'item_id,shop_id,title,image_default_id,price'); //获取促销商品列表 $promotionItem = $this->__promotionItemList($promotionInfo, $params); //echo '<pre>';print_r($promotionItem);exit(); $count = $promotionItem['total_found']; $promotionItemList = $promotionItem['list']; //处理翻页数据 $current = $filter['pages'] ? $filter['pages'] : 1; $filter['pages'] = time(); if ($count > 0) { $total = ceil($count / $pageSize); } $pagedata['pagers'] = array('link' => url::action('topc_ctl_promotion@getPromotionItem', $filter), 'current' => $current, 'total' => $total, 'token' => $filter['pages']); $pagedata['promotionItemList'] = $promotionItemList; $pagedata['count'] = $count; $pagedata['promotionInfo'] = $promotionItem['promotionInfo']; $pagedata['promotiontype'] = $promotionInfo['promotion_type']; } else { return abort(404); } return $this->page("topc/promotion/promotion.html", $pagedata); }
public function create() { $literaryid = input::get('literary_id'); if ($literaryid) { $literaryInfo = app::get('sysplan')->model('literary')->getRow("*", array("literary_id" => $literaryid)); $pagedata['literaryInfo'] = $literaryInfo; } $literarycatList = app::get("sysplan")->model("literarycat")->getList("*"); foreach ($literarycatList as $key => $value) { if ($value["literarycat"] == "其他") { unset($literarycatList[$key]); } } $pagedata["literarycatList"] = $literarycatList; $literaryclassList = app::get("sysplan")->model("literaryclass")->getList("*"); foreach ($literaryclassList as $key => $value) { if ($value["literaryclass"] == "其他") { unset($literaryclassList[$key]); } } $pagedata["literaryclassList"] = $literaryclassList; $literarytargetList = app::get("sysplan")->model("literarytarget")->getList("*"); foreach ($literarytargetList as $key => $value) { if ($value["literarytarget"] == "其他") { unset($literarytargetList[$key]); } } $pagedata["literarytargetList"] = $literarytargetList; return $this->page('sysplan/admin/adminaddliterary/addLiterary.html', $pagedata); }
/** * 结算明细 * @return */ public function detail() { $this->contentHeaderTitle = app::get('topshop')->_('企业结算明细'); $filter['shop_id'] = $this->shopId; $postSend = input::get(); if ($postSend['timearea']) { $pagedata['timearea'] = $postSend['timearea']; $timeArray = explode('-', $postSend['timearea']); $filter['settlement_time|than'] = strtotime($timeArray[0]); $filter['settlement_time|lthan'] = strtotime($timeArray[1]); } else { $filter['settlement_time|than'] = time() - 3600 * 24 * 7; $filter['settlement_time|lthan'] = time(); $pagedata['timearea'] = date('Y/m/d', time() - 3600 * 24 * 7) . '-' . date('Y/m/d', time()); } if ($postSend['settlement_type']) { $filter['settlement_type'] = $postSend['settlement_type']; $pagedata['settlement_type'] = $postSend['settlement_type']; } //处理翻页数据 $pagedata['page'] = $page = $postSend['page'] ? $postSend['page'] : 1; $pagedata['limits'] = $pageLimit = 10; $objMdlSettleDetail = app::get('sysclearing')->model('settlement_detail'); $pagedata['settlement_detail_list'] = $objMdlSettleDetail->getList('*', $filter, ($page - 1) * $pageLimit, $pageLimit, 'settlement_time desc'); $count = $objMdlSettleDetail->count($filter); $postSend['token'] = time(); if ($count > 0) { $total = ceil($count / $pageLimit); } $pagedata['pagers'] = array('link' => url::action('topshop_ctl_clearing_settlement@detail', $postSend), 'current' => $page, 'total' => $total, 'token' => $postSend['token']); return $this->page('topshop/clearing/settlement_detail.html', $pagedata); }
/** * Store a newly created resource in storage. * * @return Response */ public function store() { $date = \Carbon\Carbon::now(); $validator = Validator::make($data = Input::all(), User::$rules); $validatora = Validator::make($dataa = Input::all(), Registrasi::$rules); if ($validatora->fails()) { return Redirect::back()->withErrors($validatora)->withInput(); } else { if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } else { // Register User tanpa diaktivasi $user = Sentry::register(array('email' => Input::get('email'), 'password' => Input::get('password'), 'first_name' => Input::get('name'), 'last_name' => Input::get('jenjang')), false); // Cari grup user $regularGroup = Sentry::findGroupByName('user'); // Masukkan user ke grup user $user->addGroup($regularGroup); DB::table('schools')->insertGetId(array('jenjang' => input::get('jenjang'), 'name' => Input::get('name'), 'adstreet' => Input::get('adstreet'), 'advillage' => Input::get('advillage'), 'addistricts' => Input::get('addistricts'), 'adcity' => Input::get('adcity'), 'adpostalcode' => Input::get('adpostalcode'), 'adphone' => Input::get('adphone'), 'hmname' => Input::get('hmname'), 'hmphone' => Input::get('hmphone'), 'hmmobile' => Input::get('hmphone'), 'user_id' => $user->id, 'created_at' => $date, 'updated_at' => $date)); // Persiapkan activation code untuk dikirim ke email $data = ['email' => $user->email, 'activationCode' => $user->getActivationCode()]; // Kirim email aktivasi Mail::send('emails.auth.register', $data, function ($message) use($user) { $message->to($user->email, $user->first_name . ' ' . $user->last_name)->subject('Aktivasi Akun SIM Atletik UNESA'); }); // Redirect ke halaman login return Redirect::route('login')->with("successMessage", "Berhasil disimpan. Silahkan cek email ({$user->email}) untuk melakukan aktivasi akun."); } } }
public function auth() { $username = input::get('username'); $password = input::get('password'); $sandi = hash::make('admin'); $ceklogin = DB::table('users')->where('password', '=', $sandi)->get(); return $sandi; }
public function store() { $post = new Post(); $post->user_id = Auth::user()->id; $post->text = filter_var(input::get('post'), FILTER_SANITIZE_STRING); $post->save(); return redirect('/home'); }
public function catList() { $catId = input::get('cat_id'); $catInfo = app::get('topm')->rpcCall('category.cat.get', array('cat_id' => $catId, 'fields' => 'cat_id,cat_name')); $pagedata['data'] = $catInfo[$catId]; $pagedata['title'] = "商品分类"; return $this->page('topm/category/catlistinfo.html', $pagedata); }
public static function checkRFData() { if (input::exists()) { if (isset($_POST['rfdata'])) { echo input::get('rfdata'); } } }
public function save() { $data = input::get(); $comment = app::get('sysshoppubt')->model('comment'); $data['created_time'] = time(); $comment->save($data); return view::make('topc/comment/rate.html', $pagedata); }
/** * 异步获取数据 图表用 * @param null * @return array */ public function ajaxTrade() { $postData = input::get(); //api的参数 $all = $this->__getParams('graphall', $postData, 'trade'); $datas = app::get('topshop')->rpcCall('sysstat.data.get', $all, 'seller'); return response::json($datas); }
public function post(Requests\CreatePostRequest $request) { $title = input::get('title'); $body = input::get('body'); $id = Auth::user()->id; Post::create(['title' => $title, 'body' => $body, 'user_id' => $id, 'created_at' => Carbon::now()]); return redirect::back(); }
public function ajaxPromotionItemShow() { $pagedata = $this->__commonData(input::get()); $data['html'] = view::make('topm/shop/promotion/promotionitem.html', $pagedata)->render(); $data['pagers'] = $pagedata['pagers']; $data['success'] = true; return response::json($data); exit; }
public function index($api) { $api = input::get('api'); if ($api != null) { $tools = kernel::single('system_prism_apiJson'); $json = $tools->getJson(); echo $json[$api]; } }
public function create() { $literarycatid = input::get('literarycat_id'); if ($literarycatid) { $literarycatInfo = app::get('sysexpert')->model('literarycat')->getRow("*", array("literarycat_id" => $literarycatid)); $pagedata['literarycatInfo'] = $literarycatInfo; } return $this->page('sysexpert/admin/adminaddliterarycat/addLiterarycat.html', $pagedata); }
public function typecreate() { $typeid = input::get('type_id'); if ($typeid) { $noticeInfo = app::get('sysnotice')->model('notice_type')->getRow("*", array("type_id" => $typeid)); $pagedata['noticetypeInfo'] = $noticeInfo; } return $this->page('sysnotice/admin/noticetype.html', $pagedata); }
public function postDestroy() { $category = Category::find(input::get('id')); if ($category) { $category->delete(); return Redirect::to('blog/admin/categories/index')->with('messsage', 'Category Deleted'); } return Redirect::to('blog/admin/categories/index')->with('messsage', 'Something went wrong, please try again'); }
public function getStatusId() { $term = strtolower(input::get('term')); $data = DB::table('table_users_status')->select('users_status_id', 'users_status_title')->where('users_status_title', 'LIKE', $term . '%')->take(10)->get(); foreach ($data as $v) { $return_array[] = array('value' => '[' . $v->users_status_id . '] ' . $v->users_status_title); } return (new Response($return_array, 200))->header('Content-Type', "json"); }
public function edit() { $data = input::get(); $service = app::get('sysshop')->model('service'); $serviceinfo = $service->getRow('*', array('article_id' => $data['article_id'])); $pagedata['row'] = $serviceinfo; $this->contentHeaderTitle = '修改第三方服务'; return view::make('sysshop/admin/shop/service.html', $pagedata); }
public function updatepass($id, $value) { $user = DB::getInstance()->get('tbl_cust', array("cust_id", "=", $id)); $pwd = $user->result()->cust_pass; if (Input::get($value) != null && Crytion::generatehash(Input::get($value) != $pwd)) { return $pwd = Crytion::generatehash(input::get($value)); } return $pwd; }
public function create() { $literaryclassid = input::get('literaryclass_id'); if ($literaryclassid) { $literaryclassInfo = app::get('sysplan')->model('literaryclass')->getRow("*", array("literaryclass_id" => $literaryclassid)); $pagedata['literaryclassInfo'] = $literaryclassInfo; } return $this->page('sysplan/admin/adminaddliteraryclass/addliteraryclass.html', $pagedata); }
public function create() { $expertid = input::get('expert_id'); if ($expertid) { $expertInfo = app::get('sysexpert')->model('expert')->getRow("*", array("expert_id" => $expertid)); $pagedata['expertInfo'] = $expertInfo; } return $this->page('sysexpert/admin/adminaddexpert/addexpert.html', $pagedata); }
public function getMessageOfTheme() { if (input::has('themeId')) { $themeId = input::get('themeId'); return MessageThemes::find($themeId)->message; } else { return ""; } }
public function index() { $objLibFilter = kernel::single('topc_item_filter'); $params = $objLibFilter->decode(input::get()); $params['use_platform'] = '0,1'; //判断自营 自营是1,非自营是0 if ($params['is_selfshop'] == '1') { $pagedata['isself'] = '0'; } else { $pagedata['isself'] = '1'; } //如果不是从分类进入,并且没有关键字搜索则不能进入列表页 $params['search_keywords'] = trim($params['search_keywords']); if (empty($params['cat_id']) && empty($params['search_keywords'])) { return redirect::back(); } //默认图片 $pagedata['image_default_id'] = app::get('image')->getConf('image.set'); //搜索或者筛选获取商品 $searchParams = $this->__preFilter($params); $searchParams['fields'] = 'item_id,title,image_default_id,price,promotion.ids'; $itemsList = app::get('topc')->rpcCall('item.search', $searchParams); //检测是否有参加团购活动 if ($itemsList['list']) { $itemsList['list'] = array_bind_key($itemsList['list'], 'item_id'); $itemIds = array_keys($itemsList['list']); $activityParams['item_id'] = implode(',', $itemIds); $activityParams['status'] = 'agree'; $activityParams['end_time'] = 'bthan'; $activityParams['start_time'] = 'sthan'; $activityParams['fields'] = 'activity_id,item_id,activity_tag,price,activity_price'; $activityItemList = app::get('topc')->rpcCall('promotion.activity.item.list', $activityParams); if ($activityItemList['list']) { foreach ($activityItemList['list'] as $key => $value) { $itemsList['list'][$value['item_id']]['activity'] = $value; $itemsList['list'][$value['item_id']]['price'] = $value['activity_price']; } } } //根据条件搜索出最多商品的分类,进行显示渐进式筛选项 $filterItems = app::get('topc')->rpcCall('item.search.filterItems', $params); //渐进式筛选的数据 $pagedata['screen'] = $filterItems; $pagedata['items'] = $itemsList['list']; //根据条件搜索出的商品 $pagedata['count'] = $itemsList['total_found']; //根据条件搜索到的总数 //已有的搜索条件 $tmpFilter = $params; unset($tmpFilter['pages']); $pagedata['filter'] = $objLibFilter->encode($tmpFilter); //分页 $pagedata['pagers'] = $this->__pages($params['pages'], $pagedata['count'], $pagedata['filter']); //已选择的搜索条件 $pagedata['activeFilter'] = $params; return $this->page('topc/list/index.html', $pagedata); }