Пример #1
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);
     }
 }
Пример #2
0
    public function chart_view()
    {
        $type = $_GET['type'];
        $filter = array('time_from' => $_GET['time_from'], 'time_to' => $_GET['time_to']);
        $memberObj = app::get('sysstat')->model('analysis_member');
        $login_name = array();
        $saleTimes = array();
        $salePrice = array();
        if ($type == 'volume') {
            $data = $memberObj->getlist($cols = '*', $filter, 0, 20, 'saleTimes desc');
            foreach ($data as $val) {
                $login_name[] = '\'' . $val['login_name'] . '\'';
                $saleTimes[] = $val['saleTimes'];
            }
            $categories = implode(',', $login_name);
            $volume = implode(',', $saleTimes);
            $pagedata['categories'] = '[' . $categories . ']';
            $pagedata['data'] = '{
				name: \'' . app::get('sysstat')->_('订单量') . '\',
				data: [' . $volume . ']}';
        } else {
            $data = $memberObj->getlist($cols = '*', $filter, 0, 20, 'salePrice desc');
            foreach ($data as $val) {
                $login_name[] = '\'' . $val['login_name'] . '\'';
                $salePrice[] = $val['salePrice'];
            }
            $categories = implode(',', $login_name);
            $turnover = implode(',', $salePrice);
            $pagedata['categories'] = '[' . $categories . ']';
            $pagedata['data'] = '{
				name: \'' . app::get('sysstat')->_('订单额') . '\',
				data: [' . $turnover . ']}';
        }
        return view::make("sysstat/admin/analysis/chart_type_column.html", $pagedata);
    }
Пример #3
0
 function detail_basic($id)
 {
     $oXHProf = app::get('serveradm')->model('xhprof');
     $aData = $oXHProf->dump($id);
     $pagedata['data'] = $aData;
     return view::make('serveradm/admin/xhprof_detail.html', $pagedata)->render();
 }
Пример #4
0
 public function edit($id)
 {
     //$modul=Submodule::getModuleNotIn($id)->get();
     $modul = Submodule::getModule($id)->get();
     $allmodul = Module::getAllModule();
     return view::make('usermanagement::roles.editRoles', compact('modul', 'allmodul', 'id'));
 }
Пример #5
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $rules = array('private' => 'numeric|required', 'title' => 'max:46|required', 'paste' => 'required', 'expire' => 'required|numeric', 'private' => 'required|numeric', 'tags' => 'max:6|alpha');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         $messages = $validator->messages();
         return View::make('paste.form')->withErrors($messages);
     }
     $new_paste = new Paste();
     $new_paste->title = Input::get('title');
     $new_paste->token = Str::random(40);
     $new_paste->delete_token = Str::random(40);
     $new_paste->paste = Input::get('paste');
     $new_paste->private = Input::get('private');
     date_default_timezone_set('UTC');
     $expire_time = date('Y-m-d H:i:s', strtotime(sprintf('now + %s minutes', Input::get('expire'))));
     $new_paste->expire = $expire_time;
     if (!$new_paste->save()) {
         Debugbar::error('Saving failed!');
     }
     // Check if tags are set
     if (Input::has('hidden-tags')) {
         $tags = explode(' ', Input::get('hidden-tags'));
         foreach ($tags as $key => $tag) {
             $tag_model = new Tag();
             $tag_model->tag = $tag;
             $tag_model->paste_id = $new_paste->id;
             $new_paste->tags()->save($tag_model);
         }
     }
     if ($new_paste->id) {
         return Redirect::route('paste.show', $new_paste->token)->withCookie(Cookie::make('edittoken', $new_paste->token, 30));
     }
     return view::make('paste.form', array('page_title' => 'Create a paste'));
 }
Пример #6
0
 public function check()
 {
     $sa = kernel::single('desktop_user');
     $admName = $sa->get_login_name();
     $ideas = $_POST["ideas"];
     $is_through = $_POST["is_through"];
     $saveItem = app::get('sysshoppubt')->model('checks');
     $postData = input::get();
     $postData['create_time'] = time();
     $postData['name'] = $admName;
     $saveItem->save($postData);
     if ($is_through == '1') {
         $saveItem = app::get('sysshoppubt')->model('biddings');
         $paminfo = $saveItem->getRow('*', array('bidding_id' => $ideas));
         $paminfo1 = $paminfo;
         $seegoods_stime = strtotime($postData['seegoods_stime']);
         $paminfo['seegoods_stime'] = $seegoods_stime;
         $paminfo['through_time'] = $postData['create_time'];
         $paminfo['is_through'] = '1';
         $saveItem->update($paminfo, $paminfo1);
         return view::make('sysshoppubt/check/passsucc.html')->render();
     } else {
         return view::make('sysshoppubt/check/checksucc.html')->render();
     }
 }
