$csvline = $csvline . "\"" . $oneordernode->{"reference_order_id"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"recipient"}->{"name"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"recipient"}->{"phone_number"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"address1"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"address2"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"city"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"state"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"zip_code"} . "\"" . $DELIM;
        $allshipments = SafeGetProperty($oneordernode, "shipments");
        if (!is_null($allshipments)) {
            $shipmentline = "";
            foreach ($allshipments as $oneordershipmentnode) {
                //var_dump($oneordershipmentnode);
                $shipmentline = $shipmentline . SafeGetValue(SafeGetProperty($oneordershipmentnode, "shipment_tracking_number")) . $MULTIVAL_DELIM;
            }
            $csvline = $csvline . "\"" . $shipmentline . "\"" . $DELIM;
        }
        $csvline = $csvline . $NEW_LINE;
    }
    return $csvline;
}
$allorders = GetAllOrders('acknowledged');
$retstr = GetOrdersCSV($allorders);
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename="' . 'allacknowledgedorders.csv' . '";');
header("Pragma: no-cache");
header("Expires: 0");
// open the "output" stream
// see http://www.php.net/manual/en/wrappers.php.php#refsect2-wrappers.php-unknown-unknown-unknown-descriptioq
$f = fopen('php://output', 'w');
fwrite($f, $retstr);
        $csvline = $csvline . "\"" . $oneordernode->{"reference_order_id"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"recipient"}->{"name"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"recipient"}->{"phone_number"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"address1"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"address2"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"city"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"state"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"zip_code"} . "\"" . $DELIM;
        $allshipments = SafeGetProperty($oneordernode, "shipments");
        if (!is_null($allshipments)) {
            $shipmentline = "";
            foreach ($allshipments as $oneordershipmentnode) {
                //var_dump($oneordershipmentnode);
                $shipmentline = $shipmentline . SafeGetValue(SafeGetProperty($oneordershipmentnode, "shipment_tracking_number")) . $MULTIVAL_DELIM;
            }
            $csvline = $csvline . "\"" . $shipmentline . "\"" . $DELIM;
        }
        $csvline = $csvline . $NEW_LINE;
    }
    return $csvline;
}
$allorders = GetAllOrders('complete');
$retstr = GetOrdersCSV($allorders);
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename="' . 'allcompletedorders.csv' . '";');
header("Pragma: no-cache");
header("Expires: 0");
// open the "output" stream
// see http://www.php.net/manual/en/wrappers.php.php#refsect2-wrappers.php-unknown-unknown-unknown-descriptioq
$f = fopen('php://output', 'w');
fwrite($f, $retstr);
Пример #3
0
        $csvline = $csvline . "\"" . $oneordernode->{"reference_order_id"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"recipient"}->{"name"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"recipient"}->{"phone_number"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"address1"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"address2"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"city"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"state"} . "\"" . $DELIM;
        $csvline = $csvline . "\"" . $oneordernode->{"shipping_to"}->{"address"}->{"zip_code"} . "\"" . $DELIM;
        $allshipments = SafeGetProperty($oneordernode, "shipments");
        if (!is_null($allshipments)) {
            $shipmentline = "";
            foreach ($allshipments as $oneordershipmentnode) {
                //var_dump($oneordershipmentnode);
                $shipmentline = $shipmentline . SafeGetValue(SafeGetProperty($oneordershipmentnode, "shipment_tracking_number")) . $MULTIVAL_DELIM;
            }
            $csvline = $csvline . "\"" . $shipmentline . "\"" . $DELIM;
        }
        $csvline = $csvline . $NEW_LINE;
    }
    return $csvline;
}
$allorders = GetAllOrders('ready');
$retstr = GetOrdersCSV($allorders);
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename="' . 'allreadyorders.csv' . '";');
header("Pragma: no-cache");
header("Expires: 0");
// open the "output" stream
// see http://www.php.net/manual/en/wrappers.php.php#refsect2-wrappers.php-unknown-unknown-unknown-descriptioq
$f = fopen('php://output', 'w');
fwrite($f, $retstr);