//<?php
/*
 * @version $Id: report.php 17152 2012-01-24 11:22:16Z moyo $
 -------------------------------------------------------------------------
 GLPI - Gestionnaire Libre de Parc Informatique
 Copyright (C) 2003-2012 by the INDEPNET Development Team.

 http://indepnet.net/   http://glpi-project.org
 -------------------------------------------------------------------------

 LICENSE

 This file is part of GLPI.

 GLPI is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 GLPI is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with GLPI. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
 */

// Based on:
// IRMA, Information Resource-Management and Administration
// Christian Bauer
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------

//define('GLPI_ROOT', '..');
//include (GLPI_ROOT . "/inc/includes.php");

//Session::checkRight("reports", "r");

//Html::header($LANG['Menu'][6],$_SERVER['PHP_SELF'],"utils","report");

//Report::title();

//Html::footer();
//?>

<HTML><HEAD>
<Title>Balance Report</Title>

<HEAD>
<BODY>

<H1>Jellifish Balance</H1>

<?php

$connexion = mysql_pconnect ('localhost','info6550','Bwzm7q7n');

if (!$connexion)
{
	echo "Sorry, connection to  localhost impossible\n";
	exit;
	}
if (!mysql_select_db (info6550_glpi200, $connexion))
{
	echo "Sorry, connection to DB_BILLS is impossible\n";
	exit;
	}

$result = mysql_query ("SELECT * From glpi_plugin_order_bills WHERE entities_id=2 AND plugin_order_billstates_id=0" , $connexion);
echo "INVOICES NOT PAID<br>\n";
echo "=================<br>\n";
$val_notpaid = 0;
$val_paid = 0;
if ($result)
{
	while ($glpi_plugin_order_bills = mysql_fetch_object($result))
	{
		echo "$glpi_plugin_order_bills->name    ,   $glpi_plugin_order_bills->value.<BR>\n";
		$val_notpaid=$val_notpaid + $glpi_plugin_order_bills->value;
		}

}
echo "=================<br>\n";
Print "Total to Pay:    $val_notpaid";
;
$result = mysql_query ("SELECT * From glpi_plugin_order_bills WHERE entities_id=2 AND plugin_order_billstates_id=1" , $connexion);
echo "<br>\n";
echo "<br>\n";
echo "INVOICES PAID<br>\n";
echo "==============<br>\n";

if ($result)
{
	while ($glpi_plugin_order_bills = mysql_fetch_object($result))
	{
	
	echo "$glpi_plugin_order_bills->name    ,   $glpi_plugin_order_bills->value.<BR>\n";
			
			$val_paid=$val_paid + $glpi_plugin_order_bills->value;			
			}
		
}
echo "=================<br>\n";
Print "Total Paid:    $val_paid";
?>


</HTML></Body>


	
	