<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>会员中心-<?php echo $this->config['sitename']; ?></title>
    <meta name="description" content="会员中心,<?php echo $this->config['sitename']; ?>">
    <meta name="keywords" content="会员中心,<?php echo $this->config['sitename']; ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="/static/default/favico.ico" />
	<link rel="stylesheet" href="https://lib.baomitu.com/amazeui/2.7.2/css/amazeui.min.css">
	<!--[if (gte IE 9)|!(IE)]><!--><script src="https://lib.baomitu.com/jquery/2.0.3/jquery.min.js"></script><!--<![endif]-->
	<!--[if lt IE 9]>
    <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="https://lib.baomitu.com/modernizr/2.8.3/modernizr.min.js"></script>
    <script src="https://lib.baomitu.com/amazeui/2.7.2/js/amazeui.ie8polyfill.min.js"></script>
    <![endif]-->
	<script src="https://lib.baomitu.com/screenfull.js/5.0.0/screenfull.min.js"></script>
	<script src="https://lib.baomitu.com/amazeui/2.7.2/js/amazeui.min.js"></script>	
    <link rel="stylesheet" href="/static/default/assets/css/app.css">
    <style>
	.sy-form{
				background-color: #fff;				
		}
  .am-topbar-inverse{
		background-color:<?php echo $this->config['color'];?>;
		border-color:<?php echo $this->config['color'];?>;
	}
	.am-footer-default{
		background-color:<?php echo $this->config['color'];?>;
	}
	.am-footer-default .am-footer-miscs{
		color: #fff;
	}
        .am-container{
          max-width: 1200px;
        }
    
        /* 色调设置 */
       .good-trade{
             background-color: #fff;
        }
		.sy-form{
				background-color: #fff;				
		}
		.floatfl{
			    text-align: center!important;
			float:left!important;
		}
    </style>
</head>
<body  id="bg" data-type="user">
<header class="am-topbar am-topbar-inverse">
<div class="am-container">
<h1 class="am-topbar-btn am-fl am-btn am-btn-sm am-btn-success am-show-sm-only">
    <a href="/"><i class="am-header-icon am-icon-home"></i></a>
  </h1>
  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#doc-topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
  <div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
    <ul class="am-nav am-nav-pills am-topbar-nav">
      <li><a href="/"><span class="am-icon-home am-icon-sm"></span>首页</a></li>
      <li><a href="http://wpa.qq.com/msgrd?v=<?php echo $this->config['qq']?>&uin=&site=qq&menu=yes" target="_blank"><i class="am-icon-qq"></i>客服</a></li>
      	  <?php if($this->session->get('login_name')) { ?>		  
				  <li><a href="/user"><span class="am-icon-users"></span>会员中心</a></li>
				  <li><a href="/user/sett"><span class="am-icon-cog"></span>个人资料</a></li>	  	  
				  <li><a href="javascript:;" onclick="repwd()"><span class="am-icon-lock"></span>修改密码</a></li>
				  <li><a href="/login/logout"><span class="am-icon-sign-out"></span>退出</a></li>
           <?php }else{ ?>		   
			  <li><a href="/login"><span class="am-icon-sign-in"></span>登录</a></li>	
			  <li><a href="/reg"><span class="am-icon-sign-out"></span>注册</a></li> 
              <?php } ?> 
    </ul>

    <div class="am-topbar-right">
			<ul class="am-nav am-nav-pills am-topbar-nav">
            <li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
          </ul>     
    </div>

  </div>
</div>
</header>

