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); +} ?> +
+

처리해야할 주문

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
상태변경건수금액
주문 -> 입금
입금 -> 준비
준비 -> 배송
배송 -> 완료
+
+
+ +
+

주문현황

+ + + =0; $i--) { + $date = date('Y-m-d', strtotime('-'.$i.' days', G5_SERVER_TIME)); + + $x_val[] = $date; + $arr_order[] = get_order_date_sum($date); + } + + $max_y = get_max_value($arr_order); + $max_y = ceil(($max_y) / 1000) * 1000; + $y_val = array(); + $y_val[] = $max_y; + + for($i=4; $i>=1; $i--) { + $y_val[] = $max_y * (($i * 2) / 10); + } + + $max_height = 240; + $h_val = array(); + $js_val = array(); + foreach($arr_order as $val) { + if($val['order'] > 0) + $h1 = intval(($max_height * $val['order']) / $max_y); + else + $h1 = 0; + + if($val['cancel'] > 0) + $h2 = intval(($max_height * $val['cancel']) / $max_y); + else + $h2 = 0; + + $h_val[]['order'] = $h1; + $h_val[]['cancel'] = $h2; + + $js_val['order'][] = $h1; + $js_val['cancel'][] = $h2; + } + ?> + +
+ + + +
+
+ + + +

주문현황

@@ -268,6 +510,7 @@ $pg_anchor = '