Пример #7
0
 public function index()
 {
     /** 登录之前的预先验证 **/
     if (!defined("STRESS_TESTING")) {
         $obj_services = kernel::servicelist('app_pre_auth_use');
         foreach ($obj_services as $obj) {
             if (method_exists($obj, 'pre_auth_uses') && method_exists($obj, 'login_verify')) {
                 $pagedata['desktop_login_verify'] = $obj->login_verify();
             }
         }
     }
     /** end **/
     //检查证书是否合法,从而判定产品功能是否可用。比如b2c功能
     $certCheckObj = kernel::service("product_soft_certcheck");
     if (is_object($certCheckObj) && method_exists($certCheckObj, "check")) {
         $certCheckObj->check();
     }
     $pagedata['desktop'] = url::route('shopadmin');
     $pagedata['redirect'] = input::get('url');
     $pagedata['Commerce'] = 'yes';
     $pagedata['img_url'] = app::get('desktop')->res_url . '/images/login.png';
     if (pamAccount::isEnableVcode('desktop')) {
         $pagedata['show_varycode'] = 'true';
     }
     $pagedata['error_info'] = urldecode(input::get('msg'));
     $conf = base_setup_config::deploy_info();
     $pagedata['product_key'] = $conf['product_key'];
     return view::make('desktop/login.html', $pagedata);
 }
Пример #8
0
 /**
  * 产生订单发货页面
  * @params string order id
  * @return string html
  */
 public function godelivery()
 {
     $tid = input::get('tid');
     if (!$tid) {
         header('Content-Type:application/json; charset=utf-8');
         echo '{error:"' . app::get('topshop')->_("订单号传递出错.") . '",_:null}';
         exit;
     }
     $params['tid'] = $tid;
     $params['fields'] = "tid,receiver_name,receiver_mobile,receiver_state,receiver_district,receiver_address,need_invoice,ziti_addr,invoice_type,invoice_name,invoice_main,orders.tid,orders.oid,dlytmpl_id";
     $tradeInfo = app::get('topshop')->rpcCall('trade.get', $params, 'seller');
     $oids = implode(',', array_column($tradeInfo['orders'], 'oid'));
     $delivery = $this->createDelivery(array('tid' => $tid, 'oids' => $oids));
     $pagedata['delivery'] = $delivery;
     $pagedata['tradeInfo'] = $tradeInfo;
     //获取用户的物流模板
     if ($tradeInfo['dlytmpl_id'] == 0 && $tradeInfo['ziti_addr']) {
         $dlycorp = app::get('topshop')->rpcCall('logistics.dlycorp.get.list');
         $pagedata['dlycorp'] = $dlycorp['data'];
     } else {
         $dtytmpl = app::get('topshop')->rpcCall('logistics.dlytmpl.get', array('shop_id' => $this->shopId, 'template_id' => $tradeInfo['dlytmpl_id']));
         $pagedata['dtyList'] = $dtytmpl;
     }
     return view::make('topshop/trade/godelivery.html', $pagedata);
 }
 public function quiz()
 {
     if (Session::has('id') && (Session::get('type') === 'Student' || Session::get('type') === 'SuperAdmin')) {
         //$questions = Question::all();
         //$ansAr = array(
         //);
         $random_question = Question::orderBY(DB::raw('Rand()', 'Unique()'))->take(2)->get(array('id', 'q_description', 'q_opt_1', 'q_opt_2', 'q_opt_3', 'q_opt_4', 'q_ans'));
         //print_r($random_question);
         $cnt = 0;
         foreach ($random_question as $tmp) {
             //			    print_r($tmp);
             //			    print("---------------\n-----------------");
             $cnt++;
         }
         $totNoOfQus = $cnt;
         //echo $cnt;
         $correct_answer = array_pluck($random_question, 'q_ans');
         $qIds = array_pluck($random_question, 'id');
         $combined = array_combine($qIds, $correct_answer);
         //		    echo '<pre>';
         //		    print_r($combined);
         //		    die;
         Session::put('correct_answer', $combined);
         Session::put('total_qus', $totNoOfQus);
         //		    return $correct_answer;
         return view::make('quiz')->with('title', 'QUIZ')->with('quiz', $random_question);
     } else {
         echo 'You are not authorised';
     }
 }
