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


PHP smn_db_insert_id函数代码示例

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


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

示例1: affiliate_insert

function affiliate_insert($sql_data_array, $affiliate_parent = 0)
{
    // LOCK TABLES
    smn_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
    if ($affiliate_parent > 0) {
        $affiliate_root_query = smn_db_query("select affiliate_root, affiliate_rgt, affiliate_lft�from  " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_parent . "' ");
        // Check if we have a parent affiliate
        if ($affiliate_root_array = smn_db_fetch_array($affiliate_root_query)) {
            smn_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root  =  '" . $affiliate_root_array['affiliate_root'] . "' and  affiliate_lft > " . $affiliate_root_array['affiliate_rgt'] . "  AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
            smn_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root  =  '" . $affiliate_root_array['affiliate_root'] . "' and  affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . "  ");
            $sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root'];
            $sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt'];
            $sql_data_array['affiliate_rgt'] = $affiliate_root_array['affiliate_rgt'] + 1;
            smn_db_perform(TABLE_AFFILIATE, $sql_data_array);
            $affiliate_id = smn_db_insert_id();
        }
        // no parent -> new root
    } else {
        $sql_data_array['affiliate_lft'] = '1';
        $sql_data_array['affiliate_rgt'] = '2';
        smn_db_perform(TABLE_AFFILIATE, $sql_data_array);
        $affiliate_id = smn_db_insert_id();
        smn_db_query("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
    }
    // UNLOCK TABLES
    smn_db_query("UNLOCK TABLES");
    return $affiliate_id;
}
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:28,代码来源:affiliate_functions.php

示例2: create

 function create($customers_id = 0)
 {
     //if customer is 0, then is a new account...(needs to be added in for editing)
     //add data for table customers which hold most of the primary customers info
     $sql_data_array = array('customers_firstname' => $this->firstname, 'customers_lastname' => $this->lastname, 'customers_email_address' => $this->email_address, 'customers_telephone' => $this->telephone, 'customers_fax' => $this->fax, 'customers_newsletter' => $this->newsletter, 'customers_gender' => $this->gender, 'customers_dob' => $this->dob);
     if ($customers_id == 0) {
         $sql_data_array['customers_password'] = $this->password;
         smn_db_perform(TABLE_CUSTOMERS, $sql_data_array);
         $this->customer_id = smn_db_insert_id();
         //primary KEY for customer
     } else {
         smn_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', 'customers_id=' . (int) $customers_id);
         $this->customer_id = (int) $customers_id;
     }
     //start building array for adress book entries using the default address given on sign up
     $sql_data_array = array('customers_id' => $this->customer_id, 'entry_firstname' => $this->firstname, 'entry_lastname' => $this->lastname, 'entry_company' => $this->company, 'entry_street_address' => $this->street_address, 'entry_postcode' => $this->postcode, 'entry_city' => $this->city, 'entry_country_id' => $this->country_id, 'entry_gender' => $this->gender, 'entry_zone_id' => $this->zone_id, 'entry_state' => $this->state);
     if ($customers_id == 0) {
         smn_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
         $this->address_id = smn_db_insert_id();
         smn_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int) $this->address_id . "' where customers_id = '" . (int) $this->customer_id . "'");
         smn_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $this->customer_id . "', '0', now())");
     } else {
         smn_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', 'customers_id=' . (int) $customers_id);
         smn_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int) $customer_id . "'");
     }
     if (SESSION_RECREATE == 'True') {
         smn_session_recreate();
     }
     return $this->customer_id;
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:30,代码来源:customer.php

