当前位置: 首页>>代码示例>>PHP>>正文


PHP getJsDate函数代码示例

本文整理汇总了PHP中getJsDate函数的典型用法代码示例。如果您正苦于以下问题:PHP getJsDate函数的具体用法?PHP getJsDate怎么用?PHP getJsDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getJsDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setData

 public function setData($data, $load_data_config = 1)
 {
     $jshopConfig = JSFactory::getConfig();
     $this->data = $data;
     $review = $this->review;
     $review->bind($data);
     if ($load_data_config) {
         $review->user_id = JFactory::getUser()->id;
         $review->time = getJsDate();
         $review->ip = $_SERVER['REMOTE_ADDR'];
         if ($jshopConfig->display_reviews_without_confirm) {
             $review->publish = 1;
         }
     }
 }
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:15,代码来源:productreview.php

示例2: getEnableCode

 function getEnableCode($code)
 {
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     if (!$jshopConfig->use_rabatt_code) {
         $this->error = _JSHOP_RABATT_NON_SUPPORT;
         return 0;
     }
     $date = getJsDate('now', 'Y-m-d');
     $query = "SELECT * FROM `#__jshopping_coupons` WHERE coupon_code = '" . $db->escape($code) . "' AND coupon_publish = '1'";
     extract(js_add_trigger(get_defined_vars(), "query"));
     $db->setQuery($query);
     $row = $db->loadObject();
     if (!isset($row->coupon_id)) {
         $this->error = _JSHOP_RABATT_NON_CORRECT;
         return 0;
     }
     if ($row->coupon_expire_date < $date && $row->coupon_expire_date != "0000-00-00") {
         $this->error = _JSHOP_RABATT_NON_CORRECT;
         return 0;
     }
     if ($row->coupon_start_date > $date) {
         $this->error = _JSHOP_RABATT_NON_CORRECT;
         return 0;
     }
     if ($row->used) {
         $this->error = _JSHOP_RABATT_USED;
         return 0;
     }
     if ($row->for_user_id) {
         $user = JFactory::getUser();
         if (!$user->id) {
             $this->error = _JSHOP_FOR_USE_COUPON_PLEASE_LOGIN;
             return 0;
         }
         if ($row->for_user_id != $user->id) {
             $this->error = _JSHOP_RABATT_NON_CORRECT;
             return 0;
         }
     }
     $this->load($row->coupon_id);
     return 1;
 }
开发者ID:olegverstka,项目名称:monax.dev,代码行数:43,代码来源:coupon.php

示例3: getCalculateDeliveryDay

function getCalculateDeliveryDay($day, $date = null)
{
    if (!$date) {
        $date = getJsDate();
    }
    $time = intval(strtotime($date) + $day * 86400);
    return date('Y-m-d H:i:s', $time);
}
开发者ID:JexyRu,项目名称:jshop-updates,代码行数:8,代码来源:functions.php

示例4: copy

 function copy()
 {
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $text = array();
     $cid = JRequest::getVar('cid');
     JPluginHelper::importPlugin('jshoppingadmin');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeCopyProduct', array(&$cid));
     $_lang = $this->getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $_products = $this->getModel("products");
     // Get all data about products
     $tables = array('attr', 'attr2', 'images', 'prices', 'relations', 'to_categories', 'videos', 'files');
     foreach ($cid as $key => $value) {
         $product = JTable::getInstance('product', 'jshop');
         $product->load($value);
         $product->product_id = null;
         foreach ($languages as $lang) {
             $name_alias = 'alias_' . $lang->language;
             if ($product->{$name_alias}) {
                 $product->{$name_alias} = $product->{$name_alias} . date('ymdHis');
             }
         }
         $product->product_date_added = getJsDate();
         $product->date_modify = "";
         $product->average_rating = 0;
         $product->reviews_count = 0;
         $product->hits = 0;
         $product->store();
         $array = array();
         foreach ($tables as $table) {
             $query = "SELECT * FROM `#__jshopping_products_" . $table . "` AS prod_table WHERE prod_table.product_id = '" . $db->escape($value) . "'";
             $db->setQuery($query);
             $array[] = $db->loadAssocList();
         }
         $i = 0;
         foreach ($array as $key2 => $value2) {
             if (count($value2)) {
                 foreach ($value2 as $key3 => $value3) {
                     $db->setQuery($_products->copyProductBuildQuery($tables[$i], $value3, $product->product_id));
                     $db->query();
                 }
             }
             $i++;
         }
         //change order in category
         $query = "select * from #__jshopping_products_to_categories where product_id='" . $product->product_id . "'";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         foreach ($list as $val) {
             $query = "select max(product_ordering) as k from #__jshopping_products_to_categories where category_id='" . $val->category_id . "' ";
             $db->setQuery($query);
             $ordering = $db->loadResult() + 1;
             $query = "update #__jshopping_products_to_categories set product_ordering='" . $ordering . "' where category_id='" . $val->category_id . "' and product_id='" . $product->product_id . "' ";
             $db->setQuery($query);
             $db->query();
         }
         $query = "update #__jshopping_products_attr set ext_attribute_product_id=0 where product_id='" . $product->product_id . "'";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $text[] = sprintf(_JSHOP_PRODUCT_COPY_TO, $value, $product->product_id) . "<br>";
     }
     $dispatcher->trigger('onAfterCopyProduct', array(&$cid));
     $this->setRedirect("index.php?option=com_jshopping&controller=products", implode("</li><li>", $text));
 }
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:66,代码来源:products.php

