Skip to content
This repository was archived by the owner on Aug 5, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
634 commits
Select commit Hold shift + click to select a range
8161e88
Store Logo Update
gburton Oct 22, 2014
d5d50b7
Fix default time zone set
acidvertigo Oct 24, 2014
0ca2040
Update superglobals
acidvertigo Oct 25, 2014
7e8f722
Remove GLOBALS VARIABLE as we are checking for get and post superglobals
acidvertigo Oct 25, 2014
b29d3a8
Update standard documentation to remove the usage of deprecated globa…
acidvertigo Oct 25, 2014
b77e6ff
Update STANDARD docuemtnation
acidvertigo Oct 25, 2014
e157816
Update language.php superglobal
acidvertigo Oct 28, 2014
da06014
Update logger.php
acidvertigo Oct 28, 2014
0db1f72
Merge pull request #250 from acidvertigo/admin_superglobals
haraldpdl Nov 3, 2014
bb0824b
Merge pull request #252 from gburton/Store_Logo
haraldpdl Nov 3, 2014
2b9170e
remove brackets as exit does not pass a value
acidvertigo Nov 4, 2014
301515e
fix add INT
ruden Nov 6, 2014
7e3b6ec
Extend internationalizaion
acidvertigo Nov 6, 2014
298fe29
Update language admin
acidvertigo Nov 6, 2014
7d799dd
fix typo
acidvertigo Nov 6, 2014
dc4ba1e
fix spaces
acidvertigo Nov 6, 2014
b25b48f
Update language.php
acidvertigo Nov 6, 2014
a0e66d8
fix spaces
acidvertigo Nov 6, 2014
2892884
fix comma
acidvertigo Nov 6, 2014
be53e0e
Fix comma
acidvertigo Nov 6, 2014
9d67698
Fix Sort order
acidvertigo Nov 6, 2014
e0c8c83
Fix sort order
acidvertigo Nov 6, 2014
5ddd76b
Use strpos instead of strstr as it is faster to...
acidvertigo Nov 6, 2014
73f811f
Fix parse error
acidvertigo Nov 6, 2014
ae7753c
Merge pull request #260 from acidvertigo/patch-12
haraldpdl Nov 7, 2014
b181bed
Merge pull request #261 from ruden/master
haraldpdl Nov 7, 2014
ecec2ea
Merge pull request #262 from acidvertigo/patch-19
haraldpdl Nov 7, 2014
cdd4b3d
Merge pull request #263 from acidvertigo/patch-22
haraldpdl Nov 7, 2014
b740340
Merge pull request #30 from osCommerce/master
gburton Nov 11, 2014
1bb3c45
TWBS - update to 3.3.4
gburton Mar 20, 2015
1154563
Colorbox - update to 1.5.14
gburton Mar 20, 2015
764f959
Photoset-Grid - update to 1.0.1
gburton Mar 20, 2015
31c2474
Introduce Category Tree
gburton Mar 20, 2015
e3a0a51
Merge pull request #312 from gburton/ExternalLibrary
gburton Mar 20, 2015
127dfb5
Merge pull request #313 from gburton/CategoryTree
gburton Mar 20, 2015
dc7d64d
Merge pull request #31 from osCommerce/master
gburton Mar 20, 2015
dffff66
Introduce Helper Files
gburton Mar 20, 2015
15b6b6c
Header And Footer Optimisation
gburton Mar 20, 2015
ab40a1a
Introduce Bootstrap Options
gburton Mar 20, 2015
b20a312
Update Footer Boxes
gburton Mar 20, 2015
87fe8be
Update Footer Suffix Boxes
gburton Mar 20, 2015
60906ff
Update Header Boxes
gburton Mar 20, 2015
422b89c
Introduce MessageStack to Header
gburton Mar 20, 2015
c9917df
Introduce Navbar
gburton Mar 20, 2015
4b6b339
Merge pull request #314 from gburton/HeaderFooter
gburton Mar 20, 2015
c5a31bf
Merge pull request #32 from osCommerce/master
gburton Mar 20, 2015
266134c
Boxes Clean Up
gburton Mar 20, 2015
6811ea6
Merge pull request #315 from gburton/Boxes
gburton Mar 20, 2015
94a2f9d
Merge pull request #33 from osCommerce/master
gburton Mar 20, 2015
a7eba1f
Introduce HT Colorbox / Photoset Grid Module
gburton Mar 21, 2015
eb34cfc
Introduce HT Grid/List for Product Listing
gburton Mar 21, 2015
fb1d780
Standardise Product Listing
gburton Mar 21, 2015
3cd3472
Introduce HT Equal Heights
gburton Mar 21, 2015
4b90ff1
Introduce HT Top Link
gburton Mar 21, 2015
c534f4d
Merge pull request #316 from gburton/HT
gburton Mar 21, 2015
185c5a4
Merge pull request #34 from osCommerce/master
gburton Mar 21, 2015
a83bc92
Split Page Results
gburton Mar 23, 2015
a283012
Unused Images
gburton Mar 24, 2015
3ad1cc2
Language Cleanse
gburton Mar 24, 2015
e0fc8ac
Merge pull request #318 from gburton/SPR
gburton Mar 24, 2015
19178d3
Merge pull request #317 from gburton/Clean-Up
gburton Mar 24, 2015
11d787d
Merge pull request #35 from osCommerce/master
gburton Mar 24, 2015
69dfce3
Installer Update
gburton Mar 24, 2015
d8a94b9
Merge pull request #319 from gburton/Installer-Update
gburton Mar 24, 2015
ec88dd3
Merge pull request #36 from osCommerce/master
gburton Mar 24, 2015
b8f9d90
Account Pages - Clean Up and Optimise
gburton Mar 24, 2015
17ece95
Merge pull request #321 from gburton/Account
gburton Mar 25, 2015
9933da8
Merge pull request #37 from osCommerce/master
gburton Mar 25, 2015
b0cd60b
Update Stylesheet
gburton Mar 25, 2015
c64e62d
Update Address Book
gburton Mar 25, 2015
db65438
Merge pull request #322 from gburton/Stylesheet
gburton Mar 25, 2015
5c25892
Update Advanced Search Page and Results Page
gburton Mar 25, 2015
1f3c064
Merge pull request #324 from gburton/Advanced-Search
gburton Mar 25, 2015
8cc71e6
Merge pull request #323 from gburton/AddressBook
gburton Mar 25, 2015
b0ab75f
Merge pull request #38 from osCommerce/master
gburton Mar 25, 2015
ee1d813
Update and Optimise Checkout Pages
gburton Mar 25, 2015
e243da2
Merge pull request #325 from gburton/Checkout-Pages
gburton Mar 25, 2015
9a2c5be
Merge pull request #39 from osCommerce/master
gburton Mar 25, 2015
1066d65
Basic Pages
gburton Mar 25, 2015
4f5e5c7
Action Pages
gburton Mar 25, 2015
834ba66
Deprecate Filenames
gburton Mar 25, 2015
c1aff96
Deprecate Database Names #1
gburton Mar 25, 2015
6b99678
Deprecate Database Names #2
gburton Mar 25, 2015
371137b
Deprecate Database Names #3
gburton Mar 25, 2015
19f8e49
Deprecated Database Names #4
gburton Mar 25, 2015
f4a2f95
Deprecate Database Names #5
gburton Mar 25, 2015
b4f083b
Deprecate Database Names #6
gburton Mar 25, 2015
89122a4
Cleanse and Optimise Modules
gburton Mar 25, 2015
53cee83
Copyright Update
gburton Mar 25, 2015
47af089
Obsolete USPS Module
gburton Mar 25, 2015
5d6dcb8
Update Product Info and Breadcrumb
gburton Mar 26, 2015
5b3ddae
Reviews Content Module
gburton Mar 26, 2015
c14ba97
Microdata Product Review Page
gburton Mar 26, 2015
46b35fc
Aggregate Review - Normalize
gburton Mar 26, 2015
061b350
Product Reviews Write
gburton Mar 26, 2015
2cfcb42
Replace Star Images
gburton Mar 26, 2015
0242b6a
Deprecated Category Count
gburton Mar 26, 2015
3e97717
Enforce Selection of Attribute/Option
gburton Mar 26, 2015
bdbefc8
Enforce Selection of Shipping Method and Payment Method
gburton Mar 26, 2015
8cecbf2
Easy "Table Row" click
gburton Mar 26, 2015
21ddf7d
Enforce Minimum Lengths
gburton Mar 26, 2015
0a59382
Cleanse SQL
gburton Mar 26, 2015
36c61cd
Templatise "New Products for Month"
gburton Mar 26, 2015
1ad6a61
Pretty Shopping Cart
gburton Mar 26, 2015
efe70d0
Pretty Search
gburton Mar 26, 2015
894d998
Pretty Breadcrumb
gburton Mar 26, 2015
c2251d4
Update Language Files
gburton Mar 26, 2015
fc6b178
Merge pull request #327 from gburton/Catalog-Pages
gburton Mar 27, 2015
e4e1d47
Deprecate "includes"
gburton Mar 27, 2015
7df9c0d
Deprecate "type"
gburton Mar 27, 2015
1da90f7
Deprecate .js based form checking
gburton Mar 27, 2015
5d1102e
Merge pull request #328 from gburton/Catalog-Pages
gburton Mar 27, 2015
39600be
Merge pull request #40 from osCommerce/master
gburton Mar 27, 2015
a8333ca
PHP 5.5 Minimum
gburton Mar 27, 2015
eddeab4
Deprecate DB Tables
gburton Mar 27, 2015
8a59511
Deprecated Constants
gburton Mar 27, 2015
26f3084
Merge pull request #329 from gburton/Mini-Updates
gburton Mar 27, 2015
a6c065d
Merge pull request #41 from osCommerce/master
gburton Mar 27, 2015
ff489e4
Product ID
gburton Mar 27, 2015
e1bdfb1
Merge pull request #330 from gburton/product_id
gburton Mar 27, 2015
d9591b5
Password Length Deprecated
gburton Mar 29, 2015
65d869a
Merge pull request #332 from gburton/Password
gburton Mar 29, 2015
c1db68b
Merge pull request #42 from osCommerce/master
gburton Mar 29, 2015
f3aff93
Optimise Breadcrumb
gburton Mar 29, 2015
de099a9
Merge pull request #333 from gburton/Breadcrumb
gburton Mar 29, 2015
f0dbc24
Update paypal_express.php
Tomasonx Apr 1, 2015
709dd20
Merge pull request #334 from Tomasonx/patch-2
gburton Apr 1, 2015
8e51f85
Merge pull request #43 from osCommerce/master
gburton Apr 1, 2015
783b3e6
Update table name
gburton Apr 1, 2015
79db187
Merge pull request #335 from gburton/Tyop
gburton Apr 1, 2015
d8997c7
Update bm_reviews.php
Tomasonx Apr 2, 2015
fa21aaa
Merge pull request #44 from osCommerce/master
gburton Apr 2, 2015
618706c
Merge pull request #336 from Tomasonx/patch-1
gburton Apr 2, 2015
8c90b49
db class proposal (backport from v3.0)
haraldpdl Apr 2, 2015
3d23954
Merge pull request #337 from haraldpdl/db_class
gburton Apr 3, 2015
f0cf621
Placeholder Text
gburton Apr 3, 2015
f366ccd
Merge pull request #339 from gburton/FormOptimise
gburton Apr 3, 2015
39e93e4
fix tyop
haraldpdl Apr 3, 2015
c5be196
Merge pull request #340 from haraldpdl/adress_book_tyop
gburton Apr 3, 2015
a07840a
Merge pull request #45 from osCommerce/master
gburton Apr 3, 2015
97d1eb5
Update english.php
gburton Apr 3, 2015
0d34510
Installer Update
gburton Apr 3, 2015
c1fa3e8
Merge pull request #341 from gburton/gburton-patch-1
gburton Apr 3, 2015
94d086a
Merge pull request #342 from gburton/Installer-update
gburton Apr 6, 2015
cb0056c
add prepareInput static method
haraldpdl Apr 3, 2015
f759134
use new db class
haraldpdl Apr 3, 2015
2df9b4d
use HTML::sanitize directly instead of Db::prepareInput
haraldpdl Apr 3, 2015
03ee41e
db class usage
haraldpdl Apr 10, 2015
b21a6bf
add resultset navigation link functions
haraldpdl Apr 10, 2015
f6d294f
remove resultset navigation link functions from HTML
haraldpdl Apr 16, 2015
189c3cd
add reference of Db instance in DbStatement
haraldpdl Apr 16, 2015
68f065e
remove unused code
haraldpdl Apr 16, 2015
8fdee72
Add result set functionality to DbStatement
haraldpdl Apr 16, 2015
619b100
db class usage
haraldpdl Apr 16, 2015
0f187c4
Merge pull request #346 from haraldpdl/db_class
gburton Apr 20, 2015
e6c41e1
add prepareIdentifier() to secure backtick values in sql queries
haraldpdl Apr 21, 2015
ca16ef1
make sure $_GET/$_POST/_SESSION[$name] exists before trying to use th…
haraldpdl Apr 21, 2015
5cc29cd
set strict error reporting
haraldpdl Apr 21, 2015
1da061c
Merge pull request #348 from haraldpdl/db_class
gburton Apr 22, 2015
c4172b5
loop through with while() and not foreach()fetchAll()
haraldpdl Apr 23, 2015
cfd6852
replace tep_db* with OSC\OM\Db
haraldpdl Apr 23, 2015
b3187c7
Add bindDecimal(). Although the value is passed as a float to bindVal…
haraldpdl Apr 23, 2015
4652b1b
fix query
haraldpdl Apr 23, 2015
9422e8d
remove cache until properly supported in the admin
haraldpdl Apr 23, 2015
7ee5b14
update usage of eval() in tep_address_format() with strtr(); replace …
haraldpdl Apr 24, 2015
80031c5
replace tep_db* with OSC\OM\Db
haraldpdl May 7, 2015
c799da2
remove legacy get_db_cache() and tep_random_select() functions
haraldpdl May 7, 2015
a65a8db
remove tep_session_register(); replace global session variables with …
haraldpdl May 10, 2015
3179dbb
replace tep_db* with OSC\OM\Db
haraldpdl May 10, 2015
bd44ae7
remove global session scope
haraldpdl May 10, 2015
70428d9
fix $navigation global session scope
haraldpdl May 10, 2015
23ad3d9
fix php notice messages (variables not initialized)
haraldpdl May 10, 2015
cd9f0b6
fix variable scope
haraldpdl May 10, 2015
a304c38
remove usage of tep_db_prepare_input(); improve code
haraldpdl May 11, 2015
caa4552
fix session scope
haraldpdl May 11, 2015
6070966
add a database get() function for simple select queries
haraldpdl May 12, 2015
68c88a2
set unknown ip address to 0.0.0.0
haraldpdl May 12, 2015
d2a4e3f
open $OSCOM_Db database connection on the admin side so catalog side …
haraldpdl May 12, 2015
00750e2
add order by parameter
haraldpdl May 12, 2015
64ba9ac
remove legacy payment modules
haraldpdl May 16, 2015
571b556
remove legacy payment modules
haraldpdl May 16, 2015
3b704b3
replace tep_db* with OSC\OM\Db
haraldpdl May 19, 2015
1d2478c
replace tep_db* with OSC\OM\Db
haraldpdl May 19, 2015
a1844f7
replace tep_db* with OSC\OM\Db
haraldpdl May 19, 2015
19020fa
replace tep_db* with OSC\OM\Db
haraldpdl May 19, 2015
baabbb1
add limit parameter
haraldpdl May 19, 2015
f74934a
import HTML class
haraldpdl May 20, 2015
23a38bc
replace tep_db* with OSC\OM\Db
haraldpdl May 20, 2015
72748f9
replace tep_db* with OSC\OM\Db
haraldpdl May 20, 2015
15911fc
replace tep_db* with OSC\OM\Db
haraldpdl May 20, 2015
4e40666
replace tep_db* with OSC\OM\Db
haraldpdl May 20, 2015
2afa776
replace tep_db* with OSC\OM\Db
haraldpdl May 20, 2015
f4beab0
remove legacy paypal modules
haraldpdl May 21, 2015
2402c89
replace tep_db* with OSC\OM\Db
haraldpdl May 21, 2015
a0ee294
remove legacy functions (database)
haraldpdl May 21, 2015
6d643ba
Shopping Cart with PDO and application_top cart_delete fix
tgely Apr 4, 2015
5ceb9f4
Login with PDO
tgely Apr 4, 2015
2448a40
Password forgotten with PDO
tgely Apr 4, 2015
b20cd5b
product_info PDO
tgely Apr 6, 2015
62a10d0
fix typo
tgely Apr 6, 2015
50bec9d
reviews PDO
tgely Apr 6, 2015
1122b3d
tell_a_friend PDO and code cleaning
tgely Apr 6, 2015
94e32f0
redirect PDO
tgely Apr 6, 2015
f252ee2
code updates
haraldpdl May 21, 2015
ce92371
Merge pull request #351 from haraldpdl/db_class
haraldpdl May 21, 2015
2cf52f4
Merge pull request #352 from haraldpdl/tgely_pdo
haraldpdl May 21, 2015
a611784
new OSCOM base class; add link() function to replace tep_href_link()
haraldpdl Apr 18, 2015
23721a3
replace tep_href_link() with OSCOM::link()
haraldpdl May 21, 2015
75148eb
replace tep_draw_input_field() with HTML::inputField()
haraldpdl May 21, 2015
e39defb
replace tep_draw_password_field() with HTML::passwordField()
haraldpdl May 21, 2015
592782b
replace tep_draw_checkbox_field() and tep_draw_radio_field() with HTM…
haraldpdl May 21, 2015
e1ec2f5
replace tep_draw_textarea_field() with HTML::textareaField()
haraldpdl May 22, 2015
7d29da2
remove legacy $wrap parameter
haraldpdl May 22, 2015
add6213
replace tep_draw_hidden_field() with HTML::hiddenField()
haraldpdl May 22, 2015
d3c7102
replace tep_draw_form() with HTML::form()
haraldpdl May 22, 2015
a42acac
SQL queries with SQL_CALC_FOUND_ROWS automatically call "select found…
haraldpdl May 22, 2015
1c93181
add array parameter to HTML::form() supporting tokenize, adding sessi…
haraldpdl May 22, 2015
c25a67e
replace tep_draw_pull_down_menu() with HTML::selectField(); move tep_…
haraldpdl May 22, 2015
e7c8c32
remove legacy boxes class
haraldpdl May 22, 2015
b7f1e5b
replace tep_draw_button() with HTML::button()
haraldpdl May 22, 2015
9d846d0
replace tep_image() with HTML::image()
haraldpdl May 22, 2015
7c1c8a5
replace tep_draw_stars() with HTML::stars()
haraldpdl May 22, 2015
c3109bb
remove legacy html_output.php functions
haraldpdl May 22, 2015
81bc9b7
Merge pull request #353 from haraldpdl/html_class
haraldpdl May 22, 2015
7237be6
new HTTP class; add redirect() function to replace tep_redirect()
haraldpdl Apr 18, 2015
a38cd6d
code updates
haraldpdl Apr 18, 2015
6294501
code updates
haraldpdl May 22, 2015
a0bf6fa
replace tep_redirect() with OSCOM::redirect() and HTTP::redirect() ..…
haraldpdl May 22, 2015
be51ab5
Merge pull request #354 from haraldpdl/class_updates
haraldpdl May 22, 2015
0fa7a6d
add group support to HTML::selectField()
haraldpdl May 23, 2015
a75118a
new DateTime class to house the new getTimeZones() function
haraldpdl May 23, 2015
bf65674
replace legacy html_output functions with new HTML class
haraldpdl May 23, 2015
c854ffd
Add OSCOM::initialize(); move autoload function to OSCOM
haraldpdl May 23, 2015
6e09cfb
remove legacy functions; add new Hash class for string/password hashing
haraldpdl May 23, 2015
e5d2b6d
Merge pull request #355 from haraldpdl/setup
haraldpdl May 23, 2015
4e4edd2
update with new initialization
haraldpdl May 23, 2015
367bdfc
Merge pull request #356 from haraldpdl/admin_initialization
haraldpdl May 23, 2015
b3fe2c4
Merge commit '3141adf048460555a80b1d8cbfbe8a85983c8a65' into apps
haraldpdl May 23, 2015
163bbea
Merge commit 'd0b19eb8b35ac4ef4713133c6faf047658607e24' into apps
haraldpdl May 23, 2015
01d1606
Merge commit '1cf783e9a5fa6fb9f4b0fd1e5a2cabc6535d2a5a' into apps
haraldpdl May 23, 2015
432b39a
Merge commit '8e6a1c942d6630c0eae79caeb39ccddefdd68772' into apps
haraldpdl May 23, 2015
0bc30ab
Merge commit '71a690e8a50ed17d675ede896c7edd110d5f9f7e' into apps
haraldpdl May 23, 2015
61c9a4d
Merge commit '4436021dbcddbe495bae49c6e0eea35fc3f99ddb' into apps
haraldpdl May 23, 2015
609b44a
add an id to the main tab buttons
haraldpdl Dec 11, 2014
f4d5b7c
update jquery ui logic to bootstrap logic
haraldpdl May 23, 2015
bda6f6d
Merge pull request #357 from haraldpdl/hooks_from_23
haraldpdl May 23, 2015
8a7486e
Return directly lambda function instead to assign it to a variable
acidvertigo Jun 11, 2015
350cd9c
Update check for duplicate category ID removal
acidvertigo Jun 11, 2015
0e6c961
Remove temp_array as it is unneded
acidvertigo Jun 11, 2015
0043ccd
Change with array_flip as it is faster
acidvertigo Jun 11, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 14 additions & 10 deletions catalog/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,30 @@
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2010 osCommerce
Copyright (c) 2015 osCommerce

