Jump to content

Income by package?


MaRiOsGR

Recommended Posts

  • 1 month later...

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>";

?>

Link to comment
Share on other sites

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>";

?>

Link to comment
Share on other sites

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? :(

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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...'

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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 by dutchnet
Values with all products selected is not yet correct :(
Link to comment
Share on other sites

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";
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated