コード例 #1
0
ファイル: point.php プロジェクト: hoangvtien/module-shops
            $transaction_id = $db->insert_id("INSERT INTO " . $db_config['prefix'] . "_" . $module_data . "_transaction (transaction_id, transaction_time, transaction_status, order_id, userid, payment, payment_id, payment_time, payment_amount, payment_data) VALUES (NULL, " . NV_CURRENTTIME . ", '" . $transaction_status . "', '" . $order_id . "', '" . $userid . "', '" . $payment . "', '" . $payment_id . "', " . NV_CURRENTTIME . ", '" . $payment_amount . "', '" . $payment_data . "')");
            if ($transaction_id > 0) {
                $db->query("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_orders SET transaction_status=" . $transaction_status . ", transaction_id=" . $transaction_id . ", transaction_count=transaction_count+1 WHERE order_id=" . $order_id);
                // Cap nhat diem tich luy
                UpdatePoint($order_data);
                $db->query("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_point SET point_total=point_total - " . $order_point . " WHERE userid=" . $userid);
                $db->query("INSERT INTO " . $db_config['prefix'] . "_" . $module_data . "_point_history(userid, order_id, point, time) VALUES (" . $userid . ", " . $order_id . ", -" . $order_point . ", " . NV_CURRENTTIME . ")");
            }
            nv_del_moduleCache($module_name);
            die('OK_' . $lang_module['payment_complete']);
        }
    }
}
$data_content['point'] = $point;
$data_content['money'] = $point * $pro_config['point_conversion'];
$data_content['money'] = nv_number_format($data_content['money'], nv_get_decimals($pro_config['money_unit']));
$data_content['money_unit'] = $pro_config['money_unit'];
// Lich su thuc hien
$db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_point_history t1')->join('INNER JOIN ' . $db_config['prefix'] . '_' . $module_data . '_orders t2 ON t1.order_id = t2.order_id')->where('userid = ' . $user_info['userid']);
$all_page = $db->query($db->sql())->fetchColumn();
$db->select('t1.*, t2.order_code')->order('id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
$_query = $db->query($db->sql());
$link_module = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name;
while ($row = $_query->fetch()) {
    $checkss = md5($row['order_id'] . $global_config['sitekey'] . session_id());
    $row['link'] = $link_module . "&" . NV_OP_VARIABLE . "=payment&order_id=" . $row['order_id'] . "&checkss=" . $checkss;
    $data_content['history'][] = $row;
}
$generate_page = nv_generate_page($base_url, $all_page, $per_page, $page);
$contents = call_user_func('point_info', $data_content, $generate_page);
include NV_ROOTDIR . '/includes/header.php';
コード例 #2
0
ファイル: theme.php プロジェクト: nukeplus/shops
/**
 * email_new_order()
 *
 * @param mixed $content
 * @param mixed $data_content
 * @param mixed $data_pro
 * @param mixed $data_table
 * @return
 */
function email_new_order($content, $data_content, $data_pro, $data_table = false)
{
    global $module_info, $lang_module, $module_file, $pro_config, $global_config, $money_config;
    if ($data_table) {
        $xtpl = new XTemplate("email_new_order.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
        $xtpl->assign('LANG', $lang_module);
        $xtpl->assign('DATA', $data_content);
        $i = 0;
        foreach ($data_pro as $pdata) {
            $xtpl->assign('product_name', $pdata['title']);
            $xtpl->assign('product_number', $pdata['product_number']);
            $xtpl->assign('product_price', nv_number_format($pdata['product_price'], nv_get_decimals($pro_config['money_unit'])));
            $xtpl->assign('product_unit', $pdata['product_unit']);
            $xtpl->assign('pro_no', $i + 1);
            $bg = $i % 2 == 0 ? " style=\"background:#f3f3f3;\"" : "";
            $xtpl->assign('bg', $bg);
            if ($pro_config['active_price'] == '1') {
                $xtpl->parse('data_product.loop.price2');
            }
            $xtpl->parse('data_product.loop');
            ++$i;
        }
        if (!empty($data_content['order_note'])) {
            $xtpl->parse('data_product.order_note');
        }
        $xtpl->assign('order_total', nv_number_format($data_content['order_total'], nv_get_decimals($pro_config['money_unit'])));
        $xtpl->assign('unit', $data_content['unit_total']);
        if ($pro_config['active_price'] == '1') {
            $xtpl->parse('data_product.price1');
            $xtpl->parse('data_product.price3');
        }
        $xtpl->parse('data_product');
        return $xtpl->text('data_product');
    }
    $xtpl = new XTemplate("email_new_order.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('CONTENT', $content);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
コード例 #3
0
ファイル: or_view.php プロジェクト: hoangvtien/module-shops
}
$a = 1;
$array_transaction = array();
$result = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_transaction WHERE order_id=' . $order_id . ' ORDER BY transaction_id ASC');
if ($result->rowCount()) {
    $array_payment = array();
    while ($row = $result->fetch()) {
        $row['a'] = $a++;
        $row['transaction_time'] = nv_date('H:i:s d/m/y', $row['transaction_time']);
        $row['order_id'] = !empty($row['order_id']) ? $row['order_id'] : '';
        $row['payment_time'] = !empty($row['payment_time']) ? nv_date('H:i:s d/m/y', $row['payment_time']) : '';
        $row['payment_id'] = !empty($row['payment_id']) ? $row['payment_id'] : '';
        if (!empty($row['payment_id'])) {
            $array_payment[] = $row['payment_id'];
        }
        $row['payment_amount'] = nv_number_format($row['payment_amount'], nv_get_decimals($pro_config['money_unit']));
        if ($row['transaction_status'] == 4) {
            $row['transaction'] = $lang_module['history_payment_yes'];
        } elseif ($row['transaction_status'] == 3) {
            $row['transaction'] = $lang_module['history_payment_cancel'];
        } elseif ($row['transaction_status'] == 2) {
            $row['transaction'] = $lang_module['history_payment_check'];
        } elseif ($row['transaction_status'] == 1) {
            $row['transaction'] = $lang_module['history_payment_send'];
        } elseif ($row['transaction_status'] == 0) {
            $row['transaction'] = $lang_module['history_payment_no'];
        } elseif ($row['transaction_status'] == -1) {
            $row['transaction'] = $lang_module['history_payment_wait'];
        } else {
            $row['transaction'] = 'ERROR';
        }
コード例 #4
0
/**
 * nv_get_price()
 *
 * @param mixed $pro_id
 * @param mixed $currency_convert
 * @param mixed $number
 * @param mixed $per_pro
 * @return
 */
function nv_get_price($pro_id, $currency_convert, $number = 1, $per_pro = false, $module = '')
{
    global $db, $db_config, $site_mods, $module_data, $global_array_shops_cat, $pro_config, $money_config, $discounts_config;
    $return = array();
    $discount_percent = 0;
    $discount_unit = '';
    $discount = 0;
    $module_data = !empty($module) ? $site_mods[$module]['module_data'] : $module_data;
    $product = $db->query('SELECT listcatid, product_price, money_unit, price_config, discount_id FROM ' . $db_config['prefix'] . '_' . $module_data . '_rows WHERE id = ' . $pro_id)->fetch();
    $price = $product['product_price'];
    if (!$per_pro) {
        $price = $price * $number;
    }
    $r = $money_config[$product['money_unit']]['round'];
    $decimals = nv_get_decimals($currency_convert);
    if ($r > 1) {
        $price = round($price / $r) * $r;
    } else {
        $price = round($price, $decimals);
    }
    if ($global_array_shops_cat[$product['listcatid']]['typeprice'] == 2) {
        $_price_config = unserialize($product['price_config']);
        if (!empty($_price_config)) {
            foreach ($_price_config as $_p) {
                if ($number <= $_p['number_to']) {
                    $price = $_p['price'] * (!$per_pro ? $number : 1);
                    break;
                }
            }
        }
    } elseif ($global_array_shops_cat[$product['listcatid']]['typeprice'] == 1) {
        if (isset($discounts_config[$product['discount_id']])) {
            $_config = $discounts_config[$product['discount_id']];
            if ($_config['begin_time'] < NV_CURRENTTIME and ($_config['end_time'] > NV_CURRENTTIME or empty($_config['end_time']))) {
                foreach ($_config['config'] as $_d) {
                    if ($_d['discount_from'] <= $number and $_d['discount_to'] >= $number) {
                        $discount_percent = $_d['discount_number'];
                        if ($_d['discount_unit'] == 'p') {
                            $discount_unit = '%';
                            $discount = $price * ($discount_percent / 100);
                        } else {
                            $discount_unit = ' ' . $pro_config['money_unit'];
                            $discount = $discount_percent * $number;
                        }
                        break;
                    }
                }
            }
        }
    }
    $price = nv_currency_conversion($price, $product['money_unit'], $currency_convert);
    $return['price'] = $price;
    // Giá sản phẩm chưa format
    $return['price_format'] = nv_number_format($price, $decimals);
    // Giá sản phẩm đã format
    $return['discount'] = $discount;
    // Số tiền giảm giá sản phẩm chưa format
    $return['discount_format'] = nv_number_format($discount, $decimals);
    // Số tiền giảm giá sản phẩm đã format
    $return['discount_percent'] = $discount_unit == '%' ? $discount_percent : nv_number_format($discount_percent, $decimals);
    // Giảm giá theo phần trăm
    $return['discount_unit'] = $discount_unit;
    // Đơn vị giảm giá
    $return['sale'] = $price - $discount;
    // Giá bán thực tế của sản phẩm
    $return['sale_format'] = nv_number_format($return['sale'], $decimals);
    // Giá bán thực tế của sản phẩm đã format
    $return['unit'] = $currency_convert;
    return $return;
}
コード例 #5
0
ファイル: content.php プロジェクト: nukeplus/shops
    $sql = 'SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_discounts ORDER BY add_time DESC';
    $_result = $db->query($sql);
    while ($_discount = $_result->fetch()) {
        $_discount['selected'] = $_discount['did'] == $rowcontent['discount_id'] ? "selected=\"selected\"" : "";
        $xtpl->assign('DISCOUNT', $_discount);
        $xtpl->parse('main.typeprice1.discount');
    }
    $xtpl->parse('main.typeprice1');
    $xtpl->parse('main.product_price');
} elseif ($typeprice == 2) {
    $_arr_price_config = empty($rowcontent['price_config']) ? array() : unserialize($rowcontent['price_config']);
    $i = sizeof($_arr_price_config);
    ++$i;
    $_arr_price_config[$i] = array('id' => $i, 'number_to' => $i == 1 ? 1 : '', 'price' => $i == 1 ? $rowcontent['product_price'] : '');
    foreach ($_arr_price_config as $price_config) {
        $price_config['price'] = $price_config['price'] > 0 ? number_format($price_config['price'], nv_get_decimals($pro_config['money_unit'])) : '';
        $xtpl->assign('PRICE_CONFIG', $price_config);
        $xtpl->parse('main.typeprice2.loop');
    }
    $xtpl->parse('main.typeprice2');
} else {
    $xtpl->parse('main.product_price');
}
// List discount
$sql = 'SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_discounts';
$_result = $db->query($sql);
while ($_discount = $_result->fetch()) {
    $_discount['selected'] = $_discount['did'] == $rowcontent['discount_id'] ? "selected=\"selected\"" : "";
    $xtpl->assign('DISCOUNT', $_discount);
    $xtpl->parse('main.discount');
}
コード例 #6
0
ファイル: loadcart.php プロジェクト: hoangvtien/module-shops
}
if ($nv_Request->isset_request('get_shipping_price', 'get')) {
    $weight = $nv_Request->get_float('weight', 'get', 0);
    $weight_unit = $nv_Request->get_string('weight_unit', 'get', '');
    $location_id = $nv_Request->get_int('location_id', 'get', 0);
    $shops_id = $nv_Request->get_int('shops_id', 'get', 0);
    $carrier_id = $nv_Request->get_int('carrier_id', 'get', 0);
    $ship_price = nv_shipping_price($weight, $weight_unit, $location_id, $shops_id, $carrier_id);
    if (!empty($ship_price)) {
        $total += $ship_price;
    }
}
if ($pro_config['active_price'] == '0') {
    $total = 0;
}
$total = nv_number_format($total, nv_get_decimals($pro_config['money_unit']));
$lang_tmp['cart_title'] = $lang_module['cart_title'];
$lang_tmp['cart_product_title'] = $lang_module['cart_product_title'];
$lang_tmp['cart_product_total'] = $lang_module['cart_product_total'];
$lang_tmp['cart_check_out'] = $lang_module['cart_check_out'];
$lang_tmp['history_title'] = $lang_module['history_title'];
$lang_tmp['active_order_dis'] = $lang_module['active_order_dis'];
$lang_tmp['wishlist_product'] = $lang_module['wishlist_product'];
$lang_tmp['point_cart_text'] = $lang_module['point_cart_text'];
$xtpl = new XTemplate("block.cart.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
$xtpl->assign('LANG', $lang_tmp);
$xtpl->assign('total', $total);
$xtpl->assign('TEMPLATE', $module_info['template']);
$xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
$xtpl->assign('LINK_VIEW', NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=cart");
$xtpl->assign('WISHLIST', NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=wishlist");
コード例 #7
0
ファイル: items.php プロジェクト: hoangvtien/module-shops
        $catid_i = $listcatid;
    }
    // Xac dinh anh nho
    if ($homeimgthumb == 1) {
        $thumb = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/' . $homeimgfile;
        $imghome = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $homeimgfile;
    } elseif ($homeimgthumb == 2) {
        $imghome = $thumb = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $homeimgfile;
    } elseif ($homeimgthumb == 3) {
        $imghome = $thumb = $homeimgfile;
    } elseif (file_exists(NV_ROOTDIR . '/themes/' . $theme . '/images/' . $module_file . '/no-image.jpg')) {
        $imghome = $thumb = NV_BASE_SITEURL . 'themes/' . $theme . '/images/' . $module_file . '/no-image.jpg';
    } else {
        $imghome = $thumb = NV_BASE_SITEURL . 'themes/default/images/' . $module_file . '/no-image.jpg';
    }
    $xtpl->assign('ROW', array('id' => $id, 'link' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $global_array_shops_cat[$catid_i]['alias'] . '/' . $alias . $global_config['rewrite_exturl'], 'link_seller' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=seller&amp;pro_id=' . $id . '&amp;nv_redirect=' . nv_base64_encode($base_url), 'link_copy' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=content&amp;copy&amp;id=' . $id, 'link_warehouse' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=warehouse&amp;listid=' . $id . '&amp;checkss=' . md5($global_config['sitekey'] . session_id()), 'title' => $title, 'publtime' => $publtime, 'edittime' => $edittime, 'hitstotal' => $hitstotal, 'num_sell' => $num_sell, 'product_unit' => isset($array_unit[$product_unit]) ? $array_unit[$product_unit][NV_LANG_DATA . '_title'] : '', 'status' => $lang_module['status_' . $status], 'admin_id' => !empty($username) ? $username : '', 'product_number' => $product_number, 'product_price' => nv_number_format($product_price, nv_get_decimals($money_unit)), 'money_unit' => $money_unit, 'thumb' => $thumb, 'imghome' => $imghome, 'link_edit' => nv_link_edit_page($id), 'link_delete' => nv_link_delete_page($id)));
    if ($num_sell > 0) {
        $xtpl->parse('main.loop.seller');
    } else {
        $xtpl->parse('main.loop.seller_empty');
    }
    // Hien thi nhap kho
    if ($pro_config['active_warehouse']) {
        $xtpl->parse('main.loop.warehouse_icon');
    }
    $xtpl->parse('main.loop');
    ++$a;
}
$array_list_action = array('delete' => $lang_global['delete'], 'publtime' => $lang_module['publtime'], 'exptime' => $lang_module['exptime'], 'addtoblock' => $lang_module['addtoblock']);
if ($pro_config['active_warehouse']) {
    $array_list_action['warehouse'] = $lang_module['warehouse'];
コード例 #8
0
ファイル: order.php プロジェクト: hoangvtien/module-shops
    if ($row['order_view'] == '0') {
        $xtpl->parse('main.data.row.bgview');
    }
    $xtpl->parse('main.data.row');
    ++$count;
}
$xtpl->assign('URL_CHECK_PAYMENT', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=checkpayment");
$xtpl->assign('URL_DEL', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=or_del");
$xtpl->assign('URL_DEL_BACK', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
$xtpl->assign('PAGES', nv_generate_page($base_url, $num_items, $per_page, $page));
$xtpl->parse('main.data');
foreach ($transaction_status as $key => $lang_status) {
    $xtpl->assign('TRAN_STATUS', array('key' => $key, 'title' => $lang_status, 'selected' => (isset($search['order_payment']) and $key == $search['order_payment']) ? 'selected="selected"' : ''));
    $xtpl->parse('main.transaction_status');
}
if (!empty($search['date_from'])) {
    $search['date_from'] = nv_date('d/m/Y', $search['date_from']);
}
if (!empty($search['date_to'])) {
    $search['date_to'] = nv_date('d/m/Y', $search['date_to']);
}
$order_info['sum_unit'] = $pro_config['money_unit'];
$order_info['sum_price'] = nv_number_format($order_info['sum_price'], nv_get_decimals($pro_config['money_unit']));
$xtpl->assign('ORDER_INFO', $order_info);
$xtpl->assign('CHECKSESS', md5(session_id()));
$xtpl->assign('SEARCH', $search);
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
コード例 #9
0
    $base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&cid=' . $row['cid'];
    $generate_page = nv_generate_page($base_url, $num_items, $per_page, $page);
    if (!empty($generate_page)) {
        $xtpl->assign('PAGE', $generate_page);
        $xtpl->parse('main.view.generate_page');
    }
    $xtpl->parse('main.view');
}
if (!empty($row['cid'])) {
    $page_title = sprintf($lang_module['carrier_config_config_item'], $array_config_list[$row['cid']]['title']);
}
$row['config_weight'][] = array('weight' => '', 'weight_unit' => $pro_config['weight_unit'], 'carrier_price' => '', 'carrier_price_unit' => $pro_config['money_unit']);
$i = 0;
foreach ($row['config_weight'] as $config) {
    $config['id'] = $i;
    $config['carrier_price'] = !empty($config['carrier_price']) ? number_format($config['carrier_price'], nv_get_decimals($config['carrier_price_unit']), '.', ',') : '';
    $xtpl->assign('CONFIG', $config);
    if (!empty($weight_config)) {
        foreach ($weight_config as $key => $unit) {
            $xtpl->assign('UNIT', array('key' => $key, 'value' => $unit, 'selected' => $config['weight_unit'] == $key ? 'selected="selected"' : ''));
            $xtpl->parse('main.config.weight_unit');
        }
    }
    if (!empty($money_config)) {
        foreach ($money_config as $code => $info) {
            $info['select'] = $config['carrier_price_unit'] == $code ? "selected=\"selected\"" : "";
            $xtpl->assign('MON', $info);
            $xtpl->parse('main.config.money_unit');
        }
    }
    $xtpl->parse('main.config');
コード例 #10
0
ファイル: seller.php プロジェクト: hoangvtien/module-shops
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('MODULE_NAME', $module_name);
$xtpl->assign('OP', $op);
$xtpl->assign('C_LIST', nv_base64_decode($nv_redirect));
$db->select('t2.order_name, t2.order_email, t2.order_phone, t2.order_address, t2.unit_total, t2.order_time, t1.num, t1.price')->order('t1.order_id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
$sth = $db->prepare($db->sql());
$sth->execute();
$i = $page == 1 ? 0 : $page;
$array_total = array('price' => 0, 'num' => 0, 'pro_unit' => $pro_config['money_unit'], 'product_unit' => $pro_info['product_unit']);
while (list($order_name, $order_email, $order_phone, $order_address, $unit_total, $order_time, $num, $price) = $sth->fetch(3)) {
    $i++;
    $price = $price * $num;
    $array_total['price'] += $price;
    $array_total['num'] += $num;
    $xtpl->assign('ROW', array('no' => $i, 'order_name' => $order_name, 'order_email' => $order_email, 'order_phone' => $order_phone, 'order_address' => $order_address, 'num' => $num, 'price' => nv_number_format($price, nv_get_decimals($unit_total)), 'price_unit' => $unit_total, 'order_time' => nv_date('H:i d/m/Y', $order_time)));
    $xtpl->parse('main.loop');
}
$generate_page = nv_generate_page($base_url, $num_items, $per_page, $page);
if (!empty($generate_page)) {
    $xtpl->assign('GENERATE_PAGE', $generate_page);
    $xtpl->parse('main.generate_page');
}
$array_total['price'] = nv_number_format($array_total['price'], nv_get_decimals($array_total['pro_unit']));
$xtpl->assign('TOTAL', $array_total);
$xtpl->assign('C_REPORT', sprintf($lang_module['customer_report_display'], $i, $num_items));
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
コード例 #11
0
ファイル: print.php プロジェクト: hoangvtien/module-shops
$listid = $listnum = array();
$result = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_orders_id WHERE order_id=' . $data['order_id']);
while ($row = $result->fetch()) {
    $listid[] = $row['proid'];
    $listnum[] = $row['num'];
}
$i = 0;
foreach ($listid as $id) {
    $sql = 'SELECT id, ' . NV_LANG_DATA . '_title, product_price,money_unit FROM ' . $db_config['prefix'] . '_' . $module_data . '_rows WHERE id = ' . $id . ' AND status =1 AND publtime < ' . NV_CURRENTTIME . ' AND (exptime=0 OR exptime>' . NV_CURRENTTIME . ')';
    $result = $db->query($sql);
    list($id, $title, $product_price, $money_unit) = $result->fetch(3);
    $xtpl->assign('product_name', $title);
    $xtpl->assign('product_number', $listnum[$i]);
    $xtpl->assign('product_price', nv_number_format($product_price, nv_get_decimals($pro_config['money_unit'])));
    $xtpl->assign('product_unit', $money_unit);
    $xtpl->assign('tt', $i + 1);
    $xtpl->parse('main.loop');
    ++$i;
}
$xtpl->assign('order_total', nv_number_format($data['order_total'], nv_get_decimals($pro_config['money_unit'])));
$xtpl->assign('unit', $data['unit_total']);
$payment = $data['order_total'] == '1' ? $lang_module['order_payment'] : $lang_module['order_no_payment'];
$xtpl->assign('payment', $payment);
if ($data['status'] != '1') {
    $xtpl->parse('main.onsubmit');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo $contents;
include NV_ROOTDIR . '/includes/footer.php';
コード例 #12
0
ファイル: shipping.php プロジェクト: hoangvtien/module-shops
$xtpl->assign('LOCALTION_URL', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=location');
$xtpl->assign('CARRIER_URL', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=carrier');
$xtpl->assign('CONFIG_URL', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=carrier_config');
$xtpl->assign('SHOPS_URL', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=shops');
$base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op;
if (!empty($array_search['keywords'])) {
    $base_url .= '&keywords=' . $array_search['keywords'];
}
if (!empty($array_search['shops_id'])) {
    $base_url .= '&shops_id=' . $array_search['shops_id'];
}
if (!empty($array_search['carrier_id'])) {
    $base_url .= '&carrier_id=' . $array_search['carrier_id'];
}
while ($view = $sth->fetch()) {
    $view['ship_price'] = nv_number_format($view['ship_price'], nv_get_decimals($view['ship_price_unit']));
    $view['ship_location_title'] = $array_location[$view['ship_location_id']]['title'];
    while ($array_location[$view['ship_location_id']]['parentid'] > 0) {
        $items = $array_location[$array_location[$view['ship_location_id']]['parentid']];
        $view['ship_location_title'] .= ', ' . $items['title'];
        $array_location[$view['ship_location_id']]['parentid'] = $items['parentid'];
    }
    $view['ship_shops_title'] = $array_shops[$view['ship_shops_id']]['name'];
    $view['ship_carrier_title'] = $array_carrier[$view['ship_carrier_id']]['name'];
    $view['order_view'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=or_view&amp;order_id=' . $view['order_id'];
    $xtpl->assign('VIEW', $view);
    $xtpl->parse('main.loop');
}
$generate_page = nv_generate_page($base_url, $num_items, $per_page, $page);
if (!empty($generate_page)) {
    $xtpl->assign('NV_GENERATE_PAGE', $generate_page);
コード例 #13
0
ファイル: point.php プロジェクト: hoangvtien/module-shops
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('NV_LANG_VARIABLE', NV_LANG_VARIABLE);
$xtpl->assign('NV_LANG_DATA', NV_LANG_DATA);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('MODULE_NAME', $module_name);
$xtpl->assign('OP', $op);
$xtpl->assign('Q', $q);
$xtpl->assign('money_unit', $pro_config['money_unit']);
$base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op;
if (!empty($q)) {
    $base_url .= '&q=' . $q;
}
$generate_page = nv_generate_page($base_url, $num_items, $per_page, $page);
if (!empty($generate_page)) {
    $xtpl->assign('NV_GENERATE_PAGE', $generate_page);
    $xtpl->parse('main.generate_page');
}
while ($view = $sth->fetch()) {
    $view['point_total'] = !empty($view['point_total']) ? $view['point_total'] : 0;
    $view['money'] = nv_number_format($view['point_total'] * $pro_config['point_conversion'], nv_get_decimals($pro_config['money_unit']));
    $xtpl->assign('VIEW', $view);
    $xtpl->parse('main.loop');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
$page_title = $lang_module['point'];
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
コード例 #14
0
ファイル: discounts.php プロジェクト: hoangvtien/module-shops
        if ($view['detail']) {
            $view['detail'] = $lang_global['yes'];
            $xtpl->parse('main.view.loop.detail');
        } else {
            $view['detail'] = $lang_global['no'];
        }
        $view['link_edit'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op . '&amp;did=' . $view['did'];
        $view['link_delete'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op . '&amp;delete_did=' . $view['did'] . '&amp;delete_checkss=' . md5($view['did'] . NV_CACHE_PREFIX . $client_info['session_id']);
        $xtpl->assign('VIEW', $view);
        if (!empty($view['config'])) {
            $config_discount_i = unserialize($view['config']);
            foreach ($config_discount_i as $discount) {
                if ($discount['discount_unit'] == 'p') {
                    $discount['discount_unit'] = '%';
                } else {
                    $discount['discount_number'] = nv_number_format($discount['discount_number'], nv_get_decimals($pro_config['money_unit']));
                    $discount['discount_unit'] = ' ' . $pro_config['money_unit'];
                }
                $xtpl->assign('DISCOUNT', $discount);
                $xtpl->parse('main.view.loop.discount');
            }
        }
        $xtpl->parse('main.view.loop');
    }
    $xtpl->parse('main.view');
}
$config_discount[] = array('discount_from' => '', 'discount_to' => '', 'discount_number' => '', 'discount_unit' => 'p');
$config_unit = array('p' => $lang_module['coupons_type_percentage'], 'f' => $lang_module['coupons_type_fixed_amount']);
$i = 0;
foreach ($config_discount as $config) {
    $config['id'] = $i;