*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
llxHeader("","","Fiche Ligne");
if ($_GET["id"] or $_GET["numero"])
{
if ($_GET["action"] <> 're-edit')
{
$ligne = new LigneTel($db);
if ($_GET["id"])
{
$result = $ligne->fetch_by_id($_GET["id"]);
}
if ($_GET["numero"])
{
$result = $ligne->fetch($_GET["numero"]);
}
}
if ( $result )
{
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{
$h=0;
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/fiche.php?id=".$ligne->id;
$head[$h][1] = $langs->trans("Ligne");
$h++;
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/factures.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Factures');
$h++;
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Infos');
$h++;
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/history.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Historique');
$h++;
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/conso.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Conso');
$h++;
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/stat.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Stats');
$hselected = $h;
$h++;
dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
print_fiche_titre('Fiche Ligne', $mesg);
print '
';
print '| Numéro | '.dolibarr_print_phone($ligne->numero).' | ';
print 'Facturée : '.$ligne->facturable.' | |
';
$client = new Societe($db, $ligne->client_id);
$client->fetch($ligne->client_id);
print '| Client | ';
print '';
print $client->nom.' | ';
$client_facture = new Societe($db);
$client_facture->fetch($ligne->client_facture_id);
print 'Client Facturé | '.$client_facture->nom.' |
';
print '| Statut | ';
print ' ';
print $ligne->statuts[$ligne->statut];
print " |
";
/*
*
*
*/
print '';
print '| Chiffre d\'affaire | ';
print 'Gain |
';
print '';
$mesg_no_graph = 'Nous avons pas assez de données à ce jour pour générer ce graphique.';
$img_root = DOL_DATA_ROOT."/graph/".substr($ligne->id,-1)."/telephonie/ligne/";
$file = $img_root.$ligne->id."/graphca.png";
if (file_exists($file))
{
print ' ';
}
else
{
print $mesg_no_graph;
}
print ' | ';
$file = $img_root.$ligne->id."/graphgain.png";
if (file_exists($file))
{
print ' ';
}
else
{
print $mesg_no_graph;
}
print ' |
';
print '| Appels | ';
print '- |
';
print '';
$file = $img_root.$ligne->id."/graphappelsdureemoyenne.png";
if (file_exists($file))
{
print ' ';
}
else
{
print $mesg_no_graph;
}
print ' | ';
print " ";
print ' |
';
print '| Communications | ';
print 'Minutes |
';
print '';
$file = $img_root.$ligne->id."/nb-comm-mensuel.png";
if (file_exists($file))
{
print ' ';
}
else
{
print $mesg_no_graph;
}
print ' | ';
$file = $img_root.$ligne->id."/nb-minutes-mensuel.png";
if (file_exists($file))
{
print ' ';
}
else
{
print $mesg_no_graph;
}
print ' |
';
}
}
}
else
{
print "Error";
}
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
$db->close();
llxFooter("Dernière modification $Date$ révision $Revision$");
?>