Пример #10
0
 public function create()
 {
     $city = City::all();
     $type = VehicleType::all();
     $partner = Partner::all();
     return view::make('vehicle::addVehicle', compact('city', 'type', 'partner'));
 }
Пример #11
0
 public function chart_view()
 {
     $show = $_GET['show'];
     //todo 这里需要根据不同的需求读取数据
     if ($_GET['callback']) {
         $data = kernel::single($_GET['callback'])->fetch_graph_data($_GET);
     } else {
         $data = kernel::single('ectools_analysis_base')->fetch_graph_data($_GET);
     }
     $pagedata['categories'] = '["' . @join('","', $data['categories']) . '"]';
     foreach ($data['data'] as $key => $val) {
         $tmp[] = '{name:"' . addslashes($key) . '",data:[' . @join(',', $val) . ']}';
     }
     $pagedata['data'] = '[' . @join(',', $tmp) . ']';
     switch ($show) {
         case 'line':
             return view::make("ectools/analysis/chart_type_line.html", $pagedata);
             break;
         case 'column':
             return view::make("ectools/chart_type_column.html", $pagedata);
             break;
         default:
             return view::make("ectools/analysis/chart_type_default.html", $pagedata);
             break;
     }
 }
Пример #12
0
 public function get_single(Request $request, $id)
 {
     $view = view::make("project");
     $view->projects = Project::all();
     $view->active_project = Project::find($id);
     return $view;
 }
Пример #13
0
 public function ajaxCouponData()
 {
     $filter = input::get();
     if (!$filter['pages']) {
         $filter['pages'] = 1;
     }
     $pageSize = 10;
     $params = array('page_no' => $pageSize * ($filter['pages'] - 1), 'page_size' => $pageSize, 'fields' => '*', 'user_id' => userAuth::id());
     $couponListData = app::get('topm')->rpcCall('user.coupon.list', $params, 'buyer');
     $count = $couponListData['count'];
     $couponList = $couponListData['coupons'];
     //处理翻页数据
     $current = $filter['pages'] ? $filter['pages'] : 1;
     $filter['pages'] = time();
     if ($count > 0) {
         $total = ceil($count / $pageSize);
     }
     $pagedata['pagers'] = array('link' => url::action('topm_ctl_member_coupon@couponList', $filter), 'current' => $current, 'total' => $total, 'token' => $filter['pages']);
     $pagedata['couponList'] = $couponList;
     $pagedata['count'] = $count;
     $pagedata['action'] = 'topm_ctl_member_coupon@couponList';
     if (input::get('json')) {
         $data['html'] = view::make('topm/member/coupon/list.html', $pagedata)->render();
         $data['pagers'] = $pagedata['pagers'];
         $data['success'] = true;
         return response::json($data);
         exit;
     }
     return view::make('topm/member/coupon/list.html', $pagedata);
 }
Пример #14
0
 public function active_top_html()
 {
     /** 获取证书,企业号的验证 **/
     $active_url = url::route('shopadmin', ['app' => 'entermembercenter', 'ctl' => 'register']);
     $pagedata['active_url'] = $active_url;
     return view::make('entermembercenter/desktop_active_top.html', $pagedata)->render();
 }
Пример #15
0
 function get_output()
 {
     $act = app::get('desktop')->model('menus')->getList('menu_id,app_id,menu_title,menu_path,workground', array('menu_type' => 'workground', 'disabled' => 0));
     $user = kernel::single('desktop_user');
     if ($user->is_super()) {
         $aData = $act;
     } else {
         $group = $user->group();
         $meuns = app::get('desktop')->model('menus');
         $data = array();
         foreach ($group as $key => $val) {
             $aTmp = $meuns->workgroup($val);
             foreach ($aTmp as $val) {
                 $data[] = $val;
             }
         }
         $aData = $data;
     }
     $menu_id = array();
     $wrokground = array();
     foreach ((array) $aData as $value) {
         if (!in_array($value['menu_id'], (array) $menu_id)) {
             $workground[] = $value;
         }
         $menu_id[] = $value['menu_id'];
     }
     $pagedata['actions'] = $workground;
     $pagedata['side'] = "sidepanel";
     return view::make('desktop/sidepanel.html', $pagedata)->render();
 }
