コード例 #1
0
/**
 * Get vip status of customer from an order
 * @param String $type
 * @param Int $orders_id
 * @return Boolean
 */
function checkCustomerIsVIP($type, $orders_id)
{
    $type = strtoupper($type);
    $is_vip = false;
    if ($type == 'SP') {
        use_class('jng_sp_orders');
        use_class('jng_sp_customers');
        use_class('jng_sp_customers_special');
        $class_jo = new jng_sp_orders();
        $class_jc = new jng_sp_customers();
        $class_jcs = new jng_sp_customers_special();
        $o = $class_jo->retrieveDetail($orders_id);
        //GET CUSTOMER DETAIL VIP OR NOT
        $cust_data = $class_jc->retrieveDetail(null, $o['jng_sp_id'], $o['customer_billing_id']);
        if (is_array($cust_data) && $cust_data['jng_sp_customers_id'] > 0) {
            $cust_detail = $class_jcs->getCustomerDetail($cust_data['jng_sp_customers_id']);
        }
        $is_vip = $cust_detail['list_type'] == 'V';
    } elseif ($type == 'JG') {
        use_class('orders');
        use_class('customers_special_list');
        $class_o = new orders();
        $class_csl = new customers_special_list();
        $o = $class_o->retrieveDetail($orders_id);
        //GET CUSTOMER DETAIL VIP OR NOT
        $cust_detail = $class_csl->getCustomerDetail($o['customers_id']);
        $is_vip = $cust_detail['list_type'] == 'V';
    } elseif ($type == 'DP') {
        use_class('depot_orders');
        $class_do = new depot_orders();
        $do = $class_do->retrieveDetail($orders_id);
        if ($do['trans_type'] == 'SP' || $do['trans_type'] == 'JG') {
            if ($do['trans_type'] == 'SP') {
                use_class('jng_sp_orders');
                $class_jo = new jng_sp_orders();
                $it = $class_jo->retrieveItemDetail($do['trans_id']);
                $orders_id = $it['jng_sp_orders_id'];
            } elseif ($do['trans_type'] == 'JG') {
                use_class('orders');
                $class_o = new orders();
                $it = $class_o->retrieveProductDetail($do['trans_id']);
                $orders_id = $it['orders_id'];
            }
            $is_vip = checkCustomerIsVIP($do['trans_type'], $orders_id);
        }
    }
    return $is_vip;
}
コード例 #2
0
<?php

