laszlof Posted August 29, 2010 Share Posted August 29, 2010 Heres a little code you can add to your sales by product report in order to show domain options. (like ID Protection, DNS Management, Email Forwarding) Open up modules/reports/sales_by_product.php in your favorite editor and locate the following line: $total = formatCurrency($total); Directly ABOVE this line, add the following code: $reportdata["tablevalues"][] = array("**<b>Domain Addons</b>"); $result = select_query("tblpricing", "msetupfee, qsetupfee, ssetupfee", array("type"=>"domainaddons")); $data = mysql_fetch_array($result); $dnsmanagement = $data[0]; $emailforwarding = $data[1]; $idprotection = $data[2]; $domaddons = array("DNS Management"=>"dnsmanagement,$dnsmanagement", "Email Forwarding"=>"emailforwarding,$emailforwarding", "ID Protection"=>"idprotection,$idprotection"); foreach ($domaddons as $addname => $addkey) { $mykey = explode(",", $addkey); $keyval = $mykey[0]; $keyamount = $mykey[1]; $data = select_query("tbldomains", "SUM($keyval)","status='Active' AND registrationdate LIKE '$year-$pmonth%'"); $result = mysql_fetch_array($data); $count = $result[0]; $amount = $count*$keyamount; $total += $amount; $amount = formatCurrency($amount); $reportdata["tablevalues"][] = array($addname, $count, $amount); $prevgroup = $group; } Hope this is helpful to someone. Cheers. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.