Released under the GNU General Public License
*/

use OSC\OM\OSCOM;

require('includes/application_top.php');

if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
if (!isset($_SESSION['customer_id'])) {
$_SESSION['navigation']->set_snapshot();
OSCOM::redirect('login.php', '', 'SSL');
}

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT);
require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account.php');

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE, OSCOM::link('account.php', '', 'SSL'));

require(DIR_WS_INCLUDES . 'template_top.php');
require('includes/template_top.php');
?>

<h1><?php echo HEADING_TITLE; ?></h1>
<div class="page-header">
<h1><?php echo HEADING_TITLE; ?></h1>
</div>

<?php
if ($messageStack->size('account') > 0) {
Expand All @@ -41,6 +45,6 @@
</div>

<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
require('includes/template_bottom.php');
require('includes/application_bottom.php');
?>
185 changes: 102 additions & 83 deletions catalog/account_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,32 @@
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2013 osCommerce
Copyright (c) 2015 osCommerce

Released under the GNU General Public License
*/

use OSC\OM\HTML;
use OSC\OM\OSCOM;

require('includes/application_top.php');

if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
if (!isset($_SESSION['customer_id'])) {
$_SESSION['navigation']->set_snapshot();
OSCOM::redirect('login.php', '', 'SSL');
}

// needs to be included earlier to set the success message in the messageStack
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_EDIT);
require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_edit.php');

