"; $sclResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascResult, SQL_GET_ROW_COUNT, "Look for today's traffic counter"); switch($strWhichCounter) { case "Visitors" : $intNewCount = $ascResult['fldVisitors']; if($strDoWhat == "increment") $intNewCount = $intNewCount + 1; else $intNewCount = $intNewCount - 1; $strSet = "fldVisitors = ".$intNewCount; $strValues = "1,0,0"; break; case "Refunds" : $intNewCount = $ascResult['fldRefunds']; if($strDoWhat == "increment") $intNewCount = $intNewCount + 1; else $intNewCount = $intNewCount - 1; $strSet = "fldRefunds = ".$intNewCount; $strValues = "0,0,1"; break; case "Sales" : $intNewCount = $ascResult['fldSales']; if($strDoWhat == "increment") $intNewCount = $intNewCount + 1; else $intNewCount = $intNewCount - 1; $strSet = "fldSales = ".$intNewCount; $strValues = "0,1,0"; break; } if((!$g_objDB->HasError()) && ($g_objDB->GetRowCount($sclResultID) > 0)) { $strSQL = "UPDATE tblStatistics SET ".$strSet." WHERE fldDate=".$strWhen; //print $strSQL."
"; $g_objDB->ExecuteSQL($strSQL, SQL_VERIFY_UPDATE, &$sclInsertID, "Update traffic Counter"); } elseif($strDoWhat == "increment") { $strSQL = "INSERT INTO tblStatistics (fldDate, fldVisitors, fldSales, fldRefunds) VALUES (".$strWhen.",".$strValues.")"; //print $strSQL."
"; $g_objDB->ExecuteSQL($strSQL, SQL_VERIFY_UPDATE, &$sclInsertID, "Insert today's traffic counter"); } return; } if(!isset($_HTML_HEAD_)) # prevent duplicates { $_HTML_HEAD_ = 1; if(strstr($g_strHomeURL, "view-order.phtml") || strstr($g_strHomeURL, "refund.phtml")) { // Need to make sure pages are not cached header( "Expires: Fri, 01 Sep 2000 00:00:01 GMT" ); header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); header( "Cache-Control: no-cache, must-revalidate" ); header( "Pragma: no-cache" ); } ?> <? print $fldTradeName ?>