Пример #16
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $row = User::find($id);
     Former::populate($row);
     $this->layout->content = view::make('users.edit', compact('row', 'id'));
 }
Пример #17
0
 function main()
 {
     $pagedata['data'] = $this->getViews();
     /** 判断是否要显示归类视图 **/
     $pagedata['haspacket'] = $pagedata['data'] ? true : false;
     return view::make('desktop/finder/view/packet.html', $pagedata)->render();
 }
Пример #18
0
 public function detail_sample($row)
 {
     $oItem = app::get('sysshoppubt')->model('sample');
     $chech = $oItem->getList('*', array('standard_id' => '', 'tender_id' => '', 'bidding_id' => $row));
     $pagedata['items'] = $chech;
     return view::make('sysshoppubt/sample/sample.html', $pagedata)->render();
 }
Пример #19
0
 public function detail_basic($Id)
 {
     $objActivity = kernel::single('syspromotion_activity');
     $activity = $objActivity->getInfo("*", array('activity_id' => $Id));
     $pagedata = $activity;
     return view::make('syspromotion/activity/detail.html', $pagedata)->render();
 }
Пример #20
0
 public function getAppsDocumentHtml()
 {
     $apps = [];
     foreach ($this->getAppIds() as $appId) {
         $db = app::get($appId)->database();
         $platform = $db->getDatabasePlatform();
         $tables = [];
         foreach (kernel::single('base_application_dbtable')->detect($appId) as $item) {
             $tableDefine = [];
             $table = $item->createTableSchema()->getTable($item->real_table_name());
             $tableSchemaDefine = $item->load();
             foreach ($table->getColumns() as $columnName => $column) {
                 $tableDefine['columns'][$columnName] = array('name' => $columnName, 'type' => $column->getType()->getSQLDeclaration($column->toArray(), $platform), 'comment' => $column->getComment(), 'notnull' => $column->getNotnull() ? 'Yes' : 'No', 'default' => $column->getDefault(), 'autoincrement' => $column->getAutoincrement() ? 'Yes' : 'No');
                 if (is_array($tableSchemaDefine['columns'][$columnName]['type'])) {
                     if ($tableDefine['columns'][$columnName]['comment']) {
                         $tableDefine['columns'][$columnName]['comment'] .= '\\|';
                     }
                     $tableDefine['columns'][$columnName]['comment'] .= $this->convertEnumArrayToComment($tableSchemaDefine['columns'][$columnName]['type']);
                 }
             }
             foreach ($table->getIndexes() as $indexName => $index) {
                 $tableDefine['index'][$indexName]['columns'] = implode(', ', $index->getColumns());
                 $tableDefine['index'][$indexName]['isUnique'] = $index->isUnique() ? 'Yes' : 'No';
             }
             // 表comment
             $tableDefine['comment'] = $tableSchemaDefine['comment'];
             $tables[$item->real_table_name()] = $tableDefine;
         }
         $apps[$appId] = $tables;
     }
     //        var_dump($apps);exit;
     return view::make('dev/data_dictionary/document_apps.html', compact('apps'))->render();
 }
