Ajout scurit accs client

This commit is contained in:
Rodolphe Quiedeville 2003-11-24 09:01:13 +00:00
parent 303f7c227e
commit e8dffb1b05
2 changed files with 12 additions and 4 deletions

View File

@ -37,7 +37,7 @@ llxHeader();
print_fiche_titre('Statistiques factures', $mesg);
$stats = new FactureStats($db);
$stats = new FactureStats($db, $socidp);
$year = strftime("%Y", time());
$data = $stats->getNbByMonthWithPrevYear($year);
$filev = "/document/images/nbfacture2year-$year.png";
@ -50,12 +50,12 @@ $px->SetHeight(280);
$px->draw(DOL_DOCUMENT_ROOT.$filev, $data, $year);
$sql = "SELECT count(*), date_format(datef,'%Y') as dm, sum(total) FROM llx_facture WHERE fk_statut > 0 GROUP BY dm DESC ";
$sql = "SELECT count(*), date_format(datef,'%Y') as dm, sum(total) FROM llx_facture WHERE fk_statut > 0 ";
if ($socidp)
{
$sql .= " AND fk_soc = $socidp";
}
$sql .= " GROUP BY dm DESC ";
if ($db->query($sql))
{
$num = $db->num_rows();

View File

@ -21,6 +21,14 @@
*/
require("./pre.inc.php");
/*
* Sécurité accés client
*/
if ($user->societe_id > 0)
{
$action = '';
$socidp = $user->societe_id;
}
llxHeader();
$year = $_GET["year"];
@ -35,7 +43,7 @@ print '<a href="month.php?year='.($year + 1).'">'.($year + 1).'</a>';
*
*
*/
$stats = new FactureStats($db);
$stats = new FactureStats($db, $socidp);
$dir = DOL_DOCUMENT_ROOT;