<? if (!defined('ROOT')) exit('Can\'t Access !'); include template('admin_header','admin'); ?>
  <div id="right">
    <div class="right">
      <div style="width:auto;overflow-x:hidden;overflow-y:auto">
      
      <? if($_GET['get']=='store') { ?>
        <div class="tags">
          <div id="tagstitle">
            <a href="<?=Purl('admin_refund')?>" <? if(!$_GET['typeid']) { ?>class="hover"<? } ?>><?=$getName?></a>
          </div>
          <div id="tagscontent">
            <div id="con_one_1">
              <div class="table_td" style="margin-top:10px;">
  
              <table border="0" cellspacing="2" cellpadding="4"  width="100%">
                <tbody>
                  <tr bgcolor="#ffffff">
                    <td class="left" width="100">请输入关键词</td>
                    <td>
                     <form method="get" action="">
                     <input type="hidden" name="mod" id="mod" value="admin" />
                     <input type="hidden" name="act" id="act" value="refund" />
                     <input type="text" name="keyword" id="keyword" value="<?=$_GET['keyword']?>"  class='skey' style='width:200px;'/>    
                    <input type="submit" name="button" id="button" value="搜索会员" class='button'>           
                      </form>
                      </td>
                  </tr>
                </tbody>
              </table>
  
  
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                        <th align="center">消费编号</th>
                        <th align="center">消费订单号</th>
                        <th align="center">消费用户</th>
                        <th align="center">商户名称</th>
                        <th align="center">购买商品</th>
                        <th align="center">购买数量</th>
                        <th align="center">消费金额</th>
                        <th align="center">让利金额</th> 
                        <th align="center">消费时间</th>
                      </tr>
                    </thead>
                    
            <? if(is_array($this->store)) { foreach($this->store as $value) { ?>                    <tbody>
                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                        <td align="center"><?=$value['id']?></td>
                        <td align="center"><?=$value['orderid']?></td>
                        <td align="center"><?=$this->mysql->value($this->pre."user","username","uid=".$value['uid']); ?></td>
                        <td align="center"><?=$this->mysql->value($this->pre."company","name","uid=".$value['cid']); ?></td>
                        <td align="center"><?=$value['shopname']?></td>
                        <td align="center"><?=$value['shopnum']?></td>
                        <td align="center"><span class="red"><?=fnum($value['money']); ?>元</span></td>
                        <td align="center"><span class="red"><?=fnum($value['yfmoney']); ?>元</span></td>
                        <td align="center"><?=formattime($value['addtime']); ?></td>
                      </tr>
                    </tbody>
            <? } } ?>                    

                  </table>
                <div class="blank20"></div>
                <div class="page"><span><?=$this->pagetotal?>条记录/<? echo $_GET['page'] ? $_GET['page'] : 1  ?>页</span><?=$this->showpage?></div>
                <div class="blank20"></div>
              </div>
            </div>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>
      
      <? if($_GET['get']=='atmlog') { ?>
        <div class="tags">
          <div id="tagstitle">
            <a href="<?=Purl("?mod=admin&act=refund&get=atmlog");; ?>" class="hover"><?=$getName?></a>
          </div>
          <div id="tagscontent">
            <div id="con_one_1">
              <div class="table_td" style="margin-top:10px;">
              <table border="0" cellspacing="2" cellpadding="4"  width="100%">
                <tbody>
                  <tr bgcolor="#ffffff">
                    <td class="left" width="100">导出提现记录：</td>
                    <td>
                     <form method="get" action="" target="_blank">
                     <input type="hidden" name="mod" id="mod" value="admin" />
                     <input type="hidden" name="act" id="act" value="refund" />
                     <input type="hidden" name="get" id="get" value="atmexcel" />
                   状态： <?=config::form('checked',$_GET['checked'],'radio','[<><全部>][<0><未付款>][<1><已付款>]');?>                  
                   
              时间段： <?=config::form('time','','datas','','class=\'skey\' style=\'width:50px;\'');?>
                    <input type="submit" name="button" id="button" value="马上导出" class='button'>           
                      </form>
                      </td>
                  </tr>
                </tbody>
              </table>
              <br />
                            <form method="post" action="" onsubmit="return remind();">
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                         <th width="60px"><input type="checkbox" id="chkall" name="chkall" onclick="checkall(this.form, 'id')"></th>
                        <th align="center">序号</th>
                        <th align="center">提现金额</th>
                        <th align="center">申请用户</th>
                        <th align="center">收款信息</th>
                        <th align="center">申请时间</th>
                        <th align="center">操作</th>
                      </tr>
                    </thead>
                    
            <? if(is_array($this->atmlog)) { foreach($this->atmlog as $value) { ?>            <? $user = $this->mysql->select_one("select * from ".$this->pre."user where uid=".$value['uid']);
              $value['checkurl'] = rewrite::request("?mod=".$this->module."&act=".$this->action."&get=atmlog&id=".$value['id']);
             ?>                    <tbody>
                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                                              <td align="center" ><input type="checkbox" name="id[]" value="<?=$value['id']?>"></td>
                        <td align="center"><?=$value['id']?></td>
                        <td align="center"><span class="red"><?=fnum($value['lognum']); ?>元</span></td>
                        <td align="left" style="padding-left:10px;">用户：<?=$user['username']?><br />姓名：<?=$user['truename']?><br />电话：<?=$user['userphone']?></td>
                        <td align="left" style="padding-left:10px;">
                         开户名：<?=$user['truename']?><br />开户行：<?=$value['bankname']?><br />银行卡号：<?=$value['bankcard']?>
                         </td>
                        <td align="center"><?=formattime($value['addtime']); ?></td>
                        <td align="center" width="100">
                         <? if($value['checked']) { ?>
                          已经付款
                         <? } else { ?>
                          <a href="<?=$value['checkurl']?>" onclick="return remind();">确认付款</a>
                         <? } ?>
                        </td>
                      </tr>
                    </tbody>
            <? } } ?>                    

                  </table>
                <div class="blank20"></div>
                <?=config::form('button','批量确认付款','submit','','class=\'button\'');?>
                </form>
                <div class="page"><span><?=$this->pagetotal?>条记录/<? echo $_GET['page'] ? $_GET['page'] : 1  ?>页</span><?=$this->showpage?></div>
                <div class="blank20"></div>
              </div>
            </div>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>
      
      
      <? if($_GET['get']=='reslog') { ?>
        <div class="tags">
          <div id="tagstitle">
            <a href="javascript:;" <? if(!$_GET['typeid']) { ?>class="hover"<? } ?>><?=$getName?></a>
          </div>
          <div id="tagscontent">
            <div id="con_one_1">
              <div class="table_td" style="margin-top:10px;">
              
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                        <th align="center">序号</th>
                        <th align="center">返利类型</th>
                        <th align="center">返利金额</th>
                        <th align="center">返利说明</th>
                        <th align="center">返利用户</th>
                        <th align="center">返利时间</th>
                      </tr>
                    </thead>
                    
            <? if(is_array($this->reslog)) { foreach($this->reslog as $value) { ?>                    <tbody>
                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                        <td align="center"><?=$value['id']?></td>
                        <td align="center"><?=reslog($value['type']); ?></td>
                        <td align="center"><span class="red"><?=fnum($value['lognum']); ?>元</span></td>
                        <td align="left" style="padding-left:5px;"><?=$value['content']?></td>
                        <td align="center"><?=$this->mysql->value($this->pre."user","username","uid=".$value['uid']); ?></td>
                        <td align="center"><?=formattime($value['addtime']); ?></td>
                      </tr>
                    </tbody>
            <? } } ?>                    

                  </table>
                <div class="blank20"></div>
                <div class="page"><span><?=$this->pagetotal?>条记录/<? echo $_GET['page'] ? $_GET['page'] : 1  ?>页</span><?=$this->showpage?></div>
                <div class="blank20"></div>
              </div>
            </div>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>
      
      
      <? if($_GET['get']=='payorder') { ?>
        <div class="tags">
          <div id="tagstitle">
            <a href="javascript:;" <? if(!$_GET['typeid']) { ?>class="hover"<? } ?>><?=$getName?></a>
          </div>
          <div id="tagscontent">
            <div id="con_one_1">
              <div class="table_td" style="margin-top:10px;">
                      
              
              
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                        <th align="center">序号</th>
                        <th align="center">充值订单号</th>
                        <th align="center">充值金额</th>
                        <th align="center">充值方式</th>
                        <th align="center">目前状态</th>
                        <th align="center">充值用户</th>
                        <th align="center">充值时间</th>
                      </tr>
                    </thead>
                    
            <? if(is_array($this->paylog)) { foreach($this->paylog as $value) { ?>                    <tbody>
                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                        <td align="center"><?=$value['id']?></td>
                        <td align="center"><?=$value['orderid']?></td>
                        <td align="center"><span class="red"><?=fnum($value['total_fee']); ?>元</span></td>
                        <td align="center"><?=$value['paytype']?></td>
                        <td align="center"><?=paycheck($value['checked'],$value['orderid'],$value['id']); ?></td>
                        <td align="left" style="padding-left:10px;"><?=$this->mysql->value($this->pre."user","username","uid=".$value['uid']); ?></td>
                        <td align="center"><? echo formattime($value['addtime']) ?></td>
  
                      </tr>
                    </tbody>
            <? } } ?>                    

                  </table>
                <div class="blank20"></div>
                <div class="page"><span><?=$this->pagetotal?>条记录/<? echo $_GET['page'] ? $_GET['page'] : 1  ?>页</span><?=$this->showpage?></div>
                <div class="blank20"></div>
              </div>
            </div>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>
      
      
      <? if($_GET['get']=='res') { ?>
        <div class="tags">
          <div id="tagstitle">
            <a href="javascript:;" <? if(!$_GET['typeid']) { ?>class="hover"<? } ?>><?=$getName?></a>
          </div>
          <div id="tagscontent">
            <div id="con_one_1">
              <div>
                <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                  <tbody>
                  
                    <tr bgcolor="#F5F5F5">
                      <td class="leftaaa">昨天总营业额</td>
                      <td>&nbsp;<?=$this->ztyye?>元</td>
                      <td class="leftaaa">共需返现总金额</td>
                      <td>&nbsp;<?=$this->allje?>元</td>
                      <td class="leftaaa">已返现总金额</td>
                      <td>&nbsp;<?=$this->yfanje?>元</td>  
                      <td class="leftaaa">剩余返现总金额</td>
                      <td>&nbsp;<?=$this->sfanje?>元</td>  
                      <td class="leftaaa">今天结算将返利</td>
                      <td>&nbsp;<?=$this->todayje?>元</td> 
                    </tr>
                    
  

                    
                  </tbody>
                </table>
              </div>
            
              <div class="table_td" style="margin-top:10px;">
                      
              
              
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                        <th align="center">序号</th>
                        <th align="center">返现总额</th>
                        <th align="center">剩余返现</th>
                        <th align="center">已返金额</th>
                        <th align="center">下次返现</th>
                        <th align="center">当前状态</th>
                        <th align="center">所属用户</th>
                        <th align="center">创建时间</th>
                      </tr>
                    </thead>
                    
            <? if(is_array($this->res)) { foreach($this->res as $value) { ?>                    <tbody>
                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                        <td align="center"><?=$value['id']?></td>
                        <td align="center"><span class="red"><?=fnum($value['money']); ?>元</span></td>
                        <td align="center"><span class="red"><?=fnum($value['money']-$value['resmoney']); ?>元</span></td>
                        <td align="center"><span class="red"><?=fnum($value['resmoney']); ?>元</span></td>
                        <td align="center"><?=rescheck($value['checked'],$value['restime']); ?></td>
                        <td align="center"><?=rescheck($value['checked']); ?></td>  
                        <td align="center"><?=$this->mysql->value($this->pre."user","username","uid=".$value['uid']); ?></td>
                        <td align="center"><? echo formattime($value['addtime']) ?></td>
  
                      </tr>
                    </tbody>
            <? } } ?>                    

                  </table>
                <div class="blank20"></div>
                <div class="page"><span><?=$this->pagetotal?>条记录/<? echo $_GET['page'] ? $_GET['page'] : 1  ?>页</span><?=$this->showpage?></div>
                <div class="blank20"></div>
              </div>
            </div>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>
      
<? if($_GET['get']=='settle') { ?>
        <div class="tags">
          <div id="tagstitle"><a class="hover"><?=$getName?></a></div>
          <div id="tagscontent">

              <div>

  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
    <tbody>
      <tr>
        <td class="left">昨天营业额</td>
        <td style="padding-left:10px"><?=$this->allmoney?> 元</td>
      </tr>
      
      <tr>
        <td class="left">共需返现金额</td>
        <td style="padding-left:10px"><?=$this->allje?> 元</td>
      </tr>
      
                    
                    <tr>
                      <td class="left">已返现总金额</td>
                      <td style="padding-left:10px"><?=$this->yfanje?>元</td>
                    </tr>

                    <tr>
                      <td class="left">剩余返现金额</td>
                      <td style="padding-left:10px"><?=$this->sfanje?>元</td>
                    </tr>
                    
                    <tr>
                      <td class="left">分红权</td>
                     <td style="padding-left:10px">分红中：<?=$this->_unumber?>个 排队中：<?=$this->unumber-$this->_unumber; ?>个 总分红权：<?=$this->unumber?>个 </td>
                    </tr>


      <? if(!is_array($this->restemp)) { ?>
      <tr>
        <td class="left">要拿多少分</td>
        <td style="padding-left:10px"></td>
      </tr>
      <tr>
        <td class="left">分红权分红</td>
        <td style="padding-left:10px"><span id="money_"><?=$this->onemoney?></span>元</td>
      </tr>
      <? } else { ?>
      <tr>
        <td class="left">要拿多少分</td>
        <td style="padding-left:10px">今天已经结算过，如未结算完毕， 继续结算</td>
      </tr>
  
      <tr>
        <td class="left">说明：</td>
        <td style="padding-left:10px">此为演示版，本页面功能已经被阉割，需要请联系QQ2116198029购买。</td>
      </tr>
      <tr>
        <td class="left">分红权分红</td>
        <td style="padding-left:10px"><span id="money_"><?=$this->restemp['onemoney']?></span>元</td>
      </tr>
      <? } ?>
</tbody>
</table>
      <? if(!is_array($this->restemp)) { ?>
       <?=config::form('button','马上结算','submit','','class=\'button\'');?>
      <? } else { ?>
        <?=config::form('button','继续上次结算','submit','','class=\'button\'');?>
      <? } } ?>
              </div>
              <div class="blank20"></div>

          </div>
        </div>
        <div class="blank20"></div>
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<? include template('admin_footer','admin'); ?>
