function objectInfo($object_array)
 {
     reset($object_array);
     while (list($key, $value) = each($object_array)) {
         $this->{$key} = smn_db_prepare_input($value);
     }
 }
Example #2
0
 function send($newsletter_id)
 {
     $mail_query = smn_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
     $mimemessage = new email(array('X-Mailer: oscMall bulk mailer'));
     $mimemessage->add_html($this->content);
     $mimemessage->build_message();
     while ($mail = smn_db_fetch_array($mail_query)) {
         $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
     }
     $newsletter_id = smn_db_prepare_input($newsletter_id);
     smn_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . smn_db_input($newsletter_id) . "'");
 }
Example #3
0
 function surepay()
 {
     global $_POST;
     $this->code = 'surepay';
     $this->title = MODULE_PAYMENT_SUREPAY_TEXT_TITLE;
     $this->description = MODULE_PAYMENT_SUREPAY_TEXT_DESCRIPTION;
     $this->enabled = MODULE_PAYMENT_SUREPAY_STATUS;
     $this->test_mode = MODULE_PAYMENT_SUREPAY_TESTMODE;
     $this->login = MODULE_PAYMENT_SUREPAY_LOGIN;
     $this->password = MODULE_PAYMENT_SUREPAY_PASSWORD;
     $this->cc_number = smn_db_prepare_input($_POST['surepay_cc_number']);
     $this->cc_cvv2 = smn_db_prepare_input($_POST['surepay_cc_cvv2']);
     $this->cc_expires_month = smn_db_prepare_input($_POST['surepay_cc_expires_month']);
     $this->cc_expires_year = smn_db_prepare_input($_POST['surepay_cc_expires_year']);
     $this->single = MODULE_PAYMENT_SUREPAY_SINGLE_CHECKOUT == 'True' ? true : false;
 }
