Ajoute des reps

This commit is contained in:
Rodolphe Quiedeville 2005-02-18 15:14:00 +00:00
parent 6134c536a8
commit a7accfef93

View File

@ -24,6 +24,53 @@
*/
require ("../../master.inc.php");
/*
* Création des répertoires
*
*/
$dirs[0] = DOL_DATA_ROOT."/graph/";
$dirs[1] = DOL_DATA_ROOT."/graph/telephonie/";
$dirs[2] = DOL_DATA_ROOT."/graph/telephonie/communications/";
$dirs[3] = DOL_DATA_ROOT."/graph/telephonie/factures/";
$dirs[4] = DOL_DATA_ROOT."/graph/telephonie/ca/";
$dirs[5] = DOL_DATA_ROOT."/graph/telephonie/client/";
$dirs[6] = DOL_DATA_ROOT."/graph/telephonie/lignes/";
$dirs[7] = DOL_DATA_ROOT."/graph/telephonie/commercials/";
$img_root = DOL_DATA_ROOT."/graph/telephonie/";
$numdir = sizeof($dirs);
$sql = "SELECT distinct fk_commercial";
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne";
if ($db->query($sql))
{
$num = $db->num_rows();
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row();
$dirs[($numdir + $i)] = DOL_DATA_ROOT."/graph/telephonie/commercials/".$row[0];
$i++;
}
}
if (is_array($dirs))
{
foreach ($dirs as $key => $value)
{
$dir = $value;
create_dir($dir);
}
}
$base_dir = DOL_DATA_ROOT.'/graph/telephonie/lignes/';
for ($i = 0 ; $i < 10 ; $i++)
@ -47,6 +94,19 @@ for ($i = 0 ; $i < 10 ; $i++)
}
}
function create_dir($dir)
{
if (! file_exists($dir))