uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
Date and Time

Knowledge Base Lobby : uShop Support Conference : General Questions
Dec-16-17 02:24 AM EST
Original Message
Date and Time
Author ronharter on 05-13-2000 at 16:17 (EST)
Is there a way to add the date and time or at least the date to an order? This should be done automatically not so the customer has to add it.

I maintain two sites that use Ushop
http://www.alltronics.com
http://www.excess-solutions.com
Thanks
Ron Harter
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  date Charlie Edmunds, 2000-05-13 20:18:32 (1)
  RE: Date and Time Bill Weiner, 2000-05-18 06:34:31 (2)
  Date and Time ronharter, 2000-05-20 22:09:39 (3)
            Date and Time ronharter, 2000-05-21 09:55:46 (4)
                 RE: Date and Time Bill Weiner, 2000-05-21 19:09:56 (5)

Messages In This Discussion
         1. date
        Author Charlie Edmunds on 05-13-2000 at 20:18 (EST)
ronharter,

I've never tried but there is a "message" parameter in the uShopOrder.class applet that you may be able to use a javascript date function with.

Thanks, Charlie Edmunds
TABLE OF CONTENTS
         2. RE: Date and Time
        Author Bill Weiner on 05-18-2000 at 06:34 (EST)
Note that right now, the date can be attained by looking at the time/date of the email receipt / email notification.

However, if you want to actually add the date to the order file, then that is not configurable at this time, but we will be adding that feature to the next release.

In the mean time, however, if you feel comfortable about editing Perl scripts, then you can make the following changes to the ushop_cgiscript to insert the date for you:

1) Open the ushop_cgiscript.pl file with any text editor such as WordPad.

2) Do a search on "sub write_data"...this will get you to the first line of the "write data" subroutine.

3) Directly after the line:

local ($file_name, $order_data) = @_;

Add the following lines to define some new local variables:

# Define local variables.
local (
$sec,
$min,
$hour,
$mday,
$mon,
$year,
$wday,
$yday,
$isdst,
$formatted_date);

4) Below those lines, add the following lines to get the current time/date:

# Get the date and time.
($sec,
$min,
$hour,
$mday,
$mon,
$year,
$wday,
$yday,
$isdst) = localtime();

5) Below those lines, add the following lines to correct the Y2K date problem that exists on some servers:

# Y2K FIX - Because some servers
# return the year 2000 as 100
# instead of 00.
if ($year > 99)
{
$year = $year - 100;
}

6) Below those lines, add the following lines to format the date:

$formatted_date =
sprintf("%02d/%02d/%02d 02d:%02d",
$mon+1,
$mday,
$year,
$hour,
$min);

7) And finally, write this formatted date to the file by adding the following line directly BEFORE the line that says:

# Write the data to the file.

That is, add this line:

print FILE $formatted_date . "n";

8) Save the file and try it out.
TABLE OF CONTENTS
         3. Date and Time
        Author ronharter on 05-20-2000 at 22:09 (EST)
Thanks a lot.
The script patch worked just fine.

Ron Harter
TABLE OF CONTENTS
                 4. Date and Time
                Author ronharter on 05-21-2000 at 09:55 (EST)
The date and time additions to the cgi script work fine except there is a minor error in one of the lines.
The line that says:

sprintf("%02d/%02d/%02d 02d:%02d",

Should be:

sprintf("%02d/%02d/%02d %02d:%02d",

The fourth % was left out and it will actually print 02d as the hour without it.

Other than that it worked really well, and my boss is even happier than I am.

Ron Harter
TABLE OF CONTENTS
                         5. RE: Date and Time
                        Author Bill Weiner on 05-21-2000 at 19:09 (EST)
Good catch! Thanks.
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.