<div class="tpl-page-container tpl-page-header-fixed">

    <div class="am-container tpl-content-wrapper">
        <div class="row">
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat blue">
                    <div class="visual">
                        <i class="am-icon-calendar-o"></i>
                    </div>
                    <div class="details">
                        <div class="number"> <?php echo $okorder;?></div>
                        <div class="desc"> 总订单</div>
                    </div>

                </div>
            </div>
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat purple">
                    <div class="visual">
                        <i class="am-icon-money"></i>
                    </div>
                    <div class="details">
                        <div class="number"> <?php echo $user['allmoney']?> 元</div>
                        <div class="desc"> 总消费</div>
                    </div>

                </div>
            </div>
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat red">
                    <div class="visual">
                        <i class="am-icon-money"></i>
                    </div>
                    <div class="details">
                        <div class="number"><?php echo date("m-d H:i:s", $user['ctime']);?> </div>
                        <div class="desc"> 上次登录时间</div>
                    </div>

                </div>
            </div>
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat green">
                    <div class="visual">
                        <i class="am-icon-money"></i>
                    </div>
                    <div class="details">
                        <div class="number"> <?php echo $user['last_ip']?> </div>
                        <div class="desc"> 上次登录ip</div>
                    </div>

                </div>
            </div>


        </div>


        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> 我的订单
                </div>
                <div class="tpl-portlet-input tpl-fz-ml">

                </div>


            </div>
            <div class="tpl-block">
                
                <div class="am-g">
                    <div class="am-u-sm-12 am-scrollable-horizontal">

                        <table class="am-table am-table-striped am-table-hover table-main" >
                            <thead>
                            <tr>

                                <th class="table-id">订单id</th>
                                <th class="table-oname">订单名称</th>
                                <th class="table-otype">订单类型</th>
                                <th class="table-onum">充值数量</th>
                                <th class="table-omoney">商品单价</th>
                                <th class="table-cmoney">订单总价</th>
                                <th class="table-account">充值账号</th>
                                <th class="table-paytype">支付方式</th>
                                <th class="table-status">状态</th>
                                <th class="table-date am-hide-sm-only">下单时间</th>
                                <th class="table-set">操作</th>
                            </tr>
                            </thead>

                            <tbody id="ordcont">

                            <?php if ($orderid): ?>
                                <tr>

                                    <td><?php echo $orderid ?></td>
                                    <td><?php echo $oname ?></td>
                                    <td>
									 <?php if ($otype == 0){											
											echo '<span class="am-badge am-badge-success am-radius">自动发卡</span>';
										}else if ($otype == 2){																		
											echo '<span class="am-badge am-badge-primary am-radius">下载资源</span>';
										}else{																		
											echo '<span class="am-badge am-badge-warning am-radius">手工订单</span>';
										}
										?>
                                    </td>
                                    <td><?php echo $onum ?></td>
                                    <td><?php echo $omoney ?></td>
                                    <td><?php echo $cmoney ?></td>
                                    <td><?php echo $account ?></td>
                                    <td>

                                        <span class="am-badge am-badge-success am-radius"><?php echo $paytype ?></span>
                                    </td>
                                    <?php
                                    $orderStatus = [
                                        1 => "<span class=\"am-badge am-badge-warning am-radius\">待处理</span>",
                                        2 => " <span class=\"am-badge am-badge-primary am-radius\">已处理</span>",
                                        3 => " <span class=\"am-badge am-badge-success am-radius\">已完成</span>",
                                        4 => " <span class=\"am-badge am-badge-danger am-radius\">处理失败</span>",
                                        5 => " <span class=\"am-badge am-badge-danger am-radius\">发卡失败</span>",
                                    ];

                                    ?>

                                    <td> <?php echo $orderStatus[$status] ?></td>
                                    <td class="am-hide-sm-only"><?php echo date('Y-m-d H:i', $ctime) ?></td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button onclick="orderInfo('<?php echo $orderid ?>')" class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                                    <span class="am-icon-eye"></span>订单详情
                                                </button>
                                            </div>
											
                                                <?php if ($val['otype'] == 0): ?>
                                                <div class="am-btn-group am-btn-group-xs">
                                                        <a href="/chaka/import?id=<?php echo $val['orderid'] ?>" class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                                            <span class="am-icon-caret-down"></span>导出卡密
                                                        </a>
                                                </div>
                                                <?php endif; ?>
                                        </div>
                                    </td>
                                </tr>

                            <?php endif; ?>
                            <?php if($lists): ?>
                               <?php foreach ($lists as $key => $val): ?>
                              <tr>

                                    <td><?php echo $val['orderid'];?></td>
                                    <td><?php echo $val['oname'];?></td>
                                    <td>
									
									 <?php if ($val['otype'] == 0){											
											echo '<span class="am-badge am-badge-success am-radius">自动发卡</span>';
										}else if ($val['otype'] == 2){																		
											echo '<span class="am-badge am-badge-primary am-radius">下载资源</span>';
										}else{																		
											echo '<span class="am-badge am-badge-warning am-radius">手工订单</span>';
										}
										?>
                                    </td>
                                    <td><?php echo $val['onum'];?></td>
                                    <td><?php echo $val['omoney'];?></td>
                                    <td><?php echo $val['cmoney'];?></td>
                                    <td><?php echo $val['account'];?></td>
                                    <td>

                                        <span class="am-badge am-badge-success am-radius"><?php echo $val['paytype']; ?></span>
                                    </td>
                                    <?php
                                   $orderStatus = [
                                        1 => "<span class=\"am-badge am-badge-warning am-radius\">待处理</span>",
                                        2 => " <span class=\"am-badge am-badge-primary am-radius\">已处理</span>",
                                        3 => " <span class=\"am-badge am-badge-success am-radius\">已完成</span>",
                                        4 => " <span class=\"am-badge am-badge-danger am-radius\">处理失败</span>",
                                        5 => " <span class=\"am-badge am-badge-danger am-radius\">发卡失败</span>",
                                    ];

                                    ?>

                                    <td> <?php echo  $orderStatus["{$val['status']}"]; ?></td>
                                    <td class="am-hide-sm-only"><?php echo date( 'm-d H:i:s',$val[ 'ctime']);?></td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button onclick="orderInfo(' <?php echo $val['orderid'];?>')" class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                                    <span class="am-icon-eye"></span>订单详情
                                                </button>
                                            </div>
                                        </div>
                                    </td>
                                </tr>                             
                              
               			 <?php endforeach; ?>
                              
                            <?php endif; ?>
                            </tbody>


                        </table>

                        <div class="am-cf">

                            <div class="am-fr">

                            </div>
                        </div>
                        <hr>


                    </div>

                </div>
            </div>
            <div class="tpl-alert"></div>
        </div>


    </div>