if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) {
if (ACCOUNT_GENDER == 'true') $gender = HTML::sanitize($_POST['gender']);
$firstname = HTML::sanitize($_POST['firstname']);
$lastname = HTML::sanitize($_POST['lastname']);
if (ACCOUNT_DOB == 'true') $dob = HTML::sanitize($_POST['dob']);
$email_address = HTML::sanitize($_POST['email_address']);
$telephone = HTML::sanitize($_POST['telephone']);
$fax = HTML::sanitize($_POST['fax']);

$error = false;

Expand Down Expand Up @@ -59,21 +62,18 @@
}
}

if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
$error = true;

$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR);
}

if (!tep_validate_email($email_address)) {
$error = true;

$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}

$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . (int)$customer_id . "'");
$check_email = tep_db_fetch_array($check_email_query);
if ($check_email['total'] > 0) {
$Qcheck = $OSCOM_Db->prepare('select customers_id from :table_customers where customers_email_address = :customers_email_address and customers_id != :customers_id limit 1');
$Qcheck->bindValue(':customers_email_address', $email_address);
$Qcheck->bindInt(':customers_id', $_SESSION['customer_id']);
$Qcheck->execute();

if ($Qcheck->fetch() !== false) {
$error = true;

$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
Expand All @@ -95,122 +95,141 @@
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");
$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 = array('entry_firstname' => $firstname,
'entry_lastname' => $lastname);
$sql_data_array = ['entry_firstname' => $firstname,
'entry_lastname' => $lastname];

tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");
$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
$customer_first_name = $firstname;
$_SESSION['customer_first_name'] = $firstname;

$messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');

tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
OSCOM::redirect('account.php', '', 'SSL');
}
}

