<?php
/*
Template Name: 商城中心
*/
if(!is_user_logged_in()){
	echo "<script>window.location.href='".wp_login_url()."';</script>";
}
get_header();
global $wpdb, $erphpdown_version;
$user_info=wp_get_current_user();
$moneyName = get_option('ice_name_alipay');
$erphp_life_name    = get_option('erphp_life_name')?get_option('erphp_life_name'):'终身VIP';
$erphp_year_name    = get_option('erphp_year_name')?get_option('erphp_year_name'):'包年VIP';
$erphp_quarter_name = get_option('erphp_quarter_name')?get_option('erphp_quarter_name'):'包季VIP';
$erphp_month_name  = get_option('erphp_month_name')?get_option('erphp_month_name'):'包月VIP';
$erphp_day_name  = get_option('erphp_day_name')?get_option('erphp_day_name'):'体验VIP';

function mobantu_paging($type,$paged,$max_page) {
	if ( $max_page <= 1 ) return;
	if ( empty( $paged ) ) $paged = 1;

	echo '<div class="pagination" style="float:left"><ul>';
	echo "<li><a class=extend href='?pd=$type&pp=1'>首页</a></li>";
	if($paged > 1){
		echo '<li class="prev-page"><a href="?pd='.$type.'&pp='.($paged-1).'">上一页</a></li>';
	}
	if ( $paged > 2 ) echo "<li><span> ... </span></li>";
	for( $i = $paged - 1; $i <= $paged + 3; $i++ ) {
		if ( $i > 0 && $i <= $max_page )
		{
			if($i == $paged)
				print "<li class=\"active\"><span>{$i}</span></li>";
			else
				print "<li><a href='?pd=$type&pp={$i}'><span>{$i}</span></a></li>";
		}
	}
	if ( $paged < $max_page - 3 ) echo "<li><span> ... </span></li>";
	if($paged < $max_page){
		echo '<li class="next-page"><a href="?pd='.$type.'&pp='.($paged+1).'">下一页</a></li>';
	}
	echo "<li><a class=extend href='?pd=$type&pp=$max_page'>尾页</a></li>";
	echo '</ul></div>';
}


if(isset($_POST['ice_alipay'])){
	$fee=get_option("ice_ali_money_site");
	$fee=isset($fee) ?$fee :100;
	$userMoney=$wpdb->get_row("select * from ".$wpdb->iceinfo." where ice_user_id=".$user_info->ID);
	if(!$userMoney){
		$okMoney=0;
	}else{
		$okMoney=$userMoney->ice_have_money - $userMoney->ice_get_money;

	}
	$ice_alipay = $wpdb->escape($_POST['ice_alipay']);
	$ice_name   = $wpdb->escape($_POST['ice_name']);
	$ice_money  = isset($_POST['ice_money']) && is_numeric($_POST['ice_money']) ?$_POST['ice_money'] :0;
	$ice_money = $wpdb->escape($ice_money);
	if($ice_money<get_option('ice_ali_money_limit'))
	{
		echo '<div class="alert"><p>提现金额至少得满'.get_option('ice_ali_money_limit').get_option('ice_name_alipay').'</p></div>';
	}
	elseif(empty($ice_name) || empty($ice_alipay))
	{
		echo '<div class="alert"><p>请输入支付宝帐号和姓名</p></div>';
	}
	elseif($ice_money > $okMoney)
	{
		echo '<div class="alert"><p>提现金额大于可提现金额'.$okMoney.'</p></div>';
	}
	else
	{

		$sql="insert into ".$wpdb->iceget."(ice_money,ice_user_id,ice_time,ice_success,ice_success_time,ice_note,ice_name,ice_alipay)values
			('".$ice_money."','".$user_info->ID."','".date("Y-m-d H:i:s")."',0,'".date("Y-m-d H:i:s")."','','$ice_name','$ice_alipay')";
		if($wpdb->query($sql))
		{
			addUserMoney($user_info->ID, '-'.$ice_money);
			echo '<div class="alert"><p>申请成功，等待管理员处理！</p></div>';
		}
		else
		{
			echo '<div class="alert"><p>系统错误，请稍后重试！</p></div>';
		}
	}
}

if(isset($_POST['paytype'])){
	$paytype=intval($_POST['paytype']);
	$doo = 1;

	if(isset($_POST['paytype']) && $paytype==1)
	{
		$url=constant("erphpdown")."payment/alipay.php?ice_money=".esc_sql($_POST['ice_money']);
	}
	elseif(isset($_POST['paytype']) && $paytype==5)
	{
		$url=constant("erphpdown")."payment/f2fpay.php?ice_money=".esc_sql($_POST['ice_money']);
	}
	elseif(isset($_POST['paytype']) && $paytype==4)
	{
		if(erphpdown_is_weixin() && get_option('ice_weixin_app')){
			$url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='.get_option('ice_weixin_appid').'&redirect_uri='.urlencode(constant("erphpdown")).'payment%2Fweixin.php%3Fice_money%3D'.esc_sql($_POST['ice_money']).'&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect';
		}else{
			$url=constant("erphpdown")."payment/weixin.php?ice_money=".esc_sql($_POST['ice_money']);
		}
	}
	elseif(isset($_POST['paytype']) && $paytype==7)
	{
		$url=constant("erphpdown")."payment/paypy.php?ice_money=".esc_sql($_POST['ice_money']);
	}
	elseif(isset($_POST['paytype']) && $paytype==8)
	{
		$url=constant("erphpdown")."payment/paypy.php?ice_money=".esc_sql($_POST['ice_money'])."&type=alipay";
	}
	elseif(isset($_POST['paytype']) && $paytype==2)
	{
		$url=constant("erphpdown")."payment/paypal.php?ice_money=".esc_sql($_POST['ice_money']);
	}
    elseif(isset($_POST['paytype']) && $paytype==18)
	{
		$url=constant("erphpdown")."payment/xhpay3.php?ice_money=".esc_sql($_POST['ice_money'])."&type=2";
	}
	elseif(isset($_POST['paytype']) && $paytype==17)
	{
		$url=constant("erphpdown")."payment/xhpay3.php?ice_money=".esc_sql($_POST['ice_money'])."&type=1";
	}
    elseif(isset($_POST['paytype']) && $paytype==13)
    {
        $url=constant("erphpdown")."payment/codepay.php?ice_money=".esc_sql($_POST['ice_money'])."&type=1";
    }elseif(isset($_POST['paytype']) && $paytype==14)
    {
        $url=constant("erphpdown")."payment/codepay.php?ice_money=".esc_sql($_POST['ice_money'])."&type=3";
    }elseif(isset($_POST['paytype']) && $paytype==15)
    {
        $url=constant("erphpdown")."payment/codepay.php?ice_money=".esc_sql($_POST['ice_money'])."&type=2";
    }
	else{

	}
	if($doo) echo "<script>location.href='".$url."'</script>";
	exit;
}

if(isset($_POST['userType'])){
	$userType=isset($_POST['userType']) && is_numeric($_POST['userType']) ?intval($_POST['userType']) :0;
	if($userType >5 && $userType < 11){
		$okMoney=erphpGetUserOkMoney();
		$priceArr=array('6'=>'ciphp_day_price','7'=>'ciphp_month_price','8'=>'ciphp_quarter_price','9'=>'ciphp_year_price','10'=>'ciphp_life_price');
		$priceType=$priceArr[$userType];
		$price=get_option($priceType);
		if(!$price){
			echo "<script>alert('此类型的会员价格错误，请稍候重试！');</script>";
		}elseif($okMoney < $price){
			echo "<script>alert('当前可用余额不足完成此次交易！');</script>";
		}elseif($okMoney >=$price){
			if(erphpSetUserMoneyXiaoFei($price)){
				if(userPayMemberSetData($userType)){
					addVipLog($price, $userType);
					$RefMoney=$wpdb->get_row("select * from ".$wpdb->users." where ID=".$user_info->ID);
					if($RefMoney->father_id > 0){
						addUserMoney($RefMoney->father_id,$price*get_option('ice_ali_money_ref')*0.01);
					}
				}else{
					echo "<script>alert('系统发生错误，请联系管理员！');</script>";
				}
			}else{
				echo "<script>alert('系统发生错误，请稍候重试！');</script>";
			}
		}else{
			echo "<script>alert('未定义的操作！');</script>";
		}
	}else{
		echo "<script>alert('会员类型错误！');</script>";
	}
}

