status_array(){
if(is_array($this->orders_status_array)){
return true;
}
global $lang_orderstatus;
$this->payment_key();
if($this->payment_key == 'goodsarrivepay'){
include DIR_dzsw.'includes/ordersstatus_g.php';
}else{
include DIR_dzsw.'includes/ordersstatus.php';
}
$this->orders_status_array = $orders_status_array;
}
function order_product($reget = ''){
global $table_pre;
if($reget == ''){
if(is_array($this->order_product) && is_array($this->order_product['0'])){
return true;
}
}
$query = $this->db->query("select products_id,model,name,price,final_price, quantity from ".$table_pre."orders_products where orders_id='" . (int)$this->orders_id . "'");
$products = array();
while($query_data = $this->db->fetch_array($query)){
$query_data['final_price_text'] = display_price($query_data['final_price']);
$products[] = $query_data;
}
$this->order_product = $products;
}
function order_product_email(){
$this->order_product();
$order_product_email = '';
if(is_array($this->order_product)){
foreach($this->order_product as $k=>$v){
$small_total = display_price($v['final_price'] * $v['quantity']);
$order_product_email .= "<tr class=\"bgcolor1\"><td>".$v['name']."</td><td>".display_price($v['final_price'])."</td><td>".$v['quantity']."</td><td>".$small_total."</td></tr>";
}
}
return $order_product_email;
}
function order_history(){
global $settings, $table_pre, $cache_payment_key, $lang_payment, $lang_common, $lang_a_order;
$this->orders_status_array();
$query = $this->db->query("select * from ".$table_pre."orders_history where orders_id='" . (int)$this->orders_id . "' order by date_added");
$orders_history_array = array();
if(!is_array($cache_payment_key)){
include(cacheexists("payment_key"));
}
while($query_data = $this->db->fetch_array($query)){
$query_data['orders_status'] = $this->orders_status_array[$query_data['orders_status']]['title'];
$query_data['date_added'] = $query_data['date_added'] ? gmdate($settings['date_format'].' H:i:s', $query_data['date_added']+ $settings['time_ofset'] * 3600) : "";
if($query_data['payment_type']){
$payment_type_array = explode('_',$query_data['payment_type']);
$query_data['payment_title'] = payment_title($cache_payment_key[$payment_type_array['0']],$lang_payment);
}else{
$query_data['payment_title'] = $lang_common['no_fit'];
}
if($query_data['operator']){
$operator_array = explode('_',$query_data['operator']);
if($operator_array['0'] == 'a'){
$admin_data = $this->db->get_one("SELECT email FROM ".$table_pre."admins WHERE adminid='".$operator_array['1']."' limit 1");
$query_data['operator'] = $admin_data['email'];
}elseif($operator_array['0'] == 'c'){
$query_data['operator'] = $lang_a_order['customer_self'];
}else{
$query_data['operator'] = '';
}
}
if($query_data['paidnum'] > 0){
$query_data['paidnum'] = display_price($query_data['paidnum']);
}else{
$query_data['paidnum'] = '';
}
$orders_history_array[] = $query_data;
}
return $orders_history_array;
}
/*
$_array_ = array(
'insert_money' => '',
'payment_type' => '',
'get_paid' => '',
'get_total' => '',
'customer_id' => '',
);
*/
function insert_money($_array_s){
global $db, $table_orders_total, $table_orders_history, $table_orders, $table_customers;
global $timestamp, $settings;
if($_array_s['get_paid'] != '' && $_array_s['get_total'] != ''){
$this->get_paid = $_array_s['get_paid'];
$this->get_total = $_array_s['get_total'];
}elseif($this->get_paid != '' && $this->get_total != ''){
}else{
$this->order_total();
}
if($this->get_total > $this->get_paid){
$
sql_data_array = array(
'orders_id' => $this->orders_id,
'orders_status' => 'partpay',
'date_added' => $timestamp,
'paidnum' => $