$check = olc_db_fetch_array($check_query);
        if ($check['total'] < 1) {
            if (IS_AJAX_PROCESSING) {
                ajax_info(ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
            } else {
                $messageStack->add_session(MESSAGE_STACK_NAME, ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY, 'success');
                $action = EMPTY_STRING;
            }
            olc_redirect($address_book_link);
        }
    }
} elseif (!isset($edit)) {
    if (!isset($delete)) {
        if (olc_count_customer_address_book_entries() >= MAX_ADDRESS_BOOK_ENTRIES) {
            if (IS_AJAX_PROCESSING) {
                ajax_info(ERROR_ADDRESS_BOOK_FULL);
            } else {
                $messageStack->add_session(MESSAGE_STACK_NAME, ERROR_ADDRESS_BOOK_FULL, 'success');
                $action = EMPTY_STRING;
            }
            olc_redirect($address_book_link);
        }
    }
}
$IsAccount = true;
$redirect_link = FILENAME_ADDRESS_BOOK;
include FILENAME_CHECKOUT_ADDRESS;
if ($process) {
    $process = false;
    olc_redirect($address_book_link);
}
Exemplo n.º 2
0
        if (empty($value)) {
            ajax_info(-1);
        } else {
            $value = stripslashes($value);
            load_cache('catalogs,cotypes');
            foreach ($catalogs as $k => $v) {
                $v['dirname'] == $value && ajax_info(1);
            }
            foreach ($cotypes as $k => $v) {
                $arr = read_cache('coclasses', $k);
                foreach ($arr as $x => $y) {
                    $y['dirname'] == $value && ajax_info(1);
                }
            }
            unset($arr);
        }
        ajax_info(0);
        break;
    case 'floor':
        $v = explode(':', $querydata);
        preg_match('/^m?(?:comment|reply)s$/', $v[0]) && preg_match('/^\\w+(,\\w+)*$/', $v[1]) && preg_match('/^\\d+(,\\d+)*$/', $v[2]) || exit;
        preg_match('/\\bcid\\b/', $v[1]) || ($v[1] .= ',cid');
        $querydata = array($v[0] => array());
        $point =& $querydata[$v[0]];
        $query = $db->query("SELECT {$v['1']} FROM {$tblprefix}{$v['0']} WHERE cid IN ({$v['2']})");
        while ($row = $db->fetch_array($query)) {
            $point[$row['cid']] = $row;
            unset($point[$row['cid']]['cid']);
        }
        echo empty($callback) ? jsonEncode($querydata, 1) : $callback . '(' . jsonEncode($querydata, 1) . ')';
}
Exemplo n.º 3
0
<?php

include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
$datastr = 'failed';
$itemstr = '';
$aid = empty($aid) ? 0 : max(0, intval($aid));
empty($aid) && ajax_info($datastr);
foreach (array('clicks', 'comments', 'scores', 'orders', 'favorites', 'praises', 'debases', 'answers', 'adopts', 'price', 'crid', 'currency', 'closed', 'downs', 'plays') as $k) {
    $itemstr .= (!$itemstr ? '' : ',') . 'a.' . $k;
}
foreach (array('storage', 'spare', 'reports') as $k) {
    $itemstr .= ',s.' . $k;
}
if ($arr = $db->fetch_one("SELECT {$itemstr} FROM {$tblprefix}archives a LEFT JOIN {$tblprefix}archives_sub s ON s.aid=a.aid WHERE a.aid=" . $aid)) {
    $datastr = '';
    foreach ($arr as $k => $v) {
        $datastr .= ($datastr ? '-' : '') . $k . '#' . $v;
    }
}
ajax_info($datastr);
Exemplo n.º 4
0
function cumessage($msg = '', $forward = '')
{
    //修改为这样
    global $inajax, $cmsgs, $callback;
    if (!$callback && empty($inajax)) {
        message($msg, !$forward ? M_REFERER : $forward);
    } else {
        $str = @$cmsgs[$msg] && $msg != 'succeed' ? $cmsgs[$msg] : $msg;
        if (($num = func_num_args()) > 2) {
            $ars = func_get_args();
            array_splice($ars, 1, 1);
            $ars[0] =& $str;
            $str = call_user_func_array('sprintf', $ars);
        }
        ajax_info($str);
    }
}
Exemplo n.º 5
0
             $_SESSION['customer_first_name'] = $customers_firstname;
             $_SESSION['customer_last_name'] = $customers_lastname;
             $_SESSION['customer_country_id'] = $entry_country_id;
             $_SESSION['customer_zone_id'] = $entry_zone_id;
             $_SESSION['customer_default_address_id'] = $new_address_book_id;
             $sql_data_array = array('customers_firstname' => $customers_firstname, 'customers_lastname' => $customers_lastname, 'customers_gender' => $customers_gender, 'customers_default_address_id' => $new_address_book_id);
             olc_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id='" . CUSTOMER_ID . APOS);
         }
         if ($is_update) {
             $message = SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED;
         } else {
             $message = SUCCESS_ADDRESS_BOOK_ENTRY_INSERTED;
         }
         if (IS_AJAX_PROCESSING) {
             include_once DIR_FS_INC . 'ajax_info.inc.php';
             ajax_info($message);
         } else {
             $messageStack->add_session(MESSAGE_STACK_NAME, $message, 'success');
         }
     }
     $action = EMPTY_STRING;
 } else {
     if ($EditPersonalData) {
         $sql_data_array = array('customers_firstname' => $customers_firstname, 'customers_lastname' => $customers_lastname, 'customers_email_address' => $customers_email_address, 'customers_email_type' => $customers_email_type, 'customers_telephone' => $customers_telephone, 'customers_fax' => $customers_fax, 'customers_gender' => $customers_gender, 'customers_dob' => olc_date_raw($customers_dob));
         if ($IsCreateAccount) {
             $_SESSION['account_type'] = $customers_status_c;
             $sql_data_array['account_type'] = $customers_status_c;
             if ($IsUserMode) {
                 $sql_data_array['customers_newsletter'] = $customers_newsletter;
             }
             $sql_data_array['customers_password'] = olc_encrypt_password($customers_password);