function add_transaction()
{
    $json_trans = $_GET['trans'];
    $transaction = json_decode($json_trans);
    $total = $transaction->total;
    $phone_number = $transaction->phoneNumber;
    $phone_number = "'" . $phone_number . "'";
    $product_barcodes = $transaction->productBarcode;
    include_once 'transaction.php';
    $obj = new transaction();
    if (!$obj->connect()) {
        $json = "Failed to connect to the database.";
        echo $json;
    }
    if ($obj->add_transaction($phone_number, $total)) {
        include_once 'order.php';
        $order_obj = new order();
        $order_obj->connect();
        $trans_id = $obj->get_insert_id();
        $order_obj->add_orders($trans_id, $product_barcodes);
        if ($total > 500) {
            //            $message = "You have a 10% discount the next time you purchase.";
            //            send_smsgh($phone_number, $message);
        }
        $json = "The transaction was added.";
        echo $json;
    } else {
        $json = "The transaction was not added.";
        echo $json;
    }
}
示例#2
0
 public function getDeliveryPrice(order $order)
 {
     $deliveryPrice = $this->object->price;
     $minOrderPrice = $this->object->order_min_price;
     if (is_null($minOrderPrice)) {
         return $deliveryPrice;
     }
     $orderPrice = $order->getActualPrice() - $order->getDeliveryPrice();
     return $orderPrice < $minOrderPrice ? $deliveryPrice : 0;
 }
 public function getDeliveryPrice(order $order)
 {
     $objects = umiObjectsCollection::getInstance();
     $deliveryAddress = $objects->getObject($order->delivery_address);
     if (!$deliveryAddress) {
         return "Невозможно автоматически определить стоимость";
     }
     $orderPrice = $order->getActualPrice();
     $weight = 0;
     $items = $order->getItems();
     foreach ($items as $item) {
         $element = $item->getItemElement();
         $itemWeight = (int) $element->getValue("weight");
         if ($itemWeight != 0) {
             $weight += $itemWeight * $item->getAmount();
         } else {
             return "Невозможно автоматически определить стоимость";
         }
     }
     $viewPost = $objects->getObject($this->object->viewpost)->getValue("identifier");
     if ($viewPost == 44 || $viewPost == 45) {
         $weight = $weight / 1000;
         $departureCity = $objects->getObject($this->object->departure_city);
         $departureCity = $departureCity instanceof umiObject ? $departureCity->getName() : "Москва";
         $city = $deliveryAddress->getValue("city");
         $response = $this->calculateSumEMS($price, $departureCity, $city, $weight, $min, $max, $flag);
         if ($flag == 'ok') {
             $price = $response->price;
             $min = $response->term->min;
             $max = $response->term->max;
             $flag = " {$price} руб. (займет от {$min} до {$max} дней)";
         }
         return $flag;
     } else {
         $typePost = $objects->getObject($this->object->typepost)->getValue("identifier");
         $value = $this->object->setpostvalue ? ceil($order->getActualPrice()) : 0;
         $zip = $deliveryAddress->getValue("index");
         $url = "http://www.russianpost.ru/autotarif/Autotarif.aspx?viewPost={$viewPost}&countryCode=643&typePost={$typePost}&weight={$weight}&value1={$value}&postOfficeId={$zip}";
         $content = umiRemoteFileGetter::get($url);
         if (preg_match("/<input id=\"key\" name=\"key\" value=\"(\\d+)\"\\/>/i", $content, $match)) {
             $key = trim($match[1]);
             $content = umiRemoteFileGetter::get($url, false, array('Content-type' => 'application/x-www-form-urlencoded'), array('key' => $key));
             $content = umiRemoteFileGetter::get($url);
         }
         if (preg_match("/span\\s+id=\"TarifValue\">([^<]+)<\\/span/i", $content, $match)) {
             $price = floatval(str_replace(",", ".", trim($match[1])));
             if ($price > 0) {
                 return $price;
             } elseif (preg_match("/span\\s+id=\"lblErrStr\">([^<]+)<\\/span/i", $content, $match)) {
                 return $match[1];
             }
         }
         return "Не определено. Свяжитесь с менеджером для уточнения информации.";
     }
 }
 public function validateOrder(order $order)
 {
     $orderPrice = $order->getOriginalPrice();
     if ($this->minimum && $orderPrice < $this->minimum) {
         return false;
     }
     if ($this->maximum && $orderPrice > $this->maximum) {
         return false;
     }
     return true;
 }