$account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);
$Qaccount = $OSCOM_Db->prepare('select * from :table_customers where customers_id = :customers_id');
$Qaccount->bindInt(':customers_id', $_SESSION['customer_id']);
$Qaccount->execute();

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_edit.php', '', 'SSL'));

require(DIR_WS_INCLUDES . 'template_top.php');
require('includes/form_check.js.php');
require('includes/template_top.php');
?>

<h1><?php echo HEADING_TITLE; ?></h1>
<div class="page-header">
<h1><?php echo HEADING_TITLE; ?></h1>
</div>

<?php
if ($messageStack->size('account_edit') > 0) {
echo $messageStack->output('account_edit');
}
?>

<?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onsubmit="return check_form(account_edit);"', true) . tep_draw_hidden_field('action', 'process'); ?>
<?php echo HTML::form('account_edit', OSCOM::link('account_edit.php', '', 'SSL'), 'post', 'class="form-horizontal" role="form"', ['tokenize' => true, 'action' => 'process']); ?>

<div class="contentContainer">
<div>
<div class="inputRequirement" style="float: right;"><?php echo FORM_REQUIRED_INFORMATION; ?></div>

<h2><?php echo MY_ACCOUNT_TITLE; ?></h2>
</div>

<div class="contentText">
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<div class="inputRequirement text-right"><?php echo FORM_REQUIRED_INFORMATION; ?></div>

