<?php
$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
checkAuth('83');	//判断登录和权限
include_once(CORE_LIB . "/PHPExcel/Classes/PHPExcel.php"); 
include_once(CORE_LIB . "/PHPExcel/Classes/PHPExcel/IOFactory.php"); 
include_once(CORE_LIB . "/PHPExcel/Classes/PHPExcel/Reader/Excel5.php"); 
include_once(CORE_LIB . "/PHPExcel/Classes/PHPExcel.php"); 
include_once(CORE_LIB . "/growth/GrowthRewardUpload.php"); 
$js .= "<script src='".$conf_basedir."script/js/layer/layer.js'></script>";


$title ="批量赠送确认";
 //设置顶部查询部分
$growth = new GrowthRewardUpload();

$cond_arr_2=array("2"=>"请选择","0"=>"待赠送","1"=>"已赠送");
$cond_search_2	= tonyForm("select","status",$cond_arr_2,$status);
$where ="";


if($status==='0'){
   $where .= "status = 0";
  
}elseif($status==='1'){
    $where .= "status = 1";
}


if($keyword = trim($keyword)){    
    $where .= $where == "" ? "" : " and";
    $where .= " event like '".$keyword."%' ";            

} 

//获得数据当前页面数据
$numrows = $growth->getRewardCreditLogNum($where);

//分页参数
$pagesize	= $display_rows ? intval($display_rows) : 20;
$page_now	= $page_now ? max(1, intval($page_now)) : 1 ; // 获取当前页数
$offset		= ( $page_now - 1 ) * $pagesize;    


$CreditArr = $growth->getRewardCreditLog($where,$offset, $pagesize);



$pagenum = $numrows;//当前页面数量
$numrows = $numrows >0 ? $numrows : 0;
$time = time();
if( $numrows <= 0 || $pagenum <=0){
    $pages = 0 ;  //计算总页数
}else{
    $pages = ceil($numrows/$pagesize) ;  //计算总页数
    $new_pagenavi = new_pagenavi($page_now,$pages,$numrows);
}




include_once(Template("header"));
include_once(Template("growth/reward_upload_confirm"));
include_once(Template("footer"));

?>