示例#5
0
/**
 * delete a page
 *
 * @access public
 * @param  integer $page_id
 * @return void
 *
 **/
function delete_page($page_id)
{
    global $admin, $database, $MESSAGE;
    // Find out more about the page
    $page_info = array();
    $database->execute_query('SELECT `link`, `parent` FROM `' . TABLE_PREFIX . 'pages` WHERE `page_id` = ' . $page_id, true, $page_info, false);
    if ($database->is_error()) {
        $admin->print_error($database->get_error());
    }
    if (count($page_info) == 0) {
        $admin->print_error($MESSAGE['PAGES_NOT_FOUND']);
    }
    // Get the sections that belong to the page
    $all_sections = array();
    $database->execute_query('SELECT `section_id`, `module` FROM `' . TABLE_PREFIX . 'sections` WHERE `page_id` = ' . $page_id, true, $all_sections);
    foreach ($all_sections as &$section) {
        // Set section id
        $section_id = $section['section_id'];
        // Include the modules delete file if it exists
        if (file_exists(LEPTON_PATH . '/modules/' . $section['module'] . '/delete.php')) {
            include LEPTON_PATH . '/modules/' . $section['module'] . '/delete.php';
        }
    }
    // Update the pages table
    $sql = 'DELETE FROM `' . TABLE_PREFIX . 'pages` WHERE `page_id` = ' . $page_id;
    $database->query($sql);
    if ($database->is_error()) {
        $admin->print_error($database->get_error());
    }
    // Update the sections table
    $sql = 'DELETE FROM `' . TABLE_PREFIX . 'sections` WHERE `page_id` = ' . $page_id;
    $database->query($sql);
    if ($database->is_error()) {
        $admin->print_error($database->get_error());
    }
    // Include the ordering class or clean-up ordering
    include_once LEPTON_PATH . '/framework/class.order.php';
    $order = new order(TABLE_PREFIX . 'pages', 'position', 'page_id', 'parent');
    $order->clean($page_info['parent']);
    // Unlink the page access file and directory
    $directory = LEPTON_PATH . PAGES_DIRECTORY . $page_info['link'];
    $filename = $directory . PAGE_EXTENSION;
    $directory .= '/';
    if (file_exists($filename)) {
        if (!is_writable(LEPTON_PATH . PAGES_DIRECTORY . '/')) {
            $admin->print_error($MESSAGE['PAGES_CANNOT_DELETE_ACCESS_FILE']);
        } else {
            unlink($filename);
            if (file_exists($directory) && rtrim($directory, '/') != LEPTON_PATH . PAGES_DIRECTORY && $page_info['link'][0] != '.') {
                rm_full_dir($directory);
            }
        }
    }
}
 public function order_edit()
 {
     $object = $this->expectObject("param0", true);
     $mode = (string) getRequest('param1');
     $objectId = $object->getId();
     $this->setHeaderLabel("header-users-edit-" . $this->getObjectTypeMethod($object));
     $this->checkSv($objectId);
     $inputData = array("object" => $object, "allowed-element-types" => array('emarket', 'order'));
     if ($mode == "do") {
         $oldDeliveryPrice = $object->getValue('delivery_price');
         $object = $this->saveEditedObjectData($inputData);
         $newDeliveryPrice = $object->getValue('delivery_price');
         $order = order::get($object->id);
         $amounts = getRequest('order-amount-item');
         $dels = getRequest('order-del-item');
         $isChanged = false;
         if (is_array($amounts)) {
             foreach ($amounts as $itemId => $amount) {
                 $item = $order->getItem($itemId);
                 if ($item instanceof orderItem) {
                     if ($item->getAmount() != $amount) {
                         $item->setAmount($amount);
                         $item->commit();
                         $isChanged = true;
                     }
                 }
             }
         }
         if (is_array($dels)) {
             foreach ($dels as $itemId) {
                 $item = orderItem::get($itemId);
                 if ($item instanceof orderItem) {
                     $order->removeItem($item);
                     $isChanged = true;
                 }
             }
         }
         if ($isChanged) {
             $order->refresh();
             $order->commit();
         }
         if ($oldDeliveryPrice != $newDeliveryPrice && !$isChanged) {
             $originalPrice = $object->getValue('total_original_price');
             $totalPrice = $originalPrice;
             $discount = $order->getDiscount();
             if ($discount instanceof discount) {
                 $totalPrice = $discount->recalcPrice($originalPrice);
             }
             $totalPrice += $newDeliveryPrice;
             $object->setValue('total_price', $totalPrice);
             $object->commit();
         }
         $this->chooseRedirect();
     }
     $this->setDataType("form");
     $this->setActionType("modify");
     $data = $this->prepareData($inputData, "object");
     $this->setData($data);
     return $this->doData();
 }
