Ajout sécurité accés client
This commit is contained in:
parent
303f7c227e
commit
e8dffb1b05
@ -37,7 +37,7 @@ llxHeader();
|
|||||||
|
|
||||||
print_fiche_titre('Statistiques factures', $mesg);
|
print_fiche_titre('Statistiques factures', $mesg);
|
||||||
|
|
||||||
$stats = new FactureStats($db);
|
$stats = new FactureStats($db, $socidp);
|
||||||
$year = strftime("%Y", time());
|
$year = strftime("%Y", time());
|
||||||
$data = $stats->getNbByMonthWithPrevYear($year);
|
$data = $stats->getNbByMonthWithPrevYear($year);
|
||||||
$filev = "/document/images/nbfacture2year-$year.png";
|
$filev = "/document/images/nbfacture2year-$year.png";
|
||||||
@ -50,12 +50,12 @@ $px->SetHeight(280);
|
|||||||
|
|
||||||
$px->draw(DOL_DOCUMENT_ROOT.$filev, $data, $year);
|
$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)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND fk_soc = $socidp";
|
$sql .= " AND fk_soc = $socidp";
|
||||||
}
|
}
|
||||||
|
$sql .= " GROUP BY dm DESC ";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
|
|||||||
@ -21,6 +21,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
/*
|
||||||
|
* Sécurité accés client
|
||||||
|
*/
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socidp = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$year = $_GET["year"];
|
$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;
|
$dir = DOL_DOCUMENT_ROOT;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user