</div>

  <footer data-am-widget="footer"
          class="am-footer am-footer-default"
          data-am-footer="{  }">
      
    
    <div class="am-footer-miscs ">
      <p><?php echo $this->config['copyright']?></p>
      <p><?php echo $this->config['icpcode']?></p>
      <p><?php echo $this->config['tel']?></p>
    </div>
  </footer>

  <div id="am-footer-modal"
       class="am-modal am-modal-no-btn am-switch-mode-m am-switch-mode-m-default">
    <div class="am-modal-dialog">
      <div class="am-modal-hd am-modal-footer-hd">
        <a href="javascript:void(0)" data-dismiss="modal" class="am-close am-close-spin " data-am-modal-close>&times;</a>
      </div>
      <div class="am-modal-bd">
		<?php echo $this->config['copyright']?>
		<?php echo $this->config['icpcode']?>
		<?php echo $this->config['tel']?>
	
      </div>
    </div>
  </div>
<script src="https://lib.baomitu.com/screenfull.js/5.0.0/screenfull.min.js"></script>
<script src="/static/common/layer/layer.js"></script>
<script src="/static/default/assets/js/app.js"></script>
<script src="/static/default/js/app.js"></script>
<?php echo $this->config['stacode']?>
</body>
<?php echo $this->bgrand();?>
</html>