use_class('payone/financegateConnect');
use_class('jng_sp');
use_class('jng_sp_orders');
use_class('jng_sp_customers');
use_class('payone');
use_class('payone_invoice');
use_class('payone_logger');
$class_sp = new jng_sp();
$class_jo = new jng_sp_orders();
$class_jcust = new jng_sp_customers();
$class_payone = new payone();
//SP SETTING
salesPartnerCombo();
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADUNSUBMITTEDORDERS') {
        $orders = $class_payone->newSPorders($jng_sp_id);
        $result = $class_payone->drawListTable($orders);
    } elseif ($_POST['me_action'] == 'AUTHORIZATION') {
        $process_method = 'authorization';
        $order_id = tep_db_prepare_input($_POST['orders_id']);
        $order = $class_jo->retrieveDetail($order_id);
        $items = $class_jo->retrieveItems($order_id);
        $cust = $class_jcust->retrieveDetail(null, $order['jng_sp_id'], $order['customer_billing_id']);
        foreach ($items as $key => $i) {
            if ($class_jo->statusIsCancelled($i['status'])) {
                unset($items[$key]);
            }
        }
コード例 #3
0
use_class('Order');
use_class('tradebyte');
use_class('xml_tools');
use_class('products_ean');
use_class('jng_sp');
use_class('jng_sp_download');
use_class('jng_sp_orders');
use_class('jng_sp_customers');
use_class('logger');
$tb = new tradebyte();
$xmlt = new xml_tools();
$class_ean = new products_ean();
$class_sp = new jng_sp();
$class_jd = new jng_sp_download();
$class_jo = new jng_sp_orders();
$class_jcust = new jng_sp_customers();
$zade_prepayment_need_refreshed = false;
function logThis($logdata)
{
    global $logger;
    $logger->write($logdata);
    echo "{$logdata}<br />\n";
}
/////////////////////////////
// STEP 1: DOWNLOAD ORDERS //
/////////////////////////////
logThis('STEP 1: DOWNLOAD ORDERS');
//$tb->connect('NONSSL');
//$files = $tb->downloadFromDir(SP_TRADEBYTE_FTP_OUT_PATH, SP_TRADEBYTE_DOWNLOAD_ORDERS_PATH);
$tb->connect();
$files = $tb->downloadOrders();
コード例 #4
0
function getOrderDetail($barcode = '', $idcode_ret = '')
{
    //die("$barcode | $idcode_ret");
    $result = array();
    $result['status'] = 'MCORDERNOTFOUND';
    use_class('jng_sp');
    use_class('jng_sp_orders');
    if ($barcode != '') {
        list($type, $order_product_id) = split('-', strtoupper($barcode));
        //GET order_id
        $order_id = '';
        if ($type == 'SP' || $type == 'JR') {
            $status = 'MCSCANPRODUCT';
            use_class('jng_sp_customers');
            $class_sp = new jng_sp();
            $class_jo = new jng_sp_orders();
            $class_jc = new jng_sp_customers();
            $item = $class_jo->retrieveItemDetail($order_product_id);
            $order_id = $item['jng_sp_orders_id'];
            $order = $class_jo->retrieveDetail($order_id);
            if (count($order) > 0) {
                $sp = $class_sp->retrieveDetail($order['jng_sp_id']);
                $customer = $class_jc->retrieveDetail(null, $order['jng_sp_id'], $order['customer_billing_id']);
                $customer_name = $order['customer_billing_firstname'] . ' ' . $order['customer_billing_lastname'];
                $customers_street_address = $order['customer_billing_address'] . ' ' . $order['customer_billing_address2'];
                $order_type = $sp['name'] . ' Order ' . $order['order_id'];
                $result = setOrderResult($status, 'S', $order_id, $order_type, $customer['jng_sp_customers_id'], $customer_name, $order['customer_billing_email'], $order['customer_billing_phone'], $customers_street_address, $order['customer_billing_postcode'], $order['customer_billing_city'], $order['customer_billing_country']);
            }
        } elseif ($type == 'JG') {
            $status = 'MCSCANPRODUCT';
            use_class('orders');
            $class_o = new orders();
            $item = $class_o->retrieveProductDetail($order_product_id);
            $order_id = $item['orders_id'];
            $order = $class_o->retrieveDetail($order_id);
            if (count($order) > 0) {
                $order_type = 'J&G Order ' . $order['orders_no'];
                $result = setOrderResult($status, 'J', $order_id, $order_type, $order['customers_id'], $order['customers_name'], $order['customers_email_address'], $order['customers_telephone'], $order['customers_street_address'], $order['customers_postcode'], $order['customers_city'], $order['customers_country']);
            }
        }
    } elseif ($idcode_ret != '') {
        //1 idcode_ret utk 1 order
        $qsp = "SELECT j.name AS sp_name, jo.* FROM jng_sp_orders jo INNER JOIN jng_sp j ON j.jng_sp_id = jo.jng_sp_id";
        $qsp .= " WHERE idcode_ret = '{$idcode_ret}' ORDER BY jo.order_date DESC LIMIT 1";
        $rsp = tep_db_query($qsp);
        $dsp = tep_db_num_rows($rsp) > 0 ? tep_db_fetch_array($rsp) : null;
        if (is_null($dsp)) {
            /* 12.05.2015: 
             * If not found, try to search using order number.
             * So far at this time, returns from LZ.ID, ZR.ID, ZR.BR used order number barcode
             */
            $qsp = "SELECT j.name AS sp_name, jo.* FROM jng_sp_orders jo INNER JOIN jng_sp j ON j.jng_sp_id = jo.jng_sp_id";
            $qsp .= " WHERE jo.order_id = '{$idcode_ret}' ORDER BY jo.order_date DESC LIMIT 1";
            $rsp = tep_db_query($qsp);
            $dsp = tep_db_num_rows($rsp) > 0 ? tep_db_fetch_array($rsp) : null;
        }
        $qjg = "SELECT * FROM orders WHERE idcode_ret='{$idcode_ret}' ORDER BY date_purchased DESC  LIMIT 1";
        $rjg = tep_db_query($qjg);
        $djg = tep_db_num_rows($rjg) > 0 ? tep_db_fetch_array($rjg) : null;
        if (!is_null($dsp) || !is_null($djg)) {
            $status = 'MCSCANPRODUCT';
            if (!is_null($dsp) && !is_null($djg)) {
                $dsp_time = strtotime($dsp['order_date']);
                $djg_time = strtotime($djg['date_purchased']);
                $use_data = $dsp_time >= $djg_time ? 'sp' : 'jg';
            } else {
                $use_data = !is_null($dsp) ? 'sp' : 'jg';
            }
            if ($use_data == 'sp') {
                $order_id = $dsp['jng_sp_orders_id'];
                use_class('jng_sp_customers');
                $class_jc = new jng_sp_customers();
                $customer = $class_jc->retrieveDetail(null, $dsp['jng_sp_id'], $dsp['customer_billing_id']);
                $customer_name = $dsp['customer_billing_firstname'] . ' ' . $dsp['customer_billing_lastname'];
                $customers_street_address = $dsp['customer_billing_address'] . ' ' . $dsp['customer_billing_address2'];
                $order_type = $dsp['sp_name'] . ' Order ' . $dsp['order_id'];
                $result = setOrderResult($status, 'S', $order_id, $order_type, $customer['jng_sp_customers_id'], $customer_name, $dsp['customer_billing_email'], $dsp['customer_billing_phone'], $customers_street_address, $dsp['customer_billing_postcode'], $dsp['customer_billing_city'], $dsp['customer_billing_country']);
            } else {
                $order_id = $djg['orders_id'];
                $order_type = 'J&G Order ' . $djg['orders_no'];
                $result = setOrderResult($status, 'J', $order_id, $order_type, $djg['customers_id'], $djg['customers_name'], $djg['customers_email_address'], $djg['customers_telephone'], $djg['customers_street_address'], $djg['customers_postcode'], $djg['customers_city'], $djg['customers_country']);
            }
        }
    }
    return $result;
}
コード例 #5
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
$all_sp = $class_sp->retrieveList();
use_class('jng_sp_download');
$class_jd = new jng_sp_download();
use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
use_class('jng_sp_customers');
$class_jcust = new jng_sp_customers();
use_class('jng_sp_orders_xml');
$total_orders_created = 0;
$daily_counter = array();
foreach ($all_sp as $sp_detail) {
    //initial setting
    $files_imported = 0;
    $orders_created = 0;
    $products_created = 0;
    $jng_sp_id = $sp_detail["jng_sp_id"];
    $jng_sp_name = $sp_detail["name"];
    $process_status = array('1' => 'D', '2' => 'R', '3' => 'R', '4' => 'R', '5' => 'R');
    $xmlwithgpg = array('1');
    if (array_key_exists($jng_sp_id, $process_status)) {
        $sp_detail = $class_sp->retrieveDetail($jng_sp_id);
        $jng_sp_id_with_no_external_xml_class = array('2', '4', '5');
        if (!in_array($jng_sp_id, $jng_sp_id_with_no_external_xml_class)) {
            use_class('jng_sp_orders_xml_' . $jng_sp_id);
        }
        switch ($jng_sp_id) {
            case '1':
コード例 #6
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_customers');
$class_jcust = new jng_sp_customers();
//SP SETTING
salesPartnerCombo();
//GET PAGE
$page = 1;
if (isset($_GET['page']) && $_GET['page'] != '') {
    $page = tep_db_prepare_input($_GET['page']);
}
$filter = '';
if (isset($_POST['keyword']) && $_POST['keyword'] != '') {
    $keywords = tep_db_prepare_input($_POST['keyword']);
    $keywords = trim($keywords);
    if ($keywords != '') {
        $filter_array = array();
        $kw_array = explode(' ', $keywords);
        foreach ($kw_array as $kw) {
            $filter_array[] = " (jsc.customer_firstname LIKE '%{$kw}%' OR jsc.customer_lastname LIKE '%{$kw}%' OR jsc.customer_id='{$kw}')";
        }
        if (count($filter_array) > 0) {
            $filter = implode(' AND ', $filter_array);
        }
    }
}
$sort = '';
$limit = ROWPERPAGE;
$offset = ($page - 1) * $limit;
コード例 #7
0
ファイル: payone.php プロジェクト: blasiuscosa/manobo-2008
 function createReturnContainerSP($return_id, $return_qty, $joi_id)
 {
     use_class('Order');
     use_class('jng_sp_orders');
     use_class('jng_sp_customers');
     use_class('payone_invoice');
     $class_jcust = new jng_sp_customers();
     $class_jo = new jng_sp_orders();
     $item = $class_jo->retrieveItemDetail($joi_id);
     $oid = $item['jng_sp_orders_id'];
     $order_obj = new Order(Order::ORDER_TYPE_SALES_PARTNER, $oid);
     $order = $class_jo->retrieveDetail($oid);
     if ($order_obj->isPaymentHandledByPayone()) {
         $invoice = new payone_invoice('invoice_order_type', 'S', "invoice_order_id={$oid}");
         //ONLY QUEING JUST FOR TRANSACTION THAT HAVE payone_txid (FIRST GET FROM SUBMITTING INVOICE)
         if ($invoice->detail['payone_txid'] != '') {
             $payone_txid = $invoice->detail['payone_txid'];
             $payment_method = $order_obj->getPaymentMethodRaw();
             $customer = $class_jcust->retrieveDetail(null, $order_obj->sales_partner_id, $order_obj->customer_id);
             $customer_bankdata = $class_jcust->getBankAccountData($customer['jng_sp_customers_id']);
             $data_por = array();
             $data_por['return_id'] = $return_id;
             $data_por['jng_sp_orders_items_id'] = $joi_id;
             $data_por['jng_sp_customers_id'] = $customer['jng_sp_customers_id'];
             $data_por['amount'] = round($return_qty * ($item['price'] * 100));
             $data_por['txid'] = $payone_txid;
             $data_por['invoice_id'] = $invoice->detail['invoice_id'];
             $data_por['invoice_no'] = $invoice->detail['invoice_no'];
             $data_por['id'] = $item['article_number'];
             $data_por['pr'] = round($item['price'] * 100);
             $data_por['no'] = $return_qty;
             $data_por['de'] = strlen($item['billing_text']) > 32 ? substr($item['billing_text'], 0, 32) : $item['billing_text'];
             $data_por['va'] = 0;
             $data_por['payment_method'] = $payment_method;
             $data_por['currency'] = 'EUR';
             if (!is_null($customer_bankdata)) {
                 $data_por['bankcode'] = $customer_bankdata['bank_code'];
                 $data_por['bankcountry'] = $customer_bankdata['bank_country'];
                 $data_por['bankaccount'] = $customer_bankdata['bank_account_number'];
                 $data_por['bankaccountholder'] = $customer_bankdata['bank_account_holder'];
             }
             $this->payoneReturnItemContainer($data_por);
             $items_total = $order_obj->getTotalItemsNotCanceledQuantity();
             $returns_total = $order_obj->getTotalItemsReturnedQuantity();
             if ($items_total == $returns_total) {
                 $amount_paid = $invoice->detail['invoice_amount_paid'];
                 $shipping_cost = $order_obj->getCostShipping();
                 $cod_cost = $order_obj->getCostCOD();
                 $total_costs = $shipping_cost + $cod_cost;
                 if ($shipping_cost > 0) {
                     //if((($amount_paid*1)==0)||(($amount_paid<>$shipping_cost)&&($amount_paid<>$total_costs))){
                     if ($amount_paid * 1 == 0 || $amount_paid > $total_costs) {
                         //HANDLE DOUBLE OR MORE SHIPING RETURN CONTAINER
                         $q_check = "SELECT * FROM payone_orders_return WHERE txid = '{$payone_txid}' AND id = 'Shipping'";
                         $dbc = tep_db_query($q_check);
                         if (tep_db_num_rows($dbc) == 0) {
                             $amount = round($shipping_cost * 100);
                             $data_por = array();
                             $data_por['return_id'] = 0;
                             $data_por['jng_sp_orders_items_id'] = 0;
                             $data_por['jng_sp_customers_id'] = $customer['jng_sp_customers_id'];
                             $data_por['amount'] = $amount;
                             $data_por['txid'] = $payone_txid;
                             $data_por['invoice_id'] = $invoice->detail['invoice_id'];
                             $data_por['invoice_no'] = $invoice->detail['invoice_no'];
                             $data_por['id'] = 'Shipping';
                             $data_por['pr'] = $amount;
                             $data_por['no'] = 1;
                             $data_por['de'] = 'Verpackung & Versand';
                             $data_por['va'] = 0;
                             $data_por['payment_method'] = $payment_method;
                             $data_por['currency'] = 'EUR';
                             $this->payoneReturnItemContainer($data_por);
                         }
                     }
                 }
                 if ($cod_cost > 0) {
                     //if((($amount_paid==0*1))||(($amount_paid<>$cod_cost)&&($amount_paid<>$total_costs))){
                     if ($amount_paid * 1 == 0 || $amount_paid > $total_costs) {
                         $amount = round($cod_cost * 100);
                         $data_por = array();
                         $data_por['return_id'] = 0;
                         $data_por['jng_sp_orders_items_id'] = 0;
                         $data_por['jng_sp_customers_id'] = $customer['jng_sp_customers_id'];
                         $data_por['amount'] = $amount;
                         $data_por['txid'] = $payone_txid;
                         $data_por['invoice_id'] = $invoice->detail['invoice_id'];
                         $data_por['invoice_no'] = $invoice->detail['invoice_no'];
                         $data_por['id'] = 'COD';
                         $data_por['pr'] = $amount;
                         $data_por['no'] = 1;
                         $data_por['de'] = 'Nachnahmegebühren';
                         $data_por['va'] = 0;
                         $data_por['payment_method'] = $payment_method;
                         $data_por['currency'] = 'EUR';
                         $this->payoneReturnItemContainer($data_por);
                     }
                 }
             }
         } else {
             //ORDER NOT SUBMITTED YET TO PAYONE, SO NO TXID CREATED YET. JUST NEED TO EXCLUDE ITEM FROM payone_invoice TABLE COLUMN 'invoice_order_items_id'
             $oids_arr = explode(',', $invoice->detail['invoice_order_items_id']);
             if (is_array($oids_arr)) {
                 $new_amount = $invoice->detail['invoice_amount'] - $return_qty * $item['price'];
                 foreach ($oids_arr as $key => $value) {
                     if ($value == $joi_id) {
                         unset($oids_arr[$key]);
                     }
                 }
                 $oids = implode(',', $oids_arr);
                 if (count($oids_arr) == 0) {
                     //ALL PRODUCTS RETURNED
                     $new_amount = 0;
                     $invoice->updateCompleteStatus('3');
                     //INVOICE CANCELLED
                 }
                 tep_db_perform('payone_invoice', array('invoice_amount' => $new_amount, 'invoice_order_items_id' => $oids), 'update', "invoice_id = '" . $invoice->detail['invoice_id'] . "'");
             }
         }
     }
 }
コード例 #8
0
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('jng_sp_customers');
use_class('payone');
use_class('jng_sp_orders');
use_class('payone_invoice');
$class_payone = new payone();
$class_pi = new payone_invoice();
$class_jcust = new jng_sp_customers();
$class_jo = new jng_sp_orders();
$data_return_no_container = array();
$data_return_poa = array();
$data_return_cod = array();
//-----------HAVE RETURN (FULL) WITHOUT RETURN CONTAINER
$query = "SELECT d.shipping_costs,d.cod_costs,d.`payment_method`,a.`return_id`, a.return_quantity, c.payone_txid, c.invoice_id, b.jng_sp_orders_id, b.`jng_sp_orders_items_id`, b.article_number,b.billing_text,b.price\nFROM jng_sp_orders_items_return a,`jng_sp_orders_items` b, payone_invoice c, `jng_sp_orders` d\nWHERE a.jng_sp_orders_items_id\nIN (\nSELECT invoice_order_items_id\nFROM payone_invoice\nWHERE invoice_order_id\nIN ( 17334, 17237, 16476, 17038, 16819, 16486, 16672, 16473, 16732, 16581, 16493, 17250, 16854, 16483, 16582, 16508, 17182, 17045, 16766, 16513, 16666, 16836, 16757, 16485, 16866, 16583, 16490 )\n)\nand a.`jng_sp_orders_items_id` = b.jng_sp_orders_items_id\nand c.invoice_order_id = b.jng_sp_orders_id\nand d.`jng_sp_orders_id` = b.`jng_sp_orders_id`";
$res = tep_db_query($query);
$result = array();
if (tep_db_num_rows($res) > 0) {
    while ($row = tep_db_fetch_array($res)) {
        $result[] = $row;
    }
}
//echo"<pre>";var_dump($result);die();
foreach ($result as $data) {
    //    echo"<pre>";var_dump($data);die();
    $invoice_id = $data['invoice_id'];
コード例 #9
0
         $voucher_query .= " INNER JOIN coupons c ON c.coupon_id=crt.coupon_id";
         $voucher_query .= " INNER JOIN coupons_description cd ON cd.coupon_id=crt.coupon_id AND cd.language_id=" . LANGUAGEID;
         $voucher_query .= " WHERE crt.order_id={$order_id}";
         $voucher_result = tep_db_query($voucher_query);
         $voucher_used = tep_db_num_rows($voucher_result);
         if ($voucher_used > 0) {
             while ($row = tep_db_fetch_array($voucher_result)) {
                 $vouchers[] = $row;
             }
         }
     }
 } elseif ($source == Order::ORDER_TYPE_SALES_PARTNER) {
     use_class('jng_sp');
     use_class('jng_sp_customers');
     $class_sp = new jng_sp();
     $class_jcust = new jng_sp_customers();
     $order_object = new Order(Order::ORDER_TYPE_SALES_PARTNER, $order_id);
     $order = $class_jo->retrieveDetail($order_id);
     $sp_detail = $class_sp->retrieveDetail($order['jng_sp_id']);
     $customer = $class_jcust->retrieveDetail(null, $order['jng_sp_id'], $order['customer_billing_id']);
     if (is_null($customer)) {
         $customer_ids = $class_jcust->getFromOrder($order['jng_sp_orders_id']);
         $customer = $class_jcust->retrieveDetail($customer_ids['customer_billing_id']);
     }
     $order['amount_discount'] = 0;
     $order_int_comments = $class_jo->retrieveComments($order_id);
     $comments = $class_jo->drawComments($order_int_comments, 'Internal Comments', 'h2');
     $items = $class_jo->retrieveItems($order_id);
     $items_colname_id = 'jng_sp_orders_items_id';
     $items_colname_price = 'price';
     $items_colname_qty = 'order_quantity';
コード例 #10
0
 if ($success) {
     $upload_id = $class_ju->newUpload($jng_sp_id, 'BS', $xml_filename, $session_userinfo['username']);
     $class_jo->confirmOrderReturn($items_confirmed);
     $archive_path_raw = SP_OTTODE_ARCHIVE_PATH . 'return/' . date('Y') . '/';
     if (!file_exists($archive_path_raw)) {
         mkdir($archive_path_raw);
     }
     $archive_fullpath = $archive_path_raw . $xml_filename;
     while (file_exists($archive_fullpath)) {
         $archive_fullpath .= '_copy';
     }
     copy($xmlfullpath, $archive_fullpath);
 }
 //CONFIRM DIRECTLY TO CUSTOMER
 use_class('jng_sp_customers');
 $class_jcust = new jng_sp_customers();
 $counter_success = 0;
 $counter_fail = 0;
 $counter_noemail = 0;
 foreach ($orders as $counter => $o) {
     $to_name = "{$o['customer_billing_title']} {$o['customer_billing_firstname']} {$o['customer_billing_lastname']}";
     $to_email_address = $o['customer_billing_email'];
     $customer = $class_jcust->retrieveDetail(null, $jng_sp_id, $o['customer_billing_id']);
     //we stop asking customers for bank account (31.01.2014)
     //$cid = $customer['jng_sp_customers_id'];
     //$time = time();
     //$md5_cidtime = md5($cid+$time);
     //$key = $cid.$md5_cidtime.$cid;
     //$link  = 'http://'.JNG_LIVE_URL.'/extensions/sp-customers-bank-account.php?';
     //$link .= 'cid='.$cid.'&amp;t='.$time.'&amp;key='.$key;
     //$link_html = '<a href="'.$link.'">'.$link.'</a>';
コード例 #11
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_customers_special');
$class_jcs = new jng_sp_customers_special();
use_class('jng_sp_customers');
$class_jcust = new jng_sp_customers();
$jng_sp_customers_id = isset($_GET['id']) ? tep_db_prepare_input($_GET['id']) : '';
if ($jng_sp_customers_id == '') {
    exit;
}
$detail = $class_jcs->getCustomerDetail($jng_sp_customers_id);
if (is_null($detail)) {
    exit;
}
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'ADDNEWCOMMENT') {
        $customer_id = tep_db_prepare_input($_POST['customer_id']);
        $comment = tep_db_prepare_input(utf8_decode($_POST['comment']));
        $comment = trim($comment);
        if ($comment != "") {
            $comment_by = $session_userinfo['username'];
            $comment_id = $class_jcs->insertComment($customer_id, $comment, $comment_by);
            //          $comment = $class_jcs->retrieveCommentDetail($comment_id);
            //          $comments = array($comment);
            //          $result = $class_jcs->drawComments($comments, true);
            $result = drawSingleComment($comment_id, $comment_by, time(), $comment);
            echo utf8_encode($result);
        }
コード例 #12
0
<?php

//*SPECIAL NOTE: THIS MODULE IS CALLED FROM PRODUCTS ANALYSIS
use_class('jng_sp');
use_class('jng_sp_customers');
use_class('jng_sp_orders');
use_class('products_minierp');
use_class('products_articles');
$class_sp = new jng_sp();
$class_jc = new jng_sp_customers();
$class_jo = new jng_sp_orders();
$class_pm = new products_minierp();
$class_pa = new products_articles();
$jng_sp_id = '6';
$sp_detail = $class_sp->retrieveDetail($jng_sp_id);
$class_col_pimg = 'img';
$class_col_desc = 'product tac';
$class_col_articles = 'name tac';
$clist_headers = array();
$clist_headers['customers'] = 'Store Owner / Name';
$clist_headers['task'] = 'Store / Shipping Address';
$clist_headers['input2'] = 'Billing Address';
$clist_headers['countpro'] = 'Qty per Article';
$clist_headers['act'] = '&nbsp;';
$clist_template = '<tr class="customer">';
foreach ($clist_headers as $k => $v) {
    switch ($k) {
        case 'countpro':
            $value = '<input type="text" name="qty_per_article" value="1" class="tac" style="width:30px;" />';
            break;
        case 'act':
コード例 #13
0
require_once '../functions-2.php';
tep_db_connect();
use_class('payone/financegateConnect');
use_class('jng_sp');
use_class('jng_sp_orders');
use_class('orders');
use_class('jng_sp_customers');
use_class('minierp_customers');
use_class('payone');
use_class('payone_invoice');
use_class('payone_logger');
$class_sp = new jng_sp();
$class_jo = new jng_sp_orders();
$class_o = new orders();
$class_payone = new payone();
$class_jcust = new jng_sp_customers();
$class_cust = new minierp_customers();
$process_method = 'DEBIT';
//$sets_of_returns =  $class_payone->retrieveRefundSubmitReadyList("status = 0");
$pkey_ids = explode(',', tep_db_prepare_input($_GET['pkey_id']));
if (count($pkey_ids) > 0) {
    $pkey_ids = implode(',', $pkey_ids);
    $sets_of_returns = $class_payone->retrieveRefundList("status = 0 AND pkey_id IN (" . $pkey_ids . ")");
    $counter = 0;
    $counter_returns = 0;
    $counter_returns_no_txid = 0;
    $status_paid_complete = array('P', '1');
    //$counter_is_refund = 0;
    $counter_is_refund = array();
    if (count($sets_of_returns) > 0) {
        //echo "<pre>";var_dump($sets_of_returns);die();
コード例 #14
0
<?php

use_class('jng_sp_customers');
$class_jcust = new jng_sp_customers();
use_class('jng_sp_customers_special');
$class_jcs = new jng_sp_customers_special();
use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
$customers_id = isset($_GET['id']) ? tep_db_prepare_input($_GET['id']) : '';
if ($customers_id == '') {
    exit;
}
//SUBMIT ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SETSPECIALLIST') {
        $submit = tep_db_prepare_input($_POST['submit']);
        $type = strpos($submit, 'VIP') === false ? 'B' : 'V';
        $customers_id = tep_db_prepare_input($_POST['customer_id']);
        $class_jcs->addCustomer($type, $customers_id);
        $openspeciallistdetail = true;
    }
}
//START TEMPLATE
$customer = $class_jcust->retrieveDetail($customers_id);
$customer_special = $class_jcs->getCustomerDetail($customers_id);
$order_sl_type = '';
$order_sl_icon = '';
if (!is_null($customer_special)) {
    $crown_img = $class_jcs->getTypeSymbol($customer_special['list_type'], $customers_id);
コード例 #15
0
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('jng_sp_customers');
$class_jcust = new jng_sp_customers();
$last_order_processed = 0;
$q = tep_db_query("SELECT jng_sp_orders_id FROM jng_sp_orders WHERE jng_sp_orders_id>{$last_order_processed}");
while ($row = tep_db_fetch_array($q)) {
    $last_order_id = $row['jng_sp_orders_id'];
    $class_jcust->getFromOrder($last_order_id);
}
echo 'Last order id processed is <strong>' . $last_order_id . '</strong>';
tep_db_close();
コード例 #16
0
 function changeDeliveryAddress($jng_sp_orders_id, $title, $firstname, $lastname, $address, $address2, $city, $postcode, $country)
 {
     $order = $this->retrieveDetail($jng_sp_orders_id);
     use_class('jng_sp_customers');
     $class_jc = new jng_sp_customers();
     $customer = $class_jc->retrieveDetail(null, $order['jng_sp_id'], $order['customer_shipping_id']);
     $data = array();
     $data['customer_title'] = $title;
     $data['customer_firstname'] = $firstname;
     $data['customer_lastname'] = $lastname;
     $data['address'] = $address;
     $data['address2'] = $address2;
     $data['city'] = $city;
     $data['postcode'] = $postcode;
     $data['country'] = $country;
     $class_jc->addAddress($customer['jng_sp_customers_id'], $data);
     $data = array();
     $data['customer_shipping_title'] = $title;
     $data['customer_shipping_firstname'] = $firstname;
     $data['customer_shipping_lastname'] = $lastname;
     $data['customer_shipping_address'] = $address;
     $data['customer_shipping_address2'] = $address2;
     $data['customer_shipping_city'] = $city;
     $data['customer_shipping_postcode'] = $postcode;
     $data['customer_shipping_country'] = $country;
     tep_db_perform('jng_sp_orders', $data, 'update', "jng_sp_orders_id={$jng_sp_orders_id}");
 }