示例3: create_store

 function create_store($use_store_id = 0)
 {
     $this->store_id = $use_store_id;
     $sql_store_array = array('customer_id' => $this->get_customers_id(), 'store_status' => DISPLAY_STORE_IMMEDIATELY == 'true' ? 1 : 0, 'date_added' => date('Ymd'), 'store_type' => $this->store_type);
     if ($this->store_id == 0) {
         smn_db_perform(TABLE_STORE_MAIN, $sql_store_array);
         $this->store_id = smn_db_insert_id();
         return $this->store_id;
     } else {
         smn_db_perform(TABLE_STORE_MAIN, $sql_store_array, 'update', 'store_id=' . $this->store_id);
         return $this->store_id;
     }
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:13,代码来源:store.php

示例4: smn_db_prepare_input

         $value_name = smn_db_prepare_input($value_name_array[$languages[$i]['id']]);
         smn_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (store_id, products_options_values_id, language_id, products_options_values_name) values ('" . (int) $store_id . "', '" . (int) $value_id . "', '" . (int) $languages[$i]['id'] . "', '" . smn_db_input($value_name) . "')");
     }
     smn_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (store_id, products_options_id, products_options_values_id) values ('" . (int) $store_id . "', '" . (int) $option_id . "', '" . (int) $value_id . "')");
     smn_redirect(smn_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
     break;
 case 'add_product_attributes':
     $products_id = smn_db_prepare_input($_POST['products_id']);
     $options_id = smn_db_prepare_input($_POST['options_id']);
     $values_id = smn_db_prepare_input($_POST['values_id']);
     $value_price = smn_db_prepare_input($_POST['value_price']);
     $price_prefix = smn_db_prepare_input($_POST['price_prefix']);
     $sort_order = smn_db_prepare_input($_POST['sort_order']);
     smn_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('" . (int) $store_id . "', null, '" . (int) $products_id . "', '" . (int) $options_id . "', '" . (int) $values_id . "', '" . (double) smn_db_input($value_price) . "', '" . smn_db_input($price_prefix) . "', '" . (int) $sort_order . "')");
     if (DOWNLOAD_ENABLED == 'true') {
         $products_attributes_id = smn_db_insert_id();
         $products_attributes_filename = smn_db_prepare_input($_POST['products_attributes_filename']);
         $products_attributes_maxdays = smn_db_prepare_input($_POST['products_attributes_maxdays']);
         $products_attributes_maxcount = smn_db_prepare_input($_POST['products_attributes_maxcount']);
         if (smn_not_null($products_attributes_filename)) {
             smn_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values ('" . (int) $store_id . "', " . (int) $products_attributes_id . ", '" . smn_db_input($products_attributes_filename) . "', '" . smn_db_input($products_attributes_maxdays) . "', '" . smn_db_input($products_attributes_maxcount) . "')");
         }
     }
     smn_redirect(smn_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
     break;
 case 'update_option_name':
     $option_name_array = $_POST['option_name'];
     $option_id = smn_db_prepare_input($_POST['option_id']);
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $option_name = smn_db_prepare_input($option_name_array[$languages[$i]['id']]);
         smn_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . smn_db_input($option_name) . "' where products_options_id = '" . (int) $option_id . "' and language_id = '" . (int) $languages[$i]['id'] . "' and store_id = '" . $store_id . "'");
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:products_attributes.php

示例5: smn_db_prepare_input

     $categories_id = smn_db_prepare_input($_POST['categories_id']);
     if ($_POST['copy_as'] == 'link') {
       if ($categories_id != $current_category_id) {
         $check_query = smn_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "' and store_id = '" . $store_id . "'");
         $check = smn_db_fetch_array($check_query);
         if ($check['total'] < '1') {
           smn_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (store_id, products_id, categories_id) values ('" . (int)$store_id . "', '" . (int)$products_id . "', '" . (int)$categories_id . "')");
         }
       } else {
         $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');
       }
     } elseif ($_POST['copy_as'] == 'duplicate') {
       $product_query = smn_db_query("select store_id, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
       $product = smn_db_fetch_array($product_query);
       smn_db_query("insert into " . TABLE_PRODUCTS . " (store_id, products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . (int)$store_id . "', '" . smn_db_input($product['products_quantity']) . "', '" . smn_db_input($product['products_model']) . "', '" . smn_db_input($product['products_image']) . "', '" . smn_db_input($product['products_price']) . "',  now(), '" . smn_db_input($product['products_date_available']) . "', '" . smn_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
       $dup_products_id = smn_db_insert_id();
       $description_query = smn_db_query("select language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
       while ($description = smn_db_fetch_array($description_query)) {
         smn_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . smn_db_input($description['products_name']) . "', '" . smn_db_input($description['products_description']) . "', '" . smn_db_input($description['products_head_title_tag']) . "', '" . smn_db_input($description['products_head_desc_tag']) . "', '" . smn_db_input($description['products_head_keywords_tag']) . "', '" . smn_db_input($description['products_url']) . "', '0')");
       }    
       smn_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (store_id, products_id, categories_id) values ('" . (int)$store_id . "', '" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
       $products_id = $dup_products_id;
     }
     if (USE_CACHE == 'true') {
       smn_reset_cache_block('categories');
       smn_reset_cache_block('also_purchased');
     }
   }
   smn_redirect(html_entity_decode(smn_href_link(FILENAME_STORE_PRODUCT_CATEGORIES, 'cPath=' . $categories_id . '&ID='.$store_id.'&pID=' . $products_id)));
   break;
 case 'new_product_preview':
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:store_product_categories.php

示例6: smn_db_query

         $affiliate_billing_query = smn_db_query($sql);
         $affiliate_billing = smn_db_fetch_array($affiliate_billing_query);
         // Get affiliate Informations
         $sql = "\n        SELECT a.*, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id \n          from " . TABLE_AFFILIATE . " a \n          left join " . TABLE_ZONES . " z on (a.affiliate_zone_id  = z.zone_id) \n          left join " . TABLE_COUNTRIES . " c on (a.affiliate_country_id = c.countries_id)\n          WHERE affiliate_id = '" . $affiliate_payment['affiliate_id'] . "' \n        ";
         $affiliate_query = smn_db_query($sql);
         $affiliate = smn_db_fetch_array($affiliate_query);
         // Get need tax informations for the affiliate
         $affiliate_tax_rate = smn_get_affiliate_tax_rate(AFFILIATE_TAX_ID, $affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id']);
         $affiliate_tax = smn_round($affiliate_billing['affiliate_payment'] * $affiliate_tax_rate / 100, 2);
         // Netto-Provision
         $affiliate_payment_total = $affiliate_billing['affiliate_payment'] + $affiliate_tax;
         // Bill the order
         $affiliate['affiliate_state'] = smn_get_zone_code($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state']);
         $sql_data_array = array('affiliate_id' => $affiliate_payment['affiliate_id'], 'affiliate_payment' => $affiliate_billing['affiliate_payment'], 'affiliate_payment_tax' => $affiliate_tax, 'affiliate_payment_total' => $affiliate_payment_total, 'affiliate_payment_date' => 'now()', 'affiliate_payment_status' => '0', 'affiliate_firstname' => $affiliate['affiliate_firstname'], 'affiliate_lastname' => $affiliate['affiliate_lastname'], 'affiliate_street_address' => $affiliate['affiliate_street_address'], 'affiliate_suburb' => $affiliate['affiliate_suburb'], 'affiliate_city' => $affiliate['affiliate_city'], 'affiliate_country' => $affiliate['countries_name'], 'affiliate_postcode' => $affiliate['affiliate_postcode'], 'affiliate_company' => $affiliate['affiliate_company'], 'affiliate_state' => $affiliate['affiliate_state'], 'affiliate_address_format_id' => $affiliate['address_format_id']);
         smn_db_perform(TABLE_AFFILIATE_PAYMENT, $sql_data_array);
         $insert_id = smn_db_insert_id();
         // Set the Sales to Final State
         smn_db_query("update " . TABLE_AFFILIATE_SALES . " set affiliate_payment_id = '" . $insert_id . "', affiliate_billing_status = 1, affiliate_payment_date = now() where affiliate_id = '" . $affiliate_payment['affiliate_id'] . "' and affiliate_billing_status = 99");
         // Notify Affiliate
         if (AFFILIATE_NOTIFY_AFTER_BILLING == 'true') {
             $check_status_query = smn_db_query("select af.affiliate_email_address, ap.affiliate_lastname, ap.affiliate_firstname, ap.affiliate_payment_status, ap.affiliate_payment_date, ap.affiliate_payment_date from " . TABLE_AFFILIATE_PAYMENT . " ap, " . TABLE_AFFILIATE . " af where affiliate_payment_id  = '" . $insert_id . "' and af.affiliate_id = ap.affiliate_id ");
             $check_status = smn_db_fetch_array($check_status_query);
             $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . smn_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $insert_id, 'NONSSL') . "\n" . EMAIL_TEXT_PAYMENT_BILLED . ' ' . smn_date_long($check_status['affiliate_payment_date']) . "\n\n" . EMAIL_TEXT_NEW_PAYMENT;
             smn_mail($check_status['affiliate_firstname'] . ' ' . $check_status['affiliate_lastname'], $check_status['affiliate_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, AFFILIATE_EMAIL_ADDRESS);
         }
     }
     $messageStack->add_session(SUCCESS_BILLING, 'success');
     smn_redirect(smn_href_link(FILENAME_AFFILIATE_PAYMENT, smn_get_all_get_params(array('action')) . 'action=edit'));
     break;
 case 'update_payment':
     $pID = smn_db_prepare_input($_GET['pID']);
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:affiliate_payment.php

示例7: define

 define('EMAIL_CONTACT', 'For help with any of our online services, please email the store-owner: ' . $store->get_store_owner_email_address() . '.' . "\n\n");
 define('EMAIL_WARNING', '<b>Note:</b> This email address was given to us by one of our customers. If you did not signup to be a member, please send a email to ' . $store->get_store_owner_email_address() . '.' . "\n");
 if (ACCOUNT_GENDER == 'true') {
     if ($gender == 'm') {
         $email_text = sprintf(EMAIL_GREET_MR, $lastname);
     } else {
         $email_text = sprintf(EMAIL_GREET_MS, $lastname);
     }
 } else {
     $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
 }
 $email_text .= EMAIL_WELCOME . EMAIL_CONTACT . EMAIL_WARNING;
 if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
     $coupon_code = create_coupon_code();
     $insert_query = smn_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
     $insert_id = smn_db_insert_id($insert_query);
     $insert_query = smn_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id . "', '0', 'Admin', '" . $email_address . "', now() )");
     $email_text .= sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) . "\n\n" . sprintf(EMAIL_GV_REDEEM, $coupon_code) . "\n\n" . EMAIL_GV_LINK . smn_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code, 'NONSSL', false) . "\n\n";
 }
 if (NEW_SIGNUP_DISCOUNT_COUPON != '') {
     $coupon_code = NEW_SIGNUP_DISCOUNT_COUPON;
     $coupon_query = smn_db_query("select * from " . TABLE_COUPONS . " where coupon_code = '" . $coupon_code . "'");
     $coupon = smn_db_fetch_array($coupon_query);
     $coupon_id = $coupon['coupon_id'];
     $coupon_desc_query = smn_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . (int) $languages_id . "'");
     $coupon_desc = smn_db_fetch_array($coupon_desc_query);
     $insert_query = smn_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id . "', '0', 'Admin', '" . $email_address . "', now() )");
     $email_text .= EMAIL_COUPON_INCENTIVE_HEADER . "\n" . sprintf("%s", $coupon_desc['coupon_description']) . "\n\n" . sprintf(EMAIL_COUPON_REDEEM, $coupon['coupon_code']) . "\n\n" . "\n\n";
 }
 smn_mail($name, $email_address, EMAIL_SUBJECT, $email_text, $store->get_store_owner(), $store->get_store_owner_email_address());
 smn_redirect(smn_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'NONSSL'));
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:create_account.php