if($_POST['action'] == 'card'){
	$cardnum = $wpdb->escape($_POST['epdcardnum']);
	$cardpass = $wpdb->escape($_POST['epdcardpass']);
	$result = checkDoCardResult($cardnum,$cardpass);
	if($result == '5'){
		echo "<script>alert('充值卡不存在！');</script>";
	}elseif($result == '0'){
		echo "<script>alert('充值卡已被使用！');</script>";
	}elseif($result == '2'){
		echo "<script>alert('充值卡密码错误！');</script>";
	}elseif($result == '1'){
		echo "<script>alert('充值成功！');</script>";
	}else{
		echo "<script>alert('系统错误，请稍后重试！');</script>";
	}
}elseif($_POST['action'] == 'mycredto'){
	$epdmycrednum = $wpdb->escape($_POST['epdmycrednum']);
	if(is_numeric($epdmycrednum) && $epdmycrednum > 0 && get_option('erphp_mycred') == 'yes'){
		if(floatval(mycred_get_users_cred( $user_info->ID )) < floatval($epdmycrednum*get_option('erphp_to_mycred'))){
			$mycred_core = get_option('mycred_pref_core');
			echo "<script>alert('mycred剩余".$mycred_core['name']['plural']."不足！');</script>";
		}
		else
		{
			mycred_add( '兑换', $user_info->ID, '-'.$epdmycrednum*get_option('erphp_to_mycred'), '兑换扣除%plural%!', date("Y-m-d H:i:s") );
			$money = $epdmycrednum;
			if(addUserMoney($user_info->ID, $money))
			{
				$sql="INSERT INTO $wpdb->icemoney (ice_money,ice_num,ice_user_id,ice_time,ice_success,ice_note,ice_success_time,ice_alipay)
				VALUES ('$money','".date("ymdhis").mt_rand(10000,99999)."','".$user_info->ID."','".date("Y-m-d H:i:s")."',1,'4','".date("Y-m-d H:i:s")."','')";
				$wpdb->query($sql);
				echo "<script>alert('兑换成功！');</script>";
			}
			else
			{
				echo "<script>alert('兑换失败！');</script>";
			}
		}
	}
}

?>

