cgiles
07-21-2004, 07:41 PM
Ok. I've got this cart called html-cart. It's doing exactly what I want it to do, except when I get an order it goes into an "order" file... I can see the orders by order number and the date.
The date is what's getting me. When I get an order on let's say the date of 7/1, 7/2, 7/3 - all the way up to 7/9. On 7/10 the orders will go out of whack with 7/10 being under 7/1...
this happens because there is no 0 (zero) before the 1 on 7/1. If it looked like 7/01, then the orders would stay in order so to speak.
:)
The coding is looking like this:
sub process_order
{
local ($new_control);
$order_number = time;
$encrypt_text = "$SUBTOTAL, $SHIPPING, $SALESTAX, $GRANDTOTAL";
$new_control = &hmac_hex($encrypt_text, $encrypt_key);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
if ($hour < 10){$hour = "0$hour";}
if ($min < 10){$min = "0$min";}
if ($sec < 10){$sec = "0$sec";}
$year += 1900;
$mon++;
$date = "$mon\/$mday\/$year at $hour\:$min\:$sec";
$ord_data .= "Date: $date\n";
$ord_data .= "Order Number: $order_number\n\n";
________________________________________________-
I may be wrong, but the sniplet of code that's
$order_number = time;
is telling the folder to put the order by way of "time" from the server that it's taken...???
If so, can I change time to .... well now that I think about it I might be all wrong... I don't know... any help on this at all? Thanks in advance...
The date is what's getting me. When I get an order on let's say the date of 7/1, 7/2, 7/3 - all the way up to 7/9. On 7/10 the orders will go out of whack with 7/10 being under 7/1...
this happens because there is no 0 (zero) before the 1 on 7/1. If it looked like 7/01, then the orders would stay in order so to speak.
:)
The coding is looking like this:
sub process_order
{
local ($new_control);
$order_number = time;
$encrypt_text = "$SUBTOTAL, $SHIPPING, $SALESTAX, $GRANDTOTAL";
$new_control = &hmac_hex($encrypt_text, $encrypt_key);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
if ($hour < 10){$hour = "0$hour";}
if ($min < 10){$min = "0$min";}
if ($sec < 10){$sec = "0$sec";}
$year += 1900;
$mon++;
$date = "$mon\/$mday\/$year at $hour\:$min\:$sec";
$ord_data .= "Date: $date\n";
$ord_data .= "Order Number: $order_number\n\n";
________________________________________________-
I may be wrong, but the sniplet of code that's
$order_number = time;
is telling the folder to put the order by way of "time" from the server that it's taken...???
If so, can I change time to .... well now that I think about it I might be all wrong... I don't know... any help on this at all? Thanks in advance...