mirror of
https://github.com/fspc/biketree.git
synced 2026-09-16 14:31:36 -04:00
First commit of biketree to github!
This commit is contained in:
Executable
+117
@@ -0,0 +1,117 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['date_range']))
|
||||
{
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
|
||||
$brands_name=array();
|
||||
$brands_id=array();
|
||||
$brands_total=array();
|
||||
$brands_subtotal=array();
|
||||
}
|
||||
|
||||
$brands_table=$cfg_tableprefix.'brands';
|
||||
$sales_table=$cfg_tableprefix.'sales';
|
||||
$sales_items_table=$cfg_tableprefix.'sales_items';
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->allBrandsReport");
|
||||
|
||||
$tableheaders=array("$lang->brand","$lang->totalWithOutTax","$lang->totalWithTax","$lang->tax");
|
||||
|
||||
|
||||
$result=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id DESC",$dbf->conn);
|
||||
$result2=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id ASC",$dbf->conn);
|
||||
$row=mysql_fetch_assoc($result);
|
||||
$high_id=$row['id'];
|
||||
$row=mysql_fetch_assoc($result2);
|
||||
$low_id=$row['id'];
|
||||
|
||||
$result3=mysql_query("SELECT * FROM $sales_items_table WHERE sale_id BETWEEN \"$low_id\" and \"$high_id\" ORDER BY id DESC",$dbf->conn);
|
||||
echo "<center><h4><font color='$display->list_of_color'>$lang->totalsForBrands<br>$lang->between $date1 $lang->and $date2</font></h4></center>";
|
||||
echo '<hr>';
|
||||
echo "<table cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='50%' style=\"border: $display->border_style $display->border_color $display->border_width px\" align='center'>
|
||||
|
||||
<tr bgcolor=$display->header_rowcolor>\n\n";
|
||||
for($k=0;$k< count($tableheaders);$k++)
|
||||
{
|
||||
echo "<th align='center'>\n<font color='$display->header_text_color' face='$display->headerfont_face' size='$display->headerfont_size'>$tableheaders[$k]</font>\n</th>\n";
|
||||
}
|
||||
echo '</tr>'."\n\n";
|
||||
$rowCounter=0;
|
||||
$subtotal=0;
|
||||
$total=0;
|
||||
|
||||
$brand_result=mysql_query("SELECT * FROM $brands_table order by brand");
|
||||
while($row=mysql_fetch_assoc($brand_result))
|
||||
{
|
||||
$brands_id[]=$row['id'];
|
||||
$brands_name[]=$row['brand'];
|
||||
$brands_total[$row['id']]=0;
|
||||
$brands_subtotal[$row['id']]=0;
|
||||
|
||||
}
|
||||
|
||||
while($row=mysql_fetch_assoc($result3))
|
||||
{
|
||||
$brand_of_item=$dbf->idToField($cfg_tableprefix.'items','brand_id',$row['item_id']);
|
||||
$brands_subtotal[$brand_of_item]+=$row['item_total_cost']-$row['item_total_tax'];
|
||||
$brands_total[$brand_of_item]+=$row['item_total_cost'];
|
||||
|
||||
}
|
||||
|
||||
for($k=0;$k<count($brands_id);$k++)
|
||||
{
|
||||
if($rowCounter%2==0)
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor1>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor2>\n";
|
||||
}
|
||||
|
||||
$id=$brands_id[$k];
|
||||
$name=$brands_name[$k];
|
||||
$subtotal=number_format($brands_subtotal[$id],2,'.', '');
|
||||
$total=number_format($brands_total[$id],2,'.', '');
|
||||
$tax=number_format($total-$subtotal,2,'.', '');
|
||||
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>$name</font>\n</td>\n";
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>\$$subtotal</font>\n</td>\n";
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>\$$total</font>\n</td>\n";
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>\$$tax</font>\n</td>\n";
|
||||
|
||||
$rowCounter++;
|
||||
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Executable
+118
@@ -0,0 +1,118 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['date_range']))
|
||||
{
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
|
||||
$categories_name=array();
|
||||
$categories_id=array();
|
||||
$categories_total=array();
|
||||
$categories_subtotal=array();
|
||||
}
|
||||
|
||||
$categories_table=$cfg_tableprefix.'categories';
|
||||
$sales_table=$cfg_tableprefix.'sales';
|
||||
$sales_items_table=$cfg_tableprefix.'sales_items';
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->allCategoriesReport");
|
||||
|
||||
$tableheaders=array("$lang->category","$lang->totalWithOutTax","$lang->totalWithTax","$lang->tax");
|
||||
|
||||
|
||||
$result=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id DESC",$dbf->conn);
|
||||
$result2=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id ASC",$dbf->conn);
|
||||
$row=mysql_fetch_assoc($result);
|
||||
$high_id=$row['id'];
|
||||
$row=mysql_fetch_assoc($result2);
|
||||
$low_id=$row['id'];
|
||||
|
||||
$result3=mysql_query("SELECT * FROM $sales_items_table WHERE sale_id BETWEEN \"$low_id\" and \"$high_id\" ORDER BY id DESC",$dbf->conn);
|
||||
echo "<center><h4><font color='$display->list_of_color'>$lang->totalsForCategories<br>$lang->between $date1 $lang->and $date2</font></h4></center>";
|
||||
echo '<hr>';
|
||||
echo "<table cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='50%' style=\"border: $display->border_style $display->border_color $display->border_width px\" align='center'>
|
||||
|
||||
<tr bgcolor=$display->header_rowcolor>\n\n";
|
||||
for($k=0;$k< count($tableheaders);$k++)
|
||||
{
|
||||
echo "<th align='center'>\n<font color='$display->header_text_color' face='$display->headerfont_face' size='$display->headerfont_size'>$tableheaders[$k]</font>\n</th>\n";
|
||||
}
|
||||
echo '</tr>'."\n\n";
|
||||
$rowCounter=0;
|
||||
$subtotal=0;
|
||||
$total=0;
|
||||
|
||||
$category_result=mysql_query("SELECT * FROM $categories_table order by category");
|
||||
while($row=mysql_fetch_assoc($category_result))
|
||||
{
|
||||
$categories_id[]=$row['id'];
|
||||
$categories_name[]=$row['category'];
|
||||
$categories_total[$row['id']]=0;
|
||||
$categories_subtotal[$row['id']]=0;
|
||||
|
||||
}
|
||||
|
||||
while($row=mysql_fetch_assoc($result3))
|
||||
{
|
||||
$category_of_item=$dbf->idToField($cfg_tableprefix.'items','category_id',$row['item_id']);
|
||||
$categories_subtotal[$category_of_item]+=$row['item_total_cost']-$row['item_total_tax'];
|
||||
$categories_total[$category_of_item]+=$row['item_total_cost'];
|
||||
|
||||
}
|
||||
|
||||
for($k=0;$k<count($categories_id);$k++)
|
||||
{
|
||||
if($rowCounter%2==0)
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor1>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor2>\n";
|
||||
}
|
||||
|
||||
$id=$categories_id[$k];
|
||||
$name=$categories_name[$k];
|
||||
$subtotal=number_format($categories_subtotal[$id],2,'.', '');
|
||||
$total=number_format($categories_total[$id],2,'.', '');
|
||||
$tax=number_format($total-$subtotal,2,'.', '');
|
||||
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>$name</font>\n</td>\n";
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>\$$subtotal</font>\n</td>\n";
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>\$$total</font>\n</td>\n";
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>\$$tax</font>\n</td>\n";
|
||||
|
||||
$rowCounter++;
|
||||
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
if(isset($_POST['date_range']))
|
||||
{
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->allCustomersReport");
|
||||
$tableheaders=array("$lang->customer","$lang->itemsPurchased","$lang->moneySpentBeforeTax","$lang->moneySpentAfterTax");
|
||||
$display->displayTotalsReport($cfg_tableprefix,'customers',$tableheaders,$date1,$date2,'','')
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
if(isset($_POST['date_range']))
|
||||
{
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->allEmployeesReport");
|
||||
$tableheaders=array("$lang->employee $lang->name","$lang->totalItemsSold","$lang->moneySoldBeforeTax","$lang->moneySoldAfterTax");
|
||||
$display->displayTotalsReport($cfg_tableprefix,'employees',$tableheaders,$date1,$date2,'','')
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
if(isset($_POST['date_range']))
|
||||
{
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->allItemsReport");
|
||||
$tableheaders=array("$lang->itemName","$lang->brand","$lang->category","$lang->supplier","$lang->numberPurchased","$lang->subTotalForItem","$lang->totalForItem");
|
||||
$display->displayTotalsReport($cfg_tableprefix,'items',$tableheaders,$date1,$date2,'','')
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->allItemsReport");
|
||||
|
||||
if(isset($_POST['month1']))
|
||||
{
|
||||
$month1=$_POST['month1'];
|
||||
$day1=$_POST['day1'];
|
||||
$year1=$_POST['year1'];
|
||||
$month2=$_POST['month2'];
|
||||
$day2=$_POST['day2'];
|
||||
$year2=$_POST['year2'];
|
||||
|
||||
$date1=date("$year1-$month1-$day1");
|
||||
$date2=date("$year2-$month2-$day2");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$tableheaders=array("$lang->itemName","$lang->brand","$lang->category","$lang->supplier","$lang->numberPurchased","$lang->subTotalForItem","$lang->totalForItem");
|
||||
$display->displayTotalsReport($cfg_tableprefix,'items',$tableheaders,$date1,$date2,'','')
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+124
@@ -0,0 +1,124 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['selected_brand']))
|
||||
{
|
||||
$selected_brand=$_POST['selected_brand'];
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$sales_table=$cfg_tableprefix.'sales';
|
||||
$sales_items_table=$cfg_tableprefix.'sales_items';
|
||||
|
||||
$display_name=$dbf->idToField($cfg_tableprefix.'brands','brand',$selected_brand);
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->brandReport");
|
||||
|
||||
$tableheaders=array("$lang->saleID","$lang->itemName","$lang->unitPrice","$lang->quantityPurchased","$lang->tax","$lang->itemTotalCost");
|
||||
$tablefields=array('sale_id','item_id','item_unit_price','quantity_purchased','item_total_tax','item_total_cost');
|
||||
|
||||
$result=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id DESC",$dbf->conn);
|
||||
$result2=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id ASC",$dbf->conn);
|
||||
$row=mysql_fetch_assoc($result);
|
||||
$high_id=$row['id'];
|
||||
$row=mysql_fetch_assoc($result2);
|
||||
$low_id=$row['id'];
|
||||
|
||||
$result3=mysql_query("SELECT * FROM $sales_items_table WHERE sale_id BETWEEN \"$low_id\" and \"$high_id\" ORDER BY id DESC",$dbf->conn);
|
||||
echo "<center><h4><font color='$display->list_of_color'>$lang->listOfSalesFor $display_name<br>$lang->between $date1 $lang->and $date2</font></h4></center>";
|
||||
echo '<hr>';
|
||||
if(@mysql_num_rows($result) ==0)
|
||||
{
|
||||
echo "<div align='center'>$lang->noDataInTable <b>$sales_table</b> $lang->table.</div>";
|
||||
exit();
|
||||
}
|
||||
echo "<table cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='50%' style=\"border: $display->border_style $display->border_color $display->border_width px\" align='center'>
|
||||
|
||||
<tr bgcolor=$display->header_rowcolor>\n\n";
|
||||
for($k=0;$k< count($tableheaders);$k++)
|
||||
{
|
||||
echo "<th align='center'>\n<font color='$display->header_text_color' face='$display->headerfont_face' size='$display->headerfont_size'>$tableheaders[$k]</font>\n</th>\n";
|
||||
}
|
||||
echo '</tr>'."\n\n";
|
||||
$rowCounter=0;
|
||||
$subtotal=0;
|
||||
$total=0;
|
||||
|
||||
while($row=mysql_fetch_assoc($result3))
|
||||
{
|
||||
$brand_of_item=$dbf->idToField($cfg_tableprefix.'items','brand_id',$row['item_id']);
|
||||
if($selected_brand==$brand_of_item)
|
||||
{
|
||||
if($rowCounter%2==0)
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor1>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor2>\n";
|
||||
}
|
||||
$rowCounter++;
|
||||
for($k=0;$k<count($tablefields);$k++)
|
||||
{
|
||||
$field=$tablefields[$k];
|
||||
if($field=='brand_id' or $field=='category_id' or $field=='supplier_id')
|
||||
{
|
||||
$field_data=$display->idToField("$cfg_tableprefix".'items',"$field",$row['item_id']);
|
||||
$data=$display->formatData($field,$field_data,$cfg_tableprefix);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data=$display->formatData($field,$row[$field],$cfg_tableprefix);
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>$data</font>\n</td>\n";
|
||||
}
|
||||
|
||||
@$subtotal+=$row['item_total_cost']-$row['item_total_tax'];
|
||||
@$total+=$row['item_total_cost'];
|
||||
|
||||
}
|
||||
}
|
||||
echo '</table>'."\n";
|
||||
|
||||
$subtotal=number_format($subtotal,2,'.', '');
|
||||
$total=number_format($total,2,'.', '');
|
||||
$tax=$total-$subtotal;
|
||||
$tax=number_format($tax,2,'.', '');
|
||||
|
||||
echo "<br><table align='right' cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='60%' border=0>";
|
||||
echo "<tr><td>$lang->totalWithOutTax: <b>$display->currency_symbol$subtotal</b></td></tr>
|
||||
<tr><td>$lang->totalWithTax: <b>$display->currency_symbol$total</b></td></tr>
|
||||
<tr><td>$lang->tax: <b>$display->currency_symbol$tax</b></td></tr></table>";
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+122
@@ -0,0 +1,122 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['selected_category']))
|
||||
{
|
||||
$selected_category=$_POST['selected_category'];
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$sales_table=$cfg_tableprefix.'sales';
|
||||
$sales_items_table=$cfg_tableprefix.'sales_items';
|
||||
|
||||
$display_name=$dbf->idToField($cfg_tableprefix.'categories','category',$selected_category);
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->categoryReport");
|
||||
|
||||
$tableheaders=array("$lang->saleID","$lang->itemName","$lang->unitPrice","$lang->quantityPurchased","$lang->tax","$lang->itemTotalCost");
|
||||
$tablefields=array('sale_id','item_id','item_unit_price','quantity_purchased','item_total_tax','item_total_cost');
|
||||
|
||||
$result=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id DESC",$dbf->conn);
|
||||
$result2=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id ASC",$dbf->conn);
|
||||
$row=mysql_fetch_assoc($result);
|
||||
$high_id=$row['id'];
|
||||
$row=mysql_fetch_assoc($result2);
|
||||
$low_id=$row['id'];
|
||||
|
||||
$result3=mysql_query("SELECT * FROM $sales_items_table WHERE sale_id BETWEEN \"$low_id\" and \"$high_id\" ORDER BY id DESC",$dbf->conn);
|
||||
echo "<center><h4><font color='$display->list_of_color'>$lang->listOfSalesFor $display_name<br>$lang->between $date1 $lang->and $date2</font></h4></center>";
|
||||
echo '<hr>';
|
||||
if(@mysql_num_rows($result) ==0)
|
||||
{
|
||||
echo "<div align='center'>$lang->noDataInTable <b>$sales_table</b> $lang->table.</div>";
|
||||
exit();
|
||||
}
|
||||
echo "<table cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='50%' style=\"border: $display->border_style $display->border_color $display->border_width px\" align='center'>
|
||||
|
||||
<tr bgcolor=$display->header_rowcolor>\n\n";
|
||||
for($k=0;$k< count($tableheaders);$k++)
|
||||
{
|
||||
echo "<th align='center'>\n<font color='$display->header_text_color' face='$display->headerfont_face' size='$display->headerfont_size'>$tableheaders[$k]</font>\n</th>\n";
|
||||
}
|
||||
echo '</tr>'."\n\n";
|
||||
$rowCounter=0;
|
||||
$subtotal=0;
|
||||
$total=0;
|
||||
|
||||
while($row=mysql_fetch_assoc($result3))
|
||||
{
|
||||
$category_of_item=$dbf->idToField($cfg_tableprefix.'items','category_id',$row['item_id']);
|
||||
if($selected_category==$category_of_item)
|
||||
{
|
||||
if($rowCounter%2==0)
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor1>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor2>\n";
|
||||
}
|
||||
$rowCounter++;
|
||||
for($k=0;$k<count($tablefields);$k++)
|
||||
{
|
||||
$field=$tablefields[$k];
|
||||
if($field=='brand_id' or $field=='category_id' or $field=='supplier_id')
|
||||
{
|
||||
$field_data=$display->idToField("$cfg_tableprefix".'items',"$field",$row['item_id']);
|
||||
$data=$display->formatData($field,$field_data,$cfg_tableprefix);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data=$display->formatData($field,$row[$field],$cfg_tableprefix);
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>$data</font>\n</td>\n";
|
||||
}
|
||||
|
||||
@$subtotal+=$row['item_total_cost']-$row['item_total_tax'];
|
||||
@$total+=$row['item_total_cost'];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
$subtotal=number_format($subtotal,2,'.', '');
|
||||
$total=number_format($total,2,'.', '');
|
||||
$tax=$total-$subtotal;
|
||||
$tax=number_format($tax,2,'.', '');
|
||||
|
||||
echo "<br><table align='right' cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='60%' border=0>";
|
||||
echo "<tr><td>$lang->totalWithOutTax: <b>$display->currency_symbol$subtotal</b></td></tr>
|
||||
<tr><td>$lang->totalWithTax: <b>$display->currency_symbol$total</b></td></tr>
|
||||
<tr><td>$lang->tax: <b>$display->currency_symbol$tax</b></td></tr></table>";?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['selected_customer']))
|
||||
{
|
||||
$selected_customer=$_POST['selected_customer'];
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$first_name=$dbf->idToField($cfg_tableprefix.'customers','first_name',$selected_customer);
|
||||
$last_name=$dbf->idToField($cfg_tableprefix.'customers','last_name',$selected_customer);
|
||||
$display_name=$first_name.' '.$last_name;
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->customerReport");
|
||||
$tableheaders=array("$lang->rowID","$lang->date","$lang->itemsPurchased","$lang->paidWith","$lang->soldBy","$lang->saleSubTotal","$lang->saleTotalCost","$lang->showSaleDetails");
|
||||
$tablefields=array('id','date','items_purchased','paid_with','sold_by','sale_sub_total','sale_total_cost','sale_details');
|
||||
$display->displayReportTable("$cfg_tableprefix",'sales',$tableheaders,$tablefields,'customer_id',"$selected_customer","$date1","$date2",'date',"$lang->listOfSalesFor $display_name<br>$lang->between $date1 $lang->and $date2");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+67
@@ -0,0 +1,67 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['selected_customer']))
|
||||
{
|
||||
$selected_customer=$_POST['selected_customer'];
|
||||
$date_range=$_POST['month1'];
|
||||
$dates=explode(':',$date_range);
|
||||
|
||||
$month1=$_POST['month1'];
|
||||
$day1=$_POST['day1'];
|
||||
$year1=$_POST['year1'];
|
||||
$month2=$_POST['month2'];
|
||||
$day2=$_POST['day2'];
|
||||
$year2=$_POST['year2'];
|
||||
|
||||
$date1=date("$year1-$month1-$day1");
|
||||
$date2=date("$year2-$month2-$day2");
|
||||
|
||||
}
|
||||
|
||||
$first_name=$dbf->idToField($cfg_tableprefix.'customers','first_name',$selected_customer);
|
||||
$last_name=$dbf->idToField($cfg_tableprefix.'customers','last_name',$selected_customer);
|
||||
$display_name=$first_name.' '.$last_name;
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->customerReportDateRange");
|
||||
$tableheaders=array("$lang->rowID","$lang->date","$lang->itemsPurchased","$lang->paidWith","$lang->soldBy","$lang->saleSubTotal","$lang->saleTotalCost","$lang->showSaleDetails");
|
||||
$tablefields=array('id','date','items_purchased','paid_with','sold_by','sale_sub_total','sale_total_cost','sale_details');
|
||||
$display->displayReportTable("$cfg_tableprefix",'sales',$tableheaders,$tablefields,'customer_id',"$selected_customer","$date1","$date2",'date',"$lang->listOfSalesFor $display_name<br>$lang->between $date1 $lang->and $date2");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->dailyReport");
|
||||
$today=date("F j, Y");
|
||||
$todaysDate=date("Y-m-d");
|
||||
$tableheaders=array("$lang->rowID","$lang->date","$lang->customer","$lang->itemsPurchased","$lang->paidWith","$lang->soldBy","$lang->saleSubTotal","$lang->saleTotalCost","$lang->saleDetails");
|
||||
$tablefields=array('id','date','customer_id','items_purchased','paid_with','sold_by','sale_sub_total','sale_total_cost','sale_details');
|
||||
$display->displayReportTable("$cfg_tableprefix",'sales',$tableheaders,$tablefields,'date',"$todaysDate",'','','id',"$lang->listOfSalesFor $today");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->dateRangeReport");
|
||||
|
||||
if(isset($_POST['month1']))
|
||||
{
|
||||
$month1=$_POST['month1'];
|
||||
$day1=$_POST['day1'];
|
||||
$year1=$_POST['year1'];
|
||||
$month2=$_POST['month2'];
|
||||
$day2=$_POST['day2'];
|
||||
$year2=$_POST['year2'];
|
||||
|
||||
$date1=date("$year1-$month1-$day1");
|
||||
$date2=date("$year2-$month2-$day2");
|
||||
|
||||
}
|
||||
|
||||
$tableheaders=array("$lang->rowID","$lang->date","$lang->customer","$lang->itemsPurchased","$lang->paidWith","$lang->soldBy","$lang->saleSubTotal","$lang->saleTotalCost","$lang->showSaleDetails");
|
||||
$tablefields=array('id','date','customer_id','items_purchased','paid_with','sold_by','sale_sub_total','sale_total_cost','sale_details');
|
||||
$display->displayReportTable("$cfg_tableprefix",'sales',$tableheaders,$tablefields,'','',"$date1","$date2",'id',"$lang->listOfSalesBetween $date1 $lang->and $date2");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['selected_employee']))
|
||||
{
|
||||
$selected_employee=$_POST['selected_employee'];
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$first_name=$dbf->idToField($cfg_tableprefix.'users','first_name',$selected_employee);
|
||||
$last_name=$dbf->idToField($cfg_tableprefix.'users','last_name',$selected_employee);
|
||||
$display_name=$first_name.' '.$last_name;
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->employeeReport");
|
||||
$tableheaders=array("$lang->rowID","$lang->date","$lang->customer","$lang->itemsPurchased","$lang->paidWith","$lang->saleSubTotal","$lang->saleTotalCost","$lang->showSaleDetails");
|
||||
$tablefields=array('id','date','customer_id','items_purchased','paid_with','sale_sub_total','sale_total_cost','sale_details');
|
||||
$display->displayReportTable("$cfg_tableprefix",'sales',$tableheaders,$tablefields,'sold_by',"$selected_employee","$date1","$date2",'date',"$lang->listOfSaleBy $display_name<br>$lang->between $date1 and $date2");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+444
@@ -0,0 +1,444 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/form.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
//set default values, these will change if $action==update.
|
||||
|
||||
$day=date("d");
|
||||
$month=date("m");
|
||||
$year=date("Y");
|
||||
$today=date("Y-m-d").":".date("Y-m-d");
|
||||
$yesterday=date("Y-m-d",mktime(0,0,0,$month,$day-1,$year)).":".date("Y-m-d",mktime(0,0,0,$month,$day-1,$year));
|
||||
$week=date("Y-m-d",mktime(0,0,0,$month,$day-6,$year)).":".date("Y-m-d",mktime(0,0,0,$month,$day,$year));
|
||||
$thismonth=date("Y-m-d",mktime(0,0,0,$month,1,$year)).":".date("Y-m-d",mktime(0,0,0,$month,$day,$year));
|
||||
$lastmonth=date("Y-m-d",mktime(0,0,0,$month-1,1,$year)).":".date("Y-m-d",mktime(0,0,0,$month-1,date("t",mktime(0,0,0,$month-1,1,$year)),$year));
|
||||
$thisyear=date("Y-m-d",mktime(0,0,0,1,1,$year)).":".date("Y-m-d",mktime(0,0,0,$month,$day,$year));
|
||||
$alltime=date("Y-m-d",mktime(0,0,0,1,1,0000)).":".date("Y-m-d",mktime(0,0,0,$month,$day,$today));
|
||||
|
||||
//decides if the form will be used to update or add a user.
|
||||
if(isset($_GET['report']))
|
||||
{
|
||||
$form=$_GET['report'];
|
||||
}
|
||||
$display->displayTitle("$lang->inputNeeded $form");
|
||||
|
||||
//if action is update, sets variables to what the current users data is.
|
||||
|
||||
if($form=="$lang->allCustomersReport")
|
||||
{
|
||||
$f1=new form('all_customers.php','POST','customers','215',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'95');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->allItemsReport")
|
||||
{
|
||||
$f1=new form('all_items.php','POST','items','215',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'95');
|
||||
$f1->endForm();
|
||||
}
|
||||
elseif($form=="$lang->allItemsReportDateRange")
|
||||
{
|
||||
$f1=new form('all_items_date_range.php','POST','items','500',$cfg_theme,$lang);
|
||||
$f1->createDateSelectField();
|
||||
$f1->endForm();
|
||||
}
|
||||
elseif($form=="$lang->allBrandsReport")
|
||||
{
|
||||
$f1=new form('all_brands.php','POST','brands','215',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'95');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->allCategoriesReport")
|
||||
{
|
||||
$f1=new form('all_categories.php','POST','categories','215',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'95');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->allEmployeesReport")
|
||||
{
|
||||
$f1=new form('all_employees.php','POST','employees','215',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'95');
|
||||
$f1->endForm();
|
||||
}
|
||||
elseif($form=="$lang->brandReport")
|
||||
{
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$brands_table=$cfg_tableprefix.'brands';
|
||||
$brand_result=mysql_query("SELECT * FROM $brands_table ORDER by brand",$dbf->conn);
|
||||
|
||||
if(isset($_GET['brand_search']))
|
||||
{
|
||||
$search=$_GET['brand_search'];
|
||||
$brand_result=mysql_query("SELECT * FROM $brands_table WHERE brand like \"%$search%\" ORDER by brand",$dbf->conn);
|
||||
|
||||
}
|
||||
|
||||
if(mysql_num_rows($brand_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($brand_result))
|
||||
{
|
||||
$option_values[]=$row['id'];
|
||||
$option_titles[]=$row['brand'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
}
|
||||
echo "<center><form name='search' action='form.php' method='GET'>
|
||||
$lang->findBrand: <input type='text' size='8' name='brand_search'>
|
||||
<input type='hidden' name='report' value=$lang->brandReport value='Go'>
|
||||
<input type='submit' value='Go'>
|
||||
</form>";
|
||||
$f1=new form('brand.php','POST','brand','450',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'150');
|
||||
$f1->createSelectField("<b>$lang->selectBrand</b>",'selected_brand',$option_values,$option_titles,'150');
|
||||
$f1->endForm();
|
||||
}
|
||||
elseif($form=="$lang->categoryReport")
|
||||
{
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$categories_table=$cfg_tableprefix.'categories';
|
||||
$category_result=mysql_query("SELECT * FROM $categories_table ORDER by category",$dbf->conn);
|
||||
|
||||
if(isset($_GET['category_search']))
|
||||
{
|
||||
$search=$_GET['category_search'];
|
||||
$category_result=mysql_query("SELECT * FROM $categories_table WHERE category like \"%$search%\" ORDER by category",$dbf->conn);
|
||||
|
||||
}
|
||||
|
||||
if(mysql_num_rows($category_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($category_result))
|
||||
{
|
||||
$option_values[]=$row['id'];
|
||||
$option_titles[]=$row['category'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
}
|
||||
echo "<center><form name='search' action='form.php' method='GET'>
|
||||
$lang->findCategory: <input type='text' size='8' name='category_search'>
|
||||
<input type='hidden' name='report' value=$lang->categoryReport value='Go'>
|
||||
<input type='submit' value='Go'>
|
||||
</form>";
|
||||
$f1=new form('category.php','POST','category','450',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'150');
|
||||
$f1->createSelectField("<b>$lang->selectCategory</b>",'selected_category',$option_values,$option_titles,'150');
|
||||
$f1->endForm();
|
||||
}
|
||||
elseif($form=="$lang->taxReport")
|
||||
{
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$sales_items_table=$cfg_tableprefix.'sales_items';
|
||||
$tax_result=mysql_query("SELECT DISTINCT item_tax_percent FROM $sales_items_table ORDER by item_tax_percent DESC",$dbf->conn);
|
||||
|
||||
|
||||
if(mysql_num_rows($tax_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($tax_result))
|
||||
{
|
||||
$option_values[]=$row['item_tax_percent'];
|
||||
$option_titles[]=$row['item_tax_percent'].'%';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
}
|
||||
echo "<center>";
|
||||
$f1=new form('tax.php','POST','tax','450',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'150');
|
||||
$f1->createSelectField("<b>$lang->selectTax %</b>",'selected_tax',$option_values,$option_titles,'150');
|
||||
$f1->endForm();
|
||||
}
|
||||
elseif($form=="$lang->customerReport")
|
||||
{
|
||||
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$customers_table=$cfg_tableprefix.'customers';
|
||||
$customer_result=mysql_query("SELECT first_name,last_name,id FROM $customers_table ORDER by last_name",$dbf->conn);
|
||||
|
||||
if(isset($_GET['customer_search']))
|
||||
{
|
||||
$search=$_GET['customer_search'];
|
||||
$customer_result=mysql_query("SELECT first_name,last_name,id FROM $customers_table WHERE last_name like \"%$search%\" or first_name like \"%$search%\" ORDER by last_name",$dbf->conn);
|
||||
|
||||
}
|
||||
|
||||
if(mysql_num_rows($customer_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($customer_result))
|
||||
{
|
||||
$option_values[]=$row['id'];
|
||||
$option_titles[]=$row['last_name'].', '.$row['first_name'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
}
|
||||
echo "<center><form name='search' action='form.php' method='GET'>
|
||||
$lang->findCustomer: <input type='text' size='8' name='customer_search'>
|
||||
<input type='hidden' name='report' value=$lang->customerReport value='Go'>
|
||||
<input type='submit' value='Go'>
|
||||
</form>";
|
||||
$f1=new form('customer.php','POST','customer','450',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'150');
|
||||
$f1->createSelectField("<b>$lang->selectCustomer</b>",'selected_customer',$option_values,$option_titles,'150');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->customerReportDateRange")
|
||||
{
|
||||
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$customers_table=$cfg_tableprefix.'customers';
|
||||
$customer_result=mysql_query("SELECT first_name,last_name,account_number,id FROM $customers_table ORDER by last_name",$dbf->conn);
|
||||
|
||||
if(isset($_GET['customer_search']))
|
||||
{
|
||||
|
||||
$search=$_GET['customer_search'];
|
||||
$customer_result=mysql_query("SELECT first_name,last_name,account_number,id FROM $customers_table WHERE last_name like \"%$search%\" or first_name like \"%$search%\" or account_number like \"%$search%\" ORDER by last_name",$dbf->conn);
|
||||
|
||||
}
|
||||
|
||||
if(mysql_num_rows($customer_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($customer_result))
|
||||
{
|
||||
$option_values[]=$row['id'];
|
||||
$option_titles[]=$row['last_name'].', '.$row['first_name'].' ('.$row['account_number'].')';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
}
|
||||
echo "<center><form name='search' action='form.php' method='GET'>
|
||||
$lang->findCustomer: <input type='text' size='8' name='customer_search'>
|
||||
<input type='hidden' name='report' value=$lang->customerReportDateRange value='Go'>
|
||||
<input type='submit' value='Go'>
|
||||
</form>";
|
||||
|
||||
$f1=new form('customer_date_range.php','POST','customer','500',$cfg_theme,$lang);
|
||||
$f1->createDateSelectField();
|
||||
$f1->formBreak('500',$cfg_theme);
|
||||
$f1->createSelectField("<b>$lang->selectCustomer</b>",'selected_customer',$option_values,$option_titles,'130');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->itemReport")
|
||||
{
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$items_table=$cfg_tableprefix.'items';
|
||||
$item_result=mysql_query("SELECT item_name,id FROM $items_table ORDER by item_name",$dbf->conn);
|
||||
|
||||
if(isset($_GET['item_search']))
|
||||
{
|
||||
$search=$_GET['item_search'];
|
||||
$item_result=mysql_query("SELECT item_name,id FROM $items_table WHERE item_name like \"%$search%\" ORDER by item_name",$dbf->conn);
|
||||
|
||||
}
|
||||
|
||||
if(mysql_num_rows($item_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($item_result))
|
||||
{
|
||||
$option_values[]=$row['id'];
|
||||
$option_titles[]=$row['item_name'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
}
|
||||
echo "<center><form name='search' action='form.php' method='GET'>
|
||||
$lang->findItem: <input type='text' size='8' name='item_search'>
|
||||
<input type='hidden' name='report' value=$lang->itemReport value='Go'>
|
||||
<input type='submit' value='Go'>
|
||||
</form>";
|
||||
$f1=new form('item.php','POST','item','450',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'150');
|
||||
$f1->createSelectField("<b>$lang->selectItem</b>",'selected_item',$option_values,$option_titles,'150');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->itemReportDateRange")
|
||||
{
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$items_table=$cfg_tableprefix.'items';
|
||||
$item_result=mysql_query("SELECT item_name,item_number,id FROM $items_table ORDER by item_name",$dbf->conn);
|
||||
|
||||
if(isset($_GET['item_search']))
|
||||
{
|
||||
$search=$_GET['item_search'];
|
||||
$item_result=mysql_query("SELECT item_name,item_number,id FROM $items_table WHERE item_name like \"%$search%\" or item_number like \"%$search%\" ORDER by item_name",$dbf->conn);
|
||||
|
||||
}
|
||||
|
||||
if(mysql_num_rows($item_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($item_result))
|
||||
{
|
||||
$option_values[]=$row['id'];
|
||||
$option_titles[]=$row['item_name'].' ['.$row['item_number'].']';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
|
||||
}
|
||||
echo "<center><form name='search' action='form.php' method='GET'>
|
||||
$lang->findItem: <input type='text' size='8' name='item_search'>
|
||||
<input type='hidden' name='report' value='$lang->itemReportDateRange' value='Go'>
|
||||
<input type='submit' value='Go'>
|
||||
</form>";
|
||||
$f1=new form('item_date_range.php','POST','item','500',$cfg_theme,$lang);
|
||||
$f1->createDateSelectField();
|
||||
$f1->formBreak('500',$cfg_theme);
|
||||
$f1->createSelectField("<b>$lang->selectItem</b>",'selected_item',$option_values,$option_titles,'130');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->employeeReport")
|
||||
{
|
||||
|
||||
$option_values=array();
|
||||
$option_titles=array();
|
||||
$employees_table=$cfg_tableprefix.'users';
|
||||
$employee_result=mysql_query("SELECT first_name,last_name,id FROM $employees_table ORDER by last_name",$dbf->conn);
|
||||
|
||||
if(isset($_GET['employee_search']))
|
||||
{
|
||||
$search=$_GET['employee_search'];
|
||||
$employee_result=mysql_query("SELECT first_name,last_name,id FROM $employees_table WHERE last_name like \"%$search%\" or first_name like \"%$search%\" ORDER by last_name",$dbf->conn);
|
||||
|
||||
}
|
||||
|
||||
if(mysql_num_rows($employee_result)>0)
|
||||
{
|
||||
while($row=mysql_fetch_assoc($employee_result))
|
||||
{
|
||||
$option_values[]=$row['id'];
|
||||
$option_titles[]=$row['last_name'].', '.$row['first_name'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$option_values[]=$search.$lang->notFound;
|
||||
$option_titles[]='"'.$search.'"'.' '.$lang->notFound;
|
||||
|
||||
}
|
||||
echo "<center><form name='search' action='form.php' method='GET'>
|
||||
$lang->findEmployee: <input type='text' size='8' name='employee_search'>
|
||||
<input type='hidden' name='report' value=$lang->employeeReport value='Go'>
|
||||
<input type='submit' value='Go'>
|
||||
</form>";
|
||||
$f1=new form('employee.php','POST','employee','450',$cfg_theme,$lang);
|
||||
$option_values2=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles2=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values2,$option_titles2,'150');
|
||||
$f1->createSelectField("<b>$lang->selectEmployee</b>",'selected_employee',$option_values,$option_titles,'150');
|
||||
$f1->endForm();
|
||||
|
||||
}
|
||||
elseif($form=="$lang->dateRangeReport")
|
||||
{
|
||||
$f1=new form('date_range.php','POST','customer','500',$cfg_theme,$lang);
|
||||
|
||||
$f1->createDateSelectField();
|
||||
$f1->endForm();
|
||||
}
|
||||
elseif($form=="$lang->profitReport")
|
||||
{
|
||||
$option_values=array("$today","$yesterday","$week","$thismonth","$lastmonth","$thisyear","$alltime");
|
||||
$option_titles=array("$lang->today","$lang->yesterday","$lang->last7days","$lang->thisMonth","$lang->lastMonth","$lang->thisYear","$lang->allTime");
|
||||
|
||||
$f1=new form('profit.php','POST','profit','200',$cfg_theme,$lang);
|
||||
$f1->createSelectField("<b>$lang->dateRange</b>",'date_range',$option_values,$option_titles,'200');
|
||||
$f1->endForm();
|
||||
|
||||
|
||||
}
|
||||
$dbf->closeDBlink();
|
||||
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
<?php session_start();
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
|
||||
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
echo "
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<table border=\"0\" width=\"600\">
|
||||
<tr>
|
||||
<td><img border=\"0\" src=\"../images/reports.gif\" width=\"30\" height=\"31\" valign='top'><font color='#005B7F' size='4'> <b>$lang->reports</b></font><br>
|
||||
<br>
|
||||
<font face=\"Verdana\" size=\"2\">$lang->reportsWelcomeMessage</font>
|
||||
<ul>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->allBrandsReport\">$lang->allBrandsReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->allCategoriesReport\">$lang->allCategoriesReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->allCustomersReport\">$lang->allCustomersReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->allItemsReport\">$lang->allItemsReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->allItemsReportDateRange\">$lang->allItemsReportDateRange</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->allEmployeesReport\">$lang->allEmployeesReport</a></font></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->brandReport\">$lang->brandReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->categoryReport\">$lang->categoryReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->customerReport\">$lang->customerReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->customerReportDateRange\">$lang->customerReportDateRange</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->itemReport\">$lang->itemReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->itemReportDateRange\">$lang->itemReportDateRange</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->employeeReport\">$lang->employeeReport</a></font></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"daily.php\">$lang->dailyReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->dateRangeReport\">$lang->dateRangeReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->profitReport\">$lang->profitReport</a></font></li>
|
||||
<li><font face=\"Verdana\" size=\"2\"><a href=\"form.php?report=$lang->taxReport\">$lang->taxReport</a></font></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
$dbf->closeDBlink();
|
||||
|
||||
|
||||
?>
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
|
||||
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
if(isset($_POST['date_range']) and isset($_POST['selected_item']))
|
||||
{
|
||||
$selected_item=$_POST['selected_item'];
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->itemReport");
|
||||
$tableheaders=array("$lang->itemName","$lang->brand","$lang->category","$lang->supplier","$lang->numberPurchased","$lang->subTotalForItem","$lang->totalForItem");
|
||||
$display->displayTotalsReport($cfg_tableprefix,'item',$tableheaders,$date1,$date2,'id',"$selected_item");
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
|
||||
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
if(isset($_POST['month1']) and isset($_POST['selected_item']))
|
||||
{
|
||||
$selected_item=$_POST['selected_item'];
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
|
||||
$month1=$_POST['month1'];
|
||||
$day1=$_POST['day1'];
|
||||
$year1=$_POST['year1'];
|
||||
$month2=$_POST['month2'];
|
||||
$day2=$_POST['day2'];
|
||||
$year2=$_POST['year2'];
|
||||
|
||||
$date1=date("$year1-$month1-$day1");
|
||||
$date2=date("$year2-$month2-$day2");
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->itemReport");
|
||||
$tableheaders=array("$lang->itemName","$lang->brand","$lang->category","$lang->supplier","$lang->numberPurchased","$lang->subTotalForItem","$lang->totalForItem");
|
||||
$display->displayTotalsReport($cfg_tableprefix,'item',$tableheaders,$date1,$date2,'id',"$selected_item");
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function popUp(URL)
|
||||
{
|
||||
day = new Date();
|
||||
id = day.getTime();
|
||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 362,top = 234');");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
if(isset($_POST['date_range']))
|
||||
{
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
}
|
||||
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->profitReport");
|
||||
$tableheaders=array("$lang->date","$lang->totalAmountSoldWithOutTax","$lang->profit");
|
||||
$display->displayTotalsReport($cfg_tableprefix,'profit',$tableheaders,$date1,$date2,'id','');
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
|
||||
$lang=new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_GET['sale_id']))
|
||||
{
|
||||
$sale_id=$_GET['sale_id'];
|
||||
$customer_id=$_GET['sale_customer_id'];
|
||||
$sale_date=$_GET['sale_date'];
|
||||
|
||||
$temp_first_name=$dbf->idToField("$cfg_tableprefix".'customers','first_name',$customer_id);
|
||||
$temp_last_name=$dbf->idToField("$cfg_tableprefix".'customers','last_name',$customer_id);
|
||||
$sale_customer_name=$temp_first_name.' '.$temp_last_name;
|
||||
|
||||
}
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$lang->saleDetails");
|
||||
$tableheaders=array("$lang->rowID","$lang->itemName","$lang->brand","$lang->category","$lang->supplier","$lang->quantityPurchased","$lang->unitPrice","$lang->totalItemCost");
|
||||
$tablefields=array('id','item_id','brand_id','category_id','supplier_id','quantity_purchased','item_unit_price','item_total_cost');
|
||||
$display->displayReportTable("$cfg_tableprefix",'sales_items',$tableheaders,$tablefields,'sale_id',"$sale_id",'','','id',"$sale_customer_name<br>$sale_date<br><br>Items in sale<br>");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+125
@@ -0,0 +1,125 @@
|
||||
<?php session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
|
||||
include ("../settings.php");
|
||||
include ("../language/$cfg_language");
|
||||
include ("../classes/db_functions.php");
|
||||
include ("../classes/security_functions.php");
|
||||
include ("../classes/display.php");
|
||||
include ("../classes/form.php");
|
||||
|
||||
$lang= new language();
|
||||
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
|
||||
$sec=new security_functions($dbf,'Report Viewer',$lang);
|
||||
if(!$sec->isLoggedIn())
|
||||
{
|
||||
header ("location: ../login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($_POST['date_range']))
|
||||
{
|
||||
$date_range=$_POST['date_range'];
|
||||
$dates=explode(':',$date_range);
|
||||
$date1=$dates[0];
|
||||
$date2=$dates[1];
|
||||
$tax_percent=$_POST['selected_tax'];
|
||||
}
|
||||
|
||||
$sales_table=$cfg_tableprefix.'sales';
|
||||
$sales_items_table=$cfg_tableprefix.'sales_items';
|
||||
|
||||
$display_name=$tax_percent.'%';
|
||||
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
|
||||
$display->displayTitle("$cfg_company $lang->taxReport");
|
||||
|
||||
$tableheaders=array("$lang->saleID","$lang->itemName","$lang->tax","$lang->saleTotalCost");
|
||||
$tablefields=array('sale_id','item_id','item_total_tax','item_total_cost');
|
||||
|
||||
$result=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id DESC",$dbf->conn);
|
||||
$result2=mysql_query("SELECT * FROM $sales_table WHERE date between \"$date1\" and \"$date2\" ORDER BY id ASC",$dbf->conn);
|
||||
$row=mysql_fetch_assoc($result);
|
||||
$high_id=$row['id'];
|
||||
$row=mysql_fetch_assoc($result2);
|
||||
$low_id=$row['id'];
|
||||
|
||||
$result3=mysql_query("SELECT * FROM $sales_items_table WHERE sale_id BETWEEN \"$low_id\" and \"$high_id\" ORDER BY id DESC",$dbf->conn);
|
||||
echo "<center><h4><font color='$display->list_of_color'>$lang->listOfSalesFor $display_name<br>$lang->between $date1 $lang->and $date2</font></h4></center>";
|
||||
echo '<hr>';
|
||||
if(@mysql_num_rows($result) ==0)
|
||||
{
|
||||
echo "<div align='center'>$lang->noDataInTable <b>$sales_table</b> $lang->table.</div>";
|
||||
exit();
|
||||
}
|
||||
echo "<table cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='50%' style=\"border: $display->border_style $display->border_color $display->border_width px\" align='center'>
|
||||
|
||||
<tr bgcolor=$display->header_rowcolor>\n\n";
|
||||
for($k=0;$k< count($tableheaders);$k++)
|
||||
{
|
||||
echo "<th align='center'>\n<font color='$display->header_text_color' face='$display->headerfont_face' size='$display->headerfont_size'>$tableheaders[$k]</font>\n</th>\n";
|
||||
}
|
||||
echo '</tr>'."\n\n";
|
||||
$rowCounter=0;
|
||||
$subtotal=0;
|
||||
$total=0;
|
||||
|
||||
while($row=mysql_fetch_assoc($result3))
|
||||
{
|
||||
$tax_percent_of_item=$row['item_tax_percent'];
|
||||
if($tax_percent==$tax_percent_of_item)
|
||||
{
|
||||
if($rowCounter%2==0)
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor1>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\n<tr bgcolor=$display->rowcolor2>\n";
|
||||
}
|
||||
$rowCounter++;
|
||||
for($k=0;$k<count($tablefields);$k++)
|
||||
{
|
||||
$field=$tablefields[$k];
|
||||
if($field=='brand_id' or $field=='category_id' or $field=='supplier_id')
|
||||
{
|
||||
$field_data=$display->idToField("$cfg_tableprefix".'items',"$field",$row['item_id']);
|
||||
$data=$display->formatData($field,$field_data,$cfg_tableprefix);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data=$display->formatData($field,$row[$field],$cfg_tableprefix);
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "\n<td align='center'>\n<font color='$display->rowcolor_text' face='$display->rowfont_face' size='$display->rowfont_size'>$data</font>\n</td>\n";
|
||||
}
|
||||
|
||||
@$subtotal+=$row['item_total_cost']-$row['item_total_tax'];
|
||||
@$total+=$row['item_total_cost'];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
echo '</table>'."\n";
|
||||
|
||||
$subtotal=number_format($subtotal,2,'.', '');
|
||||
$total=number_format($total,2,'.', '');
|
||||
$tax=$total-$subtotal;
|
||||
$tax=number_format($tax,2,'.', '');
|
||||
|
||||
echo "<br><table align='right' cellspacing='$display->cellspacing' cellpadding='$display->cellpadding' bgcolor='$display->table_bgcolor' width='60%' border=0>";
|
||||
echo "<tr><td>$lang->totalWithOutTax: <b>$display->currency_symbol$subtotal</b></td></tr>
|
||||
<tr><td>$lang->totalWithTax: <b>$display->currency_symbol$total</b></td></tr>
|
||||
<tr><td>$lang->tax: <b>$display->currency_symbol$tax</b></td></tr></table>";
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user