<!--CeoMax商城顶部-->
<link rel='stylesheet' href="<?php echo ERPHPDOWN_URL.'/static/profile/erphpdown.css?ver='.$erphpdown_version; ?>" type='text/css' media='all' />
<link rel='stylesheet' href="<?php bloginfo('template_url'); ?>/static/css/ceo-users-shop.css" type='text/css' media='all' />
<section id="ceo-users" class="ceo-container">
	<div class="pagewrapper clearfix" id="profile" >
		<aside class="pagesidebar">
		    <!--会员信息-->
		    <div class="ceo-users-uher">
		        <?php
                $get_avatar_html=get_avatar(get_current_user_id(), 100);
                if($get_avatar_html){
                    $get_avatar_html=str_replace(array('http://','https://'),'//',$get_avatar_html);
                }
                echo $get_avatar_html;
                ?>
		        <h1><?php echo $current_user->display_name; ?></h1>
		        <h2>
    		        <tr>
                        <td><?php
    					$ciphp_year_price    = get_option('ciphp_year_price');
    					$ciphp_quarter_price = get_option('ciphp_quarter_price');
    					$ciphp_month_price  = get_option('ciphp_month_price');
    					$ciphp_life_price  = get_option('ciphp_life_price');
    					$ciphp_day_price  = get_option('ciphp_day_price');

                        $userTypeId=getUsreMemberType();
                        if($userTypeId==6)
                        {
                            echo "您目前是".$erphp_day_name;
                        }
                        elseif($userTypeId==7)
                        {
                            echo "您目前是".$erphp_month_name;
                        }
                        elseif ($userTypeId==8)
                        {
                            echo "您目前是".$erphp_quarter_name;
                        }
                        elseif ($userTypeId==9)
                        {
                            echo "您目前是".$erphp_year_name;
                        }
    					elseif ($userTypeId==10)
                        {
                            echo "您目前是".$erphp_life_name;
                        }
                        else
                        {
                            echo '您未购买任何VIP服务';
                        }
                        ?>&nbsp;&nbsp;&nbsp;<?php echo ($userTypeId>0 && $userTypeId<10) ?'到期时间：'.getUsreMemberTypeEndTime() :''?><br /></td>
                    </tr>
                </h2>
                <p class="ceo-users-xztj">今日已下载 <b style="margin-right: 10px;"><?php echo get_user_erphpdown_count(); ?></b> 剩余可下载 <b><?php echo get_user_erphpdown_rest(); ?></b></p>
			    <?php
    				if(get_option('ice_ali_money_checkin')){
    					if(erphpdown_check_checkin($user_info->ID)){
    			      		echo '<a href="javascript:;" class="usercheck active">已签到</a>';
    			        }else{
    			      		echo '<a href="javascript:;" class="usercheck erphp-checkin">今日签到</a>';
    			        }
    			    }
    			?>
		    </div>
    		<!--会员信息-->
			<ul class="pagesider-menu">
				<!--<li <//?php if($_GET["pd"]=='info' || !isset($_GET["pd"])){?>class="active"<//?php }?> ><a href="?pd=info">会员主页</a></li>-->
				<li <?php if($_GET["pd"]=='money'){?>class="active"<?php }?> ><a href="?pd=money"><i class="iconfont icon-huiyuan"></i> 充值中心</a></li>
				<li <?php if($_GET["pd"]=='cart'){?>class="active"<?php }?> ><a href="?pd=cart"><i class="iconfont icon-dingdan"></i> 我的订单</a></li>
				<li <?php if($_GET["pd"]=='vip'){?>class="active"<?php }?> ><a href="?pd=vip"><i class="iconfont icon-becomeagoldsupplier"></i> VIP 记录 </a></li>
				<li <?php if($_GET["pd"]=='recharge'){?>class="active"<?php }?> ><a href="?pd=recharge" ><i class="iconfont icon-integral"></i> 充值记录</a></li>
				<li <?php if($_GET["pd"]=='feedback'){?>class="active"<?php }?> ><a href="?pd=feedback"><i class="iconfont icon-pinglun"></i> 我的工单</a></li>
				<li <?php if($_GET["pd"]=='ref'){?>class="active"<?php }?> ><a href="?pd=ref"><i class="iconfont icon-fenxiang"></i> 推广注册</a></li>
				<li <?php if($_GET["pd"]=='ref2'){?>class="active"<?php }?> ><a href="?pd=ref2"><i class="iconfont icon-credit-level"></i> 推广 VIP </a></li>
				<?php if(_ceo('ceo_users_cd_tx') == true ): ?>
				<li <?php if($_GET["pd"]=='tixian'){?>class="active"<?php }?> ><a href="?pd=tixian"><i class="iconfont icon-huati"></i> 站内提现</a></li>
				<li <?php if($_GET["pd"]=='outmo'){?>class="active"<?php }?> ><a href="?pd=outmo"><i class="iconfont icon-rili"></i> 提现记录</a></li>
				<?php endif; ?>
				<!--<li <//?php if($_GET["pd"]=='pass'){?>class="active"<//?php }?> ><a href="?pd=pass">修改密码</a></li>-->
				<li><a href="<?php echo wp_logout_url(home_url());?>"><i class="iconfont icon-resonserate"></i> 安全退出</a></li>
			</ul>
            <ul class="pagesider-menu-mobile ceo-user-apps-a user-menu author-menu ceo-padding-remove ceo-margin-remove" style="display: none">
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='money'){?>class="active"<?php }?> ><a href="?pd=money"><i class="iconfont icon-huiyuan"></i> 充值中心</a></li>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='cart'){?>class="active"<?php }?> ><a href="?pd=cart"><i class="iconfont icon-dingdan"></i> 我的订单</a></li>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='vip'){?>class="active"<?php }?> ><a href="?pd=vip"><i class="iconfont icon-becomeagoldsupplier"></i> VIP 记录 </a></li>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='recharge'){?>class="active"<?php }?> ><a href="?pd=recharge" ><i class="iconfont icon-integral"></i> 充值记录</a></li>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='feedback'){?>class="active"<?php }?> ><a href="?pd=feedback"><i class="iconfont icon-pinglun"></i> 我的工单</a></li>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='ref'){?>class="active"<?php }?> ><a href="?pd=ref"><i class="iconfont icon-fenxiang"></i> 推广注册</a></li>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='ref2'){?>class="active"<?php }?> ><a href="?pd=ref2"><i class="iconfont icon-credit-level"></i> 推广 VIP </a></li>
                <?php if(_ceo('ceo_users_cd_tx') == true ): ?>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='tixian'){?>class="active"<?php }?> ><a href="?pd=tixian"><i class="iconfont icon-huati"></i> 站内提现</a></li>
                <li class="ceo-display-inline-block " <?php if($_GET["pd"]=='outmo'){?>class="active"<?php }?> ><a href="?pd=outmo"><i class="iconfont icon-rili"></i> 提现记录</a></li>
                <?php endif; ?>
                <li class="ceo-display-inline-block "  ><a href="<?php echo wp_logout_url(home_url());?>"><i class="iconfont icon-resonserate"></i> 安全退出</a></li>
            </ul>
		</aside>
		<div class="pagecontent profile-content">
		    <!--账户信息-->
			<?php if($_GET["pd"]=='info' || !isset($_GET["pd"])){?>
			<div class="ceo-users-shop-padding">
			    <div class="ceo-users-shop-title">
                    <div class="ceo-users-shop-title-d">
                        <li class="ceo-users-shop-title-l">账户信息</li>
                    </div>
                </div>
    			<div id="infocenter">
    				<?php
    					global $current_user;
    				?>
    				<div class="profile-form">
    					<form action="" method="post">
    					<dl class="dl-horizontal">
    						<dt>登录名</dt>
    						<dd><?php echo esc_attr( $current_user->user_login ); ?></dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt>注册时间</dt>
    						<dd><?php echo get_date_from_gmt( $current_user->user_registered ) ?></dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt>昵称</dt>
    						<dd>
    							<input type="text" class="profile-input" id="mm_name" name="mm_name" value="<?php echo esc_attr( $current_user->nickname ) ?>">
    						</dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt>邮箱</dt>
    						<dd>
    							<input type="text" class="profile-input" id="mm_mail" name="mm_mail" value="<?php echo esc_attr( $current_user->user_email ) ?>">
    						</dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt>网址</dt>
    						<dd>
    							<input type="text" class="profile-input" id="mm_url" name="mm_url" value="<?php echo esc_attr( $current_user->user_url ) ?>">
    						</dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt>简介</dt>
    						<dd>
    							<textarea rows="4" class="profile-input" id="mm_desc" name="mm_desc"><?php echo esc_html( $current_user->description ); ?></textarea>
    						</dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt></dt>
    						<dd>
    							<input type="button" id="doprofile" value="保存" class="profile-btn" />
    						</dd>
    					</dl>
    					</form>
    				</div>
    			</div>
    		</div>
			<script type="text/javascript">
				jQuery(document).ready(function($){

					$("#doprofile").click(function(){
						var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/ ;
						if($("#mm_name").val().trim().length==0)
						{
							alert("请输入昵称");
						}
						else if(strlen($("#mm_name").val().trim())<4)
						{
							alert("昵称长度至少为4位");
						}
						else if(!reg.test($("#mm_mail").val().trim()))
						{
							alert("请输入正确邮箱，以免忘记密码时无法找回");
						}
						else
						{
							$("#doprofile").val("保存中...");
							$("#doprofile").css("width","80px");
							$.ajax({
								type: "post",
								url: "<?php echo ERPHPDOWN_URL; ?>/admin/action/ajax-profile.php",
								data: "do=profile&mm_name=" + $("#mm_name").val() + "&mm_mail=" + $("#mm_mail").val() + "&mm_url=" + $("#mm_url").val() + "&mm_desc=" + $("#mm_desc").val(),
								dataType: "text",
								success: function (data) {
									$("#doprofile").val("保存");
									$("#doprofile").css("width","60px");
									alert("修改成功");
								},
								error: function () {
								   $("#doprofile").val("保存");
									$("#doprofile").css("width","60px");
									alert("error");
								}
							});
						}
					});

				});
			</script>

			<!--充值记录-->
			<?php }elseif($_GET["pd"]=='recharge'){
				$totallists = $wpdb->get_var("SELECT count(*) FROM $wpdb->icemoney WHERE ice_success=1 and ice_user_id=".$user_info->ID);
				$ice_perpage = 12;
				$pages = ceil($totallists / $ice_perpage);
				$page=isset($_GET['pp']) ?intval($_GET['pp']) :1;
				$offset = $ice_perpage*($page-1);
				$lists = $wpdb->get_results("SELECT * FROM $wpdb->icemoney where ice_success=1 and ice_user_id=".$user_info->ID." order by ice_time DESC limit $offset,$ice_perpage");

				?>

            	<div class="ceo-users-shop-padding">
            	    <div class="ceo-users-shop-title">
                        <div class="ceo-users-shop-title-d">
                            <li class="ceo-users-shop-title-l">充值记录</li>
                        </div>
                    </div>
                	<table class="table table-hover table-striped">
    					<thead>
    						<tr>
    							<th>金额</th>
    							<th>方式</th>
    							<th>时间</th>
    						</tr>
    					</thead>
    					<tbody>
    						<?php
    							if($lists) {
    								foreach($lists as $value)
    								{
    									echo "<tr>\n";
    									echo "<td>$value->ice_money</td>\n";
    									if(intval($value->ice_note)==0)
    									{
    										echo "<td>在线充值</td>\n";
    									}elseif(intval($value->ice_note)==1)
    									{
    										echo "<td>后台充值</td>\n";
    									}
    									elseif(intval($value->ice_note)==2)
    									{
    										echo "<td>转账收</td>\n";
    									}
    									elseif(intval($value->ice_note)==3)
    									{
    										echo "<td>转账付</td>\n";
    									}elseif(intval($value->ice_note)==4)
    									{
    										echo "<td>积分兑换</td>\n";
    									}elseif(intval($value->ice_note)==6)
    									{
    										echo "<td>充值卡</td>\n";
    									}else{
    										echo "<td>未知</td>\n";
    									}

    									echo "<td>$value->ice_time</td>";
    									echo "</tr>";
    								}
    							}
    							else
    							{
    								echo '<tr width=100%><td colspan="3" align="center"><center><strong>没有记录！</strong></center></td></tr>';
    							}
    						?>
    					</tbody>
    				</table>
				</div>
				<?php mobantu_paging('recharge',$page,$pages);?>

				<!--VIP记录-->
			    <?php }elseif($_GET["pd"]=='vip'){
				$totallists = $wpdb->get_var("SELECT COUNT(ice_id) FROM $wpdb->vip where ice_user_id=".$user_info->ID);
				$ice_perpage = 12;
				$pages = ceil($totallists / $ice_perpage);
				$page=isset($_GET['pp']) ?intval($_GET['pp']) :1;
				$offset = $ice_perpage*($page-1);
				$lists = $wpdb->get_results("SELECT * FROM $wpdb->vip where ice_user_id=".$user_info->ID." order by ice_time DESC limit $offset,$ice_perpage");

				?>

            	<div class="ceo-users-shop-padding">
            	    <div class="ceo-users-shop-title">
                        <div class="ceo-users-shop-title-d">
                            <li class="ceo-users-shop-title-l">VIP记录</li>
                        </div>
                    </div>
                	<table class="table table-hover table-striped">
    					<thead>
    						<tr>
    							<th>VIP类型</th>
    							<th>价格</th>
    							<th>时间</th>
    						</tr>
    					</thead>
    					<tbody>
    						<?php
    							if($lists) {
    								foreach($lists as $value)
    								{
    									if($value->ice_user_type == 6) $typeName = $erphp_day_name;
    									else {$typeName=$value->ice_user_type==7 ?$erphp_month_name :($value->ice_user_type==8 ?$erphp_quarter_name : ($value->ice_user_type==10 ?$erphp_life_name : $erphp_year_name));}
    									echo "<tr>\n";
    									echo "<td>$typeName</td>\n";
    									echo "<td>$value->ice_price</td>\n";
    									echo "<td>$value->ice_time</td>\n";
    									echo "</tr>";
    								}
    							}
    							else
    							{
    								echo '<tr width=100%><td colspan="3" align="center"><center><strong>没有记录！</strong></center></td></tr>';
    							}
    						?>
    					</tbody>
    				</table>
				</div>
				<?php mobantu_paging('vip',$page,$pages);?>

				<!--推广注册-->
			    <?php }elseif($_GET["pd"]=='ref'){
				$totallists = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users WHERE father_id=".$user_info->ID);
				$ice_perpage = 12;
				$pages = ceil($totallists / $ice_perpage);
				$page=isset($_GET['pp']) ?intval($_GET['pp']) :1;
				$offset = $ice_perpage*($page-1);
				$lists = $wpdb->get_results("SELECT ID,user_login,user_registered FROM $wpdb->users where father_id=".$user_info->ID." limit $offset,$ice_perpage");
				?>
				<div class="ceo-users-shop-padding">
				    <div class="ceo-users-shop-title">
                        <div class="ceo-users-shop-title-d">
                            <li class="ceo-users-shop-title-l">推广注册</li>
                        </div>
                    </div>
    				<div class="alert">推广链接&nbsp;&nbsp;&nbsp;&nbsp;<?php echo esc_url( home_url( '/?aff=' ) ).$user_info->ID; ?></div>
                	<table class="table table-hover table-striped">
    					<thead>
    						<tr>
    							<th>用户ID</th>
    							<th>注册时间</th>
    							<th>消费额</th>
    						</tr>
    					</thead>
    					<tbody>
    						<?php
    							if($lists) {
    								foreach($lists as $value)
    								{
    									echo "<tr>\n";
    									echo "<td>$value->user_login</td>\n";
    									echo "<td>$value->user_registered</td>";
    									echo "<td>".erphpGetUserAllXiaofei($value->ID)."</td>";
    									echo "</tr>";
    								}
    							}
    							else
    							{
    								echo '<tr width=100%><td colspan="3" align="center"><center><strong>没有记录！</strong></center></td></tr>';
    							}
    						?>
    					</tbody>
    				</table>
    				<div class="ceo-user-alerts">
        	            <h4>推广说明：</h4>
        	            <ul>
        	                <li>请勿作弊，否则相关奖励无效； </li>
        	                <li>推广链接可以是任意页面后加 <span class="label label-info">?aff=<?php echo $current_user->ID;?></span>即可；</li>
        	                <li>推广统计可能与实际存在差异，具体以实际数据为准。</li>
        	            </ul>
    	            </div>
    			</div>
				<?php mobantu_paging('ref',$page,$pages);?>

				<!--推广VIP-->
			    <?php }elseif($_GET["pd"]=='ref2'){
				$totallists = $wpdb->get_var("SELECT COUNT(ice_id) FROM $wpdb->vip where ice_user_id in (select ID from $wpdb->users where father_id=".$user_info->ID.")");
				$ice_perpage = 12;
				$pages = ceil($totallists / $ice_perpage);
				$page=isset($_GET['pp']) ?intval($_GET['pp']) :1;
				$offset = $ice_perpage*($page-1);
				$lists = $wpdb->get_results("SELECT * FROM $wpdb->vip where ice_user_id in (select ID from $wpdb->users where father_id=".$user_info->ID.") order by ice_time DESC limit $offset,$ice_perpage");
				?>
				<div class="ceo-users-shop-padding">
				    <div class="ceo-users-shop-title">
                        <div class="ceo-users-shop-title-d">
                            <li class="ceo-users-shop-title-l">推广VIP</li>
                        </div>
                    </div>
    				<div class="alert">推广链接&nbsp;&nbsp;&nbsp;&nbsp;<?php echo esc_url( home_url( '/?aff=' ) ).$user_info->ID; ?></div>
                	<table class="table table-hover table-striped">
    					<thead>
    						<tr>
    							<th>用户ID</th>
    							<th>VIP类型</th>
    							<th>价格</th>
    							<th>交易时间</th>
    						</tr>
    					</thead>
    					<tbody>
    						<?php
    							if($lists) {
    								foreach($lists as $value)
    								{
    									if($value->ice_user_type == 6) $typeName = $erphp_day_name;
    									else {$typeName=$value->ice_user_type==7 ?$erphp_month_name :($value->ice_user_type==8 ?$erphp_quarter_name : ($value->ice_user_type==10 ?$erphp_life_name : $erphp_year_name));}
    									echo "<tr>\n";
    									echo "<td>".get_the_author_meta( 'user_login', $value->ice_user_id )."</td>\n";
    									echo "<td>$typeName</td>\n";
    									echo "<td>$value->ice_price</td>\n";
    									echo "<td>$value->ice_time</td>\n";
    									echo "</tr>";
    								}
    							}
    							else
    							{
    								echo '<tr width=100%><td colspan="4" align="center"><center><strong>没有记录！</strong></center></td></tr>';
    							}
    						?>
    					</tbody>
    				</table>
    				<div class="ceo-user-alerts">
        	            <h4>推广说明：</h4>
        	            <ul>
        	                <li>请勿作弊，否则相关奖励无效； </li>
        	                <li>推广链接可以是任意页面后加 <span class="label label-info">?aff=<?php echo $current_user->ID;?></span>即可；</li>
        	                <li>推广统计可能与实际存在差异，具体以实际数据为准。</li>
        	            </ul>
    	            </div>
    			</div>
				<?php mobantu_paging('ref2',$page,$pages);?>

			    <!--提现记录-->
			    <?php }elseif($_GET["pd"]=='outmo'){
				$totallists = $wpdb->get_var("SELECT count(*) FROM $wpdb->iceget WHERE ice_user_id=".$user_info->ID);
				$ice_perpage = 12;
				$pages = ceil($totallists / $ice_perpage);
				$page=isset($_GET['pp']) ?intval($_GET['pp']) :1;
				$offset = $ice_perpage*($page-1);
				$lists = $wpdb->get_results("SELECT * FROM $wpdb->iceget where ice_user_id=".$user_info->ID." order by ice_time DESC limit $offset,$ice_perpage");
				?>
				<div class="ceo-users-shop-padding">
				    <div class="ceo-users-shop-title">
                        <div class="ceo-users-shop-title-d">
                            <li class="ceo-users-shop-title-l">提现记录</li>
                        </div>
                    </div>
				    <div class="alert"><a href="?pd=tixian">有收入了？去申请提现>></a></div>
                	<table class="table table-hover table-striped">
    					<thead>
    						<tr>
    							<th>申请金额</th>
    							<th>申请时间</th>
    							<th>到账金额</th>
    							<th>状态</th>
    						</tr>
    					</thead>
    					<tbody>
    						<?php
    							if($lists) {
    								foreach($lists as $value)
    								{
    									$result=$value->ice_success==1?'已支付':'--';
    									echo "<tr>\n";
    									echo "<td>$value->ice_money</td>\n";
    									echo "<td>$value->ice_time</td>\n";
    									echo "<td>".sprintf("%.2f",(((100-get_option("ice_ali_money_site"))*$value->ice_money)/100))."</td>\n";
    									echo "<td>$result</td>\n";
    									echo "</tr>";
    								}
    							}
    							else
    							{
    								echo '<tr><td colspan="4" align="center"><center><strong>没有记录！</strong></center></td></tr>';
    							}
    						?>
    					</tbody>
    				</table>
    			</div>
				<?php mobantu_paging('outmo',$page,$pages);?>

				<!--站内提现-->
			    <?php }elseif($_GET["pd"]=='tixian'){
				$fee=get_option("ice_ali_money_site");
				$fee=isset($fee) ?$fee :100;
				$userMoney=$wpdb->get_row("select * from ".$wpdb->iceinfo." where ice_user_id=".$user_info->ID);
				/////////////////////////////////////////////////www.mobantu.com   82708210@qq.com
				if(!$userMoney)
				{
					$okMoney=0;
				}
				else
				{
					$okMoney=$userMoney->ice_have_money - $userMoney->ice_get_money;
				}
				$userAli=$wpdb->get_row("select * from ".$wpdb->iceget." where ice_user_id=".$user_info->ID);
			    ?>
			    <div class="ceo-users-shop-padding">
			        <div class="ceo-users-shop-title">
                        <div class="ceo-users-shop-title-d">
                            <li class="ceo-users-shop-title-l">站内提现</li>
                        </div>
                    </div>
    				<div class="profile-form">
    					<form action="" method="post">
    					<dl class="dl-horizontal">
    						<dt>支付宝账号</dt>
    						<dd><input type="text" id="ice_alipay" name="ice_alipay" value="<?php if($userAli) echo $userAli->ice_alipay;?>"/></dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt>支付宝姓名</dt>
    						<dd><input type="text" id="ice_name" name="ice_name"  value="<?php if($userAli) echo $userAli->ice_name;?>"/></dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt>提现金额</dt>
    						<dd>
    							<input type="text" id="ice_money" name="ice_money"  />
    							<div class="ceo-users-shop-tx">
    							（账户余额：<?php echo sprintf("%.2f",$okMoney)?><?php echo get_option('ice_name_alipay')?>）
    							<i class="fa fa-exclamation-circle"></i>提现手续费：<?php echo get_option("ice_ali_money_site")?>%
    							</div>
    						</dd>
    					</dl>
    					<dl class="dl-horizontal">
    						<dt></dt>
    						<dd>
    							<input type="submit" value="提交申请" class="profile-btn" style="border-radius: 4px;"/>
    						</dd>
    					</dl>
    					</form>
    				</div>
    			</div>
			    <?php }elseif($_GET["pd"]=='pass'){?>

			    <!--修改密码-->
			    <div class="ceo-users-shop-padding">
			        <div class="ceo-users-shop-title">
                        <div class="ceo-users-shop-title-d">
                            <li class="ceo-users-shop-title-l">修改密码</li>
                        </div>
                    </div>
        			<div id="changepass">
        				<div class="alert">为了确保安全，密码最好是由“字母+字符+数字”组成！</div>
        				<div class="profile-form">
        					<form action="" method="post">
                            <dl class="dl-horizontal" style="display:none">
        						<dt>用户名</dt>
        						<dd>
        							<input type="text" id="mm_username" name="log" value="<?php echo esc_attr( $profileuser->user_login ); ?>">
        						</dd>
        					</dl>
        					<dl class="dl-horizontal">
        						<dt>新密码</dt>
        						<dd>
        							<input type="password" id="mm_pass_new" name="mm_pass_new" value="">
        						</dd>
        					</dl>
        					<dl class="dl-horizontal">
        						<dt>重复密码</dt>
        						<dd>
        							<input type="password" id="mm_pass_new2" name="mm_pass_new2" value="">
        						</dd>
        					</dl>
        					<dl class="dl-horizontal">
        						<dt></dt>
        						<dd>
        							<input type="button" id="dopassword" value="保存" class="profile-btn" />
        						</dd>
        					</dl>
        					</form>
        				</div>
        			</div>
        		</div>

    			<script type="text/javascript">
    				jQuery(document).ready(function($){

    					$("#dopassword").click(function(){
    						if($("#mm_pass_new").val().trim().length==0)
    						{
    							alert("请输入密码");
    						}
    						else if(strlen($("#mm_pass_new").val().trim())<6)
    						{
    							alert("密码长度至少为6位");
    						}
    						else if($("#mm_pass_new2").val().trim() != $("#mm_pass_new").val().trim())
    						{
    							alert("两次密码不一致");
    						}
    						else
    						{
    							$("#dopassword").val("保存中...");
    							$.ajax({
    								type: "post",
    								url: "<?php echo ERPHPDOWN_URL; ?>/admin/action/ajax-profile.php",
    								data: "do=password&mm_usrname="+$("#mm_usrname").val()+"&mm_pass_old=" + $("#mm_pass_old").val() + "&mm_pass_new=" + $("#mm_pass_new").val() + "&mm_pass_new2=" + $("#mm_pass_new2").val(),
    								dataType: "text",
    								success: function (data) {
    									$("#dopassword").val("保存");
    									alert("修改成功");
    								},
    								error: function () {
    									$("#dopassword").val("保存");
    									alert("修改失败");
    								}
    							});
    						}
    					});


    				});
    			</script>

    		<!--我的订单-->
			<?php }elseif($_GET["pd"]=='cart'){
			$total_trade   = $wpdb->get_var("SELECT COUNT(ice_id) FROM $wpdb->icealipay WHERE ice_success>0 and ice_user_id=".$user_info->ID);
			$ice_perpage = 12;
			$pages = ceil($total_trade / $ice_perpage);
			$page=isset($_GET['pp']) ?intval($_GET['pp']) :1;
			$offset = $ice_perpage*($page-1);
			$list = $wpdb->get_results("SELECT * FROM $wpdb->icealipay where ice_success=1 and ice_user_id=$user_info->ID order by ice_time DESC limit $offset,$ice_perpage");
			?>

			<div class="ceo-users-shop-padding">
			    <div class="ceo-users-shop-title">
                    <div class="ceo-users-shop-title-d">
                        <li class="ceo-users-shop-title-l">我的订单</li>
                    </div>
                </div>
    			<div id="downlist">
    				<table class="table table-hover table-striped">
    					<thead>
    						<tr>
    							<th>订单号</th>
    							<th >资源名称</th>
    							<th>价格</th>
    							<th>交易时间</th>
    							<th>下载信息</th>
    						</tr>
    					</thead>
    					<tbody>
    						<?php
    							if($list) {
    								foreach($list as $value)
    								{
    									echo "<tr>\n";
    									echo "<td>$value->ice_num</td>";
    									echo "<td><a target=_blank href=".get_permalink($value->ice_post).">$value->ice_title</a></td>\n";
    									echo "<td>$value->ice_price</td>\n";
    									echo "<td>$value->ice_time</td>\n";
    									echo "<td><a class='ceo-users-shop-xzan' href='".get_template_directory_uri().'/ceoshop/erphpdown/download.php?url='.$value->ice_url."' target='_blank'>立即下载</a></td>\n";
    									echo "</tr>";
    								}
    							}
    							else
    							{
    								echo '<tr width=100%><td colspan="5" align="center"><center><strong>没有订单</strong></center></td></tr>';
    							}
    						?>
    					</tbody>
    				</table>
                    <?php mobantu_paging('cart',$page,$pages);?>
    			</div>
    		</div>

			<!--充值中心-->
			<?php }elseif($_GET["pd"]=='money'){
					$user_Info   = wp_get_current_user();
					$userMoney=$wpdb->get_row("select * from ".$wpdb->iceinfo." where ice_user_id=".$user_Info->ID);
					if(!$userMoney){
						$okMoney=0;
					}else{
						$okMoney=$userMoney->ice_have_money - $userMoney->ice_get_money;
					}
				?>

				    <div class="ceo-users-shop-padding">
    				    <div class="ceo-grid-medium ceo-grid" ceo-grid>
    				        <!--余额-->
    	                	<div class="ceo-width-1-2 ceo-width-1-4@xl ceo-first-column">
    	                	    <div class="ceo-users-mk-item">
        	                	    <div class="ceo-users-mk-img-balance"></div>
        	                	    <div class="ceo-users-mk-date">
            	                		<p>可用余额</p>
            	                		<b><?php echo sprintf("%.2f",$okMoney);?></b>
            	                		<?php echo get_option('ice_name_alipay');?>
        	                		</div>
        	                	</div>
    	                	</div>

    	                	<!--会员-->
    	                	<div class="ceo-width-1-2 ceo-width-1-4@xl ceo-first-column">
    	                	    <div class="ceo-users-mk-item">
        	                	    <div class="ceo-users-mk-img-vip"></div>
                        	        <div class="ceo-users-mk-date">
                        	            <p>用户类型</p>
            	                		<b>
            	                		    <tr>
                                                <td>
                                                <?php
                            					$ciphp_year_price    = get_option('ciphp_year_price');
                            					$ciphp_quarter_price = get_option('ciphp_quarter_price');
                            					$ciphp_month_price  = get_option('ciphp_month_price');
                            					$ciphp_life_price  = get_option('ciphp_life_price');
                            					$ciphp_day_price  = get_option('ciphp_day_price');

                                                $userTypeId=getUsreMemberType();
                                                if($userTypeId==6)
                                                {
                                                    echo "".$erphp_day_name;
                                                }
                                                elseif($userTypeId==7)
                                                {
                                                    echo "".$erphp_month_name;
                                                }
                                                elseif ($userTypeId==8)
                                                {
                                                    echo "".$erphp_quarter_name;
                                                }
                                                elseif ($userTypeId==9)
                                                {
                                                    echo "".$erphp_year_name;
                                                }
                            					elseif ($userTypeId==10)
                                                {
                                                    echo "".$erphp_life_name;
                                                }
                                                else
                                                {
                                                    echo '普通用户';
                                                }
                                                ?>
                                                </td>
                                            </tr>
                                        </b>
                                    </div>
                                </div>
    	                	</div>

    	                	<!--消费-->
    	                	<div class="ceo-width-1-2 ceo-width-1-4@xl ceo-first-column">
    	                	    <div class="ceo-users-mk-item">
        	                	    <div class="ceo-users-mk-img-extension"></div>
        	                	    <div class="ceo-users-mk-date">
            	                		<p>站内消费</p>
            	                		<b><?php echo intval($userMoney->ice_get_money)?></b> <?php echo get_option('ice_name_alipay');?></b>
        	                		</div>
    	                		</div>
    	                	</div>

    	                	<!--推广-->
    	                	<div class="ceo-width-1-2 ceo-width-1-4@xl ceo-first-column">
    	                	    <div class="ceo-users-mk-item">
        	                	    <div class="ceo-users-mk-img-consumption"></div>
        	                	    <div class="ceo-users-mk-date">
            	                		<p>下载次数</p>
            	                		<b><?php echo get_user_erphpdown_rest(); ?></b> / <?php echo get_user_erphpdown_count(); ?></b>
        	                		</div>
    	                		</div>
    	                	</div>
    	                </div>
	                </div>

                <div class="ceo-users-shop-profile-box-zx">
                    <form action="" method="post" onSubmit="return checkFm();">
                        <table class="form-table" style="border: 0px solid #eee;">
                            <tr>
                				<td class="ceo-users-shop-czck" style="border-left: 0px solid #eee;padding: 0;">
                				<input type="text" id="ice_money" name="ice_money" required="required" class="b-r-4 ceo-input ceo-margin-small-top ceo-text-small ceo-users-shop-czjr" placeholder="请输入充值金额，1元 = <?php echo get_option('ice_proportion_alipay').' '.get_option('ice_name_alipay')?> "style="height: 80px;line-height: 80px;"/>
                				</td>
                                <td class="ceo-users-shop-czck-y" style="border-left: 0px solid #eee;padding: 0;vertical-align: bottom;">
                                    <p class="submit">
                                    <input type="submit" name="Submit" value="在线充值" class="ceo-users-cz profile-btn ceo-users-shop-czck-y-p" style="height: 80px;line-height: 80px;padding: 0 !important;width: 243px;"/>
                                    </p>
                                </td>
                            </tr>
                            <tr>
                                <td class="ceo-users-shop-an-sz" style="border-left: 0px solid #eee;">
                                    <div class="ceo-users-shop-an">
                                        <?php if(get_option('ice_weixin_mchid')){?>
                                        <li class="ceo-users-shop-weixin">
                                            <input type="radio" id="paytype4" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="4"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype4" class="ceo-users-shop-weixin-ico"><em>微信</em></label>
                                        </li>
                                        <?php }?>

                                        <?php if(get_option('ice_ali_partner')){?>
                                        <li class="ceo-users-shop-zhifubao">
                                            <input type="radio" id="paytype1" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="1"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype1" class="ceo-users-shop-zhifubao-ico"><em>支付宝</em></label>
                                        </li>
                                        <?php }?>

                                        <?php if(get_option('erphpdown_f2fpay_id')){?>
        								<li class="ceo-users-shop-zhifubao">
                                            <input type="radio" id="paytype5" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="5"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype5" class="ceo-users-shop-zhifubao-ico"><em>支付宝</em></label>
                                        </li>
        								<?php }?>

        								<?php if(get_option('erphpdown_xhpay_appid31')){?>
        								<li class="ceo-users-shop-weixin">
                                            <input type="radio" id="paytype18" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="18"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype18" class="ceo-users-shop-weixin-ico"><em>微信</em></label>
                                        </li>
        								<?php }?>

        								<?php if(get_option('erphpdown_xhpay_appid32')){?>
        								<li class="ceo-users-shop-zhifubao">
                                            <input type="radio" id="paytype17" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="17"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype17" class="ceo-users-shop-zhifubao-ico"><em>支付宝</em></label>
                                        </li>
        								<?php }?>

        				                <?php if(get_option('erphpdown_codepay_appid')){?>
        				                <li class="ceo-users-shop-zhifubao">
                                            <input type="radio" id="paytype13" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="13"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype13" class="ceo-users-shop-zhifubao-ico"><em>支付宝</em></label>
                                        </li>

        				                <li class="ceo-users-shop-weixin">
                                            <input type="radio" id="paytype14" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="14"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype14" class="ceo-users-shop-weixin-ico"><em>微信</em></label>
                                        </li>

        				                <!--<input type="radio" id="paytype15" class="paytype" name="paytype" value="15" />QQ钱包&nbsp;-->
        				                <?php }?>
        				                <?php if(get_option('erphpdown_paypy_key')){?>
        									<?php if(!get_option('erphpdown_paypy_wxpay')){?>
        									<li class="ceo-users-shop-weixin">
                                                <input type="radio" id="paytype7" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="7"/>
                                                <span class="ceo-users-shop-an-ico"></span>
                                                <label for="paytype7" class="ceo-users-shop-weixin-ico"><em>微信</em></label>
                                            </li>
        									<?php }?>

        									<?php if(!get_option('erphpdown_paypy_alipay')){?>
        									<li class="ceo-users-shop-zhifubao">
                                                <input type="radio" id="paytype8" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="8"/>
                                                <span class="ceo-users-shop-an-ico"></span>
                                                <label for="paytype8" class="ceo-users-shop-zhifubao-ico"><em>支付宝</em></label>
                                            </li>
        									<?php }?>
        								<?php }?>

                                        <?php if(get_option('ice_payapl_api_uid')){?>
                                        <li class="ceo-users-shop-payapl">
                                            <input type="radio" id="paytype2" class="paytype ceo-users-shop-an-radio" checked name="paytype" value="2"/>
                                            <span class="ceo-users-shop-an-ico"></span>
                                            <label for="paytype2" class="ceo-users-shop-payapl-ico"><em>PayPal($美元)汇率：
                                         (<?php echo get_option('ice_payapl_api_rmb')?>)</em></label>
                                        </li>
                                        <?php }?>

                                    </div>
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>

                <?php if(function_exists("checkDoCardResult")){?>
                <div class="ceo-users-shop-padding-czk">
                    <div ceo-accordion="multiple: true">
                        <div>
                            <a class="ceo-accordion-title" href="#">充值卡充值</a>
                            <div class="ceo-accordion-content">
                                <div class="profile-box">
                                	<form action="" method="post" onSubmit="return checkFm2();">
                                        <table class="form-table" style="border: 0px solid #eee;">
                                            <tr>
                                				<td style="border-left: 0px solid #eee;padding: 0 1rem;">
                                				<input type="text" id="epdcardnum" name="epdcardnum"  required="required" placeholder="请输入充值卡号，1 元 = <?php echo get_option('ice_proportion_alipay').' '.get_option('ice_name_alipay')?>" class="b-r-4 ceo-input ceo-margin-small-top ceo-text-small"/>
                                				</td>
                                            </tr>
                                            <tr>
                                				<td style="border-left: 0px solid #eee;padding: 0 1rem;">
                                				<input type="text" id="epdcardpass" name="epdcardpass"  required="required" placeholder="请输入充值卡密" class="b-r-4 ceo-input ceo-margin-small-top ceo-text-small"/>
                                				</td>
                                            </tr>
                                            <tr>
                                				<td style="border-left: 0px solid #eee;">
                                                    <p class="submit">
                                                        <input type="hidden" name="action" value="card">
                                                        <input type="submit" value="充值卡充值" class="ceo-users-czkcz profile-btn" />
                                                    </p>
                                                </td>
                                            </tr>
                                        </table>
                                	</form>
                                	
                                	<a class="ceo-accordion-title">USDT充值</a>
                                	
                                	
                                	
                                	<script language="JavaScript">
function keydown(){
var huilv = 7;
document.ff.input2.value=huilv*document.ff.input1.value + '模板币';
}
</script>
                                	                                	<form action="" name="ff" onSubmit="return checkFm8();">
                                        <table class="form-table" style="border: 0px solid #eee;">
                                            <tr>
                                				<td style="border-left: 0px solid #eee;padding: 0 1rem;">
                                				<input type="text" name="input1"  onkeyup="keydown()" required="required" placeholder="请输入充值数量，1 USD = <?php echo get_option('ice_proportion_alipay').' '.get_option('ice_name_alipay')?>" class="b-r-4 ceo-input ceo-margin-small-top ceo-text-small"/>
                                				</td>
                                            </tr>
                                            <tr>
                                				<td style="border-left: 0px solid #eee;padding: 0 1rem;">
                                				<input type="text" name="input2"  required="required" placeholder="自动换算" class="b-r-4 ceo-input ceo-margin-small-top ceo-text-small"/>
                                				</td>
                                            </tr>
                                            <tr>
                                				<td style="border-left: 0px solid #eee;">
<a href="#" class="ceo-tanchuang-gg-an header-btn-search-s ceo-dt change-color btn-search-all" target="_blank" rel="nofollow">充值地址</a>
                                                </td>
                                            </tr>
                                        </table>
                                	</form>
                
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php }?>

                <?php if(plugin_check_cred() && get_option('erphp_mycred') == 'yes'){
                	$mycred_core = get_option('mycred_pref_core');
                	?>
                <div class="profile-box">
	                <form action="" method="post" onSubmit="return checkFm3();">
	                	<h1 style="border-bottom:1px solid #999999;width:100%;color:#F04243;"><?php echo $mycred_core['name']['plural'];?>兑换<?php echo get_option('ice_name_alipay')?></h1>
	                	<table class="form-table">
	                            <tr>
	                				<td>
	                				<input type="text" id="epdmycrednum" name="epdmycrednum"  required="required" placeholder="需要兑换的<?php echo get_option('ice_name_alipay')?>数" />（请输入一个整数，<?php echo get_option('erphp_to_mycred').$mycred_core['name']['plural'];?> = 1<?php echo get_option('ice_name_alipay')?>）
	                				</td>
	                            </tr>
	                     <tr>
	                        <td><p class="submit">
	                            <input type="submit" name="Submit" value="兑换" class="profile-btn" onClick="return confirm('确认兑换?');"/>
	                            <input type="hidden" name="action" value="mycredto">
	                            </p>
	                        </td>

	                        </tr>

	                        </table>
	                </form>
	            </div>
	            <?php }?>

                <!--升级VIP-->
	            <div class="ceo-users-shop-padding">
                    <div class="ceo-users-shop-profile-box container-user">
                        <form action="" method="post">
                        	<div class="form-table" style="max-width: 100%;">
                                <div class="ceo-grid-medium ceo-grid" ceo-grid>
                                    <!--终身-->
                                    <?php if($ciphp_life_price){?>
                                    <div class="ceo-users-shop-vip ceo-width-1-1@s ceo-width-1-4@xl ceo-first-column">
                                        <input type="radio" id="userType10" name="userType" value="10" checked />
                                        <label for="userType10" class="ceo-users-shop-vip-mk">
                                            <div class="ques-card-head ques-card-1">
                                                <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="323px" height="30px" xml:space="preserve">
                                                    <defs>
                                                        <pattern id="water" width=".25" height="1.1" patternContentUnits="objectBoundingBox">
                                                            <path fill="#fff" d="M0.25,1H0c0,0,0-0.659,0-0.916c0.083-0.303,0.158,0.334,0.25,0C0.25,0.327,0.25,1,0.25,1z"></path>
                                                        </pattern>
                                                        <g id="eff">
                                                            <rect fill="url(#water)" x="-119.461" y="0" width="1200" height="120" opacity="0.1">
                                                                <animate attributeType="xml" attributeName="x" from="-300" to="0" repeatCount="indefinite" dur="10s"></animate>
                                                            </rect>
                                                            <rect fill="url(#water)" y="5" width="1600" height="125" opacity="0.1" x="-399.447">
                                                                <animate attributeType="xml" attributeName="x" from="-400" to="0" repeatCount="indefinite" dur="13s"></animate>
                                                            </rect>
                                                        </g>
                                                    </defs>
                                                    <use xlink:href="#eff" opacity="1" style="mix-blend-mode:normal;"></use>
                                                </svg>
                                            </div>
                                            <div class="ceo-users-shop-svip-ico"></div>
                                            <div class="ques-card-title"><?php echo $erphp_life_name;?></div>
                                            <div class="ques-card-title-mk">
                                                <p class="ques-card-jg"><?php echo $ciphp_life_price;?><span><?php echo $moneyName; ?></span></p>
                                                <p class="ques-card-lx">永久</p>
                                                <p class="ques-card-xz">每天可下载<?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_zs']; ?>个VIP资源</p>
                                                <p class="ques-card-p"><?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_zs_js']; ?></p>
                                            </div>

                                            <a href="javascript:;" class="btn" evt="user.vip.submit" data-type="" >立即升级</a>
                                        </label>
                                    </div>
                                    <?php }?>

                                    <!--一年-->
                                    <?php if($ciphp_year_price){?>
                                    <div class="ceo-users-shop-vip ceo-width-1-1@s ceo-width-1-4@xl ceo-first-column">
                                        <input type="radio" id="userType9" name="userType" value="9"  />
                                        <label for="userType9" class="ceo-users-shop-vip-mk">
                                            <div class="ques-card-head ques-card-2">
                                                <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="323px" height="30px" xml:space="preserve">
                                                    <defs>
                                                        <pattern id="water" width=".25" height="1.1" patternContentUnits="objectBoundingBox">
                                                            <path fill="#fff" d="M0.25,1H0c0,0,0-0.659,0-0.916c0.083-0.303,0.158,0.334,0.25,0C0.25,0.327,0.25,1,0.25,1z"></path>
                                                        </pattern>
                                                        <g id="eff">
                                                            <rect fill="url(#water)" x="-119.461" y="0" width="1200" height="120" opacity="0.1">
                                                                <animate attributeType="xml" attributeName="x" from="-300" to="0" repeatCount="indefinite" dur="10s"></animate>
                                                            </rect>
                                                            <rect fill="url(#water)" y="5" width="1600" height="125" opacity="0.1" x="-399.447">
                                                                <animate attributeType="xml" attributeName="x" from="-400" to="0" repeatCount="indefinite" dur="13s"></animate>
                                                            </rect>
                                                        </g>
                                                    </defs>
                                                    <use xlink:href="#eff" opacity="1" style="mix-blend-mode:normal;"></use>
                                                </svg>
                                            </div>
                                            <div class="ques-card-title"><?php echo $erphp_year_name;?></div>
                                            <div class="ques-card-title-mk">
                                                <p class="ques-card-jg"><?php echo $ciphp_year_price;?><span><?php echo $moneyName; ?></span></p>
                                                <p class="ques-card-lx">12个月</p>
                                                <p class="ques-card-xz">每天可下载<?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_nf']; ?>个VIP资源</p>
                                                <p class="ques-card-p"><?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_nf_js']; ?></p>
                                            </div>

                                            <a href="javascript:;" class="btn item-1" evt="user.vip.submit" data-type="" >立即升级</a>
                                        </label>
                                    </div>
                                    <?php }?>

                                    <!--包季-->
                                    <?php if($ciphp_quarter_price){?>
                                    <div class="ceo-users-shop-vip ceo-width-1-1@s ceo-width-1-4@xl ceo-first-column">
                                        <input type="radio" id="userType8" name="userType" value="8"  />
                                        <label for="userType8" class="ceo-users-shop-vip-mk">
                                            <div class="ques-card-head ques-card-3">
                                                <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="323px" height="30px" xml:space="preserve">
                                                    <defs>
                                                        <pattern id="water" width=".25" height="1.1" patternContentUnits="objectBoundingBox">
                                                            <path fill="#fff" d="M0.25,1H0c0,0,0-0.659,0-0.916c0.083-0.303,0.158,0.334,0.25,0C0.25,0.327,0.25,1,0.25,1z"></path>
                                                        </pattern>
                                                        <g id="eff">
                                                            <rect fill="url(#water)" x="-119.461" y="0" width="1200" height="120" opacity="0.1">
                                                                <animate attributeType="xml" attributeName="x" from="-300" to="0" repeatCount="indefinite" dur="10s"></animate>
                                                            </rect>
                                                            <rect fill="url(#water)" y="5" width="1600" height="125" opacity="0.1" x="-399.447">
                                                                <animate attributeType="xml" attributeName="x" from="-400" to="0" repeatCount="indefinite" dur="13s"></animate>
                                                            </rect>
                                                        </g>
                                                    </defs>
                                                    <use xlink:href="#eff" opacity="1" style="mix-blend-mode:normal;"></use>
                                                </svg>
                                            </div>
                                            <div class="ques-card-title"><?php echo $erphp_quarter_name;?></div>
                                            <div class="ques-card-title-mk">
                                                <p class="ques-card-jg"><?php echo $ciphp_quarter_price;?><span><?php echo $moneyName; ?></span></p>
                                                <p class="ques-card-lx">3个月</p>
                                                <p class="ques-card-xz">每天可下载<?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_jf']; ?>个VIP资源</p>
                                                <p class="ques-card-p"><?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_jf_js']; ?></p>
                                            </div>

                                            <a href="javascript:;" class="btn item-2" evt="user.vip.submit" data-type="" >立即升级</a>
                                        </label>
                                    </div>
                                    <?php }?>

                                    <!--包月-->
                                    <?php if($ciphp_month_price){?>
                                    <div class="ceo-users-shop-vip ceo-width-1-1@s ceo-width-1-4@xl ceo-first-column">
                                        <input type="radio" id="userType7" name="userType" value="7"  />
                                        <label for="userType7" class="ceo-users-shop-vip-mk">
                                            <div class="ques-card-head ques-card-4">
                                                <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="323px" height="30px" xml:space="preserve">
                                                    <defs>
                                                        <pattern id="water" width=".25" height="1.1" patternContentUnits="objectBoundingBox">
                                                            <path fill="#fff" d="M0.25,1H0c0,0,0-0.659,0-0.916c0.083-0.303,0.158,0.334,0.25,0C0.25,0.327,0.25,1,0.25,1z"></path>
                                                        </pattern>
                                                        <g id="eff">
                                                            <rect fill="url(#water)" x="-119.461" y="0" width="1200" height="120" opacity="0.1">
                                                                <animate attributeType="xml" attributeName="x" from="-300" to="0" repeatCount="indefinite" dur="10s"></animate>
                                                            </rect>
                                                            <rect fill="url(#water)" y="5" width="1600" height="125" opacity="0.1" x="-399.447">
                                                                <animate attributeType="xml" attributeName="x" from="-400" to="0" repeatCount="indefinite" dur="13s"></animate>
                                                            </rect>
                                                        </g>
                                                    </defs>
                                                    <use xlink:href="#eff" opacity="1" style="mix-blend-mode:normal;"></use>
                                                </svg>
                                            </div>
                                            <div class="ques-card-title"><?php echo $erphp_month_name;?></div>
                                            <div class="ques-card-title-mk">
                                                <p class="ques-card-jg"><?php echo $ciphp_month_price;?><span><?php echo $moneyName; ?></span></p>
                                                <p class="ques-card-lx">1个月</p>
                                                <p class="ques-card-xz">每天可下载<?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_yf_js']; ?>个VIP资源</p>
                                                <p class="ques-card-p"><?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_yf_js']; ?></p>
                                            </div>

                                            <a href="javascript:;" class="btn item-3" evt="user.vip.submit" data-type="">立即升级</a>
                                        </label>

                                    </div>
                                    <?php }?>

                                    <!--体验-->
                                    <?php if($ciphp_day_price){?>
                                    <div class="ceo-users-shop-vip ceo-width-1-1@s ceo-width-1-4@xl ceo-first-column" style="margin: 0 auto;">
                                        <input type="radio" id="userType6" name="userType" value="6"  />
                                        <label for="userType6" class="ceo-users-shop-vip-mk">
                                            <div class="ques-card-head ques-card-5">
                                                <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="323px" height="30px" xml:space="preserve">
                                                    <defs>
                                                        <pattern id="water" width=".25" height="1.1" patternContentUnits="objectBoundingBox">
                                                            <path fill="#fff" d="M0.25,1H0c0,0,0-0.659,0-0.916c0.083-0.303,0.158,0.334,0.25,0C0.25,0.327,0.25,1,0.25,1z"></path>
                                                        </pattern>
                                                        <g id="eff">
                                                            <rect fill="url(#water)" x="-119.461" y="0" width="1200" height="120" opacity="0.1">
                                                                <animate attributeType="xml" attributeName="x" from="-300" to="0" repeatCount="indefinite" dur="10s"></animate>
                                                            </rect>
                                                            <rect fill="url(#water)" y="5" width="1600" height="125" opacity="0.1" x="-399.447">
                                                                <animate attributeType="xml" attributeName="x" from="-400" to="0" repeatCount="indefinite" dur="13s"></animate>
                                                            </rect>
                                                        </g>
                                                    </defs>
                                                    <use xlink:href="#eff" opacity="1" style="mix-blend-mode:normal;"></use>
                                                </svg>
                                            </div>
                                            <div class="ques-card-title"><?php echo $erphp_day_name;?></div>
                                            <div class="ques-card-title-mk">
                                                <p class="ques-card-jg"><?php echo $ciphp_day_price;?><span><?php echo $moneyName; ?></span></p>
                                                <p class="ques-card-lx">1天</p>
                                                <p class="ques-card-xz">每天可下载<?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_ty_js']; ?>个VIP资源</p>
                                                <p class="ques-card-p"><?php if(_ceo('ceo_users_vip'))echo _ceo('ceo_users_vip')['ceo_users_vip_ty_js']; ?></p>
                                            </div>
                                            <a href="javascript:;" class="btn item-4" evt="user.vip.submit" data-type="" >立即升级</a>

                                        </label>
                                    </div>
                                    <?php }?>
                                </div>
                                <!--<div>
                                    <td><p class="submit"><input type="submit" name="Submit" value="升级VIP" class="ceo-users-shop-profile-btn profile-btn" onClick="return confirm('确认升级成为VIP?');"/></p>
                                    </td>
                                </div>-->
                            </div>
                        </form>
                    </div>
                </div>
			    <?php }else{
			    if(in_array($_GET['pd'],['add_feedback','reply_feedback','feedback'])){
                    get_template_part('pages/'.$_GET['pd']);
                }
            } ?><!--工单-->
		</div>
	</div>