Example #4
0
 function query($order_id)
 {
     global $languages_id, $shipping_store;
     $order_id = smn_db_prepare_input($order_id);
     $order_query = smn_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
     $order = smn_db_fetch_array($order_query);
     $totals_query = smn_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' order by sort_order");
     while ($totals = smn_db_fetch_array($totals_query)) {
         $this->totals[] = array('title' => $totals['title'], 'text' => $totals['text']);
     }
     $order_total_query = smn_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' and class = 'ot_total'");
     $order_total = smn_db_fetch_array($order_total_query);
     $shipping_method_query = smn_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' and class = 'ot_shipping'");
     $shipping_method = smn_db_fetch_array($shipping_method_query);
     $order_status_query = smn_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int) $languages_id . "'");
     $order_status = smn_db_fetch_array($order_status_query);
     $order_store_query = smn_db_query("select store_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
     $order_store = smn_db_fetch_array($order_store_query);
     $this->info = array('currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order_status['orders_status_name'], 'last_modified' => $order['last_modified'], 'total' => strip_tags($order_total['text']), 'shipping_method' => substr($shipping_method['title'], -1) == ':' ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']));
     $this->info_store[$order_store[store_id]] = array('shipping_cost' => $shipping_store[$order_store[store_id]]['cost'], 'shipping_method' => $shipping_store[$order_store[store_id]]['title']);
     $this->customer = array('id' => $order['customers_id'], 'name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => array('title' => $order['customers_country']), 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']);
     $this->delivery = array('name' => trim($order['delivery_name']), 'company' => $order['delivery_company'], 'street_address' => $order['delivery_street_address'], 'city' => $order['delivery_city'], 'postcode' => $order['delivery_postcode'], 'state' => $order['delivery_state'], 'country' => array('title' => $order['delivery_country']), 'format_id' => $order['delivery_address_format_id']);
     if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) {
         $this->delivery = false;
     }
     $this->billing = array('name' => $order['billing_name'], 'company' => $order['billing_company'], 'street_address' => $order['billing_street_address'], 'city' => $order['billing_city'], 'postcode' => $order['billing_postcode'], 'state' => $order['billing_state'], 'country' => array('title' => $order['billing_country']), 'format_id' => $order['billing_address_format_id']);
     $index = 0;
     $orders_products_query = smn_db_query("select op.orders_products_id, op.products_id,o.store_id, op.products_name, op.products_model, op.products_price, op.products_tax, op.products_quantity, op.final_price from " . TABLE_ORDERS_PRODUCTS . " op," . TABLE_ORDERS . " o where op.orders_id = '" . (int) $order_id . "' and op.orders_id=o.orders_id");
     while ($orders_products = smn_db_fetch_array($orders_products_query)) {
         $this->products[$index] = array('qty' => $orders_products['products_quantity'], 'id' => $orders_products['products_id'], 'products_store_id' => $orders_products['store_id'], 'name' => $orders_products['products_name'], 'model' => $orders_products['products_model'], 'tax' => $orders_products['products_tax'], 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price']);
         $subindex = 0;
         $attributes_query = smn_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $order_id . "' and orders_products_id = '" . (int) $orders_products['orders_products_id'] . "'");
         if (smn_db_num_rows($attributes_query)) {
             while ($attributes = smn_db_fetch_array($attributes_query)) {
                 $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price']);
                 $subindex++;
             }
         }
         $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1';
         $index++;
     }
 }
            
                    if (ACCOUNT_DOB == 'true') $sql_data_array['affiliate_dob'] = smn_date_raw($affiliate_dob);
                    if (ACCOUNT_GENDER == 'true') $sql_data_array['affiliate_gender'] = $affiliate_gender;
                    if (ACCOUNT_COMPANY == 'true') {
                      $sql_data_array['affiliate_company'] = $affiliate_company;
                      $sql_data_array['affiliate_company_taxid'] =  $affiliate_company_taxid;
                    }
                    if (ACCOUNT_SUBURB == 'true') $sql_data_array['affiliate_suburb'] = $affiliate_suburb;
                    if (ACCOUNT_STATE == 'true') {
                      $sql_data_array['affiliate_state'] = $affiliate_state;
                      $sql_data_array['affiliate_zone_id'] = $affiliate_zone_id;
                    }
            
                    $sql_data_array['affiliate_date_account_last_modified'] = 'now()';*/
            $sql_data_array = array('affiliate_payment_check' => $affiliate_payment_check, 'affiliate_payment_paypal' => $affiliate_payment_paypal, 'affiliate_payment_bank_name' => $affiliate_payment_bank_name, 'affiliate_payment_bank_branch_number' => $affiliate_payment_bank_branch_number, 'affiliate_payment_bank_swift_code' => $affiliate_payment_bank_swift_code, 'affiliate_payment_bank_account_name' => $affiliate_payment_bank_account_name, 'affiliate_payment_bank_account_number' => $affiliate_payment_bank_account_number, 'affiliate_homepage' => $affiliate_homepage, 'affiliate_commission_percent' => $affiliate_commission_percent, 'affiliate_agb' => '1');
            if (ACCOUNT_COMPANY == 'true') {
                $sql_data_array['affiliate_company_taxid'] = $affiliate_company_taxid;
            }
            smn_db_perform(TABLE_AFFILIATE, $sql_data_array, 'update', "affiliate_id = '" . smn_db_input($affiliate_id) . "'");
            smn_redirect(smn_href_link(FILENAME_AFFILIATE, smn_get_all_get_params(array('acID', 'action')) . 'acID=' . $affiliate_id));
            break;
        case 'deleteconfirm':
            $affiliate_id = smn_db_prepare_input($_GET['acID']);
            affiliate_delete(smn_db_input($affiliate_id));
            smn_redirect(smn_href_link(FILENAME_AFFILIATE, smn_get_all_get_params(array('acID', 'action'))));
            break;
    }
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
            }';
            exit;
        }
        smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
    }
}
define('AFFILIATE_NOTIFY_AFTER_BILLING', 'true');
// Nofify affiliate if he got a new invoice
define('AFFILIATE_DELETE_ORDERS', 'false');
// Delete affiliate_sales if an order is deleted (Warning: Only not yet billed sales are deleted)
define('AFFILIATE_TAX_ID', '1');
// Tax Rates used for billing the affiliates
// you get this from the URl (tID) when you select you Tax Rate at the admin: tax_rates.php?tID=1
// If set, the following actions take place each time you call the admin/affiliate_summary
define('AFFILIATE_DELETE_CLICKTHROUGHS', 'false');
// (days / false) To keep the clickthrough report small you can set the days after which they are deleted (when calling affiliate_summary in the admin)
define('AFFILIATE_DELETE_AFFILIATE_BANNER_HISTORY', 'false');
// (days / false) To keep thethe table AFFILIATE_BANNER_HISTORY small you can set the days after which they are deleted (when calling affiliate_summary in the admin)
// If an order is deleted delete the sale too (optional)
if ($_GET['action'] == 'deleteconfirm' && basename($HTTP_SERVER_VARS['SCRIPT_FILENAME']) == FILENAME_ORDERS && AFFILIATE_DELETE_ORDERS == 'true') {
    $affiliate_oID = smn_db_prepare_input($_GET['oID']);
    smn_db_query("delete from " . TABLE_AFFILIATE_SALES . " where affiliate_orders_id = '" . smn_db_input($affiliate_oID) . "' and affiliate_billing_status != 1");
}
define('SECURITY_CODE_LENGTH', '6');
require '../includes/classes/jQuery.php';
$jQuery = new jQuery();
$jQuery->loadAllExtensions();
$jQuery->loadAllPlugins();
//
//   This define('JQUERY_MENU', 'jd_menu'); ( which will be moved into the database ) has 2 values currently: jd_menu or ??//    accordion
define('JQUERY_MENU', 'jd_menu');
    $newsletter = smn_db_fetch_array($newsletter_query);
    $nInfo = new objectInfo($newsletter);
    include DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.'));
    include DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.'));
    $module_name = $nInfo->module;
    $module = new $module_name($nInfo->title, $nInfo->content);
    ?>
      <tr>
        <td><?php 
    echo $module->confirm();
    ?>
</td>
      </tr>
