function xt_row_tixian($tixian, $count, $type = "BUY") { ?> <tr id="tixian-<?php echo $tixian->id; ?> " <?php echo $count % 2 == 0 ? 'class="alternate"' : ''; ?> > <td> <span> <?php echo xt_row_tixian_status($tixian->status); ?> <?php if ($tixian->status == 0) { ?> (<a href="javascript:;" class="status" data-id="<?php echo $tixian->id; ?> " data-account="<?php echo esc_html($tixian->alipay); ?> " data-account-name="<?php echo esc_html($tixian->alipay_name); ?> " data-max="<?php echo $tixian->cash ? $tixian->cash : 0; ?> " data-max-jifen="<?php echo $tixian->jifen ? $tixian->jifen : 0; ?> ">支付</a>)<?php } ?> </span> </td> <td> <span><a href="http://<?php echo add_query_arg(array('user_id' => $tixian->user_id, 'paged' => 1, 's' => '', 'status' => -1), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?> "><?php echo $tixian->user_login; ?> </a></span> </td> <td> <p>现金: <span><?php echo $tixian->cash; ?> </p> <p><?php echo xt_jifenbao_text(); ?> : <span><?php echo intval($tixian->jifen); ?> </p> </td> <td> <p>现金: <span><?php echo $tixian->freeze; ?> </p> <p><?php echo xt_jifenbao_text(); ?> : <span><?php echo intval($tixian->freeze_jifen); ?> </p> </td> <td> <p>支付宝:<?php echo $tixian->alipay; ?> </p> <p>实名:<?php echo $tixian->alipay_name; ?> </p> </td> <td> <p>邮箱:<?php echo $tixian->user_email; ?> </p> <p>Q Q:<?php echo $tixian->qq; ?> </p> <p>手机:<?php echo $tixian->mobile; ?> </p> </td> <td> <p>创建时间:<?php echo $tixian->create_time; ?> </p> <?php if (!empty($tixian->opertor)) { ?> <p>操作员:<?php echo $tixian->opertor; ?> </p> <p>操作时间:<?php echo $tixian->update_time; ?> </p> <?php } ?> <?php if (!empty($tixian->content)) { ?> <p>备注:<?php echo $tixian->content; ?> </p><?php } ?> </td> </tr> <?php }
function xt_admin_ajax_jifen_item_update() { $result = array('code' => 0, 'msg' => '', 'result' => array()); if (!isset($_POST['id']) || empty($_POST['id'])) { exit('未指定商品'); } if (!isset($_POST['title']) || empty($_POST['title'])) { exit('未指定商品标题'); } if (!isset($_POST['pic']) || empty($_POST['pic'])) { exit('未指定商品图标地址'); } if (!isset($_POST['sort']) || empty($_POST['sort'])) { exit('未指定商品排序'); } if (!isset($_POST['stock']) || empty($_POST['stock'])) { exit('未指定商品库存'); } if (!isset($_POST['jifen']) || empty($_POST['jifen'])) { exit('未指定商品兑换' . xt_jifenbao_text()); } if (!isset($_POST['userCount']) || empty($_POST['userCount'])) { exit('未指定商品每人限兑数量'); } global $wpdb; $id = (int) $_POST['id']; $title = $_POST['title']; $pic = $_POST['pic']; $sort = $_POST['sort']; $stock = $_POST['stock']; $jifen = $_POST['jifen']; $user_count = $_POST['userCount']; $wpdb->update(XT_TABLE_USER_JIFEN_ITEM, array('title' => $title, 'pic' => $pic, 'sort' => (int) $sort, 'stock' => (int) $stock, 'jifen' => (int) $jifen, 'user_count' => $user_count, 'content' => isset($_POST['content']) ? $wpdb->escape($_POST['content']) : ''), array('id' => $id)); $item = $wpdb->get_row('SELECT * FROM ' . XT_TABLE_USER_JIFEN_ITEM . ' WHERE id=' . $wpdb->escape($id)); exit(xt_row_jifenItem($item, isset($_POST['alternate']) && $_POST['alternate'] ? 0 : 1)); }
<ul class="nav nav-list"> <?php if (xt_is_fanxian()) { ?> <li class="nav-header">返现管理</li> <li class="active"><a href="#info" id="X_Account-Info-A"><i class="icon-home"></i>我的账户</a></li> <li><a href="#orders" id="X_Account-Orders-A"><i class="icon-list-alt"></i>我的订单</a></li> <li><a href="#unorders" id="X_Account-Unorders-A"><i class="icon-search"></i>找回订单</a></li> <?php if (xt_fanxian_is_ad() || xt_fanxian_is_share()) { ?> <li><a href="#tuiguang" id="X_Account-Tuiguang-A"><i class="icon-share"></i>我的推广</a></li><?php } ?> <!--<li><a href="#jifen" id="X_Account-Jifen-A"><i class="icon-gift"></i>我的<?php echo xt_jifenbao_text(); ?> </a></li>--> <?php } ?> <li class="nav-header">账户设置</li> <li><a href="#profile" id="X_Account-Profile-A"><i class="icon-user"></i>个人信息</a></li> <li><a href="#bind" id="X_Account-Bind-A"><i class="icon-cog"></i>账号绑定</a></li> </ul> </div> </div> <div class="span10 X_Region X_Region_Span10"> <div id="X_Account-Content" class="xt-account-content clearfix"> <div id="X_Account-Container" class="xt-account-container"> <div class="xt-account-main" style="background:white;">
function xt_row_user($user, $count) { global $wp_roles; $_roles = unserialize($user->role); $_role = array(); if (!empty($_roles)) { foreach ($_roles as $_r => $_v) { if ($_v) { $_role[] = isset($wp_roles->role_names[$_r]) ? translate_user_role($wp_roles->role_names[$_r]) : '未知'; } } } $_counts = xt_user_counts($user->counts); $_parent = array(); if (!empty($user->parent)) { $_parent = unserialize($user->parent); } $parent_url = 'http://' . add_query_arg(array('s' => '', 'paged' => 1, 'issys' => -1, 'parent_id' => 'PARENT_ID'), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?> <tr id="user-<?php echo $user->ID; ?> " <?php echo $count % 2 == 0 ? 'class="alternate"' : ''; ?> > <td><?php echo $user->ID; ?> </td> <td><span><?php echo $user->user_login; ?> </span></td> <td><span><?php echo implode(',', $_role); ?> </span></td> <td><?php echo !empty($_parent) ? '<a href="' . str_replace('PARENT_ID', $_parent['id'], $parent_url) . '">' . $_parent['name'] . '</a>' : ''; ?> </td> <td><?php echo $user->user_email; ?> </td> <td> <p>现金:<?php echo $_counts[XT_USER_COUNT_CASH]; ?> </p> <p><?php echo xt_jifenbao_text(); ?> :<?php echo $_counts[XT_USER_COUNT_JIFEN]; ?> </p> <p>分享:<?php echo $_counts[XT_USER_COUNT_SHARE]; ?> </p> <p>专辑:<?php echo $_counts[XT_USER_COUNT_ALBUM]; ?> </p> </td> <td><?php echo gmdate('Y-m-d H:i:s', mysql2date('G', $user->user_registered) + get_option('gmt_offset') * 3600); ?> </td> </tr> <?php }
function xt_ajax_account_jifen_exchange() { $result = array('code' => 0, 'msg' => '', 'result' => array()); if (!isset($_POST['id']) || empty($_POST['id'])) { $result['code'] = 500; $result['msg'] = '未指定要兑换的商品'; exit(json_encode($result)); } $user = wp_get_current_user(); if ($user->exists()) { $jifen = xt_user_total_jifen($user->ID); $jifenOrder = $jifen > 0 ? xt_user_total_jifen_order($user->ID) : array(0, 0, 0); global $wpdb; $item = $wpdb->get_row('SELECT * FROM ' . XT_TABLE_USER_JIFEN_ITEM . ' WHERE id=' . (int) $_POST['id']); if (empty($item)) { $result['code'] = 500; $result['msg'] = '您要兑换的商品不存在'; } if ($item->stock - $item->buy_count <= 0) { $result['code'] = 500; $result['msg'] = '库存不足,无法兑换'; } if ($item->jifen > $jifen - $jifenOrder[0] - $jifenOrder[1]) { $result['code'] = 500; $result['msg'] = xt_jifenbao_text() . '不足,无法兑换'; } $count = $wpdb->get_var('SELECT COUNT(*) FROM ' . XT_TABLE_USER_JIFEN_ORDER . ' WHERE item_id=' . $item->id . ' AND user_id=' . $user->ID); if ($count >= $item->user_count) { $result['code'] = 500; $result['msg'] = '超出每人限兑数量'; } if ($result['code'] == 0) { if ($wpdb->insert(XT_TABLE_USER_JIFEN_ORDER, array('item_id' => $item->id, 'num' => 1, 'jifen' => $item->jifen, 'status' => 0, 'create_time' => current_time('mysql'), 'user_id' => $user->ID, 'user_name' => $user->user_login))) { $wpdb->update(XT_TABLE_USER_JIFEN_ITEM, array('buy_count' => $item->buy_count + 1), array('id' => $item->id)); } } } else { $result['code'] = 500; $result['msg'] = '未登录'; } exit(json_encode($result)); }
function get_the_share_detail_template() { global $xt_user_avatar; $cacheObj = get_the_share_cachedata(); $_item = $cacheObj['item']; $_title = get_the_share_title(); $_fxText = '元'; $isJifenbao = xt_fanxian_is_jifenbao(get_the_share_fromtype()); if ($isJifenbao) { $_fxText = xt_jifenbao_text(); } ?> <script type="text/javascript"> if(typeof(XT)!='undefined'){XT.share_id=<?php the_share_id(); ?> ;} </script> <div class="row-fluid" style="background-color:white;"> <div class="span12 media well well-small" style="margin-left:0px;margin-bottom:0px;"> <a style="display:block;width:40px;" class="pull-left X_Nick" data-value="<?php echo get_the_share_userid(); ?> " href="<?php xt_the_user_url(get_the_share_userid()); ?> " target="_blank" rel="nofollow"><img src="<?php xt_the_user_pic($xt_user_avatar); ?> " style="width:40px;height:40px;"></a> <div class="media-body"> <h5 class="media-heading"><a class="xt-red X_Nick" data-value="<?php echo get_the_share_userid(); ?> " href="<?php xt_the_user_url(get_the_share_userid()); ?> " target="_blank"><?php the_share_username(); ?> </a> 分享了该宝贝<span class="pull-right"><?php the_share_time_human(); ?> </span></h5> <div class="media" style="margin-top:0px;"><?php the_share_content(); ?> </div> </div> </div> <div class="span12 media" style="margin-left:0px;padding:5px;"> <div class="pull-left"> <a rel="nofollow" href="<?php the_share_go(); ?> " target="_blank"> <img src="<?php the_share_picurl(450); ?> " alt="<?php echo $_title; ?> "/> <?php echo get_the_admin_tool_share(get_the_share_id()); ?> </a> </div> <div class="pull-left" style="width:250px"> <h1 style="font-size:16px;line-height:22px;margin-top: 0px;"><?php echo '<img src="' . get_the_share_ico() . '"/>'; ?> <a rel="nofollow" title="<?php echo $_title; ?> " target="_blank" href="<?php the_share_go(); ?> "><?php echo $_title; ?> </a></h1> <a id="X_Share-Detail-Buy" data-from="<?php echo get_the_share_fromtype(); ?> " data-type="<?php echo $isJifenbao ? 'jifenbao' : 'cash'; ?> " data-id="<?php echo get_the_share_key(); ?> " href="<?php the_share_go(); ?> " target="_blank" rel="nofollow" class="btn btn-primary" style="padding:4px 20px;font-size:16px;font-weight:bold;">¥<?php the_share_price(); ?> 去购买</a> <?php if (xt_fanxian_is_sharebuy()) { ?> <div class="clearfix"><?php echo xt_fanxian_html('{fx}', $_fxText, 'margin-top:10px;'); ?> </div> <?php } ?> <div class="clearfix" style="margin-top:10px;padding-bottom: 10px;border-bottom: 1px solid #EAEAEA;"> <a class="badge badge-fav" title="喜欢" data-id="<?php the_share_id(); ?> " data-type="1" data-uid="<?php the_share_userid(); ?> "><?php the_share_favcount(); ?> <i class="icon-heart icon-white"></i></a> <!--<a href="javascript:;" class="xt-album-add" data-id="<?php //the_share_id() ?> " data-pic="<?php //the_share_picurl(160) ?> ">加入专辑</a>--> </div> <div class="well well-small clearfix" style="margin-top:15px;"> <?php $_tags = explode(" ", get_the_share_tags()); foreach ($_tags as $_tag) { echo "<a href=\"" . xt_get_shares_search_url(array('s' => $_tag)) . "\" target=\"_blank\" style=\"float: left;margin-left: 8px;\">{$_tag}</a>"; } ?> </div> <?php $bdshare = xt_bdshare(); if ($bdshare > 0) { ?> <!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_b" style="line-height: 12px;"><img src="http://share.baidu.com/static/images/type-button-1.jpg" /> <a class="shareCount"></a> </div> <script type="text/javascript"> document.getElementById("bdshell_js").src = "http://share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours(); </script> <!-- Baidu Button END --> <?php } ?> </div> </div> </div> <?php }
if (!in_array($type, array('cash', 'jifenbao'))) { $type = 'cash'; } $_fanxian = 0; $_tixian = 0; $_cash = 0; $_cash_text = '元'; if ($type == 'cash') { $_fanxian = xt_user_total_fanxian($user->ID); $_tixians = xt_total_tixian($user->ID); $_tixian = $_tixians[0] + $_tixians[1]; //未审核,已完成 $_cash = $_fanxian - $_tixian; //余额 } else { $_cash_text = xt_jifenbao_text(); $_fanxian = xt_user_total_jifen($user->ID); $_tixians = xt_total_tixian_jifen($user->ID); $_tixian = $_tixians[0] + $_tixians[1]; //未审核,已完成 $_cash = $_fanxian - $_tixian; //余额 } ?> <form class="xt-form-tixian"> <?php $account_field = XT_USER_ALIPAY; $account = $user->{$account_field}; $account_name_field = XT_USER_ALIPAY_NAME; $account_name = $user->{$account_name_field};
function xt_menu_fanxian() { $action = _xt_submenu_action_fanxian(); ?> <style type="text/css"> .widefat td{vertical-align: middle;}.widefat td p{margin-bottom:2px;} .xt-help-link{margin:0 2px 0 0;display: block;float:left;width:16px;height:16px;background: url("<?php echo XT_CORE_IMAGES_URL; ?> /help.png") no-repeat;} </style> <div class="wrap"> <h2 class="nav-tab-wrapper"> <a href="<?php echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=taobao'); ?> " class="nav-tab<?php echo $action == 'taobao' ? ' nav-tab-active' : ''; ?> ">淘宝</a> <a href="<?php echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=paipai'); ?> " class="nav-tab<?php echo $action == 'paipai' ? ' nav-tab-active' : ''; ?> ">拍拍</a> <a href="<?php echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=yiqifa'); ?> " class="nav-tab<?php echo $action == 'yiqifa' ? ' nav-tab-active' : ''; ?> ">商城</a> <a href="<?php echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=cash'); ?> " class="nav-tab<?php echo $action == 'cash' ? ' nav-tab-active' : ''; ?> ">提现记录</a> <a href="<?php echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=buy'); ?> " class="nav-tab<?php echo $action == 'buy' ? ' nav-tab-active' : ''; ?> ">购买返现</a> <a href="<?php echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=ads'); ?> " class="nav-tab<?php echo $action == 'ads' ? ' nav-tab-active' : ''; ?> ">推广返现</a> <!--<a href="<?php echo admin_url('admin.php?page=xt_menu_fanxian&xt-action=jifen'); ?> " class="nav-tab<?php echo $action == 'jifen' ? ' nav-tab-active' : ''; ?> "><?php echo xt_jifenbao_text(); ?> </a>--> </h2> <?php require_once XT_PLUGIN_DIR . '/xt-admin/fanxian_' . $action . '.php'; ?> </div> <?php }
if (isset($_REQUEST['type']) && ($_REQUEST['type'] == 'tuan' || $_REQUEST['type'] == 'bijia')) { $_url = urldecode($_url); } ?> <div class="row-fluid"> <div class="span12" style="min-height: 0px;"> <?php if ($_fx > 0 && xt_is_fanxian()) { ?> <div class="alert" style="width:630px;margin:0 auto;margin-bottom: 15px;"> <span>登录后购买最高可返还 <strong class="text-default"><?php echo $_REQUEST['fx']; ?> </strong> <span><?php echo isset($_REQUEST['from_type']) && xt_fanxian_is_jifenbao($_REQUEST['from_type']) ? xt_jifenbao_text() : '元'; ?> </span>。</span> <a target="_top" href="<?php echo $_url; ?> ">先购物,再返利</a> </div> <?php } elseif (isset($_REQUEST['fx'])) { ?> <div class="alert" style="width:630px;margin:0 auto;margin-bottom: 15px;"> <a target="_top" href="<?php echo $_url; ?> ">不登录,直接访问</a>
function xt_widget_template_grid_sidesmall($args) { extract($args); ?> <div class="hd"> <h4 class="xt-bd-l" <?php echo !empty($title) ? '' : 'style="display:none"'; ?> ><span><?php echo $title; ?> </span></h4> </div> <div class="bd"> <ul class="media-list"> <?php if (!empty($items)) { $rate = xt_get_rate(); $_count = 0; if (empty($count)) { $count = count($items); } $fanxianText = '元'; $platform = ''; $isJifenbao = false; if ($type == 'taobao' || $type == 'coupon' || $type == 'temai') { $platform = 'taobao'; } elseif ($type == 'paipai') { $platform = 'paipai'; } if ($platform) { if (xt_fanxian_is_jifenbao($platform)) { $isJifenbao = true; $fanxianText = xt_jifenbao_text(); } } foreach ($items as $item) { if ($_count >= $count) { break; } switch ($type) { case 'taobao': xt_widget_template_grid_sidesmall_item_taobao($_count, $rate, $item, $isJifenbao, $fanxianText); break; case 'paipai': xt_widget_template_grid_sidesmall_item_paipai($_count, $rate, $item, $isJifenbao, $fanxianText); break; case 'share': xt_widget_template_grid_sidesmall_item_share($_count, $rate, $item); break; case 'coupon': xt_widget_template_grid_sidesmall_item_coupon($_count, $rate, $item, $isJifenbao, $fanxianText); break; case 'temai': xt_widget_template_grid_sidesmall_item_temai($_count, $rate, $item, $isJifenbao, $fanxianText); break; case 'bijia': xt_widget_template_grid_sidesmall_item_bijia($_count, $rate, $item); break; case 'tuan': xt_widget_template_grid_sidesmall_item_tuan($_count, $rate, $item); break; } $_count++; } ?> <?php } ?> </ul> </div> <?php }