<?php
if (ACCOUNT_GENDER == 'true') {
if (isset($gender)) {
$male = ($gender == 'm') ? true : false;
} else {
$male = ($account['customers_gender'] == 'm') ? true : false;
$male = ($Qaccount->value('customers_gender') == 'm') ? true : false;
}
$female = !$male;
?>

<tr>
<td class="fieldKey"><?php echo ENTRY_GENDER; ?></td>
<td class="fieldValue"><?php echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
</tr>
<div class="form-group has-feedback">
<label class="control-label col-sm-3"><?php echo ENTRY_GENDER; ?></label>
<div class="col-sm-9">
<label class="radio-inline">
<?php echo HTML::radioField('gender', 'm', $male, 'required aria-required="true"') . ' ' . MALE; ?>
</label>
<label class="radio-inline">
<?php echo HTML::radioField('gender', 'f', $female) . ' ' . FEMALE; ?>
</label>
<?php echo FORM_REQUIRED_INPUT; ?>
<?php if (tep_not_null(ENTRY_GENDER_TEXT)) echo '<span class="help-block">' . ENTRY_GENDER_TEXT . '</span>'; ?>
</div>
</div>

<?php
}
?>

<tr>
<td class="fieldKey"><?php echo ENTRY_FIRST_NAME; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_LAST_NAME; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
</tr>
<div class="form-group has-feedback">
<label for="inputFirstName" class="control-label col-sm-3"><?php echo ENTRY_FIRST_NAME; ?></label>
<div class="col-sm-9">
<?php echo HTML::inputField('firstname', $Qaccount->value('customers_firstname'), 'minlength="' . ENTRY_FIRST_NAME_MIN_LENGTH . '" required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME_TEXT . '"'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputLastName" class="control-label col-sm-3"><?php echo ENTRY_LAST_NAME; ?></label>
<div class="col-sm-9">
<?php echo HTML::inputField('lastname', $Qaccount->value('customers_lastname'), 'minlength="' . ENTRY_LAST_NAME_MIN_LENGTH . '" required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME_TEXT . '"'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>

<?php
if (ACCOUNT_DOB == 'true') {
?>

<tr>
<td class="fieldKey"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob']), 'id="dob"') . '&nbsp;' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?><script type="text/javascript">$('#dob').datepicker({dateFormat: '<?php echo JQUERY_DATEPICKER_FORMAT; ?>', changeMonth: true, changeYear: true, yearRange: '-100:+0'});</script></td>
</tr>
<div class="form-group has-feedback">
<label for="inputName" class="control-label col-sm-3"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
<div class="col-sm-9">
<?php echo HTML::inputField('dob', tep_date_short($Qaccount->value('customers_dob')), 'minlength="' . ENTRY_DOB_MIN_LENGTH . '" required aria-required="true" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH_TEXT . '"'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>

<?php
}
?>

<tr>
<td class="fieldKey"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_FAX_NUMBER; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('fax', $account['customers_fax']) . '&nbsp;' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
</tr>
</table>
<div class="form-group has-feedback">
<label for="inputEmail" class="control-label col-sm-3"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
<div class="col-sm-9">
<?php echo HTML::inputField('email_address', $Qaccount->value('customers_email_address'), 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '"', 'email'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
<div class="col-sm-9">
<?php echo HTML::inputField('telephone', $Qaccount->value('customers_telephone'), 'minlength="' . ENTRY_TELEPHONE_MIN_LENGTH . '" required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER_TEXT . '"', 'tel'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
<div class="form-group">
<label for="inputFax" class="control-label col-sm-3"><?php echo ENTRY_FAX_NUMBER; ?></label>
<div class="col-sm-9">
<?php echo HTML::inputField('fax', $Qaccount->value('customers_fax'), 'id="inputFax" placeholder="' . ENTRY_FAX_NUMBER_TEXT . '"'); ?>
</div>
</div>

<br />

<div class="buttonSet">
<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>
<br />

<?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); ?>
<div class="row">
<div class="col-xs-6 text-right pull-right"><?php echo HTML::button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', null, 'primary', null, 'btn-success'); ?></div>
<div class="col-xs-6"><?php echo HTML::button(IMAGE_BUTTON_BACK, 'glyphicon glyphicon-chevron-left', OSCOM::link('account.php', '', 'SSL')); ?></div>
</div>

</div>
</div>

</form>

<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
require('includes/template_bottom.php');
require('includes/application_bottom.php');
?>
Loading