<?php 
} elseif ($action == 'confirm_send') {
    $nID = smn_db_prepare_input($HTTP_GET_VARS['nID']);
    $newsletter_query = smn_db_query("select newsletters_id, title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int) $nID . "'");
    $newsletter = smn_db_fetch_array($newsletter_query);
    $nInfo = new objectInfo($newsletter);
    include DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.'));
    include DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.'));
    $module_name = $nInfo->module;
    $module = new $module_name($nInfo->title, $nInfo->content);
    ?>
      <tr>
        <td><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main" valign="middle"><?php 
    echo smn_image(DIR_WS_IMAGES . 'ani_send_email.gif', IMAGE_ANI_SEND_EMAIL);
    ?>
</td>
    $navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
}
include 'editor.php';
require DIR_WS_CLASSES . 'customer.php';
$profile_edit = new customer($store_id);
if ($store->is_store_owner($customer_id)) {
    require DIR_WS_CLASSES . 'store.php';
    $store_edit = new store($store_id);
}
if (isset($_POST['action']) && $_POST['action'] == 'process') {
    $error = false;
    // include validation functions (right now only email address)
    require DIR_WS_FUNCTIONS . 'validations.php';
    if (isset($_POST['state'])) {
        $zone_id = smn_db_prepare_input($_POST['state']);
    } else {
        $zone_id = false;
    }
    if (strlen($_POST['firstname']) < ENTRY_FIRST_NAME_MIN_LENGTH) {
        $error = true;
        $messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
    }
    if (strlen($_POST['lastname']) < ENTRY_LAST_NAME_MIN_LENGTH) {
        $error = true;
        $messageStack->add('account_edit', ENTRY_LAST_NAME_ERROR);
    }
    if (strlen($_POST['email_address']) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
        $error = true;
        $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR);
    }
Example #9
0
    ?>
</td>
                <td class="dataTableHeadingContent" align="center"><?php 
    echo TABLE_HEADING_STATUS;
    ?>
</td>
                <td class="dataTableHeadingContent" align="right"><?php 
    echo TABLE_HEADING_ACTION;
    ?>
&nbsp;</td>
              </tr>
<?php 
    $categories_count = 0;
    $rows = 0;
    if (isset($_POST['search'])) {
        $search = smn_db_prepare_input($_POST['search']);
        $categories_query = smn_db_query("select cd.categories_description, c.category_head_title_tag, c.category_head_desc_tag, c.category_head_keywords_tag, c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.store_id = '" . $store_id . "' and c.store_id = '" . $store_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' and cd.categories_name like '%" . smn_db_input($search) . "%' order by c.sort_order, cd.categories_name");
    } else {
        $categories_query = smn_db_query("select cd.categories_description, c.category_head_title_tag, c.category_head_desc_tag, c.category_head_keywords_tag, c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.store_id = '" . $store_id . "' and c.store_id = '" . $store_id . "' and c.parent_id = '" . (int) $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by c.sort_order, cd.categories_name");
    }
    while ($categories = smn_db_fetch_array($categories_query)) {
        $categories_count++;
        $rows++;
        // Get parent_id for subcategories if search
        if (isset($_POST['search'])) {
            $cPath = $categories['parent_id'];
        }
        if ((!isset($_GET['cID']) && !isset($_GET['pID']) || isset($_GET['cID']) && $_GET['cID'] == $categories['categories_id']) && !isset($cInfo) && substr($action, 0, 3) != 'new') {
            $category_childs = array('childs_count' => smn_childs_in_category_count($categories['categories_id']));
            $category_products = array('products_count' => smn_products_in_category_count($categories['categories_id']));
            $cInfo_array = array_merge($categories, $category_childs, $category_products);
Example #10
0
  license@systemsmanager.net so we can mail you a copy immediately.
*/
require 'includes/application_top.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (smn_not_null($action)) {
    switch ($action) {
        case 'insert':
            $zone_country_id = smn_db_prepare_input($_POST['zone_country_id']);
            $zone_code = smn_db_prepare_input($_POST['zone_code']);
            $zone_name = smn_db_prepare_input($_POST['zone_name']);
            smn_db_query("insert into " . TABLE_ZONES . " (zone_country_id, zone_code, zone_name) values ('" . (int) $zone_country_id . "', '" . smn_db_input($zone_code) . "', '" . smn_db_input($zone_name) . "')");
            smn_redirect(smn_href_link(FILENAME_ZONES));
            break;
        case 'save':
            $zone_id = smn_db_prepare_input($_GET['cID']);
            $zone_country_id = smn_db_prepare_input($_POST['zone_country_id']);
            $zone_code = smn_db_prepare_input($_POST['zone_code']);
            $zone_name = smn_db_prepare_input($_POST['zone_name']);
            smn_db_query("update " . TABLE_ZONES . " set zone_country_id = '" . (int) $zone_country_id . "', zone_code = '" . smn_db_input($zone_code) . "', zone_name = '" . smn_db_input($zone_name) . "' where zone_id = '" . (int) $zone_id . "'");
            smn_redirect(smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $zone_id));
            break;
        case 'deleteconfirm':
            $zone_id = smn_db_prepare_input($_GET['cID']);
            smn_db_query("delete from " . TABLE_ZONES . " where zone_id = '" . (int) $zone_id . "'");
            smn_redirect(smn_href_link(FILENAME_ZONES, 'page=' . $_GET['page']));
            break;
    }
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
         } elseif ($action == 'update_store_product') {
           smn_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_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=' . $cPath . '&ID='.$store_id.'&pID=' . $products_id)));
     }
   }
   break;
 case 'copy_to_confirm':
   if (isset($_POST['products_id']) && isset($_POST['categories_id'])) {
     $products_id = smn_db_prepare_input($_POST['products_id']);
     $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();
 if (ACCOUNT_COMPANY == 'true') {
     $company = smn_db_prepare_input($_POST['company']);
 }
 $firstname = smn_db_prepare_input($_POST['firstname']);
 $lastname = smn_db_prepare_input($_POST['lastname']);
 $street_address = smn_db_prepare_input($_POST['street_address']);
 $postcode = smn_db_prepare_input($_POST['postcode']);
 $city = smn_db_prepare_input($_POST['city']);
 $country = smn_db_prepare_input($_POST['country']);
 if (ACCOUNT_STATE == 'true') {
     if (isset($_POST['zone_id'])) {
         $zone_id = smn_db_prepare_input($_POST['zone_id']);
     } else {
         $zone_id = false;
     }
     $state = smn_db_prepare_input($_POST['state']);
 }
 if (ACCOUNT_GENDER == 'true') {
     if ($gender != 'm' && $gender != 'f') {
         $error = true;
         $messageStack->add('addressbook', ENTRY_GENDER_ERROR);
     }
 }
 if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('addressbook', ENTRY_FIRST_NAME_ERROR);
 }
 if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('addressbook', ENTRY_LAST_NAME_ERROR);
 }
            } elseif ($_GET['gID'] != 'edit_group') {
                $check_groups_name_query = smn_db_query("select admin_groups_name as group_name_new from " . TABLE_ADMIN_GROUPS . " where admin_groups_name like '%" . $name_replace . "%'");
                $check_duplicate = smn_db_num_rows($check_groups_name_query);
                if ($check_duplicate > 0) {
                    smn_redirect(smn_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $_GET['gID'] . '&gName=used&action=new_group'));
                } else {
                    $sql_product_data_array = array('products_quantity' => '1000', 'products_model' => 'mem_6_', 'products_price' => smn_db_prepare_input($_POST['admin_groups_cost']), 'products_date_available' => date('Y-m-d'), 'store_id' => 1, 'products_weight' => '0', 'products_status' => '1', 'products_tax_class_id' => '', 'products_date_added' => 'now()', 'products_image' => '', 'manufacturers_id' => '');
                    smn_db_perform(TABLE_PRODUCTS, $sql_product_data_array);
                    $products_id = smn_db_insert_id();
                    smn_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int) $products_id . "', '1')");
                    $languages = smn_get_languages();
                    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                        $language_id = $languages[$i]['id'];
                        $sql_data_array = array('products_id' => $products_id, 'products_name' => smn_db_prepare_input($admin_groups_name), 'language_id' => $language_id, 'products_url' => HTTP_CATALOG_SERVER);
                        smn_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
                    }
                    $sql_data_array = array('admin_groups_name' => $admin_groups_name, 'admin_groups_store_type' => smn_db_prepare_input($_POST['admin_groups_store_types']), 'admin_groups_products_id' => $products_id, 'admin_sales_cost' => smn_db_prepare_input($_POST['admin_sales_cost']), 'admin_groups_max_products' => smn_db_prepare_input($_POST['admin_groups_max_products']));
                    smn_db_perform(TABLE_ADMIN_GROUPS, $sql_data_array);
                    $admin_groups_id = smn_db_insert_id();
                    $set_groups_id = smn_db_prepare_input($_POST['set_groups_id']);
                    $add_group_id = $set_groups_id . ',\'' . $admin_groups_id . '\'';
                    smn_db_query("alter table " . TABLE_ADMIN_FILES . " change admin_groups_id admin_groups_id set( " . $add_group_id . ") NOT NULL DEFAULT '1' ");
                    smn_redirect(smn_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $admin_groups_id));
                }
            }
            break;
    }
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
  http://www.systemsmanager.net
  
  Portions Copyright (c) 2002 osCommerce
  
  This source file is subject to version 2.0 of the GPL license,   
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
require 'includes/application_top.php';
reset($_GET);
while (list($key, ) = each($_GET)) {
    switch ($key) {
        case 'banner':
            $banners_id = smn_db_prepare_input($_GET['banner']);
            $banner_query = smn_db_query("select affiliate_banners_title, affiliate_banners_image, affiliate_banners_html_text from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . smn_db_input($banners_id) . "'");
            $banner = smn_db_fetch_array($banner_query);
            $page_title = $banner['affiliate_banners_title'];
            if ($banner['affiliate_banners_html_text']) {
                $image_source = $banner['affiliate_banners_html_text'];
            } elseif ($banner['affiliate_banners_image']) {
                $image_source = smn_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $banner['affiliate_banners_image'], $page_title);
            }
            break;
    }
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
echo HTML_PARAMS;
Example #15
0
 function set_newsletter($subscribe)
 {
     $this->newsletter = smn_db_prepare_input($subscribe);
 }
Example #16
0
         $action = 'new';
     }
     break;
 case 'deleteconfirm':
     $newsletter_id = smn_db_prepare_input($_GET['nID']);
     smn_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int) $newsletter_id . "'");
     smn_redirect(smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page']));
     break;
 case 'delete':
 case 'new':
     if (!isset($_GET['nID'])) {
         break;
     }
 case 'send':
 case 'confirm_send':
     $newsletter_id = smn_db_prepare_input($_GET['nID']);
     $check_query = smn_db_query("select locked from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int) $newsletter_id . "' and store_id = '" . $store_id . "'");
     $check = smn_db_fetch_array($check_query);
     if ($check['locked'] < 1) {
         switch ($action) {
             case 'delete':
                 $error = ERROR_REMOVE_UNLOCKED_NEWSLETTER;
                 break;
             case 'new':
                 $error = ERROR_EDIT_UNLOCKED_NEWSLETTER;
                 break;
             case 'send':
                 $error = ERROR_SEND_UNLOCKED_NEWSLETTER;
                 break;
             case 'confirm_send':
                 $error = ERROR_SEND_UNLOCKED_NEWSLETTER;
             }
             $messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success');
         } elseif ($_GET['action'] == 'update') {
             $insert_sql_data = array('affiliate_date_status_change' => 'now()');
             $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
             smn_db_perform(TABLE_AFFILIATE_BANNERS, $sql_data_array, 'update', 'affiliate_banners_id = \'' . $affiliate_banners_id . '\'');
             $messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success');
         }
         smn_redirect(smn_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $_GET['page'] . '&abID=' . $affiliate_banners_id));
     } else {
         $_GET['action'] = 'new';
     }
     break;
 case 'deleteconfirm':
     $affiliate_banners_id = smn_db_prepare_input($_GET['abID']);
     $delete_image = smn_db_prepare_input($_POST['delete_image']);
     if ($delete_image == 'on') {
         $affiliate_banner_query = smn_db_query("select affiliate_banners_image from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . smn_db_input($affiliate_banners_id) . "'");
         $affiliate_banner = smn_db_fetch_array($affiliate_banner_query);
         if (is_file(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image'])) {
             if (is_writeable(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image'])) {
                 unlink(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image']);
             } else {
                 $messageStack->add_session(ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
             }
         } else {
             $messageStack->add_session(ERROR_IMAGE_DOES_NOT_EXIST, 'error');
         }
     }
     smn_db_query("delete from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . smn_db_input($affiliate_banners_id) . "'");
     smn_db_query("delete from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . smn_db_input($affiliate_banners_id) . "'");
<table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php 
echo HEADING_TITLE;
?>
</td>
          </tr>
        </table></td>
      </tr>
<?php 
if ($_GET['action'] == 'new') {
    $form_action = 'insert';
    if ($_GET['abID']) {
        $abID = smn_db_prepare_input($_GET['abID']);
        $form_action = 'update';
        $affiliate_banner_query = smn_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . smn_db_input($abID) . "'");
        $affiliate_banner = smn_db_fetch_array($affiliate_banner_query);
        $abInfo = new objectInfo($affiliate_banner);
    } elseif ($_POST) {
        $abInfo = new objectInfo($_POST);
    } else {
        $abInfo = new objectInfo(array());
    }
    $groups_array = array();
    $groups_query = smn_db_query("select distinct affiliate_banners_group from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_group");
    while ($groups = smn_db_fetch_array($groups_query)) {
        $groups_array[] = array('id' => $groups['affiliate_banners_group'], 'text' => $groups['affiliate_banners_group']);
    }
    ?>
     if (isset($_POST['zone_id'])) {
         $zone_id = smn_db_prepare_input($_POST['zone_id']);
     } else {
         $zone_id = false;
     }
 }
 $country = smn_db_prepare_input($_POST['country']);
 $telephone = smn_db_prepare_input($_POST['telephone']);
 $fax = smn_db_prepare_input($_POST['fax']);
 if (isset($_POST['newsletter'])) {
     $newsletter = smn_db_prepare_input($_POST['newsletter']);
 } else {
     $newsletter = false;
 }
 $password = smn_db_prepare_input($_POST['password']);
 $confirmation = smn_db_prepare_input($_POST['confirmation']);
 $error = false;
 if (ACCOUNT_GENDER == 'true') {
     if ($gender != 'm' && $gender != 'f') {
         $error = true;
         $messageStack->add('create_account', ENTRY_GENDER_ERROR);
     }
 }
 if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
 }
 if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
 }
Example #20
0
            $mail_query = smn_db_query("select distinct(customers.customers_email_address), customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . ", " . TABLE_ORDERS . " where customers.customers_id = orders.customers_id and orders.store_id = " . $store_id . " group by customers.customers_id");
            $mail_sent_to = TEXT_ALL_CUSTOMERS;
            break;
        case '**D':
            $mail_query = smn_db_query("select distinct(customers.customers_email_address), customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . ", " . TABLE_ORDERS . " where customers.customers_id = orders.customers_id and orders.store_id = " . $store_id . " and customers_newsletter = '1'  group by customers.customers_id");
            $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
            break;
        default:
            $customers_email_address = smn_db_prepare_input($_POST['customers_email_address']);
            $mail_query = smn_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . smn_db_input($customers_email_address) . "'");
            $mail_sent_to = $_POST['customers_email_address'];
            break;
    }
    $from = smn_db_prepare_input($_POST['from']);
    $subject = smn_db_prepare_input($_POST['subject']);
    $message = smn_db_prepare_input($_POST['message']);
    //Let's build a message object using the email class
    $mimemessage = new email(array('X-Mailer: osCommerce'));
    // add the message to the object
    $mimemessage->add_text($message);
    $mimemessage->build_message();
    while ($mail = smn_db_fetch_array($mail_query)) {
        $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
    }
    smn_redirect(smn_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
}
if ($action == 'preview' && !isset($_POST['customers_email_address'])) {
    $messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
}
if (isset($_GET['mail_sent_to'])) {
    $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $_GET['mail_sent_to']), 'success');
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
global $page_name;
// include the password crypto functions
require DIR_WS_FUNCTIONS . 'password_funcs.php';
if (!smn_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
}
if (isset($_POST['action']) && $_POST['action'] == 'process') {
    $password_current = smn_db_prepare_input($_POST['password_current']);
    $password_new = smn_db_prepare_input($_POST['password_new']);
    $password_confirmation = smn_db_prepare_input($_POST['password_confirmation']);
    $error = false;
    if (strlen($password_current) < ENTRY_PASSWORD_MIN_LENGTH) {
        $error = true;
        $messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
    } elseif (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
        $error = true;
        $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
    } elseif ($password_new != $password_confirmation) {
        $error = true;
        $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
    }
    if ($error == false) {
        $check_customer_query = smn_db_query("select customers_password from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
        $check_customer = smn_db_fetch_array($check_customer_query);
        if (smn_validate_password($password_current, $check_customer['customers_password'])) {
 $a_payment_bank_branch_number = smn_db_prepare_input($_POST['a_payment_bank_branch_number']);
 $a_payment_bank_swift_code = smn_db_prepare_input($_POST['a_payment_bank_swift_code']);
 $a_payment_bank_account_name = smn_db_prepare_input($_POST['a_payment_bank_account_name']);
 $a_payment_bank_account_number = smn_db_prepare_input($_POST['a_payment_bank_account_number']);
 $a_street_address = smn_db_prepare_input($_POST['a_street_address']);
 $a_suburb = smn_db_prepare_input($_POST['a_suburb']);
 $a_postcode = smn_db_prepare_input($_POST['a_postcode']);
 $a_city = smn_db_prepare_input($_POST['a_city']);
 $a_country = smn_db_prepare_input($_POST['a_country']);
 $a_zone_id = smn_db_prepare_input($_POST['a_zone_id']);
 $a_state = smn_db_prepare_input($_POST['a_state']);
 $a_telephone = smn_db_prepare_input($_POST['a_telephone']);
 $a_fax = smn_db_prepare_input($_POST['a_fax']);
 $a_homepage = smn_db_prepare_input($_POST['a_homepage']);
 $a_password = smn_db_prepare_input($_POST['a_password']);
 $a_newsletter = smn_db_prepare_input($_POST['a_newsletter']);
 $error = false;
 // reset error flag
 if (ACCOUNT_GENDER == 'true') {
     if ($a_gender == 'm' || $a_gender == 'f') {
         $entry_gender_error = false;
     } else {
         $error = true;
         $entry_gender_error = true;
     }
 }
 if (strlen($a_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $entry_firstname_error = true;
 } else {
     $entry_firstname_error = false;
  http://www.systemsmanager.net
  
  Portions Copyright (c) 2002 osCommerce
  
  This source file is subject to version 2.0 of the GPL license,   
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
global $page_name;
// include the password crypto functions
require DIR_WS_FUNCTIONS . 'password_funcs.php';
if (isset($_GET['action']) && $_GET['action'] == 'process') {
    $affiliate_username = smn_db_prepare_input($_POST['affiliate_username']);
    $affiliate_password = smn_db_prepare_input($_POST['affiliate_password']);
    // Check if username exists
    /*Changed the query to take the sales agent details from customer table by Cimi*/
    //$check_affiliate_query = smn_db_query("select affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . smn_db_input($affiliate_username) . "'");
    $check_customer_query = smn_db_query("select a.affiliate_id,c.customers_id, c.customers_firstname, c.customers_password, c.customers_email_address, c.customers_default_address_id from " . TABLE_CUSTOMERS . " c," . TABLE_AFFILIATE . " a where c.customers_email_address = '" . smn_db_input($affiliate_username) . "' and c.customers_id=a.affiliate_customer_id");
    if (!smn_db_num_rows($check_customer_query)) {
        $_GET['login'] = '******';
    } else {
        $check_customer = smn_db_fetch_array($check_customer_query);
        // Check that password is good
        if (!smn_validate_password($affiliate_password, $check_customer['customers_password'])) {
            $_GET['login'] = '******';
        } else {
            /*Changed the code to set the session of user and sales agent if the login is success by Cimi*/
            /*$affiliate_id = $check_affiliate['affiliate_id'];
                    smn_session_register('affiliate_id');
Example #24
0
function smn_db_prepare_input($string)
{
    if (is_string($string)) {
        return trim(smn_sanitize_string(stripslashes($string)));
    } elseif (is_array($string)) {
        reset($string);
        while (list($key, $value) = each($string)) {
            $string[$key] = smn_db_prepare_input($value);
        }
        return $string;
    } else {
        return $string;
    }
}
Example #25
0
    echo smn_draw_separator('pixel_trans.gif', '1', '10');
    ?>
</td>
      </tr>
      <tr>
        <td align="right" class="main"><?php 
    echo smn_draw_hidden_field('reviews_id', $rInfo->reviews_id) . smn_draw_hidden_field('products_id', $rInfo->products_id) . smn_draw_hidden_field('customers_name', $rInfo->customers_name) . smn_draw_hidden_field('products_name', $rInfo->products_name) . smn_draw_hidden_field('products_image', $rInfo->products_image) . smn_draw_hidden_field('date_added', $rInfo->date_added) . smn_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . smn_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID']) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
    ?>
</td>
      </form></tr>
<?php 
} elseif ($action == 'preview') {
    if (smn_not_null($_POST)) {
        $rInfo = new objectInfo($_POST);
    } else {
        $rID = smn_db_prepare_input($_GET['rID']);
        $reviews_query = smn_db_query("select r.reviews_id, r.products_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int) $rID . "' and r.reviews_id = rd.reviews_id and r.store_id = rd.store_id");
        $reviews = smn_db_fetch_array($reviews_query);
        $products_query = smn_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int) $reviews['products_id'] . "'");
        $products = smn_db_fetch_array($products_query);
        $products_name_query = smn_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $reviews['products_id'] . "' and language_id = '" . (int) $languages_id . "'");
        $products_name = smn_db_fetch_array($products_name_query);
        $rInfo_array = array_merge($reviews, $products, $products_name);
        $rInfo = new objectInfo($rInfo_array);
    }
    ?>
      <tr><?php 
    echo smn_draw_form('update', FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID'] . '&action=update', 'post', 'enctype="multipart/form-data"');
    ?>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
Example #26
0
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
global $page_name;
// include the password crypto functions
require DIR_WS_FUNCTIONS . 'password_funcs.php';
// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
if ($session_started == false) {
    smn_redirect(smn_href_link(FILENAME_COOKIE_USAGE));
}
$error = false;
if (isset($_GET['action']) && $_GET['action'] == 'process') {
    $email_address = smn_db_prepare_input($_POST['email_address']);
    $password = smn_db_prepare_input($_POST['password']);
    // Check if email exists
    $check_customer_query = smn_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . smn_db_input($email_address) . "'");
    if (!smn_db_num_rows($check_customer_query)) {
        $error = true;
    } else {
        $check_customer = smn_db_fetch_array($check_customer_query);
        // Check that password is good
        if (!smn_validate_password($password, $check_customer['customers_password'])) {
            $error = true;
        } else {
            if (SESSION_RECREATE == 'True') {
                smn_session_recreate();
            }
            $check_country_query = smn_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $check_customer['customers_id'] . "' and address_book_id = '" . (int) $check_customer['customers_default_address_id'] . "'");
            $check_country = smn_db_fetch_array($check_country_query);
 $tollfree = $_POST['tollfree_0'] . '-' . $_POST['tollfree_1'] . '-' . $_POST['tollfree_2'];
 $fax = $_POST['fax_0'] . '-' . $_POST['fax_1'] . '-' . $_POST['fax_2'];
 if (isset($_POST['newsletter']) && $_POST['newsletter'] == '1') {
     $newsletter = '1';
 } else {
     $newsletter = false;
 }
 if (isset($_POST['affiliate_id'])) {
     $Qcheck = smn_db_query('select * from ' . TABLE_AFFILIATE . ' where affiliate_id = "' . $_POST['affiliate_id'] . '"');
     if (!smn_db_num_rows($Qcheck)) {
         $error = true;
         $messageStack->add('account_edit', 'There is no affiliate with the entered id.', '');
     }
 }
 if (smn_session_is_registered('customer_store_id')) {
     $new_store_name = smn_db_prepare_input($_POST['storename']);
     $store_query = smn_db_query("select store_name from " . TABLE_STORE_DESCRIPTION . " WHERE store_name like '" . $new_store_name . "' and store_id != '" . $customer_store_id . "'");
     if (smn_db_num_rows($store_query)) {
         $error = true;
         $messageStack->add('account_edit', ENTRY_STORE_NAME_ERROR, '');
     }
     if (isset($_POST['sp_store_path'])) {
         $sp = new store_path($customer_store_id);
         $data = array('sp_store_path' => $_POST['sp_store_path'], 'sp_store_id' => $customer_store_id, 'sp_store_path_text' => $_POST['sp_store_path_text']);
         $rv = $sp->choose_path($data);
         if ($rv) {
         } else {
             $error = true;
             $messageStack->add('account_edit', $sp->error_message());
         }
     }
  This source file is subject to version 2.0 of the GPL license,   
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
global $page_name;
if (!smn_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, '', 'NONSSL'));
}
$newsletter_query = smn_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
$newsletter = smn_db_fetch_array($newsletter_query);
if (isset($_POST['action']) && $_POST['action'] == 'process') {
    if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) {
        $newsletter_general = smn_db_prepare_input($_POST['newsletter_general']);
    } else {
        $newsletter_general = '0';
    }
    if ($newsletter_general != $newsletter['customers_newsletter']) {
        $newsletter_general = $newsletter['customers_newsletter'] == '1' ? '0' : '1';
        smn_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '" . (int) $newsletter_general . "' where customers_id = '" . (int) $customer_id . "'");
    }
    $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
    smn_redirect(smn_href_link(FILENAME_ACCOUNT, '', 'NONSSL'));
}
$breadcrumb->add(NAVBAR_TITLE_1, smn_href_link(FILENAME_ACCOUNT, '', 'NONSSL'));
$breadcrumb->add(NAVBAR_TITLE_2, smn_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'NONSSL'));
?>
  
  
             if ($_POST['new_catagory'] != '') {
                 $sql_navbar_data_array = array('page_name' => $store_page_title, 'language_id' => $language_id, 'store_id' => $store_id, 'text_key' => 'NAVBAR_TITLE', 'text_content' => smn_db_prepare_input($_POST['page_navbar'][$language_id]), 'date_modified' => 'now()');
                 $sql_heading_data_array = array('page_name' => $store_page_title, 'language_id' => $language_id, 'store_id' => $store_id, 'text_key' => 'HEADING_TITLE', 'text_content' => smn_db_prepare_input($_POST['page_header'][$language_id]), 'date_modified' => 'now()');
                 $sql_header_data_array = array('page_name' => $store_page_title, 'language_id' => $language_id, 'store_id' => $store_id, 'text_key' => 'HEADER_TITLE', 'text_content' => smn_db_prepare_input($_POST['page_heading'][$language_id]), 'date_modified' => 'now()');
                 smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_navbar_data_array, 'insert');
                 smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_heading_data_array, 'insert');
                 smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_header_data_array, 'insert');
             }
             $sql_page_data_array = array('page_id' => $page_id, 'language_id' => $language_id, 'store_id' => $store_id, 'page_title' => smn_db_prepare_input($_POST['page_title'][$language_id]), 'text_content' => '', 'date_modified' => 'now()');
             smn_db_perform($db_table, $sql_page_data_array, 'insert');
         }
     } elseif ($_GET['type'] == 'site_text') {
         $languages = smn_get_languages();
         for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
             $language_id = $languages[$i]['id'];
             $sql_text_key_data_array = array('page_name' => $store_page_title, 'language_id' => $language_id, 'store_id' => $store_id, 'text_key' => smn_db_prepare_input($_POST['text_key']), 'text_content' => '', 'date_modified' => 'now()');
             smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_text_key_data_array, 'insert');
         }
         smn_redirect(smn_href_link(FILENAME_TEXT_EDITOR, 'page_name=' . $store_page_title . '&action=edit' . '&type=' . $_GET['type'] . '&text_key=' . $_POST['text_key']));
         break;
     }
     smn_redirect(smn_href_link(FILENAME_TEXT_EDITOR, 'page_id=' . $page_id . '&action=edit' . '&type=' . $_GET['type']));
     break;
 case 'save':
     $languages = smn_get_languages();
     if ($_GET['type'] == 'site_text') {
         for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
             $language_id = $languages[$i]['id'];
             $sql_data_array = array('text_content' => addslashes($_POST['file_content'][$language_id]), 'date_modified' => 'now()');
             smn_db_perform($db_table, $sql_data_array, 'update', "page_name='" . $_POST['page_name'] . "' and text_key='" . $_POST['text_key'] . "' and language_id='" . $language_id . "' and store_id = '" . $store_id . "'");
         }
Example #30
0
if (smn_not_null($action)) {
    switch ($action) {
        case 'insert':
            $tax_zone_id = smn_db_prepare_input($_POST['tax_zone_id']);
            $tax_class_id = smn_db_prepare_input($_POST['tax_class_id']);
            $tax_rate = smn_db_prepare_input($_POST['tax_rate']);
            $tax_description = smn_db_prepare_input($_POST['tax_description']);
            $tax_priority = smn_db_prepare_input($_POST['tax_priority']);
            smn_db_query("insert into " . TABLE_TAX_RATES . " (store_id, tax_zone_id, tax_class_id, tax_rate, tax_description, tax_priority, date_added) values ('" . (int) $store_id . "', '" . (int) $tax_zone_id . "', '" . (int) $tax_class_id . "', '" . smn_db_input($tax_rate) . "', '" . smn_db_input($tax_description) . "', '" . smn_db_input($tax_priority) . "', now())");
            smn_redirect(smn_href_link(FILENAME_TAX_RATES));
            break;
        case 'save':
            $tax_rates_id = smn_db_prepare_input($_GET['tID']);
            $tax_zone_id = smn_db_prepare_input($_POST['tax_zone_id']);
            $tax_class_id = smn_db_prepare_input($_POST['tax_class_id']);
            $tax_rate = smn_db_prepare_input($_POST['tax_rate']);
            $tax_description = smn_db_prepare_input($_POST['tax_description']);
            $tax_priority = smn_db_prepare_input($_POST['tax_priority']);
            smn_db_query("update " . TABLE_TAX_RATES . " set tax_rates_id = '" . (int) $tax_rates_id . "', tax_zone_id = '" . (int) $tax_zone_id . "', tax_class_id = '" . (int) $tax_class_id . "', tax_rate = '" . smn_db_input($tax_rate) . "', tax_description = '" . smn_db_input($tax_description) . "', tax_priority = '" . smn_db_input($tax_priority) . "', last_modified = now() where tax_rates_id = '" . (int) $tax_rates_id . "' and store_id = '" . $store_id . "'");
            smn_redirect(smn_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $tax_rates_id));
            break;
        case 'deleteconfirm':
            $tax_rates_id = smn_db_prepare_input($_GET['tID']);
            smn_db_query("delete from " . TABLE_TAX_RATES . " where tax_rates_id = '" . (int) $tax_rates_id . "' and store_id = '" . $store_id . "'");
            smn_redirect(smn_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page']));
            break;
    }
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';