4) { $srView = $srDefaultView; } // detail if (isset($_GET['detail']) && oos_is_not_null($_GET['detail'])) { $srDetail = $_GET['detail']; } if ($srDetail < 0 || $srDetail > 2) { $srDetail = $srDefaultDetail; } // report views (1: yearly 2: monthly 3: weekly 4: daily) if (isset($_GET['export']) && oos_is_not_null($_GET['export'])) { $srExp = $_GET['export']; } if ($srExp < 0 || $srExp > 2) { $srExp = $srDefaultExp; } // item_level if (isset($_GET['max']) && oos_is_not_null($_GET['max'])) { $srMax = $_GET['max']; } if (!is_numeric($srMax)) { $srMax = 0; } // order status if (isset($_GET['status']) && oos_is_not_null($_GET['status'])) { $srStatus = $_GET['status']; } if (!is_numeric($srStatus)) { $srStatus = 0; } // sort if (isset($_GET['sort']) && oos_is_not_null($_GET['sort'])) { $srSort = $_GET['sort']; } if ($srSort < 1 || $srSort > 6) { $srSort = $srDefaultSort; } // check start and end Date $startDate = ""; $startDateG = 0; if (isset($_GET['startD']) && oos_is_not_null($_GET['startD'])) { $sDay = $_GET['startD']; $startDateG = 1; } else { $sDay = 1; } if (isset($_GET['startM']) && oos_is_not_null($_GET['startM'])) { $sMon = $_GET['startM']; $startDateG = 1; } else { $sMon = 1; } if (isset($_GET['startY']) && oos_is_not_null($_GET['startY'])) { $sYear = $_GET['startY']; $startDateG = 1; } else { $sYear = date("Y"); } if ($startDateG) { $startDate = mktime(0, 0, 0, $sMon, $sDay, $sYear); } else { $startDate = mktime(0, 0, 0, date("m"), 1, date("Y")); } $endDate = ""; $endDateG = 0; if (isset($_GET['endD']) && oos_is_not_null($_GET['endD'])) { $eDay = $_GET['endD']; $endDateG = 1; } else { $eDay = 1; } if (isset($_GET['endM']) && oos_is_not_null($_GET['endM'])) { $eMon = $_GET['endM']; $endDateG = 1; } else { $eMon = 1; } if (isset($_GET['endY']) && oos_is_not_null($_GET['endY'])) { $eYear = $_GET['endY']; $endDateG = 1; } else { $eYear = date("Y"); } if ($endDateG) { $endDate = mktime(0, 0, 0, $eMon, $eDay + 1, $eYear); } else { $endDate = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y")); } require 'includes/classes/class_sales_report2.php'; $sr = new sales_report($srView, $startDate, $endDate, $srSort, $srStatus, $srFilter); $startDate = $sr->startDate; $endDate = $sr->endDate; if ($srExp < 2) { // not for csv export require 'includes/header.php'; if ($srExp < 1) { require 'includes/header.php'; } ?>

actDate < $sr->endDate) { $info = $sr->getNext(); $last = count($info) - 1; if ($srExp < 2) { ?> showDate) . SR_SEPARATOR1 . date(DATE_FORMAT, $sr->showDateEnd) . SR_SEPARATOR1; echo $info[0]['order'] . SR_SEPARATOR1; echo $info[$last - 1]['totitem'] . SR_SEPARATOR1; echo $currencies->format($info[$last - 1]['totsum']) . SR_SEPARATOR1; echo $currencies->format($info[0]['shipping']) . SR_NEWLINE; } if ($srDetail) { for ($i = 0; $i < $last; $i++) { if ($srMax == 0 or $i < $srMax) { if ($srExp < 2) { ?> 0) { echo ", " . $value; } else { echo $value; $flag = 1; } } $price = 0; foreach ($attr['price'] as $value) { $price += $value; } if ($price != 0) { echo ' ('; if ($price > 0) { echo "+"; } else { echo " "; } echo $currencies->format($price). ')'; } echo ")" . SR_SEPARATOR2; if ($srDetail == 2) { echo $attr['quant'] . SR_SEPARATOR2; echo $currencies->format( $attr['quant'] * ($info[$i]['price'] + $price)) . SR_NEWLINE; } else { echo $attr['quant'] . SR_NEWLINE; } $info[$i]['pquant'] = $info[$i]['pquant'] - $attr['quant']; } } if ($info[$i]['pquant'] > 0) { echo $info[$i]['pname'] . SR_SEPARATOR2; if ($srDetail == 2) { echo $info[$i]['pquant'] . SR_SEPARATOR2; echo $currencies->format($info[$i]['pquant'] * $info[$i]['price']) . SR_NEWLINE; } else { echo $info[$i]['pquant'] . SR_NEWLINE; } } } } } } } if ($srExp < 2) { ?>
showDate)) . " - " . oos_date_short(date("Y-m-d\ H:i:s", $sr->showDateEnd)); ?> showDate)); ?> showDate)) . " - " . oos_date_short(date("Y-m-d\ H:i:s", $sr->showDateEnd)); ?> format($info[$last - 1]['totsum']);?> format($info[0]['shipping']);?>
   ' . $attr['quant'] . 'x ' ; // $attr['options'] . ': ' $flag = 0; foreach ($attr['options_values'] as $value) { if ($flag > 0) { echo "," . $value; } else { echo $value; $flag = 1; } } $price = 0; foreach ($attr['price'] as $value) { $price += $value; } if ($price != 0) { echo ' ('; if ($price > 0) { echo "+"; } echo $currencies->format($price). ')'; } echo ''; } } ?> format($info[$i]['psum']); ?>