function get_detail_html($record) { $sm = get_smarty(); $sm->assign("r", $record); return $sm->fetch("pages/detail.html"); }
public function index() { $smarty = get_smarty(); $this->_header($smarty); $username = User::getLoginUsername(); $smarty->assign('username', $username); //我的朋友 $my_friend_url = url("myweb", "friend::myfriend"); $smarty->assign("my_friend_url", $my_friend_url); //登录链接 $login_url = url("myweb", "login::index"); $smarty->assign("login_url", $login_url); //信息提醒 $msg_url = url("myweb", "friend::msg"); $smarty->assign("msg_url", $msg_url); $uid = User::getLoginUid(); if ($uid == '1' || $uid == '2') { $is_love = 'yes'; $love_url = url("myweb", "home::index", 1); } elseif ($uid == '3' || $uid == '4') { $is_love = 'yes'; $love_url = url("myweb", "home::index", 2); } else { $is_love = 'no'; $love_url = url("myweb", "home::index"); } $smarty->assign("is_love", $is_love); $smarty->assign("love_url", $love_url); $smarty->display('myweb/usercenter/index.html'); }
public function photolist($act) { $smarty = get_smarty(); $this->_header($smarty); $dir_id = explode('_', $act); if (!isset($dir_id[1])) { $dir_id[1] = null; } $uid = User::getLoginUid(); //获取列表 $list = UploadFile::getList($dir_id[1], $uid); $smarty->assign("user_photo_list", $list); //返回 $return_url = url("myweb", "photo::index"); $smarty->assign("return_url", $return_url); //更换封面 $change_title_photo_url = url("myweb", "photo::covers", $dir_id[1]); $smarty->assign("change_title_photo_url", $change_title_photo_url); //pc上传 $upload_url = url("myweb", "photo::upload", $dir_id[1]); $smarty->assign("upload_url", $upload_url); //手机端上传文件链接 $upload_mobile_url = url("myweb", "photo::mobileupload", $dir_id[1], $uid); $smarty->assign("upload_mobile_url", $upload_mobile_url); //删除文件链接 $select_del_url = url("myweb", "photo::ajaxdel", $dir_id[1]); $smarty->assign("select_del_url", $select_del_url); $smarty->display("myweb/usercenter/upload.html"); }
/** * 根据用户点击找回密码的url来寻找是哪一个email * 并且检查是否过期,是否被使用过了 */ public function checkcode($code) { $rs = self::_checkCode($code); $smarty = get_smarty(); $url = url("myweb", "fpw::npw"); $smarty->assign('code', $code); $smarty->assign('url', $url); $smarty->display('myweb/findpassword/password_update.html'); }
/** * 根据用户点击找回密码的url来寻找是哪一个email * 并且检查是否过期,是否被使用过了 */ public function checkcode($code) { $rs = self::_checkCode($code); $smarty = get_smarty(); $url = url("login", "passwd::newpasswd"); $smarty->assign('code', $code); $smarty->assign('url', $url); $smarty->display('login/password_update.html'); }
public function index() { $smarty = get_smarty(); $this->_show($smarty); //列表 $goodslist_url = url('goods', 'goods::index'); $smarty->assign('goodslist_url', $goodslist_url); $smarty->display('goods/index.html'); }
function get_detail_text($record, $is_text) { $sm = get_smarty(); $sm->assign("is_text", $is_text); $sm->assign("r", $record); return $sm->fetch("email/send_message.txt"); }
function get_one_result_html($record) { $p = new SiteParse(); $sm = get_smarty(); $record["info_keys"] = $p->detail_keys; if ($saved = ar_get('saved', $_SESSION)) { $record["is_saved"] = array_key_exists($bibid, $saved); } $sm->assign("r", $record); $html = $sm->fetch("pages/detail_all.html"); return $html; }
public function index() { $smarty = get_smarty(); //注册账号链接 $reg_action_url = url("myweb", "reg::reging"); $smarty->assign("reg_action_url", $reg_action_url); //验证码图片链接 $captcha_url = HOMEURL . "plugins/captcha/captcha.php?a="; $smarty->assign("captcha_url", $captcha_url); //已有账号,去登录链接 $login_url = url("myweb", "login::index"); $smarty->assign("login_url", $login_url); $smarty->display("myweb/register/register.html"); }
function get_smarty_header($data, $auth, $perm ) { $smarty = get_smarty(); $smarty->assign("uname",$auth->auth[uname]); global $company_logo_image; $smarty->assign("company_logo_image", $company_logo_image); if ($perm->have_perm('SUPER') ) { $smarty->assign("admin_reseller",1); $smarty->assign("admin_clients",1); } if ($perm->have_perm('SUPER') || $perm->have_perm('RESELLER') ) { ## they are allowed to view more than one domain // change_domain(); $smarty->assign("admin_domain",1); $opts = $data->get_domain_options(null,null); $udomain_values = $opts[0]; $udomain_output = $opts[1]; $smarty->assign("udomain_values", $udomain_values); $smarty->assign("udomain_output", $udomain_output); global $adomain; if ($adomain) { $smarty->assign("udomain_selected", $adomain); } else { $smarty->assign("udomain_selected", $auth->auth[udomain]); } } else { $smarty->assign("admin_domain",0); $smarty->assign("udomain",$auth->auth[udomain]); } if ($perm->have_perm('ADMIN') ) { $smarty->assign("admin_subscribers",1); $smarty->assign("admin_voicemail",1); } return $smarty ; }
public function index() { $smarty = get_smarty(); //找回密码链接 $findpassword_url = url("myweb", "fpw::index"); $smarty->assign("findpassword_url", $findpassword_url); //注册链接 $reg_url = url("myweb", "reg::index", "ready"); $smarty->assign("reg_url", $reg_url); //微博登陆链接 $weibo_login_url = WeiBoLogin::getWeiboLoginUrl(); $smarty->assign("weibo_login_url", $weibo_login_url); //QQ登陆链接 $qq_login_url = url("myweb", "qq::login"); $smarty->assign("qq_login_url", $qq_login_url); //检查登录账号链接 $login_action_url = url("myweb", "login::logining"); $smarty->assign("login_action_url", $login_action_url); $smarty->display("myweb/login/login.html"); }
public function zfb_order_done($order_id) { //检查orderid是不是本人的 Assert::num_gt_zero($order_id); $uid = User::get_login_id(); if (!$uid) { $url = URL . 'login'; header("Location:{$url}"); throw new Exception("exit"); } else { $result = OrderInfo::get_order_info($order_id); if (!$result) { header("location:" . URL); } $smarty = get_smarty(); //再去逛逛 $smarty->assign('homeurl', URL); //订单详情 $smarty->assign('order_detail_url', URL . 'weixin/usercenter/order_detail/' . $order_id); $smarty->display('web/home/order_success.html'); } }
public function index($love = 0) { $smarty = get_smarty(); $this->_header($smarty); //用户名 $username = User::getLoginUsername(); $smarty->assign('username', $username); //是否登录 if (User::getLoginUid()) { $smarty->assign("is_login", "yes"); } else { $smarty->assign("is_login", "no"); } if ($love == 1) { //h $smarty->display("myweb/love/index.html"); } elseif ($love == 2) { //w $smarty->display("myweb/love/love.html"); } else { //index $smarty->display("myweb/home/index.html"); } }
$begin_time = get_init_time('begin'); $log->log("begin time = $begin_time "); } if ($_POST[end_time] ){ $end_time = $_POST[end_time]; } else { // default value $end_time = get_init_time('end'); $log->log("end time = $end_time "); } $footer_smarty = get_smarty(); $header_smarty->assign('include_js_datepicker',1); $header_smarty->assign('conference_bg_flag',1); $header_smarty->display('app_header.tpl'); $smarty->assign('conference_name',$conference_name); $smarty->assign('conference_date',$conference_date); $smarty->assign( 'msgs', $msgs ); $smarty->assign('owner',$spUser->username); $smarty->assign('owner_name',$spUser->dbFields[first_name] . " " . $spUser->dbFields[last_name]); $smarty->assign('times',$times ); $smarty->assign('begin_time',$begin_time ); $smarty->assign('end_time',$end_time ); $smarty->display('new_conference.tpl'); $footer_smarty->display('app_footer.tpl');
function action_chat() { $user_id = $_SESSION['user_id']; $smarty = get_smarty(); $ecs = get_ecs(); $db = get_database(); /** * 判断当前用户是为聊天系统的注册用户 */ $exist = check_of_username_exist($user_id); // 获取用户头像 if (!empty($user_id)) { $sql = "select password, headimg from " . $ecs->table('users') . " where user_id = '{$user_id}'"; $row = $db->getRow($sql); $headimg = $row['headimg']; $password = $row['password']; $smarty->assign('headimg', $headimg); } if (!$exist) { // 查询ECShop内用户信息 $sql = 'select a.user_id, a.password, a.email, a.user_name from ' . $ecs->table('users') . ' AS a where a.user_id = "' . $user_id . '"'; $user = $GLOBALS['db']->getRow($sql); if (empty($user)) { // 根据user_id未查找到任何用户信息 } // 用户不存在,创建用户信息 $username = $user_id; $password = $user['password']; $name = $user['user_name']; $email = $user['email']; $type = 10; $shop_id = -1; $result = create_of_user($username, $password, $name, $email, $type, $shop_id); if ($result) { // 创建成功 } else { // 创建失败 } } // 获取前端传来的商品编号、订单编号、店铺编号等 // 商品编号则显示商品信息 // 订单编号则显示订单信息 // 店铺编号则显示店铺信息 $goods_id = null; $supp_id = -1; $order_id = null; $customers = null; // 获取客服信息 $tab_items = array(); // 客服类型 $cus_types = CUSTOMER_SERVICE; // 记录需要发给客服的URL if (!empty($_REQUEST['chat_goods_id'])) { /* 咨询商品信息 */ $goods_id = $_REQUEST['chat_goods_id']; $goods = goods_info($goods_id); $smarty->assign('chat_goods', $goods); $smarty->assign('chat_goods_id', $goods_id); // 获取店铺信息 $supp_id = null; $tab_items[] = array("id" => "chat_goods", "name" => "咨询商品"); // 客服+售前 $cus_types = CUSTOMER_SERVICE . ',' . CUSTOMER_PRE; } if (!empty($_REQUEST['chat_supp_id'])) { /* 店铺信息 */ $supp_id = $_REQUEST['chat_supp_id']; $supp_info = get_dianpu_baseinfo($supp_id); $smarty->assign('supp_info', $supp_info); $smarty->assign('chat_supp_id', $supp_id); $tab_items[] = array("id" => "chat_supp", "name" => "店铺信息"); // 客服+售前 $cus_types = CUSTOMER_SERVICE . ',' . CUSTOMER_PRE; } if (!empty($_REQUEST['chat_order_id'])) { /* 咨询订单信息 */ require 'includes/lib_order.php'; $order_id = $_REQUEST['chat_order_id']; // 获取商品和店铺信息 $goods_id = null; $supp_id = null; $order = order_info($order_id); $order['order_status_text'] = $GLOBALS['_LANG']['os'][$order['order_status']] . ',' . $GLOBALS['_LANG']['ps'][$order['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$order['shipping_status']]; $order['goods_list'] = order_goods($order_id); $smarty->assign('chat_order', $order); $smarty->assign('chat_order_id', $order_id); $smarty->assign('chat_order_sn', $order['order_sn']); $tab_items[] = array("id" => "chat_order", "name" => "咨询订单"); // 客服+售后 $cus_types = CUSTOMER_SERVICE . ',' . CUSTOMER_AFTER; } if (true) { /* 最近订单列表 */ require 'includes/lib_transaction_1.php'; // 获取用户最近的5条订单列表 $order_list = get_user_orders_1($user_id, 5, 0); // 所有客服忙碌状态,提示web端 $smarty->assign('order_list', $order_list); $smarty->assign('order_count', count($order_list)); $tab_items[] = array("id" => "chat_order_list", "name" => "最近订单"); // 客服 $cus_types = CUSTOMER_SERVICE; } // 获取客服信息 $customers = get_customers($cus_types, $supp_id); // 转换为JSON数据 $smarty->assign('tab_items', json_encode($tab_items)); $to = null; // 客服获取策略:0-顺序、1-随机、2-竞争 if (!empty($customers)) { // 暂时采用随机策略 $poliy = 1; if ($poliy == 0) { foreach ($customers as $customer) { $status = $customer['status']; if ($status == '在线' || $status == '空闲') { $to = $customer; break; // if(isset($customer['cus_status']) && count($customers) > 1) // { // if(time() - $customer['chat_time'] > 5*60) // { // set_customer_status($customer['cus_id'], 0); // $customer['cus_status'] = 0; // } // if($customer['cus_status'] == 0) // { // $to = $customer; // break; // } // } // else // { // $to = $customer; // break; // } } } } else { if ($poliy == 1) { /* 随进策略 */ $onlines = array(); foreach ($customers as $customer) { $status = $customer['status']; if ($status == '在线' || $status == '空闲') { $onlines[] = $customer; } } if (count($onlines) > 0) { $min = 1; $max = count($onlines); $i = mt_rand($min, $max); $to = $onlines[$i - 1]; } } else { } } if (empty($to)) { if ($supp_id == -1) { // 所有客服忙碌状态,提示web端 $smarty->assign('system_notice', '当前客服忙碌,请稍后联系!'); } else { // 所有客服忙碌状态,提示web端 $smarty->assign('system_notice', '当前店铺客服忙碌,请稍后联系!'); } } else { $xmpp_domain = get_xmpp_domain(); $_SESSION['OF_FROM'] = $user_id . '@' . $xmpp_domain; $_SESSION['OF_TO'] = $to['of_username'] . '@' . $xmpp_domain; $smarty->assign('from', $_SESSION['OF_FROM']); $smarty->assign('password', $password); // $smarty->assign('password', "123456"); $smarty->assign('to', '==to=='); $smarty->assign('username', $_SESSION['user_name']); $smarty->assign('customername', $to['cus_name']); // 存储在Session中方便其他地方使用 // 所有客服忙碌状态,提示web端 $smarty->assign('system_notice', '客服<span class="kf_name">' . $to['cus_name'] . '</span>已加入会话!'); } } else { // 所有客服忙碌状态,提示web端 $smarty->assign('system_notice', '当前客服忙碌,请稍后联系!'); } // 打开聊天页面 $smarty->display('chat.dwt'); }
public function vhosts() { //create file_name if (!empty($_POST['vhostsname'])) { $file_name = 'F:\\wamp\\www\\' . $_POST['vhostsname']; if (!is_dir($file_name)) { mkdir($file_name); //httpd-vhosts.conf $vhosts_name = 'F:\\wamp\\bin\\apache\\apache2.2.22\\conf\\extra\\httpd-vhosts.conf'; $search_vhosts = 'DocumentRoot "F:\\wamp\\www\\' . $_POST['vhostsname']; if (!in_array($search_vhosts, file($vhosts_name))) { $vhosts_content = "\r\n" . '<VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "F:\\wamp\\www\\' . $_POST['vhostsname'] . '" ServerName ' . $_POST['vhostsname'] . ' ErrorLog "logs/' . $_POST['vhostsname'] . '-error.log" CustomLog "logs/' . $_POST['vhostsname'] . '-access.log" common </VirtualHost>'; file_put_contents($vhosts_name, $vhosts_content, FILE_APPEND); } //hosts $hosts_name = 'C:\\Windows\\System32\\drivers\\etc\\hosts'; $hosts_content = "\r\n" . '127.0.0.1 ' . $_POST['vhostsname']; if (!in_array($hosts_content, file($hosts_name))) { file_put_contents($hosts_name, $hosts_content, FILE_APPEND); } } } $url = url("myweb", "Test::vhosts"); $smarty = get_smarty(); $smarty->assign("action_url", $url); $smarty->display("myweb/home/vhosts.html"); }
public function addtoorder() { //是否已经登录 User::isLogin(); if (!$_POST) { $url = url('goods', 'goods::balance'); header('Location:' . $url); throw new Exception('exit'); } $default_address_id = isset($_POST['shipping']) ? htmlspecialchars($_POST['shipping']) : 0; $payment = isset($_POST['payment']) ? htmlspecialchars($_POST['payment']) : ''; $is_mobile = isset($_POST['mobile']) ? htmlspecialchars($_POST['mobile']) : ''; $uid = LuS::get('uid'); $username = LuS::get('username'); $order_id = Cart::addOrder($uid, $username, $payment, $default_address_id); //订单详情页 $order_detail_url = url('usercenter', 'usercenter::detail', $order_id); //首页 $home_url = HOMEURL; //订单号 $order_info = OrderInfo::getUserOrderInfoByOrderId($uid, $order_id); //获取支付链接 $pay = GoodsM::getPayList($order_info['sn']); //货到付款 $hdfkpay_url = $order_detail_url; $smarty = get_smarty(); $smarty->assign('order_detail_url', $order_detail_url); $smarty->assign('home_url', $home_url); $str = $smarty->fetch('goods/order_success.html'); //增加一个订单id $return_arr = array(true, $str, $pay['alipay'], $pay['wxpay'], $pay['wxsaomapay'], $hdfkpay_url, $order_id); echo json_encode($return_arr); throw new Exception('exit'); }
public function detail($goods_id) { //检查登录 $this->_login(); if (!$goods_id) { $url = url('admin', 'admingoods::sale'); header('Location:' . $url); throw new Exception('exit'); } $goods_id = $goods_id + 0; //取出该商品信息 $goods_info = AdminGoodsM::getGoodsInfoByGoodsId($goods_id); $smarty = get_smarty(); $this->_goodsleft($smarty); //更新连接 $update_url = url('admin', 'admingoods::edit', $goods_id); $smarty->assign('update_url', $update_url); $smarty->assign('is_upload', false); $smarty->assign('goods_info', $goods_info); $smarty->display('admin/goods/index.html'); }
public function msg() { $smarty = get_smarty(); $this->_header($smarty); $uid = User::getLoginUid(); $msg_info_list = UserMsg::getUserMsgByUid($uid); if ($msg_info_list) { foreach ($msg_info_list as $key => $value) { $msg_info_list[$key]['accept_url'] = url("myweb", "friend::accept", $value['friend_id']); } } else { $msg_info_list = array(); } $smarty->assign("msg", $msg_info_list); //返回 $return_url = url("myweb", "friend::index"); $smarty->assign("return_url", $return_url); $smarty->display("myweb/usercenter/msg.html"); }
public function info($type_id, $id) { if (!$type_id || !$id) { echo '<script>history.go(-1);</script>'; throw new Exception('exit'); } $uid = User::getLoginUid(); $detail_info = JournalM::getJournalDetail($type_id, $id, $uid); if (!$detail_info) { echo '<script>history.go(-1);</script>'; throw new Exception('exit'); } $smarty = get_smarty(); $this->_header($smarty); //点赞数量 $goods_num = JournalGoods::getJournalGoodsCount($type_id, $detail_info['id']); $smarty->assign("goods_num", $goods_num); //评论数量 $comment_num = JournalComment::getJournalCommentCount($type_id, $detail_info['id']); $smarty->assign("comment_num", $comment_num); //是否已点赞 $is_goods = JournalGoods::getJournalGoodsCount($type_id, $detail_info['id']); if ($is_goods) { $smarty->assign("is_goods", "yes"); } else { $smarty->assign("is_goods", 'no'); } //公开日记链接 $public_url = url("myweb", "journal::index", 1); $public_count = JournalM::getJournalCount(1, $uid); $smarty->assign("public_count", $public_count); $smarty->assign("public_url", $public_url); //私密日记链接 $private_url = url("myweb", "journal::index", 2); $private_count = JournalM::getJournalCount(2, $uid); $smarty->assign("private_count", $private_count); $smarty->assign("private_url", $private_url); //日记点赞链接 $journal_good_url = url("myweb", "journal::good"); $smarty->assign("journal_good_url", $journal_good_url); //评论日记链接 $comment_url = url("myweb", "journal::comment", $detail_info['id']); $smarty->assign("comment_url", $comment_url); //日记内容修改链接 $content_edit_url = url("myweb", "journal::contentedit", $detail_info['id']); $smarty->assign("content_edit_url", $content_edit_url); $smarty->assign("uid", User::getLoginUid()); $smarty->assign("detail_info", $detail_info); $smarty->assign("type_id", $type_id); $smarty->display("myweb/usercenter/journal_detail.html"); }
public function editaddr($address_id) { $uid = LuS::get('uid'); //获取地址详情信息 $address = UserAddress::getAddrByAddressId($uid, $address_id); if (!$address) { echo "<script>alert('编辑错误!'); history.go(-1);</script>"; throw new Exception('exit'); } //如果手机号为空 if (!$address['mobile']) { $address['mobile'] = ''; } $smarty = get_smarty(); //获取省份列表 $province_list = RegionM::getProvinces(); $smarty->assign('province', $province_list); //获取城市列表 $city_list = RegionM::getCitys($address['province']); $smarty->assign('city', $city_list); //获取地区列表 $district_list = RegionM::getDistricts($address['city']); $smarty->assign('district', $district_list); //ajax获取城市列表地址 $addr_get_city_url = url('region', 'region::getcitys'); $smarty->assign('addr_get_city_url', $addr_get_city_url); //ajax获取地区列表地址 $addr_get_dist_url = url('region', 'region::getdistricts'); $smarty->assign('addr_get_dist_url', $addr_get_dist_url); //添加新地址action $addr_edit_act_url = url('usercenter', 'usercenter::editactaddr', $address['address_id']); $smarty->assign('addr_edit_act_url', $addr_edit_act_url); $smarty->assign("address", $address); $smarty->display('usercenter/usercenter_addr_edit.html'); }
<? require_once("util.php"); # don't want nojs return-to-search navigation in saved list items. clear_prev_search(); $sm = get_smarty(); $p = new SiteParse(); try { $saved = ar_get('saved', $_SESSION); $records = array(); if(!isset($_COOKIE['PHPSESSID'])) $sm->assign('cookies_disabled', true); if ($saved) { foreach (array_keys($saved) as $pos_bibid) { $bibid = valid_bibid($pos_bibid); $record = $p->get_record($bibid); $record['info_keys'] = $p->detail_keys; $record['is_saved'] = true; $records[] = $record; } } $sm->assign("records", $records); header("Content-Type: text/html; charset=utf-8");
public function detail($order_id) { //检查登录 $this->_login(); $smarty = get_smarty(); $this->_orderleft($smarty); //取出订单信息 $order_info = OrderInfo::getOrderInfoByOrderId($order_id); if (!$order_info) { //不存在该订单,返回到全部订单列表页 $url = url('admin', 'adminorder::all'); header('Location:' . $url); throw new Exception('exit'); } //取出商品信息 $order_id = $order_info['order_id']; $goods_list = OrderGoodsInfo::getOrderGoodsInfoByOrderId($order_id); //获取省份列表 $province_list = RegionM::getProvinces(); $smarty->assign('province', $province_list); //获取市 $city_list = RegionM::getCitys($order_info['province']); $smarty->assign('city', $city_list); //获取区列表 $district_list = RegionM::getDistricts($order_info['city']); $smarty->assign('district', $district_list); //ajax获取城市列表地址 $addr_get_city_url = url('region', 'region::getcitys'); $smarty->assign('addr_get_city_url', $addr_get_city_url); //ajax获取地区列表地址 $addr_get_dist_url = url('region', 'region::getdistricts'); $smarty->assign('addr_get_dist_url', $addr_get_dist_url); //发货连接 $change_shipping_url = url('admin', 'adminorder::changeshipping', $order_id); $smarty->assign("change_shipping_url", $change_shipping_url); $smarty->assign("order_info", $order_info); $smarty->assign("goods_list", $goods_list); $smarty->assign("edit_detail_url", url('admin', 'adminorder::edit', $order_id)); //修改订单信息链接 $smarty->display('admin/order/order_info.html'); }
public function detail($cate_id) { if (!$cate_id) { return false; } $cate_id = $cate_id + 0; $cate_info = CateM::getCateInfoByCateId($cate_id); $smarty = get_smarty(); $this->_goodsleft($smarty); $act_url = url('admin', 'cate::edit', $cate_id); $smarty->assign('act_url', $act_url); $smarty->assign('is_detail', 'yes'); $smarty->assign('cate_info', $cate_info); $smarty->display('admin/cate/cate_add.html'); }