Пример #21
0
 public function tenderule()
 {
     $uniqid = input::get('uniqid');
     $pagedata['uniqid'] = $uniqid;
     $tender = app::get('sysshoppubt')->model('tender');
     $rule = app::get('sysshoppubt')->model('tenderule');
     $chrule = app::get('sysshoppubt')->model('chrule');
     $rulelist = $rule->getList('*');
     $getdetail = app::get('sysshoppubt')->model('detail');
     $show = $getdetail->getList("*");
     foreach ($show as $key => $value) {
         $newproject[$key] = $value['tenderrule_id'];
     }
     $all = $rule->getList('*');
     //选择型资质
     $newpro = array();
     $project = $rule->getList('*', array('tenderrule_id' => $newproject));
     foreach ($project as $key => $value) {
         $fun = $getdetail->getList('detail', array('tenderrule_id' => $value['tenderrule_id']));
         $value['detail'] = $fun;
         $newpro[] = $value;
     }
     $pagedata['newpro'] = $newpro;
     //打分型资质
     $pro = $rule->getList('*', array('have_detail' => 0));
     foreach ($pro as $key => $value) {
         $oldscore = $chrule->getRow('score', array('tenderrule_id' => $value['tenderrule_id'], 'detail' => null, 'uniqid' => $uniqid));
         $pro[$key]['score'] = $oldscore['score'];
     }
     $pagedata['pro'] = $pro;
     $pagedata['num'] = $rule->count(array('have_detail' => 0));
     //算总分
     $score = $chrule->getList('score', array('category' => '必要资质', 'detail' => null, 'uniqid' => $pagedata['uniqid']));
     foreach ($score as $key => $value) {
         $sums = $sums + $value['score'];
     }
     $pagedata['sums'] = $sums;
     $scorec = $chrule->getList('score', array('category' => '可选资质', 'detail' => null, 'uniqid' => $pagedata['uniqid']));
     foreach ($scorec as $key => $value) {
         $sumc = $sumc + $value['score'];
     }
     $pagedata['sumc'] = $sumc;
     $scorem = $chrule->getList('score', array('category' => '设备能力', 'detail' => null, 'uniqid' => $pagedata['uniqid']));
     foreach ($scorem as $key => $value) {
         $summ = $summ + $value['score'];
     }
     $pagedata['summ'] = $summ;
     $scored = $chrule->getList('score', array('category' => '处置能力', 'detail' => null, 'uniqid' => $pagedata['uniqid']));
     foreach ($scored as $key => $value) {
         $sumd = $sumd + $value['score'];
     }
     $pagedata['sumd'] = $sumd;
     $scoresv = $chrule->getList('score', array('category' => '服务能力', 'detail' => null, 'uniqid' => $pagedata['uniqid']));
     foreach ($scoresv as $key => $value) {
         $sumsv = $sumsv + $value['score'];
     }
     $pagedata['sumsv'] = $sumsv;
     return view::make('topc/member/shoppubt/tenderule.html', $pagedata);
 }
Пример #22
0
 public function addSelfUser()
 {
     $objShop = kernel::single('sysshop_data_shop');
     $shopList = $objShop->fetchListShopInfo('shop_id,shop_name', array('shop_type' => 'self'));
     $pagedata['shopList'] = $shopList;
     $this->contentHeaderTitle = '添加自营用户';
     return view::make('sysshop/admin/seller/addSelfUser.html', $pagedata);
 }
Пример #23
0
 public function import_view()
 {
     $pagedata['check_policy'] = $this->check_policy();
     $pagedata['params'] = $_GET['_params'];
     //支持导出类型
     $pagedata['import_type'] = $this->import_support_filetype();
     return view::make('importexport/admin/import/import.html', $pagedata);
 }
Пример #24
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function getTareas()
 {
     $tareas = Tarea::getTareass();
     $proyectos = Proyecto::all();
     $usuarios = Usuario::all();
     $estatus = Estatus::all('id_estatus');
     return view::make('tareasadmin', compact('tareas', 'proyectos', 'usuarios', 'estatus'));
 }
Пример #25
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);
 }
Пример #26
0
 public function testViewFactory()
 {
     //        var_dump(base_facades_view::make());
     var_dump(view::make());
     exit;
     //::make('abc');
     $this->assertEquals(true, true);
 }
Пример #27
0
 public function create($gradeId)
 {
     if ($gradeId) {
         $objMdlGrade = app::get('sysuser')->model('user_grade');
         $pagedata['grade'] = $objMdlGrade->getRow('*', array('grade_id' => $gradeId));
     }
     return view::make('sysuser/admin/user/grade.html', $pagedata);
 }
Пример #28
0
 public function active()
 {
     $pagedata['conf'] = base_setup_config::deploy_info();
     $pagedata['callback_ur'] = base64_encode(kernel::base_url(1) . '/index.php/entermembercenter/default/success');
     $pagedata['enterprise_url'] = config::get('link.shop_user_enterprise');
     $output = view::make('entermembercenter/installer-active.html', $pagedata)->render();
     return str_replace('%BASE_URL%', kernel::base_url(1), $output);
 }
Пример #29
0
 function page($html, $pagedata = array())
 {
     $menus = array('project' => app::get('dev')->_('项目'), 'apps' => app::get('dev')->_('应用程序'), 'doc' => app::get('dev')->_('文档'), 'setting' => app::get('dev')->_('系统设置'));
     $pagedata['__CUR_MENU__'] = $this->workground;
     $pagedata['__MENUS__'] = $menus;
     $pagedata['__PAGE__'] = $html;
     return view::make('dev/frame.html', $pagedata);
 }
Пример #30
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Session::get('fingerprint') == md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR'])) {
         return view::make('dasboard.index');
     } else {
         return Redirect::to('login');
     }
 }