</section>
<script type="text/javascript">
	function checkFm(){
		if(document.getElementById("ice_money").value=="")
		{
			alert('请输入金额');
			return false;
		}
	}

	function checkFm2(){
		if(document.getElementById("epdcardnum").value=="")
		{
			alert('请输入金额');
			return false;
		}
	}

	function checkFm3(){
		if(document.getElementById("epdmycrednum").value=="")
		{
			alert('请输入兑换的金额');
			return false;
		}
	}

	function strlen(str){
		var len = 0;
		for (var i=0; i<str.length; i++){
			var c = str.charCodeAt(i);
			if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {
				len++;
			}else {
				len+=2;
			}
		}
		return len;
	}
</script>
<script>window._MBT = {
        uri: '<?php bloginfo('template_url') ?>',
        url: '<?php bloginfo('url');?>',
        //usr: '<?php //echo get_permalink(MBThemes_page("template/user.php"));?>//',
        //roll: [<?php //echo _MBT('sidebar_fixed');?>//],
        admin_ajax: '<?php echo admin_url('admin-ajax.php');?>',
        erphpdown: '<?php if (defined("erphpdown")) {
            echo constant("erphpdown");
        }?>',
    }</script>

<script src="<?php bloginfo("template_url")?>/static/js/user.js"></script>


<?php get_footer(); ?>
