Mise aux normes W3C

This commit is contained in:
Rodolphe Quiedeville 2006-12-23 10:48:26 +00:00
parent a399e0369d
commit 1901f4c8c9
2 changed files with 83 additions and 96 deletions

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@ -21,10 +21,10 @@
*/
/**
\file htdocs/compta/facture/stats/index.php
\ingroup facture
\brief Page des stats factures
\version $Revision$
\file htdocs/compta/facture/stats/index.php
\ingroup facture
\brief Page des stats factures
\version $Revision$
*/
require("./pre.inc.php");
@ -51,62 +51,60 @@ $data = $stats->getNbByMonthWithPrevYear($year);
create_exdir($conf->facture->dir_temp);
$filename = $conf->facture->dir_temp."/nbfacture2year-".$year.".png";
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=nbfacture2year-'.$year.'.png';
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=nbfacture2year-'.$year.'.png';
$px = new DolGraph();
$mesg = $px->isGraphKo();
if (! $mesg)
{
$px->SetData($data);
$px->SetPrecisionY(0);
$px->SetPrecisionY(0);
$px->SetMaxValue($px->GetCeilMaxValue());
$px->SetLegend(array($year - 1, $year));
$px->SetWidth($WIDTH);
$px->SetHeight($HEIGHT);
$px->SetShading(5);
$px->SetHorizTickIncrement(1);
$px->SetPrecisionY(0);
$px->SetHorizTickIncrement(1);
$px->SetPrecisionY(0);
$px->draw($filename);
}
$sql = "SELECT count(*) as nb, date_format(datef,'%Y') as dm, sum(total) as total FROM ".MAIN_DB_PREFIX."facture WHERE fk_statut > 0 ";
if ($socid)
{
$sql .= " AND fk_soc = $socid";
$sql .= " AND fk_soc=$socid";
}
$sql .= " GROUP BY dm DESC ";
$sql.= " GROUP BY dm DESC;";
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
print '<table class="border" width="100%">';
print '<tr><td align="center">'.$langs->trans("Year").'</td><td width="10%" align="center">'.$langs->trans("NumberOfBills").'</td><td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center" valign="top" rowspan="'.($num + 1).'">';
if ($mesg) { print $mesg; }
else { print '<img src="'.$fileurl.'" alt="Nombre de factures par mois">'; }
print '</td></tr>';
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$nbproduct = $obj->nb;
$year = $obj->dm;
$total = price($obj->total);
print "<tr>";
print '<td align="center"><a href="month.php?year='.$year.'">'.$year.'</a></td><td align="center">'.$nbproduct.'</td><td align="center">'.$total.'</td></tr>';
$i++;
}
print '</table>';
$db->free();
$num = $db->num_rows($resql);
print '<table class="border" width="100%">';
print '<tr><td align="center">'.$langs->trans("Year").'</td><td width="10%" align="center">'.$langs->trans("NumberOfBills").'</td><td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center" valign="top" rowspan="'.($num + 1).'">';
if ($mesg) { print $mesg; }
else { print '<img src="'.$fileurl.'" alt="Nombre de factures par mois">'; }
print '</td></tr>';
while ($obj = $db->fetch_object($resql))
{
$nbproduct = $obj->nb;
$year = $obj->dm;
$total = price($obj->total);
print "<tr>";
print '<td align="center"><a href="month.php?year='.$year.'">'.$year.'</a></td><td align="center">'.$nbproduct.'</td><td align="center">'.$total.'</td></tr>';
}
print '</table>';
$db->free($resql);
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($db);
}
$db->close();
llxFooter('$Date$ - $Revision$');

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@ -20,10 +20,11 @@
* $Source$
*/
/** \file htdocs/compta/paiement/rapport.php
\ingroup facture
\brief Rapports de paiements
\version $Revision$
/**
\file htdocs/compta/paiement/rapport.php
\ingroup facture
\brief Rapports de paiements
\version $Revision$
*/
require("./pre.inc.php");
@ -31,7 +32,6 @@ require_once(DOL_DOCUMENT_ROOT."/includes/modules/rapport/pdf_paiement.class.php
$user->getrights("facture");
// Sécurité accés
if (! $user->rights->facture->lire)
accessforbidden();
@ -41,19 +41,14 @@ $dir = $conf->compta->dir_output;
$socid=0;
if ($user->societe_id > 0)
{
$action = '';
$socid = $user->societe_id;
$dir = DOL_DATA_ROOT.'/private/'.$user->id.'/compta';
$action = '';
$socid = $user->societe_id;
$dir = DOL_DATA_ROOT.'/private/'.$user->id.'/compta';
}
$year = $_GET["year"];
if (! $year) { $year=date("Y"); }
/*
* Action générer fichier rapport paiements
*/
@ -65,8 +60,6 @@ if ($_POST["action"] == 'gen')
$year = $_POST["reyear"];
}
llxHeader();
/*
@ -82,21 +75,19 @@ print '<input type="hidden" name="action" value="gen">';
$cmonth = date("n", time());
$syear = date("Y", time());
print '<select name="remonth">';
for ($month = 1 ; $month < 13 ; $month++)
{
if ($month == $cmonth)
{
print "<option value=\"$month\" selected=\"true\">" . dolibarr_print_date(mktime(0,0,0,$month),"%B");
}
else
{
print "<option value=\"$month\">" . dolibarr_print_date(mktime(0,0,0,$month),"%B");
}
if ($month == $cmonth)
{
print "<option value=\"$month\" selected=\"true\">" . dolibarr_print_date(mktime(0,0,0,$month),"%B");
}
else
{
print "<option value=\"$month\">" . dolibarr_print_date(mktime(0,0,0,$month),"%B");
}
}
print "</select>";
print '<select name="reyear">';
for ($formyear = $syear - 2; $formyear < $syear +1 ; $formyear++)
@ -113,7 +104,6 @@ for ($formyear = $syear - 2; $formyear < $syear +1 ; $formyear++)
print "</select>\n";
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
print '</form>';
print '<br>';
clearstatcache();
@ -123,49 +113,48 @@ clearstatcache();
$found=0;
if (is_dir($dir))
{
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{
if (is_dir($dir.'/'.$file) && ! eregi('^\.',$file))
{
$found=1;
print '<a href="rapport.php?year='.$file.'">'.$file.'</a> ';
}
if (is_dir($dir.'/'.$file) && ! eregi('^\.',$file))
{
$found=1;
print '<a href="rapport.php?year='.$file.'">'.$file.'</a> ';
}
}
}
if ($year)
{
if (is_dir($dir.'/'.$year))
if (is_dir($dir.'/'.$year))
{
$handle=opendir($dir.'/'.$year);
if ($found) print '<br>';
print '<br>';
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Reporting").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="right">'.$langs->trans("Date").'</td>';
print '</tr>';
$var=true;
while (($file = readdir($handle))!==false)
{
$handle=opendir($dir.'/'.$year);
if ($found) print '<br>';
print '<br>';
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Reporting").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="right">'.$langs->trans("Date").'</td>';
print '</tr>';
$var=true;
while (($file = readdir($handle))!==false)
{
if (eregi('^payment',$file))
{
$var=!$var;
$tfile = $dir . '/'.$year.'/'.$file;
$relativepath = $year.'/'.$file;
print "<tr $bc[$var]>".'<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<td align="right">'.filesize($tfile). ' '.$langs->trans("Bytes").'</td>';
print '<td align="right">'.dolibarr_print_date(filemtime($tfile),"%d %b %Y %H:%M:%S").'</td></tr>';
}
}
print '</table>';
if (eregi('^payment',$file))
{
$var=!$var;
$tfile = $dir . '/'.$year.'/'.$file;
$relativepath = $year.'/'.$file;
print "<tr $bc[$var]>".'<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<td align="right">'.filesize($tfile). ' '.$langs->trans("Bytes").'</td>';
print '<td align="right">'.dolibarr_print_date(filemtime($tfile),"%d %b %Y %H:%M:%S").'</td></tr>';
}
}
print '</table>';
}
}
$db->close();
llxFooter('$Date$ - $Revision$');
?>