示例#7
0
 function returnsuccess()
 {
     // mandatory function
     $orderid = JRequest::getVar("custom");
     // orderid coming back from PP
     $txn_id = JRequest::getVar("txn_id");
     // pp transaction ID
     $cfg = new sc_configuration();
     $statuses = explode("\r\n", $cfg->get("ostatus"));
     $status = $statuses[count($statuses) - 1];
     // set the status to the last one in the list
     $scorder = new order();
     $scorder->load($orderid);
     $scorder->ordercode = $txn_id;
     $scorder->status = $status;
     $scorder->store();
     return;
 }
function viewHistory()
{
    include "order.php";
    $obj = new order();
    if ($obj->viewHistory()) {
        $row = $obj->fetch();
        echo '{"result":1,"history":[';
        while ($row) {
            echo json_encode($row);
            $row = $obj->fetch();
            if ($row) {
                echo ",";
            }
        }
        echo "]}";
    } else {
        echo '{"result":0}';
    }
}
 public function update(Request $request, $id)
 {
     $order = order::find($id);
     $order->express_code = $request->express_code;
     //只有当前在未发货状态下,才修改订单状态
     if ($order->status == 1) {
         $order->status = 2;
     }
     $order->save();
     return back()->with('info', '发货成功');
 }
 protected function buildDomainObject($row)
 {
     $order = new order();
     $order->setId($row['cart_id']);
     $order->setTacosId($row['tacos_id']);
     $order->setTacosName($row['tacos_name']);
     $order->setNumber($row['cart_number']);
     $order->setPrice($row['tacos_price'] * $row['cart_number']);
     return $order;
 }
示例#11
0
 public function getOrdersFactured($deb_a, $end_a)
 {
     $deb = DateTime::createFromFormat('d-m-y', $deb_a)->getTimestamp();
     $end = DateTime::createFromFormat('d-m-y', $end_a)->getTimestamp();
     $stmt = $this->pdo->PDOInstance->prepare("SELECT id FROM `order` WHERE ref != 0 and date_billing > :deb and date_billing < :end");
     $stmt->bindParam(':deb', $deb);
     $stmt->bindParam(':end', $end);
     try {
         $stmt->execute();
     } catch (Exception $e) {
         echo "Problem at " . $e->getLine() . " from model Extraction :" . $e->getMessage();
     }
     $orders = $stmt->fetchAll(PDO::FETCH_ASSOC);
     $results = array();
     foreach ($orders as $line) {
         $order = new order($line["id"]);
         if ($order->getAlready_paid() < $order->getPrice()) {
             array_push($results, $order);
         }
     }
     return $results;
 }
function topics_move_topic($movetopic)
{
    global $database;
    global $admin;
    //global $queryextra;
    global $page_id;
    global $section_id;
    global $picture_dir;
    global $restrict2picdir;
    $mod_dir = basename(dirname(__FILE__));
    $tablename = $mod_dir;
    //change page_id and section_id to get back to new page!
    $query_sections = $database->query("SELECT section_title, page_id, picture_dir FROM `" . TABLE_PREFIX . "mod_" . $tablename . "_settings` WHERE section_id = '" . $movetopic . "'");
    if ($query_sections->numRows() > 0) {
        $sections_fetch = $query_sections->fetchRow();
        $newpicture_dir = $sections_fetch['picture_dir'];
        if ($restrict2picdir > 0 and $newpicture_dir != $picture_dir) {
            die('No Permission');
        }
        //Hier muss überprüft werden, ob der User überhaupt in die andere Section speichern darf.
        if (!$admin->get_page_permission($sections_fetch['page_id'])) {
            die('No Permission');
        }
        //------------------------------------------------------------
        $section_id = $movetopic;
        $page_id = $sections_fetch['page_id'];
        $section_title = $sections_fetch['section_title'];
        $order = new order(TABLE_PREFIX . 'mod_' . $tablename, 'position', 'topic_id', 'section_id');
        $position = $order->get_new($section_id);
        $qextra = ", page_id = '{$page_id}', section_id = '{$section_id}', position = '{$position}'";
        echo "<p>Save it in " . $section_title . '</p>';
        return $qextra;
    } else {
        return '';
    }
}
 protected function getCustomerOrders()
 {
     static $customerOrders = null;
     if (!is_null($customerOrders)) {
         return $customerOrders;
     }
     $customer = customer::get();
     $cmsController = cmsController::getInstance();
     $domain = $cmsController->getCurrentDomain();
     $domainId = $domain->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('customer_id')->equals($customer->id);
     $sel->where('domain_id')->equals($domainId);
     $sel->where('status_id')->equals(order::getStatusByCode('ready'));
     return $customerOrders = $sel->result;
 }
