Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Looking for a simple sales report mod


HSMagic

Recommended Posts

I have Contrib "Sales between two dates" and is nice for a report, but I want the output to be able to cut/paste to Excel.

 

A great contrib with the output I'm looking for is Stock View. The entire code (a few mods by me) is below.

 

How can I use similar code to pull a report that contains order information. All I really want is Order ID, Customer Name, and Order Total.

 

Any Help is appreciated!

 

<?php
/*
 $Id: stockview.php,v 1.00 2005/03/07

 osCommerce Simple StockViewer

 Contribution based on:

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 - 2005 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<head>
<body>
<table width="700" class="infoBoxContents">
<tr>
<td colspan="2" class="infoBoxHeading" align="center">osCommerce StockView Version 1.0. </td>
</tr>
<?
echo "<tr><td><b>". 'Products ID' . "</b></td><td><b>" . 'Products Name' . "</b></td> <td><b>" . 'Products Model' . "</b></td> <td><b>" . 'Products Status' . "</b></td><td><b>". 'Stock Quantity ' . "</b></td><td><b>". 'Wholesale Cost ' ."</b></td> </tr><tr>";
$result = mysql_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id and products_description.language_id = '" . $languages_id . "' ORDER BY products_description.products_name");
if ($row = mysql_fetch_array($result)) {
	do {
		echo "<td class='infoBoxContents'> ".$row["products_id"]."</td>\n";
		echo "<td class='infoBoxContents'>".$row["products_name"]."</td>\n";
		echo "<td class='infoBoxContents'>".$row["products_model"]."</td>\n";
		echo "<td class='infoBoxContents'>".$row["products_status"]."</td>\n";
		echo "<td class='infoBoxContents'>".$row["products_quantity"]."</td>\n";
		echo "<td class='infoBoxContents'>".$row["products_cost"]."</td>\n";
		echo "</tr>\n";
	}
	while($row = mysql_fetch_array($result));
}
echo "</table>\n";
?>
<p class="smallText" align="right"><?php echo '<a href="java script:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?>   </p>
<br>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...