Ejemplo n.º 1
0
 public function getJson($addWhere = '', $addSql = '', $showMax = 12)
 {
     $sort = input::getInput("mix.sort") ? input::getInput("mix.sort") : 'id';
     $order = input::getInput("mix.order") ? input::getInput("mix.order") : "asc";
     $page = input::getInput("mix.page") ? input::getInput("mix.page") : 1;
     $rows = input::getInput("mix.rows") ? input::getInput("mix.rows") : 10;
     $db = sf::getLib("db");
     if ($select) {
         $sql = $select . " ";
     } else {
         $sql = "SELECT * FROM `" . $this->table . "` ";
     }
     $addWhere && ($sql .= "WHERE " . $addWhere . " ");
     if ($addSql) {
         $sql .= $addSql . " ";
     } else {
         $sql .= " ORDER BY {$sort} {$order} ";
     }
     if (!router::get("totalnum" . $key)) {
         $query = $db->query($sql);
         $total = $db->num_rows($query);
     } else {
         $total = router::get("totalnum" . $key);
     }
     $sql .= "LIMIT " . $rows * ($page - 1) . "," . $rows;
     $query = $db->query($sql);
     while ($row = $db->fetch_array($query)) {
         $result[] = $this->fillObject($row)->toArray();
     }
     return '{"total":' . $total . ',"rows":' . json_encode($result) . '}';
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 protected function _sendFeedback()
 {
     // Check if demo mode is enabled
     if (input::demo()) {
         return false;
     }
     // Extra rules
     $rules = array('name' => array('rules' => array('required', 'is_string', 'trim', 'min_length' => 2, 'max_length' => 255)), 'email' => array('rules' => array('required', 'is_string', 'trim', 'valid_email', 'min_length' => 4, 'max_length' => 255)), 'subject' => array('rules' => array('required', 'is_string', 'trim', 'min_length' => 5, 'max_length' => 255)), 'message' => array('rules' => array('required', 'is_string', 'trim', 'min_length' => 10, 'max_length' => 10000)));
     if (config::item('feedback_captcha', 'feedback') == 1 || config::item('feedback_captcha', 'feedback') == 2 && !users_helper::isLoggedin()) {
         $rules['captcha'] = array('rules' => array('is_captcha'));
     }
     validate::setRules($rules);
     // Validate form values
     if (!validate::run($rules)) {
         return false;
     }
     // Get values
     $email = input::post('email');
     $subject = input::post('subject');
     $message = input::post('message') . "\n\n--\n" . input::post('name') . ' <' . input::post('email') . '>' . "\n" . input::ipaddress();
     // Send feedback
     if (!$this->feedback_model->sendFeedback($email, $subject, $message)) {
         if (!validate::getTotalErrors()) {
             view::setError(__('send_error', 'system'));
         }
         return false;
     }
     // Success
     view::setInfo(__('message_sent', 'feedback'));
     router::redirect('feedback');
 }
 function bannerDuzenleKaydet($duzenle)
 {
     $form = input::all();
     //        $kural = array('ad'=>'required','yol'=>'required','genislik'=>'required','yukseklik'=>'required','url'=>'required','durum'=>'required');
     //        $dogrulama = \Validator::Make($form,$kural);
     //        if($dogrulama->fails()) {
     //            // gönderilen verilerde hata var
     //            return Redirect::to('admin/bannerDuzenle/'. $duzenle)->withErrors($dogrulama)->withInput();
     //        }else{
     $dosya = Input::file('dosya');
     $uzanti = $dosya->getClientOriginalExtension();
     $dosyaAdi = date('YmdHis') . "_b." . $uzanti;
     $path = base_path('bannerResimler/' . $dosyaAdi);
     $imagePath = 'bannerResimler/' . $dosyaAdi;
     Image::make($dosya->getRealPath())->save($path);
     $sorgu = "UPDATE banner SET ad=?,yol=?, genislik=?, yukseklik=?, url=?, durum=? WHERE id=?";
     $islem = DB::update($sorgu, array($form["ad"], $dosyaAdi, $form["genislik"], $form["yukseklik"], $form["url"], $form["durum"], $duzenle));
     if ($islem) {
         $mesaj = "basarili";
         return Redirect::to("admin/bannerListele")->with("mesaj", $mesaj);
     } else {
         $mesaj = "başarısız";
         return Redirect::to("admin/bannerListele")->with("mesaj", $mesaj);
     }
 }
Ejemplo n.º 5
0
 /**
  * 结算明细
  * @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);
 }
Ejemplo n.º 6
0
 /**
  * 发送简历
  */
 function send()
 {
     if (input::getInput("post")) {
         $back = sf::getModel("backs");
         $back->setSubject(input::getInput("post.subject"));
         $back->setUserName(input::getInput("post.user_name"));
         $back->setUserSex(input::getInput("post.user_sex"));
         $back->setUserAge(input::getInput("post.user_age"));
         $back->setUserDegree(input::getInput("post.user_degree"));
         $back->setIdcard(input::getInput("post.idcard"));
         $back->setUserPhone(input::getInput("post.user_phone"));
         $back->setUserIm(input::getInput("post.user_im"));
         $back->setUserEmail(input::getInput("post.user_email"));
         $back->setUserAddress(input::getInput("post.user_address"));
         $back->setPostCode(input::getInput("post.post_code"));
         $back->setWorkAt(input::getInput("post.work_at"));
         $back->setStudyList(input::getInput("post.study_list"));
         $back->setWorkList(input::getInput("post.work_list"));
         $back->setUpdatedAt(date("Y-m-d H:i:s"));
         $back->save();
         $this->page_debug(lang::get("Has been saved!"), site_url("job/index"));
     }
     view::set("job", sf::getModel("jobs", input::getInput("get.id")));
     view::apply("inc_body", "template/job_send");
     view::display("template/page");
 }
Ejemplo n.º 7
0
 /**
  * 资讯保存
  **/
 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);
 }
Ejemplo n.º 8
0
 /**
  * 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.");
         }
     }
 }
Ejemplo n.º 9
0
 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);
 }
Ejemplo n.º 10
0
 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);
 }
Ejemplo n.º 11
0
 /**
  * Селектор файлов плагинов
  * @param array $res массив уже включенных плагинов
  * @return null
  */
 public function file_selector($res = null)
 {
     $res = (array) $res;
     $mask = implode('|', array_map('mpc', $res));
     $mask = '/^plugin\\.' . ($mask ? "(?!" . $mask . ")" : "") . '(\\w+)\\.php$/i';
     return input::o()->snull()->select_folder("plugin_files", PLUGINS_PATH, false, $mask, 1);
 }
Ejemplo n.º 12
0
 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);
 }
Ejemplo n.º 13
0
 public function store(Request $request)
 {
     $rules = array('dmm4-7' => 'required', 'dmm8-13' => 'required', 'dfgd8-13' => 'required', 'lmm4-7' => 'required', 'lmm8-10' => 'required', 'lmm11-13' => 'required', 'lfgd8-13' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     // if the validator fails, redirect back to the form
     if ($validator->fails()) {
         session()->flash('error_message', " You can't leave this all empty.");
         session()->flash('error_message2', " You can use letters, numbers, Periods, and Hyphen.");
         return Redirect::back()->withErrors($validator)->withInput();
         $input = input::all();
     } else {
         $id = $request->input('id');
         $data = ServSetModel::find($id);
         $data->mm_4_17_db_server = $request->input('dmm4-7');
         $data->mm_8_13_db_server = $request->input('dmm8-13');
         //$data->mm_11_13_db_server = $request->input('dmm11-13');
         $data->fgd_8_13_db_server = $request->input('dfgd8-13');
         $data->mm_4_7_logs_server = $request->input('lmm4-7');
         $data->mm_8_10_logs_server = $request->input('lmm8-10');
         $data->mm_11_13_logs_server = $request->input('lmm11-13');
         $data->fgd_8_13_logs_server = $request->input('lfgd8-13');
         $data->save();
         session()->flash('message', ' Update successfuly.');
         return redirect('ais/serverSetting');
     }
 }
Ejemplo n.º 14
0
 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');
 }
Ejemplo n.º 15
0
 public static function get($id, $type = FALSE)
 {
     // Type specified
     if ($type) {
         if ($note = input::cookie("note-{$type}-{$id}")) {
             self::delete($id);
             return array('id' => $id, 'type' => $type, 'content' => $note);
         } else {
             return FALSE;
         }
     } else {
         // Regular
         if ($note = input::cookie("note-regular-{$id}")) {
             self::delete($id);
             return array('id' => $id, 'type' => 'regular', 'content' => $note);
         } elseif ($note = input::cookie("note-error-{$id}")) {
             self::delete($id);
             return array('id' => $id, 'type' => 'error', 'content' => $note);
         } elseif ($note = input::cookie("note-warning-{$id}")) {
             self::delete($id);
             return array('id' => $id, 'type' => 'warning', 'content' => $note);
         } elseif ($note = input::cookie("note-success-{$id}")) {
             self::delete($id);
             return array('id' => $id, 'type' => 'success', 'content' => $note);
         } else {
             return FALSE;
         }
     }
 }
Ejemplo n.º 16
0
 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);
     }
 }
Ejemplo n.º 17
0
 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);
 }
Ejemplo n.º 18
0
 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);
 }
Ejemplo n.º 19
0
 function main()
 {
     $data['user'] = sf::getModel("managers", input::getInput("session.userid"));
     view::set($data);
     view::apply("inc_body", "admin/main");
     view::display("admin/page");
 }
Ejemplo n.º 20
0
 public function action_SearchResults()
 {
     //ドロップダウンの値呼び出し
     $this->action_categorize();
     //もし入力されたら
     if (Input::post()) {
         //バリデーション
         $val = Validation::forge();
         $val->add_field('username', 'ユーザID', 'max_length[255]');
         $val->add_field('Title', 'タイトル', 'max_length[255]');
         $val->add_field('Pcontent', '内容', 'max_length[255]');
         $val->add_field('category', 'カテゴリ', 'required');
         $val->add_field('Syear', '開始年', 'required');
         $val->add_field('Smonth', '開始月', 'required');
         $val->add_field('Sday', '開始日', 'required');
         $val->add_field('Eyear', '終了年', 'required');
         $val->add_field('Emonth', '終了月', 'required');
         $val->add_field('Eday', '終了日', 'required');
         //バリデーション起動
         if ($val->run()) {
             //バリデーションOK
             //入力内容の取得
             $username = Input::post('username');
             $title = Input::post('Title');
             $Pcontent = Input::post('Pcontent');
             $category = Input::post('category');
             $Syear = Input::post('Syear');
             $Smonth = Input::post('Smonth');
             $Sday = input::post('Sday');
             $Eyear = Input::post('Eyear');
             $Emonth = Input::post('Emonth');
             $Eday = input::post('Eday');
             //セッションにセット
             Session::set('user', $username);
             Session::set('Title', $title);
             Session::set('Pcontent', $Pcontent);
             Session::set('category', $category);
             Session::set('Syear', $Syear);
             Session::set('Smonth', $Smonth);
             Session::set('Sday', $Sday);
             Session::set('Eyear', $Eyear);
             Session::set('Emonth', $Emonth);
             Session::set('Eday', $Eday);
             //検索処理呼び出し
             //                $kensaku = $this->action_kensaku();
             //ビューにセット
             $view = View::forge('search/SearchResults', $this->action_kensaku($username, $title, $Pcontent, $category, $Syear, $Smonth, $Sday, $Eyear, $Emonth, $Eday));
         } else {
             //バリデーションエラー
             $this->message = $val->error();
             $view = View::forge('search/Search', $this->action_categorize());
             $view->set_global('message', $this->message, false);
         }
     } else {
         $view = View::forge('search/Search', $this->action_categorize());
         $view->set_global('message', $this->message, false);
     }
     return $view;
 }
Ejemplo n.º 21
0
 public function login()
 {
     if (input::post('username') && input::post('password') && auth::login(input::post('username'), input::post('password'), self::AUTH_REALM)) {
         $this->index();
     } else {
         return $this->access_denied();
     }
 }
Ejemplo n.º 22
0
 /**
  * 异步获取数据  图表用
  * @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);
 }
Ejemplo n.º 23
0
 function index()
 {
     $page = sf::getModel("pages")->showPage($this->type, input::getInput("get.id"));
     config::set('title', $page->getSubject());
     view::set("page", $page);
     view::apply("inc_body", "template/about_us");
     view::display("template/page");
 }
Ejemplo n.º 24
0
 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);
 }
Ejemplo n.º 25
0
 public static function checkRFData()
 {
     if (input::exists()) {
         if (isset($_POST['rfdata'])) {
             echo input::get('rfdata');
         }
     }
 }
Ejemplo n.º 26
0
 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');
 }
Ejemplo n.º 27
0
 /**
 		@brief		Sort the options.
 		@since		2016-01-12 22:25:10
 	**/
 public function sort_inputs()
 {
     // The sort_inputs() method from the sort_order trait requires inputs, which a select doesn't have.
     $this->inputs = $this->options;
     parent::sort_inputs();
     $this->options = $this->inputs;
     return $this;
 }
Ejemplo n.º 28
0
 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);
 }
Ejemplo n.º 29
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $file = input::file('avatar');
     $dest = public_path() . '/images/';
     $name = str_random(6) . '_' . $file->getClientOriginalName();
     $file->move($dest, $name);
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'avatar' => $name, 'password' => bcrypt($data['password'])]);
 }
Ejemplo n.º 30
0
 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;
 }