Exemplo n.º 1
0
    $Qcheck->execute();
    if ($Qcheck->fetch() !== false) {
        $error = true;
        $messageStack->add('account_edit', OSCOM::getDef('entry_email_address_error_exists'));
    }
    if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
        $error = true;
        $messageStack->add('account_edit', OSCOM::getDef('entry_telephone_number_error', ['min_length' => ENTRY_TELEPHONE_MIN_LENGTH]));
    }
    if ($error == false) {
        $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax);
        if (ACCOUNT_GENDER == 'true') {
            $sql_data_array['customers_gender'] = $gender;
        }
        if (ACCOUNT_DOB == 'true') {
            $sql_data_array['customers_dob'] = $dobDateTime->getRaw(false);
        }
        $OSCOM_Db->save('customers', $sql_data_array, ['customers_id' => (int) $_SESSION['customer_id']]);
        $OSCOM_Db->save('customers_info', ['customers_info_date_account_last_modified' => 'now()'], ['customers_info_id' => (int) $_SESSION['customer_id']]);
        $sql_data_array = ['entry_firstname' => $firstname, 'entry_lastname' => $lastname];
        $OSCOM_Db->save('address_book', $sql_data_array, ['customers_id' => (int) $_SESSION['customer_id'], 'address_book_id' => (int) $_SESSION['customer_default_address_id']]);
        // reset the session variables
        $_SESSION['customer_first_name'] = $firstname;
        $messageStack->add_session('account', OSCOM::getDef('success_account_updated'), 'success');
        OSCOM::redirect('account.php');
    }
}
$Qaccount = $OSCOM_Db->prepare('select * from :table_customers where customers_id = :customers_id');
$Qaccount->bindInt(':customers_id', $_SESSION['customer_id']);
$Qaccount->execute();
$breadcrumb->add(OSCOM::getDef('navbar_title_1'), OSCOM::link('account.php'));
}
if (isset($search_keywords) && sizeof($search_keywords) > 0) {
    for ($i = 0, $n = sizeof($search_keywords); $i < $n; $i++) {
        $Qlisting->bindValue(':products_name_' . $i, '%' . $search_keywords[$i] . '%');
        $Qlisting->bindValue(':products_model_' . $i, '%' . $search_keywords[$i] . '%');
        $Qlisting->bindValue(':manufacturers_name_' . $i, '%' . $search_keywords[$i] . '%');
        if (isset($_GET['search_in_description']) && $_GET['search_in_description'] == '1') {
            $Qlisting->bindValue(':products_description_' . $i, '%' . $search_keywords[$i] . '%');
        }
    }
}
if (isset($dfromDateTime) && $dfromDateTime->isValid()) {
    $Qlisting->bindValue(':products_date_added_from', $dfromDateTime->getRaw(false));
}
if (isset($dtoDateTime) && $dtoDateTime->isValid()) {
    $Qlisting->bindValue(':products_date_added_to', $dtoDateTime->getRaw(false));
}
if (DISPLAY_PRICE_WITH_TAX == 'true') {
    if ($pfrom > 0) {
        $Qlisting->bindDecimal(':price_from', $pfrom);
    }
    if ($pto > 0) {
        $Qlisting->bindDecimal(':price_to', $pto);
    }
} else {
    if ($pfrom > 0) {
        $Qlisting->bindDecimal(':price_from', $pfrom);
    }
    if ($pto > 0) {
        $Qlisting->bindDecimal(':price_to', $pto);
    }