<?php /*a:3:{s:72:"/data/web/mall.valimart.net/app/admin/view/statgoods/stat_goodssale.html";i:1657785098;s:61:"/data/web/mall.valimart.net/app/admin/view/public/header.html";i:1657785098;s:66:"/data/web/mall.valimart.net/app/admin/view/public/admin_items.html";i:1657785098;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title><?php echo htmlentities((isset($html_title) && ($html_title !== '')?$html_title:config('ds_config.site_name'))); ?><?php echo htmlentities(lang('system_backend')); ?></title>
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <link rel="stylesheet" href="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/css/admin.css">
        <link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.css">
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery-2.1.4.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.validate.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.cookie.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/common.js"></script>
        <script src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/admin.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery.ui.datepicker-zh-CN.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/perfect-scrollbar.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/layer/layer.js"></script>
        <script type="text/javascript">
            var BASESITEROOT = "<?php echo htmlentities(BASE_SITE_ROOT); ?>";
            var ADMINSITEROOT = "<?php echo htmlentities(ADMIN_SITE_ROOT); ?>";
            var BASESITEURL = "<?php echo htmlentities(BASE_SITE_URL); ?>";
            var HOMESITEURL = "<?php echo htmlentities(HOME_SITE_URL); ?>";
            var ADMINSITEURL = "<?php echo htmlentities(ADMIN_SITE_URL); ?>";
        </script>
    </head>
    <body>
        <div id="append_parent"></div>
        <div id="ajaxwaitid"></div>







<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3><?php echo htmlentities(lang('ds_statgoods')); ?></h3>
                <h5></h5>
            </div>
            <?php if($admin_item): ?>
<ul class="tab-base ds-row">
    <?php if(is_array($admin_item) || $admin_item instanceof \think\Collection || $admin_item instanceof \think\Paginator): if( count($admin_item)==0 ) : echo "" ;else: foreach($admin_item as $key=>$item): ?>
    <li><a href="<?php echo htmlentities($item['url']); ?>" <?php if($item['name'] == $curitem): ?>class="current"<?php endif; ?>><span><?php echo htmlentities($item['text']); ?></span></a></li>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</ul>
<?php endif; ?>
        </div>
    </div>
   <div class="fixed-empty"></div>
    <form method="get"  name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dd>
                    <select name="search_type" id="search_type" class="querySelect">
                        <option value="day" <?php if(isset($search_arr['search_type']) && $search_arr['search_type'] == 'day'): ?>selected<?php endif; ?>><?php echo htmlentities(lang('search_type_day')); ?></option>
                        <option value="week" <?php if(isset($search_arr['search_type']) && $search_arr['search_type'] == 'week'): ?>selected<?php endif; ?>><?php echo htmlentities(lang('search_type_week')); ?></option>
                        <option value="month" <?php if(isset($search_arr['search_type']) && $search_arr['search_type'] == 'month'): ?>selected<?php endif; ?>><?php echo htmlentities(lang('search_type_month')); ?></option>
                    </select>
                </dd>
                <dd id="searchtype_day" style="display:none;">
                    <input class="txt date" type="text" value="<?php echo date('Y-m-d',$search_arr['day']['search_time']); ?>" id="search_time" name="search_time">
                </dd>
                <dd id="searchtype_week" style="display:none;">
                    <select name="searchweek_year" class="querySelect">
                        <?php if(is_array($year_arr) || $year_arr instanceof \think\Collection || $year_arr instanceof \think\Paginator): if( count($year_arr)==0 ) : echo "" ;else: foreach($year_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $search_arr['week']['current_year']==$key ? 'selected' : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <select name="searchweek_month" class="querySelect">
                        <?php if(is_array($month_arr) || $month_arr instanceof \think\Collection || $month_arr instanceof \think\Paginator): if( count($month_arr)==0 ) : echo "" ;else: foreach($month_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $search_arr['week']['current_month']==$key ? 'selected' : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <select name="searchweek_week" class="querySelect">
                        <?php if(is_array($week_arr) || $week_arr instanceof \think\Collection || $week_arr instanceof \think\Paginator): if( count($week_arr)==0 ) : echo "" ;else: foreach($week_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($v['key']); ?>" <?php echo $search_arr['week']['current_week']==$key ? 'selected' : ''; ?>><?php echo htmlentities($v['val']); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </dd>
                <dd id="searchtype_month" style="display:none;">
                    <select name="searchmonth_year" class="querySelect">
                        <?php if(is_array($year_arr) || $year_arr instanceof \think\Collection || $year_arr instanceof \think\Paginator): if( count($year_arr)==0 ) : echo "" ;else: foreach($year_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $search_arr['month']['current_year']==$key ? 'selected' : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <select name="searchmonth_month" class="querySelect">
                        <?php if(is_array($month_arr) || $month_arr instanceof \think\Collection || $month_arr instanceof \think\Paginator): if( count($month_arr)==0 ) : echo "" ;else: foreach($month_arr as $key=>$v): ?>
                        <option value="<?php echo htmlentities($key); ?>" <?php echo $search_arr['month']['current_month']==$key ? 'selected' : ''; ?>><?php echo htmlentities($v); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </dd>
                <dd><?php echo htmlentities(lang('ds_goods')); ?><input class="txt-long" type="text" name="goods_name" value="<?php echo htmlentities(app('request')->param('goods_name')); ?>" /></dd>
                <dd><?php echo htmlentities(lang('ds_store_name')); ?><input class="txt-long" type="text" name="store_name" value="<?php echo htmlentities(app('request')->param('store_name')); ?>" /></dd>
                <dt><?php echo htmlentities(lang('ds_class')); ?></dt>
                <dd id="searchgc_td"></dd>
                <input type="hidden" id="choose_gcid" name="choose_gcid" value="0"/>
                <input type="hidden" id="exporttype"  name="exporttype"  value="">         	
            </dl>
            <div class="btn_group">
                <a href="javascript:void(0);" id="dssubmit" class="btn tooltip"><?php echo htmlentities(lang('ds_query')); ?></a>
                <a href="<?php echo url('Statgoods/goods_sale'); ?>" class="btn btn-default" title="<?php echo htmlentities(lang('ds_cancel')); ?>"><?php echo htmlentities(lang('ds_cancel')); ?></a>
            </div>
        </div>       
  </form>

  <div class="explanation" id="explanation">
        <div class="title" id="checkZoom">
            <h4 title="<?php echo htmlentities(lang('ds_explanation_tip')); ?>"><?php echo htmlentities(lang('ds_explanation')); ?></h4>
            <span id="explanationZoom" title="<?php echo htmlentities(lang('ds_explanation_close')); ?>" class="arrow"></span>
        </div>
        <ul>
            <li><?php echo htmlentities(lang('stat_validorder_explain')); ?></li>
        	<li><?php echo htmlentities(lang('statgoods_stat_goodssale_help1')); ?></li>
            <li><?php echo htmlentities(lang('statgoods_stat_goodssale_help2')); ?></li>
        </ul>
    </div>


  <div id="container" class="w100pre close_float">
      <div style="text-align:right;">
      	<a class="btn btn-mini" href="javascript:void(0);" id="export_btn"><?php echo htmlentities(lang('ds_export')); ?>Excel</a>
      </div>
  </div>
  <table class="ds-default-table">
    <thead>
      <tr class="thead sortbar-array" >
	      <th class="align-center"><?php echo htmlentities(lang('ds_goods')); ?></th>
	      <th class="align-center"><?php echo htmlentities(lang('goods_commonid')); ?></th>
	      <th class="align-center"><?php echo htmlentities(lang('ds_store_name')); ?></th>
	      <th class="align-center">
            <a ds_type="orderitem" data-param='{"orderby":"goodsnum"}' class="{!$orderby || $orderby=='goodsnum desc' ?'selected desc':''}<?php echo $orderby=='goodsnum asc' ? 'selected asc' : ''; ?>"><?php echo htmlentities(lang('goodsnum')); ?><i></i></a>
          </th>
	      <th class="align-center">
            <a ds_type="orderitem" data-param='{"orderby":"ordernum"}' class="<?php echo $orderby=='selected desc' ? 'selected desc' : ''; ?> <?php echo $orderby=='ordernum asc' ? 'selected asc' : ''; ?>"><?php echo htmlentities(lang('statstore_ordernum')); ?><i></i></a>
          </th>
	      <th class="align-center">
            <a ds_type="orderitem" data-param='{"orderby":"goodsamount"}' class="<?php echo $orderby=='goodsamount desc' ? 'selected desc' : ''; ?><?php echo $orderby=='goodsamount asc' ? 'selected asc' : ''; ?>"><?php echo htmlentities(lang('statstore_orderamount')); ?><i></i></a>
          </th>
      </tr>
    </thead>
    <tbody id="datatable">
    <?php if(!(empty($goods_list) || (($goods_list instanceof \think\Collection || $goods_list instanceof \think\Paginator ) && $goods_list->isEmpty()))): if(is_array($goods_list) || $goods_list instanceof \think\Collection || $goods_list instanceof \think\Paginator): if( count($goods_list)==0 ) : echo "" ;else: foreach($goods_list as $key=>$v): ?>
      <tr class="hover">
        <td class="align-left">
          <a href="<?php echo url('home/Goods/index',['goods_id'=>$v['goods_id']]); ?>" target="_blank"><?php echo htmlentities($v['goods_name']); ?></a>
        </td>
        <td class="align-center"><?php echo htmlentities($v['goods_commonid']); ?></td>
        <td class="align-center"><?php echo htmlentities($v['store_name']); ?></td>
        <td class="align-center"><?php echo htmlentities($v['goodsnum']); ?></td>
        <td class="align-center"><?php echo htmlentities($v['ordernum']); ?></td>
        <td class="align-center"><?php echo htmlentities($v['goodsamount']); ?></td>
      </tr>
    <?php endforeach; endif; else: echo "" ;endif; else: ?>
    <tr class="no_data">
      <td colspan="15"><?php echo htmlentities(lang('ds_no_record')); ?></td>
    </tr>
   <?php endif; ?>
    </tbody>
  </table>
   <?php echo $show_page; ?>
</div>
<script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/highcharts/highcharts.js"></script>
<script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/statistics.js"></script>
<script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/mlselection.js"></script>
<script>
//展示搜索时间框
function show_searchtime(){
    s_type = $("#search_type").val();
    $("[id^='searchtype_']").hide();
    $("#searchtype_"+s_type).show();
}
$(function () {
    //统计数据类型
    var s_type = $("#search_type").val();
    $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});

    show_searchtime();
    $("#search_type").change(function(){
        show_searchtime();
    });

    //更新周数组
    $("[name='searchweek_month']").change(function(){
        var year = $("[name='searchweek_year']").val();
        var month = $("[name='searchweek_month']").val();
        $("[name='searchweek_week']").html('');
        $.getJSON(ADMINSITEURL+'/Common/getweekofmonth.html',{y:year,m:month},function(data){
            if(data != null){
                for(var i = 0; i < data.length; i++) {
                    $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
                }
            }
        });
    });

    $('#dssubmit').click(function(){
        $("#exporttype").val('');
        $("#orderby").val('');
        $('#formSearch').submit();
    });

    //导出图表
    $("#export_btn").click(function(){
        $("#exporttype").val('excel');
        $('#formSearch').submit();
    });
    //排序
    $("[ds_type='orderitem']").click(function(){
        $("#exporttype").val('');
        var data_str = $(this).attr('data-param');
        eval( "data_str = "+data_str);
        if($(this).hasClass('desc')){
            $("#orderby").val(data_str.orderby + ' asc');
        } else {
            $("#orderby").val(data_str.orderby + ' desc');
        }
        $('#formSearch').submit();
    });

    //商品分类
    init_gcselect(<?php echo $gc_choose_json; ?>,<?php echo $gc_json; ?>);
    /* AJAX选择品牌 */
    $("#ajax_brand").brandinit();
});
</script>