示例5: changeStatusOrder

 function changeStatusOrder($order_id, $status, $sendmessage = 1)
 {
     $mainframe = JFactory::getApplication();
     $lang = JSFactory::getLang();
     $jshopConfig = JSFactory::getConfig();
     $restext = '';
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeChangeOrderStatus', array(&$order_id, &$status, &$sendmessage, &$restext));
     $order = JSFactory::getTable('order', 'jshop');
     $order->load($order_id);
     $order->order_status = $status;
     $order->order_m_date = getJsDate();
     $order->store();
     $vendorinfo = $order->getVendorInfo();
     $order_status = JSFactory::getTable('orderStatus', 'jshop');
     $order_status->load($status);
     if ($jshopConfig->order_stock_removed_only_paid_status) {
         $product_stock_removed = in_array($status, $jshopConfig->payment_status_enable_download_sale_file);
     } else {
         $product_stock_removed = !in_array($status, $jshopConfig->payment_status_return_product_in_stock);
     }
     if ($order->order_created && !$product_stock_removed && $order->product_stock_removed == 1) {
         $order->changeProductQTYinStock("+");
     }
     if ($order->order_created && $product_stock_removed && $order->product_stock_removed == 0) {
         $order->changeProductQTYinStock("-");
     }
     $order_history = JSFactory::getTable('orderHistory', 'jshop');
     $order_history->order_id = $order->order_id;
     $order_history->order_status_id = $status;
     $order_history->status_date_added = getJsDate();
     $order_history->customer_notify = 1;
     $order_history->comments = $restext;
     $order_history->store();
     $name = $lang->get("name");
     $uri = JURI::getInstance();
     $liveurlhost = $uri->toString(array("scheme", 'host', 'port'));
     $order_details_url = $liveurlhost . SEFLink('index.php?option=com_jshopping&controller=user&task=order&order_id=' . $order_id, 1);
     if ($order->user_id == -1) {
         $order_details_url = '';
     }
     $message = $this->getMessageChangeStatusOrder($order, $order_status->{$name}, $vendorinfo, $order_details_url);
     if ($jshopConfig->admin_show_vendors) {
         $listVendors = $order->getVendors();
     } else {
         $listVendors = array();
     }
     $vendors_send_message = $jshopConfig->vendor_order_message_type == 1 || $order->vendor_type == 1 && $jshopConfig->vendor_order_message_type == 2;
     $vendor_send_order = $jshopConfig->vendor_order_message_type == 2 && $order->vendor_type == 0 && $order->vendor_id;
     if ($jshopConfig->vendor_order_message_type == 3) {
         $vendor_send_order = 1;
     }
     $admin_send_order = 1;
     if ($jshopConfig->admin_not_send_email_order_vendor_order && $vendor_send_order && count($listVendors)) {
         $admin_send_order = 0;
     }
     $mailfrom = $mainframe->getCfg('mailfrom');
     $fromname = $mainframe->getCfg('fromname');
     if ($sendmessage) {
         //message client
         $subject = sprintf(_JSHOP_ORDER_STATUS_CHANGE_SUBJECT, $order->order_number);
         $mailer = JFactory::getMailer();
         $mailer->setSender(array($mailfrom, $fromname));
         $mailer->addRecipient($order->email);
         $mailer->setSubject($subject);
         $mailer->setBody($message);
         $mailer->isHTML(false);
         $dispatcher->trigger('onBeforeSendMailChangeOrderStatusClient', array(&$mailer, &$order_id, &$status, &$sendmessage, &$order));
         $send = $mailer->Send();
         //message admin
         if ($admin_send_order) {
             $mailer = JFactory::getMailer();
             $mailer->setSender(array($mailfrom, $fromname));
             $mailer->addRecipient(explode(',', $jshopConfig->contact_email));
             $mailer->setSubject(_JSHOP_ORDER_STATUS_CHANGE_TITLE);
             $mailer->setBody($message);
             $mailer->isHTML(false);
             $dispatcher->trigger('onBeforeSendMailChangeOrderStatusAdmin', array(&$mailer, &$order_id, &$status, &$sendmessage, &$order));
             $send = $mailer->Send();
         }
         //message vendors
         if ($vendors_send_message || $vendor_send_order) {
             foreach ($listVendors as $k => $datavendor) {
                 $mailer = JFactory::getMailer();
                 $mailer->setSender(array($mailfrom, $fromname));
                 $mailer->addRecipient($datavendor->email);
                 $mailer->setSubject(_JSHOP_ORDER_STATUS_CHANGE_TITLE);
                 $mailer->setBody($message);
                 $mailer->isHTML(false);
                 $dispatcher->trigger('onBeforeSendMailChangeOrderStatusVendor', array(&$mailer, &$order_id, &$status, &$sendmessage, &$order));
                 $send = $mailer->Send();
             }
         }
     }
     $dispatcher->trigger('onAfterChangeOrderStatus', array(&$order_id, &$status, &$sendmessage));
     return 1;
 }
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:97,代码来源:checkout.php

