diff --git a/adm/shop_admin/index.php b/adm/shop_admin/index.php index 6e498c334..647e6b954 100644 --- a/adm/shop_admin/index.php +++ b/adm/shop_admin/index.php @@ -14,8 +14,250 @@ $pg_anchor = '
'; + +function get_order_status_sum($status) +{ + global $g5; + + $sql = " select count(*) as cnt, + sum(od_cart_price + od_send_cost + od_send_cost2 - od_cancel_price - od_cart_coupon - od_coupon - od_send_coupon) as price + from {$g5['g5_shop_order_table']} + where od_status = '$status' "; + $row = sql_fetch($sql); + + $info = array(); + $info['count'] = (int)$row['cnt']; + $info['price'] = (int)$row['price']; + $info['href'] = './orderlist.php?od_status='.$status; + + return $info; +} + +function get_order_date_sum($date) +{ + global $g5; + + $sql = " select sum(od_cart_price + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon) as orderprice, + sum(od_cancel_price) as cancelprice + from {$g5['g5_shop_order_table']} + where SUBSTRING(od_time, 1, 10) = '$date' "; + $row = sql_fetch($sql); + + $info = array(); + $info['order'] = (int)$row['orderprice']; + $info['cancel'] = (int)$row['cancelprice']; + + return $info; +} + +function get_max_value($arr) +{ + foreach($arr as $key => $val) + { + if(is_array($val)) + { + $arr[$key] = get_max_value($val); + } + } + + sort($arr); + + return array_pop($arr); +} ?> +