示例8: smn_session_register

             $sql_data_array['entry_company'] = $company;
         }
         if (ACCOUNT_STATE == 'true') {
             if ($zone_id > 0) {
                 $sql_data_array['entry_zone_id'] = $zone_id;
                 $sql_data_array['entry_state'] = '';
             } else {
                 $sql_data_array['entry_zone_id'] = '0';
                 $sql_data_array['entry_state'] = $state;
             }
         }
         if (!smn_session_is_registered('sendto')) {
             smn_session_register('sendto');
         }
         smn_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
         $sendto = smn_db_insert_id();
         if (smn_session_is_registered('shipping')) {
             smn_session_unregister('shipping');
         }
         /*Unregister the session shipping_store,By Cimi*/
         if (smn_session_is_registered('shipping_store')) {
             smn_session_unregister('shipping_store');
         }
         smn_redirect(smn_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'NONSSL'));
     }
     // process the selected shipping destination
 } elseif (isset($_POST['address'])) {
     $reset_shipping = false;
     if (smn_session_is_registered('sendto')) {
         if ($sendto != $_POST['address']) {
             if (smn_session_is_registered('shipping')) {
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:checkout_shipping_address.php

示例9: smn_db_query

         } else {
             $stock_left = $stock_values['products_quantity'];
         }
         smn_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . smn_get_prid($order->products[$i]['id']) . "'");
         if ($stock_left < 1 && STOCK_ALLOW_CHECKOUT == 'false') {
             smn_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . smn_get_prid($order->products[$i]['id']) . "'");
         }
     }
 }
 // Update products_ordered (for bestsellers list)
 smn_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . smn_get_prid($order->products[$i]['id']) . "'");
 if ($order->products[$i]['products_store_id'] == $store_list[$k]) {
     $sql_data_array = array('orders_id' => $insert_id, 'products_id' => smn_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']);
     smn_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
 }
 $order_products_id = smn_db_insert_id();
 $order_total_modules->update_credit_account($i);
 $member_product = explode('_', $order->products[$i]['model']);
 if ($member_product[0] == 'mem' && $store_id == 1) {
     $start_day = getdate();
     $day = $start_day['mday'];
     $month = $start_day['mon'];
     $year = $start_day['year'];
     $product_end_date = strftime('%Y', mktime(0, 0, 0, $month + (int) $member_product[1], $day, $year)) . '-' . strftime('%m', mktime(0, 0, 0, $month + (int) $member_product[1], $day, $year)) . '-' . strftime('%d', mktime(0, 0, 0, $month + (int) $member_product[1], $day, $year));
     $sql_data_array = array('orders_id' => $insert_id, 'store_id' => $insert_id, 'products_id' => smn_get_prid($order->products[$i]['id']), 'customer_id' => $customer_id, 'products_end_date' => $product_end_date);
     $update_query = smn_db_query("select store_id from " . TABLE_MEMBER_ORDERS . " where customer_id = '" . (int) $customer_id . "'");
     if (smn_db_num_rows($update_query)) {
         smn_db_perform(TABLE_MEMBER_ORDERS, $sql_data_array, 'update', "customer_id = '" . (int) $customer_id . "'");
     } else {
         smn_db_perform(TABLE_MEMBER_ORDERS, $sql_data_array);
     }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:checkout_process.php

示例10: array

         $sql_data_array = array('admin_files_name' => smn_db_prepare_input($_GET['fileName']), 'admin_tabs_to_files' => smn_db_prepare_input($_GET['masterFileID']), 'admin_files_is_tab' => '1', 'admin_files_to_boxes' => smn_db_prepare_input($_GET['boxID']));
     } else {
         $sql_data_array = array('admin_files_name' => smn_db_prepare_input($_GET['fileName']), 'admin_files_to_boxes' => smn_db_prepare_input($_GET['boxID']));
     }
     smn_db_perform(TABLE_ADMIN_FILES, $sql_data_array);
     $masterFileID = smn_db_insert_id();
     $tabDir = str_replace('.php', '', $_GET['fileName']);
     $directory = DIR_FS_TEMPLATES . 'content/tabs/' . $tabDir . '/';
     $tabs = array();
     if (is_dir($directory)) {
         $dir = dir($directory);
         while (($file = $dir->read()) !== false) {
             if ($file != '.' && $file != '..' && is_file($directory . $file)) {
                 $sql_data_array = array('admin_files_name' => smn_db_prepare_input($file), 'admin_files_is_tab' => '1', 'admin_tabs_to_files' => $masterFileID, 'admin_files_to_boxes' => smn_db_prepare_input($_GET['boxID']));
                 smn_db_perform(TABLE_ADMIN_FILES, $sql_data_array);
                 $fileID = smn_db_insert_id();
                 $tabs[] = '["' . $fileID . '", "' . $file . '"]';
             }
         }
     }
     echo '{
           success: true,
           file_id: "' . $masterFileID . '",
           tabs: [' . implode(',', $tabs) . ']
       }';
 } else {
     $admin_files_name = smn_db_prepare_input($_GET['fileName']);
     $admin_boxes_id = smn_db_prepare_input($_GET['boxID']);
     $Qcheck = smn_db_query('select admin_files_id from ' . TABLE_ADMIN_FILES . ' where admin_files_is_boxes = "0" and admin_files_to_boxes = "' . $admin_boxes_id . '" and admin_files_name = "' . $admin_files_name . '"');
     if (smn_db_num_rows($Qcheck)) {
         $check = smn_db_fetch_array($Qcheck);
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:admin.php

示例11: smn_db_prepare_input

 case 'deleteRate':
     $tax_rates_id = smn_db_prepare_input($_GET['rate_id']);
     smn_db_query("delete from " . TABLE_TAX_RATES . " where tax_rates_id = '" . (int) $tax_rates_id . "' and store_id = '" . $store_id . "'");
     echo '{ success:true }';
     exit;
     break;
 case 'saveSubZone':
     $geo_zone_id = smn_db_prepare_input($_POST['geo_zone_id']);
     $zone_country_id = smn_db_prepare_input($_POST['zone_country_id']);
     $zone_id = smn_db_prepare_input($_POST['zone_id']);
     if ($_POST['hidden_action'] == 'edit' && $_POST['association_id'] > 0) {
         smn_db_query("update " . TABLE_ZONES_TO_GEO_ZONES . " set geo_zone_id = '" . (int) $geo_zone_id . "', zone_country_id = '" . (int) $zone_country_id . "', zone_id = " . (smn_not_null($zone_id) ? "'" . (int) $zone_id . "'" : 'null') . ", last_modified = now() where association_id = '" . (int) $_POST['association_id'] . "' and store_id = '" . $store_id . "'");
         $association_id = $_POST['association_id'];
     } else {
         smn_db_query("insert into " . TABLE_ZONES_TO_GEO_ZONES . " (store_id, zone_country_id, zone_id, geo_zone_id, date_added) values ('" . (int) $store_id . "', '" . (int) $zone_country_id . "', '" . (int) $zone_id . "', '" . (int) $geo_zone_id . "', now())");
         $association_id = smn_db_insert_id();
     }
     $Qzone = smn_db_query('select * from ' . TABLE_ZONES_TO_GEO_ZONES . ' where association_id = "' . $association_id . '"');
     $zone = smn_db_fetch_array($Qzone);
     echo '{
          success: true,
          db: {
            association_id  : "' . $zone['association_id'] . '",
            zone_country_id  : "' . $zone['zone_country_id'] . '",
            zone_id  : "' . $zone['zone_id'] . '",
            geo_zone_id  : "' . $zone['geo_zone_id'] . '",
            last_modified  : "' . $zone['last_modified'] . '",
            date_added  : "' . $zone['date_added'] . '"
          }
      }';
     exit;
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:store_taxes.php

示例12: saveHelpPage

 function saveHelpPage()
 {
     if (isset($_POST['customHelp'])) {
         $helpContent = $_POST['customHelpContent']['catalog'];
         $customString = smn_db_prepare_input($_POST['customHelp']);
         $Qcheck = smn_db_query('select help_id from ' . TABLE_HELP . ' where help_custom = "' . $customString . '"');
         if (smn_db_num_rows($Qcheck)) {
             $check = smn_db_fetch_array($Qcheck);
             smn_db_query('update ' . TABLE_HELP_CONTENT . ' set help_content = "' . $fullPageHelp . '" where help_id = "' . $check['help_id'] . '"');
         } else {
             smn_db_query('insert into ' . TABLE_HELP . ' (help_file, help_file_tab, help_custom) values ("false", "false", "' . $customString . '")');
             $helpID = smn_db_insert_id();
             smn_db_query('insert into ' . TABLE_HELP_CONTENT . ' (help_id, help_content, language_id) values ("' . $helpID . '", "' . $helpContent . '", "1")');
         }
     } else {
         $pageName = $_POST['helpFile'];
         $fullPageHelp = smn_db_prepare_input($_POST['fullPageHelp']['catalog']);
         $tabs = $_POST['tab'];
         $Qcheck = smn_db_query('select * from ' . TABLE_HELP . ' where help_file = "' . $pageName . '"');
         if (smn_db_num_rows($Qcheck)) {
             $check = smn_db_fetch_array($Qcheck);
             smn_db_query('update ' . TABLE_HELP_CONTENT . ' set help_content = "' . $fullPageHelp . '" where help_id = "' . $check['help_id'] . '"');
         } else {
             smn_db_query('insert into ' . TABLE_HELP . ' (help_file, help_file_tab, help_custom) values ("' . $pageName . '", "false", "false")');
             $fullHelpID = smn_db_insert_id();
             smn_db_query('insert into ' . TABLE_HELP_CONTENT . ' (help_id, help_content, language_id) values ("' . $fullHelpID . '", "' . $fullPageHelp . '", "1")');
         }
         if (!empty($tabs)) {
             foreach ($tabs as $tabFile => $helpContent) {
                 $Qcheck = smn_db_query('select * from ' . TABLE_HELP . ' where help_file = "' . $pageName . '" and help_file_tab = "' . $tabFile . '"');
                 if (smn_db_num_rows($Qcheck)) {
                     $check = smn_db_fetch_array($Qcheck);
                     smn_db_query('update ' . TABLE_HELP_CONTENT . ' set help_content = "' . $helpContent . '" where help_id = "' . $check['help_id'] . '"');
                 } else {
                     smn_db_query('insert into ' . TABLE_HELP . ' (help_file, help_file_tab, help_custom) values ("' . $pageName . '", "' . $tabFile . '", "false")');
                     $tabHelpID = smn_db_insert_id();
                     smn_db_query('insert into ' . TABLE_HELP_CONTENT . ' (help_id, help_content, language_id) values ("' . $tabHelpID . '", "' . $helpContent . '", "1")');
                 }
             }
         }
     }
     $this->setJsonResponse('{
           success: true
       }');
 }
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:45,代码来源:site_text.php

示例13: upload

     if (empty($banners_image_local) || $_POST['delete_current_image'] == '1') {
         $banners_image = new upload('banners_image');
         $banners_image->set_destination(DIR_FS_CATALOG . 'images/' . $banners_image_target);
         if ($banners_image->parse() == false || $banners_image->save() == false) {
             $banner_error = true;
         }
     }
 }
 if ($banner_error == false) {
     $db_image_location = smn_not_null($banners_image_local) && $_POST['delete_current_image'] != 1 ? $banners_image_local : $banners_image_target . $banners_image->filename;
     $sql_data_array = array('banners_title' => $banners_title, 'banners_url' => $banners_url, 'banners_image' => $db_image_location, 'banners_group' => $banners_group, 'categories_id' => $categories_id, 'banners_html_text' => $banners_html_text);
     if ($action == 'insert') {
         $insert_sql_data = array('date_added' => 'now()', 'status' => '1');
         $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
         smn_db_perform(TABLE_BANNERS, $sql_data_array);
         $banners_id = smn_db_insert_id();
         $messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success');
     } elseif ($action == 'update') {
         smn_db_perform(TABLE_BANNERS, $sql_data_array, 'update', "banners_id = '" . (int) $banners_id . "'");
         $messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success');
     }
     if (smn_not_null($expires_date)) {
         list($day, $month, $year) = explode('/', $expires_date);
         $expires_date = $year . (strlen($month) == 1 ? '0' . $month : $month) . (strlen($day) == 1 ? '0' . $day : $day);
         smn_db_query("update " . TABLE_BANNERS . " set expires_date = '" . smn_db_input($expires_date) . "', expires_impressions = null where banners_id = '" . (int) $banners_id . "'");
     } elseif (smn_not_null($expires_impressions)) {
         smn_db_query("update " . TABLE_BANNERS . " set expires_impressions = '" . smn_db_input($expires_impressions) . "', expires_date = null where banners_id = '" . (int) $banners_id . "'");
     }
     if (smn_not_null($date_scheduled)) {
         list($day, $month, $year) = explode('/', $date_scheduled);
         $date_scheduled = $year . (strlen($month) == 1 ? '0' . $month : $month) . (strlen($day) == 1 ? '0' . $day : $day);
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:banner_manager.php

示例14: array

     if (empty($title)) {
         $messageStack->add(ERROR_NEWSLETTER_TITLE, 'error');
         $affiliate_newsletter_error = true;
     }
     if (empty($module)) {
         $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
         $affiliate_newsletter_error = true;
     }
     if ($affiliate_newsletter_error == false) {
         $sql_data_array = array('title' => $title, 'content' => $content, 'module' => $affiliate_newsletter_module);
         if ($action == 'insert') {
             $sql_data_array['date_added'] = 'now()';
             $sql_data_array['status'] = '0';
             $sql_data_array['locked'] = '0';
             smn_db_perform(TABLE_AFFILIATE_NEWSLETTERS, $sql_data_array);
             $affiliate_newsletter_id = smn_db_insert_id();
         } elseif ($action == 'update') {
             smn_db_perform(TABLE_AFFILIATE_NEWSLETTERS, $sql_data_array, 'update', "affiliate_newsletters_id = '" . (int) $affiliate_newsletter_id . "'");
         }
         smn_redirect(smn_href_link(FILENAME_AFFILIATE_NEWSLETTERS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'nID=' . $affiliate_newsletter_id));
     } else {
         $action = 'new';
     }
     break;
 case 'deleteconfirm':
     $affiliate_newsletter_id = smn_db_prepare_input($_GET['nID']);
     smn_db_query("delete from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int) $affiliate_newsletter_id . "'");
     smn_redirect(smn_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $_GET['page']));
     break;
 case 'delete':
 case 'new':
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:31,代码来源:affiliate_newsletters.php

示例15: before_process

 function before_process()
 {
     global $_POST, $language;
     require DIR_WS_LANGUAGES . $language . "/modules/payment/surepay.php";
     require DIR_WS_CLASSES . "sausurepay.php";
     #  Creditcard test AUTH:
     #     cc number: 4012000033330026   any future exp date
     #     $11 = AUTH     $21 = "REF"   $31 = "DCL"   any other may give "ERR"
     #     This test request uses total $1 shipping, and 1x$5 + 1x$5 goods,
     #     total $11. Just change the item quantities to try the other status.
     #  I have also found some bugs and weakneses in Surepays processing, here is a
     #  couple of them:
     #
     #   - Do not add % as character data, best off staying away from it totally.
     #     This can cause surepays servlets to crash and gives a 500 server error.
     #
     #   - Do not convert < > & ' " to the correct XML entities, surepays parser or
     #     data collector rejects any characterdata like &lt; and so on.
     #
     #   - Phone numbers in address are limited length (stay 11 digits or less), they
     #     claim to be "US domestic oriented" (?)
     #
     #   - What is the correct way to handle ref? Should the script handle and check
     #     avs and cvv2status responses to something automatically? If someone has
     #     a guideline to this would be appreciated.. (sausurepay@sauen.com)
     ## Syntax:
     ##  vobject_identifier: sausp (
     ##     boolean: live?
     ##    ,string: merchant id
     ##    ,string: password
     ##   [,array: extra pp.request parameters ]
     ##  )
     // --- Create the SurePay request object. ---
     // --- This is where you can change some of the settings. ---
     $amount = $_POST['surepay_total'];
     $shipping_cost = $_POST['surepay_shipping_cost'];
     if ($this->test_mode == true) {
         // --- Fill in the info for the fake auth requests. ---
         $shipping_cost = '0.00USD';
         $amount = '11.00USD';
         // Use this amount if you want to test: card okay.
         $amount = '31.00USD';
         // Use this amount if you want to test: card referred to voice center.
         $amount = '44.00USD';
         // Use this amount if you want to test: card declined.
         // -- Random valid generator.
         if (rand() % 2 == 1) {
             $amount = '11.00USD';
         }
     }
     // -- Figure out whether to use xml.test.surepay.com (test) or xml.surepay.com (live).
     $live = !$this->test_mode;
     $ssp = new sausp($live, $this->login, $this->password);
     if ($ssp->err) {
         die($ssp->err);
     }
     // --- Generate SurePay order id. ---
     // --   Note that this is not the same as the order_id in OS Commerce, which does
     // --   not exist until after a payment is approved.
     smn_db_perform(TABLE_SUREPAY_TRANSACTIONS, array(message => ''));
     $order_number = smn_db_insert_id();
     // --- Add miscellanous auth request info. ---
     // --   ecommercecode specifies the level of encryption( default is 07 - NONSSL, )
     // --   05 - secure w/ cardholder & merchant cert,
     // --   06 - secure w/ merchant cert
     // --   07 - NONSSL
     // --   08 - no security
     $auth = $ssp->add_auth(array('ordernumber' => $order_number, 'ecommerce' => 'true', 'ecommercecode' => '07', 'ipaddress' => $REMOTE_ADDR, 'shippingcost' => $shipping_cost, 'shippingcost2' => "0.00USD", 'taxamount' => $_POST['surepay_tax'], 'referringurl' => $HTTP_REFERER, 'browsertype' => $HTTP_USER_AGENT));
     if ($ssp->err) {
         die($ssp->err);
     }
     // --- Add the shipping address using the order info. ---
     $ssp->add_shipping_address($auth, array('fullname' => $_POST['surepay_delivery_fullname'], 'address1' => $_POST['surepay_delivery_address'], 'address2' => '', 'city' => $_POST['surepay_delivery_city'], 'state' => $_POST['surepay_delivery_state'], 'zip' => $_POST['surepay_delivery_postcode'], 'country' => $_POST['surepay_delivery_country'], 'phone' => $_POST['surepay_phone'], 'email' => $_POST['surepay_email']));
     if ($ssp->err) {
         die($ssp->err);
     }
     // --- Add the credit card info. ---
     ## Syntax:
     ##  object_identifier: add_creditcard (
     ##      object_identifier: parent object
     ##     ,string: card number
     ##     ,string: expiration (mm/yy)
     ##     ,int: cvv2 code from card
     ##    [,int: cvv2status (security mode) (0|1|9) default is 1 (In Use), 0 = off, 9 = no code available ]
     ##    [,array: billing address]
     ##  )
     $creditcard = $ssp->add_creditcard($auth, $this->cc_number, $this->cc_expires_month . "/" . $this->cc_expires_year, $this->cc_cvv2);
     // --- Add the billing address for the order. ---
     $ssp->add_billing_address($creditcard, array('fullname' => $_POST['surepay_fullname'], 'address1' => $_POST['surepay_address'], 'address2' => '', 'city' => $_POST['surepay_city'], 'state' => $_POST['surepay_state'], 'zip' => $_POST['surepay_postcode'], 'country' => $_POST['surepay_country'], 'phone' => $_POST['surepay_phone'], 'email' => $_POST['surepay_email']));
     if ($ssp->err) {
         die($ssp->err);
     }
     // --- Add total as lineitem ---
     // -- We only add one lineitem with the total right now.  If you wanted to, you could
     // --  rewrite this to use multiple lineitems to more accurately reflect the items
     // --  in the current order.
     ## Syntax:
     ##  object_identifier: add_lineitem (
     ##      object_identifier: parent object (The AUTH object)
     ##     ,int: quantity,
//.........这里部分代码省略.........
开发者ID:stanislauslive,项目名称:StanMarket,代码行数:101,代码来源:surepay.php


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