MaRiOsGR Posted September 8, 2009 Share Posted September 8, 2009 Hello, is there any way to get an report about whats the income per package ? 0 Quote Link to comment Share on other sites More sharing options...
MaRiOsGR Posted November 3, 2009 Author Share Posted November 3, 2009 no one uses that ? 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted November 3, 2009 Share Posted November 3, 2009 Actually, we've come up with something like that. You can select by date and by package. Save the code below on a php file and drop it on the modules > reports directory. We named ours income_by_product.php. It's not perfect, but it helps. Enjoy. <?php if ($startday=="") { $startday=date("d"); $startmonth=date("m"); $startyear=date("Y"); $endday=date("d"); $endmonth=date("m"); $endyear=date("Y"); } $pmonth = str_pad($month, 2, "0", STR_PAD_LEFT); $reportdata["title"] = "Products query list for $startday/$startmonth/$startyear - $endday/$endmonth/$endyear"; $reportdata["description"] = "Products Per Period"; $reportdata["headertext"] = "<form method=\"post\" action=\"$PHP_SELF?report=$report&calculate=true\"><center>Start Date: "; $reportdata["headertext"] .= "<select name=\"startday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startyear\">"; for ( $counter = 2002; $counter <= 2010; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> End Date: "; $reportdata["headertext"] .= "<select name=\"endday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endyear\">"; for ( $counter = 2006; $counter <= 2010; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <br><br>Services:<br><select name=\"service\">"; $cont1=1; $result3 = mysql_query("SELECT id, name FROM tblproducts"); while ($data3 = mysql_fetch_array($result3)) { if($cont1 == 1){ $reportdata["headertext"] .= "<option value=0>All Services</option>"; $cont1=2; } $name = $data3["name"]; $id = $data3["id"]; $reportdata["headertext"] .= "<option value=$id>$name</option>"; } $reportdata["headertext"] .= "</select> <br /><br /> <input type=\"submit\" value=\"Generate Report\" action='<?php $grandtotal=0; $valor=0;>' \"></form>"; $selectedservice = $_POST["service"]; $startday = str_pad($startday,2,"0",STR_PAD_LEFT); $startmonth = str_pad($startmonth,2,"0",STR_PAD_LEFT); $endday = str_pad($endday,2,"0",STR_PAD_LEFT); $endmonth = str_pad($endmonth,2,"0",STR_PAD_LEFT); $num_rows=0; $startdate = $startyear.$startmonth.$startday; $enddate = $endyear.$endmonth.$endday; $enddate = $enddate."235959"; $query = "SELECT `tblhosting`.*, CONCAT(`tblclients`.`firstname`, ' ', `tblclients`.`lastname`) AS 'fullname' FROM `tblhosting`, `tblclients` WHERE `tblhosting`.`regdate` >='$startdate' AND `tblhosting`.`regdate` <='$enddate' AND `tblclients`.`id` = `tblhosting`.`userid` ORDER BY `tblhosting`.`id` ASC"; $result = mysql_query($query); $grandtotal = 0; $valor = 0; while ($data = mysql_fetch_array($result)) { $id = "<a href=\"orders.php?action=view&id=". $data["id"] ."\" target=\"_blank\"\">". $data["id"] ."</a>"; $client = "<a href=\"clientssummary.php?userid=". $data['userid'] ."\" target=\"_blank\"\">" . $data['fullname'] . "</a>"; $service = $data["packageid"]; $status = $data['domainstatus']; $colour = "<span style='color:"; $query2 = "SELECT name, id FROM tblproducts WHERE id = $service"; $result2 = mysql_query($query2); while ($data2 = mysql_fetch_array($result2)) { $service = $data2["name"]; $serviceid = $data2["id"]; $type = $data2["paytype"]; } switch($status){ case "Active": $colour .= "green"; break; case "Fraud": $colour .= "red"; break; case "Terminated": $colour .= "lightgrey"; break; case "Cancelled": $colour .= "lightgrey"; break; case "Suspended": $colour .= "blue"; break; } $colour .= ";'>"; if($selectedservice == 0){ $result4 = mysql_query("SELECT monthly, annually FROM tblpricing WHERE id = $serviceid "); while ($data4 = mysql_fetch_array($result4)) { if($status == "onetime" or $data4["monthly"] < 0){ if($status == "Active"){$valor = $data4["annually"]; $grandtotal += $valor;} }else{ if($status == "Active"){$valor = $data4["monthly"]; $grandtotal += $valor; } } } $num_rows++; $reportdata["tableheadings"] = array("Order ID","Service","Client","Status"); $reportdata["tablevalues"][] = array($id,$service,$client,$colour . $status . "</span>"); }else{ if($selectedservice == $serviceid){ $result4 = mysql_query("SELECT monthly, annually FROM tblpricing WHERE id = $serviceid "); while ($data4 = mysql_fetch_array($result4)) { if($status == "onetime" or $data4["monthly"] < 0){ if($status == "Active"){$valor = $data4["annually"]; $grandtotal += $valor;} }else{ if($status == "Active"){$valor = $data4["monthly"]; $grandtotal += $valor; } } } $num_rows++; $reportdata["tableheadings"] = array("Order ID","Service","Client","Status"); $reportdata["tablevalues"][] = array($id,$service,$client,$colour . $status . "</span>"); } } } $reportdata["headertext"] .= "<p>Total number of Products: $num_rows </p>"; $reportdata["headertext"] .= "<p>Total: R$ $grandtotal</p>"; $data['footertext'] = "<p style=\"text-align:center\"><span style=\"font-size:2em; margin:10px auto; font-weight:bold;\">Total: R$ $grandtotal </span><table width=90% align=center><tr><td>"; $data["footertext"].="</td></tr></table>"; ?> 0 Quote Link to comment Share on other sites More sharing options...
bhavicp Posted November 4, 2009 Share Posted November 4, 2009 Wow, Pretty awesome. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted November 4, 2009 WHMCS Support Manager Share Posted November 4, 2009 That's cool. If you could use the installation's currency symbol instead of hardcoding $, that would definitely be worth uploading to http://whmcs.com/members/communityaddons.php 0 Quote Link to comment Share on other sites More sharing options...
MaRiOsGR Posted November 4, 2009 Author Share Posted November 4, 2009 First of all thank you for the code. I dont know what I am doing wrong, I'm going to the Reports menu and I see this: ".Income By Product.Swp" I press on that and I see the page: No Data for the Report Report Generated on 04/11/2009 13:50 any help? Actually, we've come up with something like that. You can select by date and by package.Save the code below on a php file and drop it on the modules > reports directory. We named ours income_by_product.php. It's not perfect, but it helps. Enjoy. <?php if ($startday=="") { $startday=date("d"); $startmonth=date("m"); $startyear=date("Y"); $endday=date("d"); $endmonth=date("m"); $endyear=date("Y"); } $pmonth = str_pad($month, 2, "0", STR_PAD_LEFT); $reportdata["title"] = "Products query list for $startday/$startmonth/$startyear - $endday/$endmonth/$endyear"; $reportdata["description"] = "Products Per Period"; $reportdata["headertext"] = "<form method=\"post\" action=\"$PHP_SELF?report=$report&calculate=true\"><center>Start Date: "; $reportdata["headertext"] .= "<select name=\"startday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startyear\">"; for ( $counter = 2002; $counter <= 2010; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> End Date: "; $reportdata["headertext"] .= "<select name=\"endday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endyear\">"; for ( $counter = 2006; $counter <= 2010; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <br><br>Services:<br><select name=\"service\">"; $cont1=1; $result3 = mysql_query("SELECT id, name FROM tblproducts"); while ($data3 = mysql_fetch_array($result3)) { if($cont1 == 1){ $reportdata["headertext"] .= "<option value=0>All Services</option>"; $cont1=2; } $name = $data3["name"]; $id = $data3["id"]; $reportdata["headertext"] .= "<option value=$id>$name</option>"; } $reportdata["headertext"] .= "</select> <br /><br /> <input type=\"submit\" value=\"Generate Report\" action='<?php $grandtotal=0; $valor=0;>' \"></form>"; $selectedservice = $_POST["service"]; $startday = str_pad($startday,2,"0",STR_PAD_LEFT); $startmonth = str_pad($startmonth,2,"0",STR_PAD_LEFT); $endday = str_pad($endday,2,"0",STR_PAD_LEFT); $endmonth = str_pad($endmonth,2,"0",STR_PAD_LEFT); $num_rows=0; $startdate = $startyear.$startmonth.$startday; $enddate = $endyear.$endmonth.$endday; $enddate = $enddate."235959"; $query = "SELECT `tblhosting`.*, CONCAT(`tblclients`.`firstname`, ' ', `tblclients`.`lastname`) AS 'fullname' FROM `tblhosting`, `tblclients` WHERE `tblhosting`.`regdate` >='$startdate' AND `tblhosting`.`regdate` <='$enddate' AND `tblclients`.`id` = `tblhosting`.`userid` ORDER BY `tblhosting`.`id` ASC"; $result = mysql_query($query); $grandtotal = 0; $valor = 0; while ($data = mysql_fetch_array($result)) { $id = "<a href=\"orders.php?action=view&id=". $data["id"] ."\" target=\"_blank\"\">". $data["id"] ."</a>"; $client = "<a href=\"clientssummary.php?userid=". $data['userid'] ."\" target=\"_blank\"\">" . $data['fullname'] . "</a>"; $service = $data["packageid"]; $status = $data['domainstatus']; $colour = "<span style='color:"; $query2 = "SELECT name, id FROM tblproducts WHERE id = $service"; $result2 = mysql_query($query2); while ($data2 = mysql_fetch_array($result2)) { $service = $data2["name"]; $serviceid = $data2["id"]; $type = $data2["paytype"]; } switch($status){ case "Active": $colour .= "green"; break; case "Fraud": $colour .= "red"; break; case "Terminated": $colour .= "lightgrey"; break; case "Cancelled": $colour .= "lightgrey"; break; case "Suspended": $colour .= "blue"; break; } $colour .= ";'>"; if($selectedservice == 0){ $result4 = mysql_query("SELECT monthly, annually FROM tblpricing WHERE id = $serviceid "); while ($data4 = mysql_fetch_array($result4)) { if($status == "onetime" or $data4["monthly"] < 0){ if($status == "Active"){$valor = $data4["annually"]; $grandtotal += $valor;} }else{ if($status == "Active"){$valor = $data4["monthly"]; $grandtotal += $valor; } } } $num_rows++; $reportdata["tableheadings"] = array("Order ID","Service","Client","Status"); $reportdata["tablevalues"][] = array($id,$service,$client,$colour . $status . "</span>"); }else{ if($selectedservice == $serviceid){ $result4 = mysql_query("SELECT monthly, annually FROM tblpricing WHERE id = $serviceid "); while ($data4 = mysql_fetch_array($result4)) { if($status == "onetime" or $data4["monthly"] < 0){ if($status == "Active"){$valor = $data4["annually"]; $grandtotal += $valor;} }else{ if($status == "Active"){$valor = $data4["monthly"]; $grandtotal += $valor; } } } $num_rows++; $reportdata["tableheadings"] = array("Order ID","Service","Client","Status"); $reportdata["tablevalues"][] = array($id,$service,$client,$colour . $status . "</span>"); } } } $reportdata["headertext"] .= "<p>Total number of Products: $num_rows </p>"; $reportdata["headertext"] .= "<p>Total: R$ $grandtotal</p>"; $data['footertext'] = "<p style=\"text-align:center\"><span style=\"font-size:2em; margin:10px auto; font-weight:bold;\">Total: R$ $grandtotal </span><table width=90% align=center><tr><td>"; $data["footertext"].="</td></tr></table>"; ?> 0 Quote Link to comment Share on other sites More sharing options...
MaRiOsGR Posted November 4, 2009 Author Share Posted November 4, 2009 Sorry, I was stupid, I had the php file open with vi thats why whcms saw the swap text file and thus the extention .swp. Now it works fine. How can I change the $ to € ;; First of all thank you for the code. I dont know what I am doing wrong, I'm going to the Reports menu and I see this: ".Income By Product.Swp" I press on that and I see the page: No Data for the Report Report Generated on 04/11/2009 13:50 any help? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted November 4, 2009 WHMCS Support Manager Share Posted November 4, 2009 Find: $reportdata["headertext"] .= "<p>Total: R$ $grandtotal</p>"; Replace with: $reportdata["headertext"] .= "<p>Total: € $grandtotal</p>"; ...should do the trick. 0 Quote Link to comment Share on other sites More sharing options...
MaRiOsGR Posted November 4, 2009 Author Share Posted November 4, 2009 Find: $reportdata["headertext"] .= "<p>Total: R$ $grandtotal</p>"; Replace with: $reportdata["headertext"] .= "<p>Total: € $grandtotal</p>"; ...should do the trick. also this line: $data['footertext'] = "<p style=\"text-align:center\"><span style=\"font-size:2em; margin:10px auto; font-weight:bold;\">Total: R$ $grandtotal </span><table width=90% align=center><tr><td>"; $data["footertext"].="</td></tr></table>"; My problem is that it shows: Total number of Products: 27 Total: € 134.73 each package costs 57€/year, how come I only see 134.73 € for 27 packages? 0 Quote Link to comment Share on other sites More sharing options...
aXeR Posted November 9, 2009 Share Posted November 9, 2009 Thanks for this, I think the income may be a little inaccurate but at least I can easily and quickly identify who is using what package now EDIT: Is anyone else whose using this get this error when they click on some of the order links 'Order not found... Exiting...' 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted November 9, 2009 Share Posted November 9, 2009 Thanks for this, I think the income may be a little inaccurate but at least I can easily and quickly identify who is using what package now EDIT: Is anyone else whose using this get this error when they click on some of the order links 'Order not found... Exiting...' Like I said, it's not perfect, it's really not that accurate, but it can give us a good idea of who's using what and the global income. I'm not getting that error you mentioned. Does the order still exists on your system? 0 Quote Link to comment Share on other sites More sharing options...
aXeR Posted November 9, 2009 Share Posted November 9, 2009 They do but under a different number which is slightly odd? 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted November 9, 2009 Share Posted November 9, 2009 mm.... weird. Maybe it needs to be adjusted for your system? I'm sorry, I'm no programmer I really don't know how to fix this. It's working fine for me. 0 Quote Link to comment Share on other sites More sharing options...
Methinks Posted November 22, 2009 Share Posted November 22, 2009 Ok I have two problems that I am sure no one else is having or I would have seen a post LOL 1. The info does not show up in a table but rather one long string just after the generate button. 2. There is no info showing up for money it just shows $0 any ideas? Jeff 0 Quote Link to comment Share on other sites More sharing options...
dutchnet Posted November 26, 2009 Share Posted November 26, 2009 (edited) Hi, nice script, but I made some minor adjustments to get the generated data in a proper table <?php if ($startday=="") { $startday=date("d"); $startmonth=date("m"); $startyear=date("Y"); $endday=date("d"); $endmonth=date("m"); $endyear=date("Y"); } $pmonth = str_pad($month, 2, "0", STR_PAD_LEFT); $reportdata["title"] = "Products query list for $startday/$startmonth/$startyear - $endday/$endmonth/$endyear"; $reportdata["description"] = "Products Per Period"; $reportdata["headertext"] = "<form method=\"post\" action=\"$PHP_SELF?report=$report&calculate=true\"><center>Start Date: "; $reportdata["headertext"] .= "<select name=\"startday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startyear\">"; for ( $counter = 2002; $counter <= 2010; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> End Date: "; $reportdata["headertext"] .= "<select name=\"endday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endyear\">"; for ( $counter = 2002; $counter <= 2010; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <br><br>Services:<br><select name=\"service\">"; $cont1=1; $result3 = mysql_query("SELECT id, name FROM tblproducts"); while ($data3 = mysql_fetch_array($result3)) { if($cont1 == 1){ $reportdata["headertext"] .= "<option value=0>All Services</option>"; $cont1=2; } $name = $data3["name"]; $id = $data3["id"]; $reportdata["headertext"] .= "<option value=$id>$name</option>"; } $reportdata["headertext"] .= "</select> <input type=\"submit\" value=\"Generate Report\"></form>"; $selectedservice = $_POST["service"]; $startday = str_pad($startday,2,"0",STR_PAD_LEFT); $startmonth = str_pad($startmonth,2,"0",STR_PAD_LEFT); $endday = str_pad($endday,2,"0",STR_PAD_LEFT); $endmonth = str_pad($endmonth,2,"0",STR_PAD_LEFT); $num_rows=0; $startdate = $startyear.$startmonth.$startday; $enddate = $endyear.$endmonth.$endday; $enddate = $enddate."235959"; $reportdata["tableheadings"] = array("Order ID","Product/Service","Client","Value","Status"); $query = "SELECT `tblhosting`.*, CONCAT(`tblclients`.`firstname`, ' ', `tblclients`.`lastname`) AS 'fullname' FROM `tblhosting`, `tblclients` WHERE `tblhosting`.`regdate` >='$startdate' AND `tblhosting`.`regdate` <='$enddate' AND `tblclients`.`id` = `tblhosting`.`userid` ORDER BY `tblhosting`.`id` ASC"; $result = mysql_query($query); $grandtotal = 0; $valor = 0; while ($data = mysql_fetch_array($result)) { $id = "<a href=\"orders.php?action=view&id=". $data["id"] ."\" target=\"_blank\"\">". $data["id"] ."</a>"; $client = "<a href=\"clientssummary.php?userid=". $data['userid'] ."\" target=\"_blank\"\">" . $data['fullname'] . "</a>"; $service = $data["packageid"]; $status = $data['domainstatus']; $colour = "<span style='color:"; $query2 = "SELECT name, id FROM tblproducts WHERE id = $service"; $result2 = mysql_query($query2); while ($data2 = mysql_fetch_array($result2)) { $service = $data2["name"]; $serviceid = $data2["id"]; $type = $data2["paytype"]; } switch($status) { case "Active": $colour .= "green"; break; case "Fraud": $colour .= "red"; break; case "Terminated": $colour .= "lightgrey"; break; case "Cancelled": $colour .= "lightgrey"; break; case "Suspended": $colour .= "blue"; break; } $colour .= ";'>"; if($selectedservice == 0) { $result4 = mysql_query("SELECT monthly, annually FROM tblpricing WHERE id = $serviceid "); while ($data4 = mysql_fetch_array($result4)) { if($status == "onetime" or $data4["monthly"] < 0) { if($status == "Active") { $valor = $data4["monthly"]; $grandtotal += $valor; } }else{ if($status == "Active") { $valor = $data4["annually"]; $grandtotal += $valor; } } } $num_rows++; $reportdata["tablevalues"][] = array($id,$service,$client,$valor,$colour .$status . "</span><br />"); } else { if($selectedservice == $serviceid) { $result4 = mysql_query("SELECT monthly, annually FROM tblpricing WHERE id = $serviceid "); while ($data4 = mysql_fetch_array($result4)) { if($status == "onetime" or $data4["monthly"] < 0) { if($status == "Active") { $valor = $data4["monthly"]; $grandtotal += $valor;} }else { if($status == "Active") { $valor = $data4["annually"]; $grandtotal += $valor; } } } $num_rows++; $reportdata["tablevalues"][] = array($id,$service,$client,$valor,$colour .$status . "</span><br />"); } } } $reportdata["headertext"] .= "<p>Total number of Products: $num_rows </p>"; $reportdata["headertext"] .= "<p>Total: ". formatCurrency($grandtotal) . "</p>"; $data['footertext'] = "<p style=\"text-align:center\"><span style=\"font-size:2em; margin:10px auto; font-weight:bold;\">Total:" . formatCurrency($grandtotal) . "</span><table width=90% align=center><tr><td>"; $data["footertext"].="</td></tr></table>"; ?> Edited November 26, 2009 by dutchnet Values with all products selected is not yet correct :( 0 Quote Link to comment Share on other sites More sharing options...
Methinks Posted November 26, 2009 Share Posted November 26, 2009 I also made a change or two. I can never understand the day,month,year format so I switched it to Month,Day,Year and added a few more years so I wont have to fix it next year . Now if I could just get the values to show up Replace this code } $pmonth = str_pad($month, 2, "0", STR_PAD_LEFT); $reportdata["title"] = "Products query list for $startmonth/$startday/$startyear - $endmonth/$endday/$endyear"; $reportdata["description"] = "Products Per Period"; $reportdata["headertext"] = "<form method=\"post\" action=\"$PHP_SELF?report=$report&calculate=true\"><center>Start Date: "; $reportdata["headertext"] .= "<select name=\"startmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"startyear\">"; for ( $counter = 2002; $counter <= 2015; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$startyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> End Date: "; $reportdata["headertext"] .= "<select name=\"endmonth\">"; for ( $counter = 1; $counter <= 12; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endday) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endday\">"; for ( $counter = 1; $counter <= 31; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endmonth) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } $reportdata["headertext"] .= "</select> <select name=\"endyear\">"; for ( $counter = 2002; $counter <= 2015; $counter += 1) { $reportdata["headertext"] .= "<option"; if ($counter==$endyear) { $reportdata["headertext"] .= " selected"; } $reportdata["headertext"] .= ">$counter"; } 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.