<?php import('session'); import('products'); import('delivery'); import('html'); import('contacts'); import('orders'); import('shipments'); import('forms'); import('contacts'); import('documents'); $order_id = $_GET['id']; if (order_exists($order_id)) { $order = order_get($order_id); if ($order['PARTY_ID'] == $_SESSION['user']['PARTY_ID']) { $order_cart = unserialize($order['SESSION_SERILIALIZE']); $documents = documents_get($order_id); $shipment = shipment_get($order_id); if (!empty($shipment)) { if ($shipment['DESTINATION_CONTACT_MECH_ID'] == SHIPMENT_REQUISITION) { $address = 'Look at requisition files'; } else { $address = contact_generate_string(contact_mech_get_attributes($shipment['DESTINATION_CONTACT_MECH_ID'])); } } } else { $errors[] = sprintf('Order %d does not belong to you!', $order_id); } } else { $errors[] = sprintf('Order %d does not exist!', $order_id);
import('session'); import('cart'); import('products'); import('forms'); import('delivery'); import('html'); import('contacts'); import('orders'); import('shipments'); import('documents'); import('mails'); import('html2pdf/html2pdf.class'); // Here the users starts ordering from tan existing offer and we // load the basket with it if (isset($_GET['copy']) && (int) $_GET['copy'] > 0 || isset($_GET['copy']) && stristr($_GET['copy'], 'Offer') !== false) { if (order_exists($_GET['copy'])) { $order = order_get($_GET['copy']); if ($order['PARTY_ID'] == $_SESSION['user']['PARTY_ID']) { $Cart->fromString($order['SESSION_SERILIALIZE']); $Cart->setFromOffer($_GET['copy']); $success[] = 'You order is now similar to order %d from %s'; } else { $errors[] = sprintf('Order %d does not belong to you!', $_GET['copy']); } } else { $errors[] = sprintf('Order %d does not exist!', $_GET['copy']); } } // If we have data coming from the order form // we save it in the cart if (isset($_POST) && !empty($_POST)) {