示例#14
0
 /**
  * Функция рисует список заказов пользователя
  * @param string $template Название шаблона
  * @return mixed Список заказов пользователя
  */
 public function show_user_orders($template = 'default')
 {
     list($tpl_block, $tpl_block_empty, $tpl_item, $tpl_order_item) = def_module::loadTemplates("emarket/" . $template, 'orders_block', 'orders_block_empty', 'orders_item', 'orders_order_item');
     $cmsController = cmsController::getInstance();
     $domain = $cmsController->getCurrentDomain();
     $domainId = $domain->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('customer_id')->equals(customer::get()->id);
     $sel->where('name')->isNull(false);
     $sel->where('domain_id')->equals($domainId);
     if ($sel->length == 0) {
         $tpl_block = $tpl_block_empty;
     }
     $items_arr = array();
     foreach ($sel->result as $selOrder) {
         $order = order::get($selOrder->id);
         $item_arr['attribute:id'] = $order->id;
         $item_arr['attribute:name'] = $order->name;
         $item_arr['attribute:type-id'] = $order->typeId;
         $item_arr['attribute:guid'] = $order->GUID;
         $item_arr['attribute:type-guid'] = $order->typeGUID;
         $item_arr['attribute:ownerId'] = $order->ownerId;
         $item_arr['xlink:href'] = $order->xlink;
         $item_arr['attribute:delivery_allow_date'] = date('d.m.Y', $order->getValue('delivery_allow_date')->timestamp);
         //print_r($order->getValue('order_items'));
         //Получаем список товаров заказа
         $items = array();
         foreach ($order->getItems() as $orderItem) {
             //					print_r($order_item); die;
             $item_line = array();
             //					print_r(umiHierarchy::getInstance()->getObjectInstances($orderItem->id));
             $item_line['attribute:element_id'] = $orderItem->id;
             $item_line['attribute:name'] = $orderItem->name;
             $item_line['attribute:item_amount'] = $orderItem->getAmount();
             //					$item_line['attribute:options'] = $orderItem->getOptions();
             //						print_r($order_item->options);
             $items[] = def_module::parseTemplate($tpl_order_item, $item_line, false, $iOrderItemId);
             umiObjectsCollection::getInstance()->unloadObject($iOrderItemId);
         }
         $item_arr['subnodes:order_items'] = $items;
         $items_arr[] = def_module::parseTemplate($tpl_item, $item_arr, false, $order->id);
     }
     return def_module::parseTemplate($tpl_block, array('subnodes:items' => $items_arr));
 }
示例#15
0
 function __construct($params = array(), $get_assoc = true, $get_attached = false)
 {
     global $db, $user;
     if (!empty($params['id']) || is_numeric($params)) {
         parent::__construct($params, $get_assoc, $get_attached);
         $prodtype = $this->product_type;
         $this->product = new $prodtype($this->product_id, false, true);
     } elseif (isset($params['product_id']) && isset($params['product_type'])) {
         // see if this is an existing item in the cart
         if (isset($params['orderid'])) {
             $order = new order($params['orderid']);
         } else {
             $order = order::getUserCart();
         }
         //adding lookup on price to acocomdate quantity discounts
         $where = 'orders_id=' . $order->id . ' AND product_id=' . $params['product_id'] . ' AND products_price=' . $params['products_price'] . " AND product_type='" . $params['product_type'] . "'";
         $where .= empty($params['options']) ? '' : " AND options='" . $params['options'] . "'";
         $where .= empty($params['user_input_fields']) ? '' : " AND user_input_fields='" . $params['user_input_fields'] . "'";
         $item = $db->selectObject($this->table, $where);
         $this->product = new $params['product_type']($params['product_id'], false, true);
         if (empty($item)) {
             parent::__construct(array('orders_id' => $order->id, 'user_id' => $user->id, 'product_id' => $this->product->id, 'product_type' => $params['product_type'], 'products_name' => $this->product->title, 'products_price' => $this->product->getBasePrice()), $get_assoc, $get_attached);
         } else {
             parent::__construct($item->id, $get_assoc, $get_attached);
             //$this->quantity = $this->product->incrementQuantity($this->quantity);
         }
     } else {
         parent::__construct(null, $get_assoc, $get_attached);
     }
     if (isset($this->options)) {
         $this->opts = expUnserialize($this->options);
     }
     if (!empty($this->user_input_fields)) {
         //$this->user_input_fields = expUnserialize($this->user_input_fields);
     }
 }