示例6: reviewsave

 function reviewsave()
 {
     $mainframe = JFactory::getApplication();
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $post = JRequest::get('post');
     $backlink = JRequest::getVar('back_link');
     $product_id = JRequest::getInt('product_id');
     JRequest::checkToken() or jexit('Invalid Token');
     JPluginHelper::importPlugin('jshoppingproducts');
     $dispatcher = JDispatcher::getInstance();
     $review = JTable::getInstance('review', 'jshop');
     if ($review->getAllowReview() <= 0) {
         JError::raiseWarning('', jshopReview::getText());
         $this->setRedirect($backlink);
         return 0;
     }
     $review->bind($post);
     $review->time = getJsDate();
     $review->user_id = $user->id;
     $review->ip = $_SERVER['REMOTE_ADDR'];
     if ($jshopConfig->display_reviews_without_confirm) {
         $review->publish = 1;
     }
     $dispatcher->trigger('onBeforeSaveReview', array(&$review));
     if (!$review->check()) {
         JError::raiseWarning('', _JSHOP_ENTER_CORRECT_INFO_REVIEW);
         $this->setRedirect($backlink);
         return 0;
     }
     $review->store();
     $dispatcher->trigger('onAfterSaveReview', array(&$review));
     $product = JTable::getInstance('product', 'jshop');
     $product->load($product_id);
     $product->loadAverageRating();
     $product->loadReviewsCount();
     $product->store();
     $lang = JSFactory::getLang();
     $name = $lang->get("name");
     $view_name = "product";
     $view_config = array("template_path" => JPATH_COMPONENT . "/templates/" . $jshopConfig->template . "/" . $view_name);
     $view = $this->getView($view_name, 'html', '', $view_config);
     $view->setLayout("commentemail");
     $view->assign('product_name', $product->{$name});
     $view->assign('user_name', $review->user_name);
     $view->assign('user_email', $review->user_email);
     $view->assign('mark', $review->mark);
     $view->assign('review', $review->review);
     $message = $view->loadTemplate();
     $mailfrom = $mainframe->getCfg('mailfrom');
     $fromname = $mainframe->getCfg('fromname');
     $mailer = JFactory::getMailer();
     $mailer->setSender(array($mailfrom, $fromname));
     $mailer->addRecipient(explode(',', $jshopConfig->contact_email));
     $mailer->setSubject(_JSHOP_NEW_COMMENT);
     $mailer->setBody($message);
     $mailer->isHTML(true);
     $send = $mailer->Send();
     if ($jshopConfig->display_reviews_without_confirm) {
         $this->setRedirect($backlink, _JSHOP_YOUR_REVIEW_SAVE_DISPLAY);
     } else {
         $this->setRedirect($backlink, _JSHOP_YOUR_REVIEW_SAVE);
     }
 }
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:65,代码来源:product.php

