add 6 hours to Simply Caddy - Joomla! Forum - community, help and support
hi
how make server offset on +6 hours on php file in comp. caddy.
my clients mail says 05.30, has 11.30 instead.
it "mktime" in file
i totallly lost in f...... server offset time.
how make server offset on +6 hours on php file in comp. caddy.
my clients mail says 05.30, has 11.30 instead.
it "mktime" in file
code: select all
function checkout() {
global $database;
//create order info
$o=new mosdbtable("#__sc_orders", "id", $database);
$o->id=null;
$o->name=stripslashes(mosgetparam($_request, 'edtname', 'name error'));
$o->email=mosgetparam($_request, 'edtemail', 'email error');
$o->address=mosgetparam($_request, 'edtaddress', 'address error');
$o->codepostal=mosgetparam($_request, 'edtcodepostal', 'cp error');
$o->city=stripslashes(mosgetparam($_request, 'edtcity', 'city error'));
$o->orderdt=mktime ();
$o->telephone=mosgetparam($_request, 'edtphone', 'phone error');
$database->insertobject("#__sc_orders", $o);
echo $database->geterrormsg();
$orderid=$database->insertid();
$tmp=array();
$tmp=$_cookie["simplecaddy"];
$gtotal=0;
if (!$tmp) return;
//create order details cookie
foreach ($tmp $key=>$value) {
$caddy=array();
$caddy=explode(",", $value);
// caddy 0 = code product
// caddy 1 = quantity
// caddy 2 = shorttext
// caddy 3 = unitprice
$odet=new mosdbtable("#__sc_odetails", "id", $database);
$odet->id=null;
$odet->orderid=$orderid;
$odet->prodcode=$caddy[0];
$odet->qty=$caddy[1];
$odet->unitprice=$caddy[3];
$odet->total=$caddy[1]*$caddy[3];
$odet->shorttext=$caddy[2];
$gtotal=$gtotal+($caddy[1]*$caddy[3]);
$database->insertobject("#__sc_odetails", $odet);
}
//update order grand total
$o->total=$gtotal;
$o->id=$orderid;
$database->updateobject("#__sc_orders", $o, "id");
// destroy cookie
foreach ($tmp $key=>$value) {
setcookie("simplecaddy[".$key."]", "", time()-1500);
}
return $orderid;
}
function mailorder($id) {
global $database, $mosconfig_mailfrom, $mosconfig_fromname;
$query="select #__sc_orders.*, #__sc_odetails.* #__sc_orders, #__sc_odetails #__sc_orders.id='$id' , #__sc_odetails.orderid='$id'";
$database->setquery($query);
$lst=$database->loadobjectlist();
echo $database->geterrormsg();
$html = "";
if ($lst) {
$m=$lst[0];
$html .= "<p>hej $m->name !</p>";
$html .= "<table width='100%' border='1'>\n";
$html .= "<tr><td>ordre fra uf</td></tr>\n";
$html .= "<tr><td>".date("d-m-y h:i:s", $m->orderdt)."</td></tr>\n";
$html .= "<tr><td>$m->name</td></tr>\n";
$html .= "<tr><td>".nl2br($m->address)."</td></tr>\n";
$html .= "<tr><td>$m->codepostal</td></tr>\n";
$html .= "<tr><td>$m->city</td></tr>\n";
$html .= "<tr><td>$m->telephone</td></tr>\n";
$html .= "<tr><td>$m->email</td></tr>\n";
$html .= "<tr><td> </td></tr>\n";
$html .= "</table>\n";
$html .= "<p>";
$html .= "<table width='100%' border='1'>\n";
foreach ($lst $det) {
$html .= "<tr><td>$det->prodcode</td>\n";
$html .= "<td>$det->shorttext</td>\n";
$html .= "<td>".number_format($det->unitprice, 2, ',', ' ')."</td>\n";
$html .= "<td>$det->qty</td>\n";
$html .= "<td><strong>".number_format($det->qty*$det->unitprice, 2, ',', ' ')."</strong></td>\n";
}
$html .= "</table>\n";
$html .= "</p>";
}
$emailsubject=_sc_order." "._sc_for.number_format($m->total, 2, ',', ' ')._sc_from.$m->name;
$emailbody=$html;
//------------vv site email-----------vv site name-------vv--> change vendor's personal email
$n=mosmail($mosconfig_mailfrom, $mosconfig_fromname, $m->email, $emailsubject, $emailbody, 1); //, $mosconfig_mailfrom, '', '', $replytomail);
$n=mosmail($mosconfig_mailfrom, $mosconfig_fromname, $mosconfig_mailfrom, $emailsubject, $emailbody, 1); //, $mosconfig_mailfrom, '', '', $replytomail);
//printf("<p>my email '%s' <br>my username '%s' <br>user's email '%s' <br>email subject '%s' <br>email body %s</p>",$mosconfig_mailfrom, $mosconfig_fromname, $m->email, $emailsubject, $emailbody);
}
}
i totallly lost in f...... server offset time.
Comments
Post a Comment