示例#16
0
<?php

require_once 'checkSession.php';
require_once '../model/order.php';
$order = new order($_GET["id"]);
$company = new company($order->getId_company());
$employee_ = new employee($order->getId_employee());
include '../view/order.php';
示例#17
0
$vamTemplate->assign('company_kpp', $company['kpp']);
$vamTemplate->assign('company_ogrn', $company['ogrn']);
$vamTemplate->assign('company_okpo', $company['okpo']);
$vamTemplate->assign('company_rs', $company['rs']);
$vamTemplate->assign('company_bank_name', $company['bank_name']);
$vamTemplate->assign('company_bik', $company['bik']);
$vamTemplate->assign('company_ks', $company['ks']);
$vamTemplate->assign('company_address', $company['address']);
$vamTemplate->assign('company_yur_address', $company['yur_address']);
$vamTemplate->assign('company_fakt_address', $company['fakt_address']);
$vamTemplate->assign('company_director', $company['name']);
$vamTemplate->assign('company_accountant', $company['accountant']);
if ($_SESSION['customer_id'] == $order_check['customers_id']) {
    // get order data
    include DIR_WS_CLASSES . 'order.php';
    $order = new order($oID);
    $vamTemplate->assign('address_label_customer', vam_address_format($order->customer['format_id'], $order->customer, 1, '', '<br />'));
    $vamTemplate->assign('address_label_shipping', vam_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'));
    $vamTemplate->assign('address_label_payment', vam_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'));
    $vamTemplate->assign('csID', $order->customer['csID']);
    // get products data
    $order_total = $order->getTotalData($oID);
    $vamTemplate->assign('order_data', $order->getOrderData($oID));
    $vamTemplate->assign('order_total', $order_total['data']);
    $vamTemplate->assign('1', MODULE_PAYMENT_SCHET_1);
    $vamTemplate->assign('2', MODULE_PAYMENT_SCHET_2);
    $vamTemplate->assign('3', MODULE_PAYMENT_SCHET_3);
    $vamTemplate->assign('4', MODULE_PAYMENT_SCHET_4);
    $vamTemplate->assign('5', MODULE_PAYMENT_SCHET_5);
    $vamTemplate->assign('6', MODULE_PAYMENT_SCHET_6);
    $vamTemplate->assign('7', MODULE_PAYMENT_SCHET_7);
示例#18
0
    $_SESSION['cart']->reset(TRUE);
    zen_session_destroy();
    zen_redirect(zen_href_link(FILENAME_TIME_OUT));
}
// END CC SLAM PREVENTION
if (!isset($credit_covers)) {
    $credit_covers = FALSE;
}
// load selected payment module
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment($_SESSION['payment']);
// load the selected shipping module
require DIR_WS_CLASSES . 'shipping.php';
$shipping_modules = new shipping($_SESSION['shipping']);
require DIR_WS_CLASSES . 'order.php';
$order = new order();
// prevent 0-entry orders from being generated/spoofed
if (sizeof($order->products) < 1) {
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
require DIR_WS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_BEFORE_ORDER_TOTALS_PRE_CONFIRMATION_CHECK');
if (strpos($GLOBALS[$_SESSION['payment']]->code, 'paypal') !== 0) {
    $order_totals = $order_total_modules->pre_confirmation_check();
}
if ($credit_covers === TRUE) {
    $order->info['payment_method'] = $order->info['payment_module_code'] = '';
}
$zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_BEFORE_ORDER_TOTALS_PROCESS');
$order_totals = $order_total_modules->process();
示例#19
0
<?php

// Includng configuration file
include 'config/config.php';
//Check user is already login or not
checkAuthentication();
$id = $_SESSION['adminid'];
$product = new product();
$order = new order();
$cashmemo = new cashmemo();
if (isset($_GET['action']) && $_GET['action'] == 'suggestprod') {
    $keyword = $_GET['keyword'];
    $elementid = $_GET['id'];
    $string = '';
    $autosuggpro = $product->getSearchProducts($keyword);
    if (is_array($autosuggpro)) {
        $string .= '<ul>';
        foreach ($autosuggpro as $val) {
            $string .= '<li onClick="fillname(\'' . addslashes($val['name']) . '\',\'' . $elementid . '\');fillcode(\'' . addslashes($val['sku']) . '\',\'' . $elementid . '\');fillprice(\'' . addslashes($val['price']) . '\',\'' . $elementid . '\');" >' . $val['name'] . '</li>';
        }
        $string .= '</ul>';
    } else {
        $string .= '<li>No Record found</li></ul>';
    }
    echo $string;
    exit;
} elseif (isset($_GET['action']) && $_GET['action'] == 'suggestchalan') {
    $keyword = $_GET['chalan_no'];
    $string = '';
    $autosuggpro = $order->getChalanOrders($keyword);
    if (is_array($autosuggpro)) {
示例#20
0
 /**
  * 提交
  */
 public function put()
 {
     $request_data = $this->input->post();
     $total_products = 0;
     $total = 0;
     if (empty($request_data['order_id']) || !is_numeric($request_data['order_id'])) {
         remind::set(Kohana::lang('o_global.bad_request'), request::referrer());
     }
     $order = Myorder::instance($request_data['order_id'])->get();
     if (empty($order) || !isset($order)) {
         remind::set(Kohana::lang('o_global.bad_request'), request::referrer());
     }
     $good_ids = $request_data['good_id'];
     $prices = $request_data['discount_price'];
     $amounts = $request_data['amount'];
     if ($good_ids && is_array($good_ids)) {
         foreach ($good_ids as $key => $val) {
             $good_full_data = ProductService::get_instance()->get($val);
             if (empty($good_full_data) || !isset($good_full_data)) {
                 remind::set(Kohana::lang('o_global.bad_request'), request::referrer());
             }
             if ($good_full_data['store'] == '0') {
                 remind::set(Kohana::lang('o_global.bad_request'), request::referrer());
             }
             //得到合理的价格数值
             if ($good_full_data['store'] == -1 && $amounts[$key] > 999) {
                 $amounts[$key] = 999;
             }
             if ($good_full_data['store'] != -1 && $amounts[$key] > $good_full_data['store']) {
                 $amounts[$key] = $good_full_data['store'];
             }
             //$product_data = ProductService::get_instance()->get($good_full_data['product_id']);
             $order_product_detail_data = array();
             $order_product_detail_data['order_id'] = $order['id'];
             $order_product_detail_data['product_type'] = ProductService::PRODUCT_TYPE_GOODS;
             $order_product_detail_data['dly_status'] = 'storage';
             //$order_product_detail_data['product_id']            = $product_data['id'];
             $order_product_detail_data['good_id'] = $val;
             $order_product_detail_data['quantity'] = $amounts[$key];
             $order_product_detail_data['sendnum'] = '0';
             $order_product_detail_data['price'] = $good_full_data['price'];
             $order_product_detail_data['discount_price'] = $prices[$key];
             $order_product_detail_data['weight'] = $good_full_data['weight'];
             $order_product_detail_data['name'] = $good_full_data['title'];
             $order_product_detail_data['SKU'] = $good_full_data['sku'];
             $order_product_detail_data['brief'] = $good_full_data['brief'];
             $order_product_detail_data['date_add'] = date('Y-m-d H:i:s', time());
             $order_product_detail_data['link'] = product::permalink($good_full_data);
             order::do_order_product_detail_data_by_good(&$order_product_detail_data, $good_full_data, $good_full_data['default_image_id']);
             Myorder_product::instance()->add($order_product_detail_data);
         }
         //重新查询数据库,计算价格
         $goods_order = Myorder_product::instance()->order_product_details(array('order_id' => $order['id']));
         foreach ($goods_order as $val) {
             $total_products += $val['quantity'] * $val['discount_price'];
         }
         $total = $total_products + $order['total_shipping'];
         $total_real = round($total * 100 / $order['conversion_rate']) / 100;
         $final_data = array('total' => $total, 'total_products' => $total_products, 'total_real' => $total_real);
         if (Myorder::instance($order['id'])->edit($final_data)) {
             remind::set(Kohana::lang('o_global.add_success'), '', 'success');
         } else {
             remind::set(Kohana::lang('o_global.add_error'), '', 'error');
         }
     } else {
         remind::set(Kohana::lang('o_global.add_error'), '', 'error');
     }
     $this->template = new View('layout/commonfix_html');
     $this->template->content = new View("order/order_product/put_goods");
     $this->template->content->order = $order;
 }
	<link rel="stylesheet" type="text/css" href="css/s.css" />
	<style type="text/css">
	.table{
		width:80%;
		height:80%;
	}
	</style>

</head>
<?php 
//session_start();
include 'head.php';
include 'user.php';
if (isset($_SESSION['uid'])) {
    $user = new User($_SESSION['uid']);
    $order = new order();
    $x = $user->credite - $_SESSION['sum'];
    $demand = $order->userOrder($_SESSION['uid']);
}
?>
<!--- main div-->
<div class="col-md-9 personal-info">

        <h3>Orders</h3>
        
        
        <table class="table table-bordered table-hover table-striped table-responsive">
          <tbody>
          <tr>
          	<th>orders </th>
          	<th>Quantity</th>
示例#22
0
<?php

include_once 'order_class.php';
$order = new order();
$result = $order->showOrdersByStatus(3);
echo json_encode($result);
示例#23
0
        $level += 1;
    }
    if (file_exists($root . '/framework/class.secure.php')) {
        include $root . '/framework/class.secure.php';
    } else {
        trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
    }
}
// end include class.secure.php
global $section_id, $database, $page_id, $admin, $TEXT;
// Include admin wrapper script
require LEPTON_PATH . '/modules/admin.php';
// Include the ordering class
require LEPTON_PATH . '/framework/class.order.php';
// Get new order
$order = new order(TABLE_PREFIX . 'mod_news_posts', 'position', 'post_id', 'section_id');
$position = $order->get_new($section_id);
// Get default commenting
$fetch_settings = array();
$database->execute_query("SELECT commenting FROM " . TABLE_PREFIX . "mod_news_settings WHERE section_id = '" . $section_id . "'", true, $fetch_settings, false);
$commenting = $fetch_settings['commenting'];
// Insert new row into database
$fields = array('section_id' => $section_id, 'page_id' => $page_id, 'position' => $position, 'commenting' => $commenting, 'active' => 1, 'link' => "", 'content_short' => "", 'content_long' => "");
$database->build_and_execute("insert", TABLE_PREFIX . "mod_news_posts", $fields);
// Get the id
$post_id = $database->db_handle->lastInsertId();
// Say that a new record has been added, then redirect to modify page
if ($database->is_error()) {
    $admin->print_error($database->get_error(), LEPTON_URL . '/modules/news/modify_post.php?page_id=' . $page_id . '&section_id=' . $section_id . '&post_id=' . $post_id);
} else {
    ?>
示例#24
0
<?php

require_once '../model/order.php';
$order = new order();
$order->setId_company($_GET["id_company"]);
$order->setId_employee($_GET["id_employee"]);
$order->setBilling_period_bis($_GET["billing_period_bis"]);
$order->setDate_issuing(strtotime($_GET["date_issuing"]));
$order->setDate_received(strtotime($_GET["date_received"]));
$order->setDate_entry(time());
$id_order = $order->addToDatabase();
header('location:viewOrder.php?id=' . $id_order);
示例#25
0
                $pos = $database->get_one('SELECT `position` FROM `' . TABLE_PREFIX . $tablename . "_groups` WHERE `group_id` = '" . $prev_id . "'");
            } else {
                $pos = 0;
            }
            $database->query("UPDATE `" . TABLE_PREFIX . $tablename . "_groups` SET `position` = '" . $pos++ . "' WHERE `group_id` = '" . $group_id . "'");
            $section_id = $database->get_one('SELECT `section_id` FROM `' . TABLE_PREFIX . $tablename . "_groups` WHERE `group_id` = '" . $group_id . "'");
            $o->clean($section_id);
        }
    }
} else {
    $item_id = is_numeric($_POST['item_id']) ? $_POST['item_id'] : NULL;
    $group_id = is_numeric($_POST['group_id']) ? $_POST['group_id'] : NULL;
    // new group
    $prev_id = is_numeric($_POST['prev_id']) ? $_POST['prev_id'] : NULL;
    // new position
    $o = new order(TABLE_PREFIX . $tablename . '_files', 'position', 'file_id', 'group_id');
    if ($item_id) {
        // group changed
        if ($group_id) {
            $database->query("UPDATE `" . TABLE_PREFIX . $tablename . "_files` SET `group_id` = '" . $group_id . "' WHERE `file_id` = '" . $item_id . "'");
        }
        // get prev item id
        if ($prev_id) {
            $pos = $database->get_one('SELECT `position` FROM `' . TABLE_PREFIX . $tablename . "_files` WHERE `file_id` = '" . $prev_id . "'");
        } else {
            $pos = 0;
        }
        $database->query("UPDATE `" . TABLE_PREFIX . $tablename . "_files` SET `position` = '" . $pos++ . "' WHERE `file_id` = '" . $item_id . "'");
        $o->clean($group_id);
    }
}
示例#26
0
     // Work out root parent
     $root_parent = root_parent($page_id);
     // Work out page trail
     $page_trail = get_page_trail($page_id);
     // Update page with new level and link
     $query = "UPDATE " . TABLE_PREFIX . "pages SET level = '{$level}', root_parent = '{$root_parent}', page_trail = '{$page_trail}', template = '{$template}' WHERE page_id = '{$page_id}'";
     echoh($query . "<br />");
     $database->query($query);
     // Create a new file in the /pages dir
     create_access_file($filename, $page_id, $level);
     /* clean up page order */
     $order = new order(TABLE_PREFIX . 'pages', 'position', 'page_id', 'parent');
     // First clean order
     $order->clean($parent);
     // Get new order for section
     $order = new order(TABLE_PREFIX . 'sections', 'position', 'section_id', 'page_id');
     $position = $order->get_new($parent);
     // Add new record into the sections table
     $query = "INSERT INTO " . TABLE_PREFIX . "sections (page_id,position,module,block) VALUES ('{$page_id}','{$position}', '{$module}','1')";
     echoh($query . "<br />");
     $database->query($query);
     // Get the section id
     $section_id = $database->get_one("SELECT LAST_INSERT_ID()");
     // Include the selected modules add file if it exists
     if (file_exists(WB_PATH . '/modules/' . $module . '/add.php')) {
         require WB_PATH . '/modules/' . $module . '/add.php';
     }
 }
 echo "<br /><strong>" . $MESSAGE['PAGES']['ADDED'] . ":</strong><ul class='listcreated'>";
 foreach ($created as $row) {
     echo "<li>" . $row . "</li>";
示例#27
0
		protected function returnBonus($orderId) {
			$order = order::get($orderId);
			$customerId = $order->getCustomerId();
			$customer = umiObjectsCollection::getInstance()->getObject($customerId);	
			$order->setBonusDiscount(0);
			$order->refresh();	
		}
示例#28
0
文件: order.php 项目: dieka2501/jip
 function get_email($email)
 {
     return order::where('order_email', $email)->orderBy('id_order', 'DESC')->paginate(20);
 }
示例#29
0
<?php

include_once 'order_class.php';
$order = new order();
$result = $order->addOrder();
echo json_encode($result);
// Include WB admin wrapper script
require WB_PATH . '/modules/admin.php';
$backlink = ADMIN_URL . '/pages/modify.php?page_id=' . (int) $page_id;
// Get id
$pid = isset($aRequestVars['post_id']) ? $admin->checkIDKEY('post_id', false, 'GET') : 0;
$gid = isset($aRequestVars['group_id']) ? $admin->checkIDKEY('group_id', false, 'GET') : 0;
if (!$pid) {
    if (!$gid) {
        $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $backlink);
        exit;
    } else {
        $id = $gid;
        $id_field = 'group_id';
        $table = TABLE_PREFIX . 'mod_news_groups';
    }
} else {
    $id = $pid;
    $id_field = 'post_id';
    $table = TABLE_PREFIX . 'mod_news_posts';
}
// Include the ordering class
require WB_PATH . '/framework/class.order.php';
// Create new order object an reorder
$order = new order($table, 'position', $id_field, 'section_id');
if ($order->move_down($id)) {
    $admin->print_success($TEXT['SUCCESS'], $backlink);
} else {
    $admin->print_error($TEXT['ERROR'], $backlink);
}
// Print admin footer
$admin->print_footer();