示例7: createOrder

 public function createOrder(&$adv_user, &$post)
 {
     $jshopConfig = JSFactory::getConfig();
     $dispatcher = JDispatcher::getInstance();
     $cart = $this->getCart();
     $orderNumber = $jshopConfig->getNextOrderNumber();
     $jshopConfig->updateNextOrderNumber();
     $pm_method = $this->getPaymentMethod();
     if ($jshopConfig->without_payment) {
         $pm_method->payment_type = 1;
         $paymentSystemVerySimple = 1;
     } else {
         $paymentsysdata = $pm_method->getPaymentSystemData();
         $payment_system = $paymentsysdata->paymentSystem;
         if ($paymentsysdata->paymentSystemVerySimple) {
             $paymentSystemVerySimple = 1;
         }
     }
     $order = JSFactory::getTable('order', 'jshop');
     $arr_property = $order->getListFieldCopyUserToOrder();
     foreach ($adv_user as $key => $value) {
         if (in_array($key, $arr_property)) {
             $order->{$key} = $value;
         }
     }
     $sh_mt_pr = $this->getShippingMethodPrice();
     $order->order_date = $order->order_m_date = getJsDate();
     $order->order_tax = $cart->getTax(1, 1, 1);
     $order->setTaxExt($cart->getTaxExt(1, 1, 1));
     $order->order_subtotal = $cart->getPriceProducts();
     $order->order_shipping = $cart->getShippingPrice();
     $order->order_payment = $cart->getPaymentPrice();
     $order->order_discount = $cart->getDiscountShow();
     $order->shipping_tax = $cart->getShippingPriceTaxPercent();
     $order->setShippingTaxExt($cart->getShippingTaxList());
     $order->payment_tax = $cart->getPaymentTaxPercent();
     $order->setPaymentTaxExt($cart->getPaymentTaxList());
     $order->order_package = $cart->getPackagePrice();
     $order->setPackageTaxExt($cart->getPackageTaxList());
     $order->order_total = $cart->getSum(1, 1, 1);
     $order->currency_exchange = $jshopConfig->currency_value;
     $order->vendor_type = $cart->getVendorType();
     $order->vendor_id = $cart->getVendorId();
     $order->order_status = $jshopConfig->default_status_order;
     $order->shipping_method_id = $cart->getShippingId();
     $order->payment_method_id = $cart->getPaymentId();
     $order->delivery_times_id = $sh_mt_pr->delivery_times_id;
     if ($jshopConfig->delivery_order_depends_delivery_product) {
         $order->delivery_time = $cart->getDelivery();
     }
     if ($jshopConfig->show_delivery_date) {
         $order->delivery_date = $cart->getDeliveryDate();
     }
     $order->coupon_id = $cart->getCouponId();
     $pm_params = $cart->getPaymentParams();
     if (is_array($pm_params) && !$paymentSystemVerySimple) {
         $payment_system->setParams($pm_params);
         $payment_params_names = $payment_system->getDisplayNameParams();
         $order->payment_params = getTextNameArrayValue($payment_params_names, $pm_params);
         $order->setPaymentParamsData($pm_params);
     }
     $sh_params = $cart->getShippingParams();
     if (is_array($sh_params)) {
         $sh_method = $this->getShippingMethod();
         $shippingForm = $sh_method->getShippingForm();
         if ($shippingForm) {
             $shippingForm->setParams($sh_params);
             $shipping_params_names = $shippingForm->getDisplayNameParams();
             $order->shipping_params = getTextNameArrayValue($shipping_params_names, $sh_params);
         }
         $order->setShippingParamsData($sh_params);
     }
     $order->ip_address = $_SERVER['REMOTE_ADDR'];
     $order->order_add_info = $post['order_add_info'];
     $order->currency_code = $jshopConfig->currency_code;
     $order->currency_code_iso = $jshopConfig->currency_code_iso;
     $order->order_number = $order->formatOrderNumber($orderNumber);
     $order->order_hash = md5(time() . $order->order_total . $order->user_id);
     $order->file_hash = md5(time() . $order->order_total . $order->user_id . "hashfile");
     $order->display_price = $jshopConfig->display_price_front_current;
     $order->lang = $jshopConfig->getLang();
     if ($order->client_type) {
         $order->client_type_name = $jshopConfig->user_field_client_type[$order->client_type];
     } else {
         $order->client_type_name = "";
     }
     if ($order->order_total == 0) {
         $pm_method->payment_type = 1;
         $order->order_status = $jshopConfig->payment_status_paid;
     }
     if ($pm_method->payment_type == 1) {
         $order->order_created = 1;
     } else {
         $order->order_created = 0;
     }
     if (!$adv_user->delivery_adress) {
         $order->copyDeliveryData();
     }
     $dispatcher->trigger('onBeforeCreateOrder', array(&$order, &$cart, &$this));
     $order->store();
//.........这里部分代码省略.........
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:101,代码来源:checkoutorder.php

示例8: setInvoiceDate

 function setInvoiceDate()
 {
     if (datenull($this->invoice_date)) {
         $db = JFactory::getDBO();
         $this->invoice_date = getJsDate();
         $query = "UPDATE `#__jshopping_orders` SET invoice_date='" . $db->escape($this->invoice_date) . "' WHERE order_id = '" . $db->escape($this->order_id) . "'";
         $db->setQuery($query);
         $db->query();
     }
 }
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:10,代码来源:order.php

示例9: changeStatusOrder

 function changeStatusOrder($order_id, $status, $sendmessage = 1)
 {
     $mainframe = JFactory::getApplication();
     $lang = JSFactory::getLang();
     $jshopConfig = JSFactory::getConfig();
     $restext = '';
     JPluginHelper::importPlugin('jshoppingorder');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeChangeOrderStatus', array(&$order_id, &$status, &$sendmessage, &$restext));
     $order = JTable::getInstance('order', 'jshop');
     $order->load($order_id);
     $order->order_status = $status;
     $order->store();
     $vendorinfo = $order->getVendorInfo();
     $order_status = JTable::getInstance('orderStatus', 'jshop');
     $order_status->load($status);
     if ($order->order_created && in_array($status, $jshopConfig->payment_status_return_product_in_stock)) {
         $order->changeProductQTYinStock("+");
     }
     $order_history = JTable::getInstance('orderHistory', 'jshop');
     $order_history->order_id = $order->order_id;
     $order_history->order_status_id = $status;
     $order_history->status_date_added = getJsDate();
     $order_history->customer_notify = 1;
     $order_history->comments = $restext;
     $order_history->store();
     if (!$sendmessage) {
         return 1;
     }
     $name = $lang->get("name");
     $uri = JURI::getInstance();
     $liveurlhost = $uri->toString(array("scheme", 'host', 'port'));
     $order_details_url = $liveurlhost . SEFLink('index.php?option=com_jshopping&controller=user&task=order&order_id=' . $order_id, 1);
     if ($order->user_id == -1) {
         $order_details_url = '';
     }
     include_once JPATH_COMPONENT_SITE . "/views/checkout/view.html.php";
     $view_name = "order";
     $view_config = array("template_path" => JPATH_COMPONENT_SITE . "/templates/" . $jshopConfig->template . "/" . $view_name);
     $view = new JshoppingViewCheckout($view_config);
     $view->setLayout("statusorder");
     $view->assign('order', $order);
     $view->assign('order_status', $order_status->{$name});
     $view->assign('vendorinfo', $vendorinfo);
     $view->assign('order_detail', $order_details_url);
     $dispatcher->trigger('onBeforeCreateMailOrderStatusView', array(&$view));
     $message = $view->loadTemplate();
     if ($jshopConfig->admin_show_vendors) {
         $listVendors = $order->getVendors();
     } else {
         $listVendors = array();
     }
     $vendors_send_message = $jshopConfig->vendor_order_message_type == 1 || $order->vendor_type == 1 && $jshopConfig->vendor_order_message_type == 2;
     $vendor_send_order = $jshopConfig->vendor_order_message_type == 2 && $order->vendor_type == 0 && $order->vendor_id;
     if ($jshopConfig->vendor_order_message_type == 3) {
         $vendor_send_order = 1;
     }
     $admin_send_order = 1;
     if ($jshopConfig->admin_not_send_email_order_vendor_order && $vendor_send_order && count($listVendors)) {
         $admin_send_order = 0;
     }
     $mailfrom = $mainframe->getCfg('mailfrom');
     $fromname = $mainframe->getCfg('fromname');
     //message client
     $subject = sprintf(_JSHOP_ORDER_STATUS_CHANGE_SUBJECT, $order->order_number);
     $mailer = JFactory::getMailer();
     $mailer->setSender(array($mailfrom, $fromname));
     $mailer->addRecipient($order->email);
     $mailer->setSubject($subject);
     $mailer->setBody($message);
     $mailer->isHTML(false);
     $send = $mailer->Send();
     //message admin
     if ($admin_send_order) {
         $mailer = JFactory::getMailer();
         $mailer->setSender(array($mailfrom, $fromname));
         $mailer->addRecipient(explode(',', $jshopConfig->contact_email));
         $mailer->setSubject(_JSHOP_ORDER_STATUS_CHANGE_TITLE);
         $mailer->setBody($message);
         $mailer->isHTML(false);
         $send = $mailer->Send();
     }
     //message vendors
     if ($vendors_send_message || $vendor_send_order) {
         foreach ($listVendors as $k => $datavendor) {
             $mailer = JFactory::getMailer();
             $mailer->setSender(array($mailfrom, $fromname));
             $mailer->addRecipient($datavendor->email);
             $mailer->setSubject(_JSHOP_ORDER_STATUS_CHANGE_TITLE);
             $mailer->setBody($message);
             $mailer->isHTML(false);
             $send = $mailer->Send();
         }
     }
     $dispatcher->trigger('onAfterChangeOrderStatus', array(&$order_id, &$status, &$sendmessage));
     return 1;
 }
开发者ID:Tommar,项目名称:vino2,代码行数:97,代码来源:checkout.php

示例10: save

 function save()
 {
     $db = JFactory::getDBO();
     $jshopConfig = JSFactory::getConfig();
     $post = JRequest::get('post');
     $client_id = JRequest::getInt('client_id', 0);
     $file_generete_pdf_order = $jshopConfig->file_generete_pdf_order;
     $dispatcher = JDispatcher::getInstance();
     $order_id = intval($post['order_id']);
     $orders = JSFactory::getModel("orders");
     $order = JSFactory::getTable('order', 'jshop');
     $order->load($order_id);
     if (!$order_id) {
         $order->user_id = -1;
         $order->order_date = getJsDate();
         $orderNumber = $jshopConfig->next_order_number;
         $jshopConfig->updateNextOrderNumber();
         $order->order_number = $order->formatOrderNumber($orderNumber);
         $order->order_hash = md5(time() . $order->order_total . $order->user_id);
         $order->file_hash = md5(time() . $order->order_total . $order->user_id . "hashfile");
         $order->ip_address = $_SERVER['REMOTE_ADDR'];
         $order->order_status = $jshopConfig->default_status_order;
     }
     $order->order_m_date = getJsDate();
     $order_created_prev = $order->order_created;
     if ($post['birthday']) {
         $post['birthday'] = getJsDateDB($post['birthday'], $jshopConfig->field_birthday_format);
     }
     if ($post['d_birthday']) {
         $post['d_birthday'] = getJsDateDB($post['d_birthday'], $jshopConfig->field_birthday_format);
     }
     if ($post['invoice_date']) {
         $post['invoice_date'] = getJsDateDB($post['invoice_date'], $jshopConfig->store_date_format);
     }
     if (!$jshopConfig->hide_tax) {
         $post['order_tax'] = 0;
         $order_tax_ext = array();
         if (isset($post['tax_percent'])) {
             foreach ($post['tax_percent'] as $k => $v) {
                 if ($post['tax_percent'][$k] != "" || $post['tax_value'][$k] != "") {
                     $order_tax_ext[number_format($post['tax_percent'][$k], 2)] = $post['tax_value'][$k];
                 }
             }
         }
         $post['order_tax_ext'] = serialize($order_tax_ext);
         $post['order_tax'] = number_format(array_sum($order_tax_ext), 2);
     }
     $currency = JSFactory::getTable('currency', 'jshop');
     $currency->load($post['currency_id']);
     $post['currency_code'] = $currency->currency_code;
     $post['currency_code_iso'] = $currency->currency_code_iso;
     $post['currency_exchange'] = $currency->currency_value;
     $dispatcher->trigger('onBeforeSaveOrder', array(&$post, &$file_generete_pdf_order, &$order));
     $order->bind($post);
     $order->delivery_times_id = $post['order_delivery_times_id'];
     $order->store();
     $order_id = $order->order_id;
     $order_items = $order->getAllItems();
     $orders->saveOrderItem($order_id, $post, $order_items);
     $order->items = null;
     $vendor_id = $order->getVendorIdForItems();
     $order->vendor_id = $vendor_id;
     $order->store();
     JSFactory::loadLanguageFile($order->getLang());
     $lang = JSFactory::getLang($order->getLang());
     $order->items = null;
     if ($order->order_created == 1 && $order_created_prev == 0) {
         $order->updateProductsInStock(1);
         $checkout = JSFactory::getModel('checkout', 'jshop');
         if ($jshopConfig->send_order_email) {
             $checkout->sendOrderEmail($order_id, 1);
         }
     } elseif ($order->order_created == 1 && $jshopConfig->generate_pdf) {
         $order->load($order_id);
         $order->prepareOrderPrint();
         $order->generatePdf($file_generete_pdf_order);
     }
     JSFactory::loadAdminLanguageFile();
     $dispatcher->trigger('onAfterSaveOrder', array(&$order, &$file_generete_pdf_order));
     $this->setRedirect("index.php?option=com_jshopping&controller=orders&client_id=" . $client_id);
 }
开发者ID:binhnk0791,项目名称:joomla,代码行数:81,代码来源:orders.php

示例11: saveOrderHistory

 function saveOrderHistory($notify, $comments)
 {
     $history = JSFactory::getTable('orderHistory', 'jshop');
     $history->order_id = $this->order_id;
     $history->order_status_id = $this->order_status;
     $history->status_date_added = getJsDate();
     $history->customer_notify = $notify;
     $history->comments = $comments;
     JDispatcher::getInstance()->trigger('onBeforeJshopOrderSaveOrderHistory', array(&$history, &$notify, &$comments, &$this));
     return $history->store();
 }
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:11,代码来源:order.php

示例12: storeStatDownloads

 public function storeStatDownloads()
 {
     $stat_download = $this->stat_download;
     $id = $this->id;
     $stat_download[$id]['download'] = intval($stat_download[$id]['download']) + 1;
     $stat_download[$id]['time'] = getJsDate();
     $this->order->setFilesStatDownloads($stat_download);
     $this->order->store();
 }
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:9,代码来源:productdownload.php

示例13: productGroupUpdate

 function productGroupUpdate($id, $post)
 {
     $jshopConfig = JSFactory::getConfig();
     $product = JSFactory::getTable('product', 'jshop');
     $product->load($id);
     if ($post['access'] != -1) {
         $product->set('access', $post['access']);
     }
     if ($post['product_publish'] != -1) {
         $product->set('product_publish', $post['product_publish']);
     }
     if ($post['product_weight'] != "") {
         $product->set('product_weight', $post['product_weight']);
     }
     if ($post['product_quantity'] != "") {
         $product->set('product_quantity', $post['product_quantity']);
         $product->set('unlimited', 0);
     }
     if (isset($post['unlimited']) && $post['unlimited']) {
         $product->set('product_quantity', 1);
         $product->set('unlimited', 1);
     }
     if (isset($post['product_template']) && $post['product_template'] != -1) {
         $product->set('product_template', $post['product_template']);
     }
     if (isset($post['product_tax_id']) && $post['product_tax_id'] != -1) {
         $product->set('product_tax_id', $post['product_tax_id']);
     }
     if (isset($post['product_manufacturer_id']) && $post['product_manufacturer_id'] != -1) {
         $product->set('product_manufacturer_id', $post['product_manufacturer_id']);
     }
     if (isset($post['vendor_id']) && $post['vendor_id'] != -1) {
         $product->set('vendor_id', $post['vendor_id']);
     }
     if (isset($post['delivery_times_id']) && $post['delivery_times_id'] != -1) {
         $product->set('delivery_times_id', $post['delivery_times_id']);
     }
     if (isset($post['label_id']) && $post['label_id'] != -1) {
         $product->set('label_id', $post['label_id']);
     }
     if (isset($post['weight_volume_units']) && $post['weight_volume_units'] != "") {
         $product->set('weight_volume_units', $post['weight_volume_units']);
         $product->set('basic_price_unit_id', $post['basic_price_unit_id']);
     }
     if ($post['product_price'] != "") {
         $oldprice = $product->product_price;
         $price = $this->getModPrice($product->product_price, saveAsPrice($post['product_price']), $post['mod_price']);
         $product->set('product_price', $price);
         if ($post['use_old_val_price'] == 1) {
             $product->set('product_old_price', $oldprice);
         }
     }
     if (isset($post['product_old_price']) && $post['product_old_price'] != "") {
         $price = $this->getModPrice($product->product_old_price, saveAsPrice($post['product_old_price']), $post['mod_old_price']);
         $product->set('product_old_price', $price);
     }
     if (isset($post['product_buy_price']) && $post['product_buy_price'] != "") {
         $product->set('product_buy_price', $post['product_buy_price']);
     }
     if (isset($post['product_price']) && $post['product_price'] != "" || $post['product_old_price'] != "") {
         $product->set('currency_id', $post['currency_id']);
     }
     if (isset($post['category_id']) && $post['category_id']) {
         $this->setCategoryToProduct($id, $post['category_id']);
     }
     if ($jshopConfig->admin_show_product_extra_field) {
         $_productfields = JSFactory::getModel("productFields");
         $list_productfields = $_productfields->getList(1);
         foreach ($list_productfields as $v) {
             $_nef = 'extra_field_' . $v->id;
             switch ($v->type) {
                 case 0:
                     if (isset($post['productfields'][$_nef]) and is_array($post['productfields'][$_nef]) and count($post['productfields'][$_nef]) > 0) {
                         if ($v->multilist == 1 || ($v->multilist == 0 and !in_array(0, $post['productfields'][$_nef]))) {
                             $product->set($_nef, implode(',', $post['productfields'][$_nef]));
                         }
                     }
                     break;
                 case 1:
                     if (isset($post[$_nef]) and $post[$_nef] != '') {
                         $product->set($_nef, $post[$_nef]);
                     }
                     break;
             }
         }
     }
     $this->updatePriceAndQtyDependAttr($id, $post);
     $product->store();
     if ($post['product_price'] != "") {
         $mprice = $product->getMinimumPrice();
         $product->set('min_price', $mprice);
     }
     if (!$product->unlimited) {
         $qty = $product->getFullQty();
         $product->set('product_quantity', $qty);
     }
     $product->date_modify = getJsDate();
     extract(js_add_trigger(get_defined_vars(), "beforeStore"));
     $product->store();
 }
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:100,代码来源:products.php

示例14: orderStatusStore

 private function orderStatusStore()
 {
     $this->order->load($this->order_id);
     $prev_status = $this->order->order_status;
     $this->order->order_status = $this->status;
     $this->order->order_m_date = getJsDate();
     $this->order->store();
     return $prev_status;
 }
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:9,代码来源:orderchangestatus.php

示例15: saveTransactionData

 function saveTransactionData($rescode, $status_id, $data)
 {
     $row = JSFactory::getTable("PaymentTrx", "jshop");
     $row->order_id = $this->order_id;
     $row->rescode = $rescode;
     $row->status_id = $status_id;
     $row->transaction = $this->transaction;
     $row->date = getJsDate();
     $row->store();
     if (is_array($data)) {
         foreach ($data as $k => $v) {
             $rowdata = JSFactory::getTable("PaymentTrxData", "jshop");
             $rowdata->id = 0;
             $rowdata->trx_id = $row->id;
             $rowdata->order_id = $this->order_id;
             $rowdata->key = $k;
             $rowdata->value = $v;
             $rowdata->store();
         }
     }
 }
开发者ID:olegverstka,项目名称:monax.dev,代码行数:21,代码来源:order.php


注:本文中的getJsDate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。