473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

SQL Update help - OsCommerce related

I am trying to integrate a Credit Card # deletion option into
Batch_print_center and need some help.

Batch_print_center has a form where you specify orders you want to
print or proccess by either entering in a range(ie, 3-9), a comma
separated list(ie, 3,4,5,6) or a range by start and end date(ie,
yyyy-MM-dd - yyyy-MM-dd)which is a javascript calendar widget.
Date_purchased is stored in the DB as 2005-04-12 13:19:13.

This first condition works if a range or comma separated list is
given, but the second start/end date range does not. I believe the
time stamp is not being added successfully.

// Clear Credit Card
if(($HTTP_POST_VARS['clear_CC'] == 'on') && ($invoicenumbers != '')) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = ''
where orders_id in (" . tep_db_input($invoicenumbers) . ") ");
} elseif (($HTTP_POST_VARS['clear_CC'] == 'on') &&
(isset($HTTP_POST_VARS['startdate'])) &&
(!isset($HTTP_POST_VARS['enddate']))) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = '' where
date_purchased between '" . $HTTP_POST_VARS['startdate'] . "' and '" .
$HTTP_POST_VARS['enddate'] . "23:59:59");
}
//

Any ideas?
TIA
"These animals evacuate ethyl alcohol from their bowels and carbon dioxide from their urinary organs. Thus, one can observe how a specially lighter fluid is exuded from the anus and rises vertically whereas a stream of carbon dioxide is ejected at very short intervals from enormously long genitales."

Justus Freiherr von Liebig - 1839
Jul 17 '05 #1
1 1792
Obviously no one cares and/or knew, but I figured out my problem.
Initially I had an errant ! that I didnt see which made the elseif
condition never true. Then there was a syntax problem when the query
encountered the colons. A few odd single quotes Here's the working
code:

// Clear Credit Card
if(($HTTP_POST_VARS['clear_CC'] == 'on') && ($invoicenumbers != '')) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = ''
where orders_id in (" . tep_db_input($invoicenumbers) . ") ");
} elseif (($HTTP_POST_VARS['clear_CC'] == 'on') &&
(isset($HTTP_POST_VARS['startdate'])) &&
(isset($HTTP_POST_VARS['enddate']))) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = '' where
date_purchased between '" . tep_db_input($startdate) . "' and '" .
tep_db_input($enddate) . "23:59:59'");
}
//

On Wed, 13 Apr 2005 14:22:04 -0600, MattMika
<rotaourATdimcomDEEOHTEEnet> wrote:
I am trying to integrate a Credit Card # deletion option into
Batch_print_center and need some help.

Batch_print_center has a form where you specify orders you want to
print or proccess by either entering in a range(ie, 3-9), a comma
separated list(ie, 3,4,5,6) or a range by start and end date(ie,
yyyy-MM-dd - yyyy-MM-dd)which is a javascript calendar widget.
Date_purchased is stored in the DB as 2005-04-12 13:19:13.

This first condition works if a range or comma separated list is
given, but the second start/end date range does not. I believe the
time stamp is not being added successfully.

// Clear Credit Card
if(($HTTP_POST_VARS['clear_CC'] == 'on') && ($invoicenumbers != '')) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = ''
where orders_id in (" . tep_db_input($invoicenumbers) . ") ");
} elseif (($HTTP_POST_VARS['clear_CC'] == 'on') &&
(isset($HTTP_POST_VARS['startdate'])) &&
(!isset($HTTP_POST_VARS['enddate']))) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = '' where
date_purchased between '" . $HTTP_POST_VARS['startdate'] . "' and '" .
$HTTP_POST_VARS['enddate'] . "23:59:59");
}
//

Any ideas?
TIA
"These animals evacuate ethyl alcohol from their bowels and carbon dioxide from their urinary organs. Thus, one can observe how a specially lighter fluid is exuded from the anus and rises vertically whereas a stream of carbon dioxide is ejected at very short intervals from enormously long genitales."

Justus Freiherr von Liebig - 1839


"These animals evacuate ethyl alcohol from their bowels and carbon dioxide from their urinary organs. Thus, one can observe how a specially lighter fluid is exuded from the anus and rises vertically whereas a stream of carbon dioxide is ejected at very short intervals from enormously long genitales."

Justus Freiherr von Liebig - 1839
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Chris Hope | last post by:
Anyone know of any decent PHP/MySQL OSS ecommerce packages other than osCommerce and ZenCart? From what I've seen of ZenCart it just appears to be a fork of osCommerce and having now set a site up...
1
by: 3070 | last post by:
hi all i have a question.... can anyone recommend zencart over oscommerce? is it just as stable? (i prefer the look and feel options of zen cart) also, how does one go about updating both...
3
by: Justin Koivisto | last post by:
OK, here's one of the rare times where I call out to all of you. ;) I need to implement a promotional discount code module into osCommerce 2.2 Milestone 2. I've never created an OSC module...
2
by: Angie | last post by:
Hello everybody, I have an osCommerce shopping cart on my site, which is an open-source product that uses php. I'm very new to php. I also have an online scheduling application that I outsourced...
6
by: Steven Kalcevich | last post by:
Hi all. I am working on finishing an oscommerce based site and need some help. One page is listing in 1 column 6 down, I wish to have a layout of 4 across and 5 down. When there is more then 20...
4
by: opensourcearts | last post by:
Hello all, I am working on an application that is basically a bridge between oscommerce and gallery2 software, with some other functionality. It will allow users to port all of their media...
0
by: Kshipra | last post by:
In this era of growing Internet usage, e-commerce has started to grab a big share of the market. The title helps the readers understand how they can earn their share of money from the growing...
1
by: solarissa | last post by:
Hello, What am I doing wrong ? this code doesn't work in a oscommerce site. Please help me have a look and tell me the problem. The code: <SCRIPT TYPE="text/javascript"> function battery_size()...
4
by: Bala | last post by:
Hi Experts, How to resolve this osCommerce issues? for the past couple of days, its irritating me like anything. well as i run on my local pc it works fine. my local pc configuration is ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.