Nouveau fichier
This commit is contained in:
parent
07ab9595c0
commit
8368991885
168
htdocs/telephonie/ligne/commande/fiche.php
Normal file
168
htdocs/telephonie/ligne/commande/fiche.php
Normal file
@ -0,0 +1,168 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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");
|
||||
|
||||
$mesg_erreur = "";
|
||||
|
||||
$page = $_GET["page"];
|
||||
$sortorder = $_GET["sortorder"];
|
||||
$sortfield = $_GET["sortfield"];
|
||||
|
||||
if ($_GET["action"] == "create")
|
||||
{
|
||||
|
||||
$fourntel = new FournisseurTelephonie($db,1);
|
||||
if ( $fourntel->fetch() == 0)
|
||||
{
|
||||
$ct = new CommandeTableur($db, $user, $fourntel);
|
||||
|
||||
$result = $ct->create();
|
||||
|
||||
if ($result == 0)
|
||||
{
|
||||
Header("Location: archives.php");
|
||||
}
|
||||
elseif ($result == -3)
|
||||
{
|
||||
/* Erreur */
|
||||
$mesg_erreur = "Email fournisseur non définit";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
llxHeader("","Telephonie - Ligne - Commande");
|
||||
|
||||
print $mesg_erreur;
|
||||
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
if ($sortorder == "") {
|
||||
$sortorder="ASC";
|
||||
}
|
||||
if ($sortfield == "") {
|
||||
$sortfield="s.nom";
|
||||
}
|
||||
|
||||
/*
|
||||
* Recherche
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($mode == 'search') {
|
||||
if ($mode-search == 'soc') {
|
||||
$sql = "SELECT s.idp FROM ".MAIN_DB_PREFIX."societe as s ";
|
||||
$sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
|
||||
}
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
if ( $db->num_rows() == 1) {
|
||||
$obj = $db->fetch_object(0);
|
||||
$socid = $obj->idp;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
}
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
$sql = "SELECT sf.idp as sfidp, sf.nom as sfnom, s.idp as socidp, s.nom, l.ligne, f.nom as fournisseur, l.statut, l.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."societe as sf";
|
||||
$sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid AND l.statut IN (1,4) ";
|
||||
$sql .= " AND l.fk_soc_facture = sf.idp";
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
print_barre_liste("Commande", $page, "liste.php", "", $sortfield, $sortorder, '', $num);
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre"><td valign="center">Ligne';
|
||||
print '</td><td align="center">Statut</td><td>Client';
|
||||
print '</td><td>Client Facturé</td><td align="center">Rib OK</td><td>Fournisseur</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
|
||||
$ligne = new LigneTel($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$var=!$var;
|
||||
|
||||
$socf = new Societe($db);
|
||||
$socf->fetch($obj->sfidp);
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="../fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne)."</a></td>\n";
|
||||
print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->socidp.'">'.$obj->nom.'</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->sfidp.'">'.$obj->sfnom.'</a></td>';
|
||||
print '<td align="center">'.$socf->verif_rib().'</a></td>';
|
||||
print "<td>".$obj->fournisseur."</td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error() . ' ' . $sql;
|
||||
}
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print "<br>\n<div class=\"tabsAction\">\n";
|
||||
print '<a class="tabAction" href="fiche.php?action=create">Créer la commande</a>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
154
htdocs/telephonie/ligne/communications.php
Normal file
154
htdocs/telephonie/ligne/communications.php
Normal file
@ -0,0 +1,154 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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");
|
||||
|
||||
|
||||
$page = $_GET["page"];
|
||||
$sortorder = $_GET["sortorder"];
|
||||
|
||||
llxHeader();
|
||||
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
if ($sortorder == "") {
|
||||
$sortorder="DESC";
|
||||
}
|
||||
if ($sortfield == "") {
|
||||
$sortfield="l.date";
|
||||
}
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
$sql = "SELECT ligne, numero, date, fourn_cout, fourn_montant, duree, tarif_achat_temp, tarif_achat_fixe, tarif_vente_temp, tarif_vente_fixe, cout_achat, cout_vente, remise";
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details as l";
|
||||
|
||||
if ($_GET["ligne"])
|
||||
{
|
||||
$sql .= " WHERE ligne like '%".$_GET["ligne"]."%'";
|
||||
|
||||
if ($_GET["numero"])
|
||||
{
|
||||
$sql .= " AND numero like '%".$_GET["numero"]."%'";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//$sql .= " WHERE fourn_montant > cout_vente AND cout_vente > 0";
|
||||
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
print_barre_liste("Communications", $page, "communications.php", '&ligne='.$_GET["ligne"], $sortfield, $sortorder, '', $num);
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ligne","communications.php","l.ligne");
|
||||
print '<td align="center">Date</td><td align="center">Numéro</td><td align="center">';
|
||||
print "Durée</td>";
|
||||
print '<td align="right">Prix Vente</td><td align="right">Cout Achat</td>';
|
||||
|
||||
print '<td align="right">Vente /sec</td><td align="right">Vente Fixe</td>';
|
||||
print '<td align="right">Achat /sec</td><td align="right">Achat Fixe</td>';
|
||||
print '<td align="right">Remise</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="communications.php" method="GET">';
|
||||
print '<td><input type="text" name="ligne" value="'. $_GET["ligne"].'" size="20"></td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center"><input type="text" name="numero" value="'. $_GET["numero"].'" size="12"></td>';
|
||||
|
||||
print '<td><input type="submit" value="Chercher"></td>';
|
||||
|
||||
|
||||
|
||||
print '<td> </td>';
|
||||
print '<td align="center" colspan="6">Tarifs</td>';
|
||||
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$var=True;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>".$obj->ligne."</td>\n";
|
||||
print '<td align="center">'.$obj->date."</td>\n";
|
||||
print '<td align="center">'.$obj->numero."</td>\n";
|
||||
print '<td align="center">'.$obj->duree."</td>\n";
|
||||
|
||||
print '<td align="right">'.sprintf("%01.4f",$obj->cout_vente)."</td>\n";
|
||||
print '<td align="right">'.sprintf("%01.4f",$obj->cout_achat)."</td>\n";
|
||||
|
||||
print '<td align="right">'.sprintf("%01.4f",$obj->tarif_vente_temp)."</td>\n";
|
||||
print '<td align="right">'.sprintf("%01.4f",$obj->tarif_vente_fixe)."</td>\n";
|
||||
|
||||
print '<td align="right">'.sprintf("%01.4f",$obj->tarif_achat_temp)."</td>\n";
|
||||
print '<td align="right">'.sprintf("%01.4f",$obj->tarif_achat_fixe)."</td>\n";
|
||||
|
||||
print '<td align="center">'.$obj->remise." %</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error() . ' ' . $sql;
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
190
htdocs/telephonie/ligne/groupe.php
Normal file
190
htdocs/telephonie/ligne/groupe.php
Normal file
@ -0,0 +1,190 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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");
|
||||
|
||||
$page = $_GET["page"];
|
||||
$sortorder = $_GET["sortorder"];
|
||||
$sortfield = $_GET["sortfield"];
|
||||
|
||||
llxHeader('','Telephonie - Ligne - Liste');
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
if ($sortorder == "") {
|
||||
$sortorder="ASC";
|
||||
}
|
||||
if ($sortfield == "") {
|
||||
$sortfield="l.statut";
|
||||
}
|
||||
|
||||
/*
|
||||
* Recherche
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
$sql = "SELECT g.nom as gnom, s.idp as socidp, sf.idp as sfidp, sf.nom as nom_facture,s.nom, l.ligne, l.statut, l.rowid, l.remise";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."societe as sf";
|
||||
|
||||
|
||||
$sql .= " , ".MAIN_DB_PREFIX."telephonie_groupeligne as g";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."telephonie_groupe_ligne as gl";
|
||||
|
||||
|
||||
$sql .= " WHERE l.fk_soc = s.idp ";
|
||||
|
||||
$sql .= " AND g.rowid = gl.fk_groupe";
|
||||
$sql .= " AND gl.fk_ligne = l.rowid";
|
||||
|
||||
|
||||
$sql .= " AND l.fk_soc_facture = sf.idp";
|
||||
|
||||
if ($_GET["search_ligne"])
|
||||
{
|
||||
$sel =urldecode($_GET["search_ligne"]);
|
||||
$sel = ereg_replace("\.","",$sel);
|
||||
$sel = ereg_replace(" ","",$sel);
|
||||
$sql .= " AND l.ligne LIKE '%".$sel."%'";
|
||||
}
|
||||
|
||||
if ($_GET["search_client"])
|
||||
{
|
||||
$sel =urldecode($_GET["search_client"]);
|
||||
$sql .= " AND s.nom LIKE '%".$sel."%'";
|
||||
}
|
||||
|
||||
if ($_GET["search_client_facture"])
|
||||
{
|
||||
$sel =urldecode($_GET["search_client_facture"]);
|
||||
$sql .= " AND sf.nom LIKE '%".$sel."%'";
|
||||
}
|
||||
|
||||
if (strlen($_GET["statut"]))
|
||||
{
|
||||
$sql .= " AND l.statut = ".$_GET["statut"];
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
$urladd= "&statut=".$_GET["statut"];
|
||||
|
||||
print_barre_liste("Lignes", $page, "groupe.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre"><td>Groupe</td>';
|
||||
|
||||
print_liste_field_titre("Ligne","groupe.php","l.ligne");
|
||||
print_liste_field_titre("Client","groupe.php","s.nom");
|
||||
|
||||
print '<td>Client facturé</td>';
|
||||
print '<td align="center">Statut</td>';
|
||||
|
||||
print_liste_field_titre("Remise LMN","groupe.php","l.remise","","",' align="center"');
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="groupe.php" method="GET">';
|
||||
print '<td> </td>';
|
||||
print '<td><input type="text" name="search_ligne" value="'. $_GET["search_ligne"].'" size="12"></td>';
|
||||
print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="20"></td>';
|
||||
print '<td><input type="text" name="search_client_facture" value="'. $_GET["search_client_facture"].'" size="20"></td>';
|
||||
|
||||
print '<td><input type="submit" value="Chercher"></td>';
|
||||
|
||||
|
||||
|
||||
print '<td> </td>';
|
||||
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$var=True;
|
||||
|
||||
$ligne = new LigneTel($db);
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print "<td>".$obj->gnom."</td><td>\n";
|
||||
|
||||
print '<img src="./graph'.$obj->statut.'.png"> ';
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">';
|
||||
print img_file();
|
||||
print '</a> ';
|
||||
|
||||
print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne)."</a></td>\n";
|
||||
|
||||
print '<td>'.$obj->nom.'</td>';
|
||||
print '<td>'.$obj->nom_facture.'</td>';
|
||||
|
||||
print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n";
|
||||
|
||||
print '<td align="center">'.$obj->remise." %</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error() . ' ' . $sql;
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
204
htdocs/telephonie/ligne/numdata.php
Normal file
204
htdocs/telephonie/ligne/numdata.php
Normal file
@ -0,0 +1,204 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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");
|
||||
|
||||
|
||||
$page = $_GET["page"];
|
||||
$sortorder = $_GET["sortorder"];
|
||||
$sortfield = $_GET["sortfield"];
|
||||
|
||||
if ($_POST["action"] == 'addnum')
|
||||
{
|
||||
|
||||
if (strlen(trim($_POST["numero"])) > 0)
|
||||
{
|
||||
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."telephonie_numdata";
|
||||
$sql .= " (fk_groupe, numero,fk_user) VALUES ";
|
||||
$sql .= " (".$_POST["groupeid"].",'".$_POST["numero"]."',".$user->id.")";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
//Header("Location: numdata.php?id=".$ligne->id);
|
||||
Header("Location: numdata.php?id=".$ligne->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
|
||||
if (strlen(trim($_GET["id"])) > 0)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_numdata";
|
||||
$sql .= " WHERE rowid = ".$_GET["id"];
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
Header("Location: numdata.php");
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
llxHeader('','Telephonie - Ligne - Liste');
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Recherche
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
print_barre_liste("Numéros data", $page, "numdata.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Numéro","numdata.php","l.ligne");
|
||||
|
||||
print_liste_field_titre("Client","numdata.php","s.nom");
|
||||
print '<td> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="numdata.php" method="GET">';
|
||||
print '<td><input type="text" name="search_ligne" value="'. $_GET["search_ligne"].'" size="12"></td>'; print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="20"></td>';
|
||||
|
||||
print '<td><input type="submit" value="Chercher"></td>';
|
||||
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="numdata.php" method="POST">';
|
||||
print '<input type="hidden" name="action" value="addnum"></td>';
|
||||
print '<td><input type="text" name="numero" size="12" maxlength="12"></td>';
|
||||
|
||||
print '<td><select name="groupeid">';
|
||||
$sql = "SELECT distinct g.rowid , g.nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_groupeligne as g";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($i);
|
||||
print '<option value="'.$row[0].'">'.$row[1];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
print '<td><input type="submit" value="Ajouter"></td>';
|
||||
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$sql = "SELECT g.nom, n.numero, n.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_groupeligne as g";
|
||||
$sql .= ",".MAIN_DB_PREFIX."telephonie_numdata as n";
|
||||
|
||||
$sql .= " WHERE n.fk_groupe = g.rowid";
|
||||
|
||||
if ($sortorder == "") {
|
||||
$sortorder="ASC";
|
||||
}
|
||||
if ($sortfield == "") {
|
||||
$sortfield="g.nom";
|
||||
}
|
||||
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
$var=True;
|
||||
|
||||
$ligne = new LigneTel($db);
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]><td>";
|
||||
|
||||
print dolibarr_print_phone($obj->numero)."</td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->socidp.'">'.$obj->nom.'</a></td>';
|
||||
|
||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/telephonie/ligne/numdata.php?action=delete&id='.$obj->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error() . ' ' . $sql;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -20,6 +20,7 @@
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
|
||||
create table llx_telephonie_facture (
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
fk_ligne integer NOT NULL,
|
||||
|
||||
75
htdocs/telephonie/stats/index.php
Normal file
75
htdocs/telephonie/stats/index.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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");
|
||||
|
||||
$page = $_GET["page"];
|
||||
$sortorder = $_GET["sortorder"];
|
||||
|
||||
if (!$user->rights->telephonie->lire)
|
||||
accessforbidden();
|
||||
|
||||
llxHeader('','Telephonie - Ligne');
|
||||
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
|
||||
print '<tr><td width="50%" valign="top">';
|
||||
|
||||
print '<img src="./graphcommandeweek.php"><br /><br />';
|
||||
print '<img src="./graphcommandemonth.php"><br /><br />';
|
||||
|
||||
|
||||
print '</td>';
|
||||
|
||||
|
||||
|
||||
print '</td><td valign="top" width="50%" rowspan="3">';
|
||||
|
||||
print '<a href="commerciaux"><img border="0" src="./graphcommercial.php"></a><br /><br />';
|
||||
print '<img src="./graphconcurrent.php">';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
62
htdocs/telephonie/stats/pre.inc.php
Normal file
62
htdocs/telephonie/stats/pre.inc.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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("../../main.inc.php");
|
||||
require(DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php");
|
||||
|
||||
$user->getrights('telephonie');
|
||||
|
||||
function llxHeader($head = "", $title="") {
|
||||
global $user, $conf;
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
top_menu($head, $title);
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/index.php", "Telephonie");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/tarifs/", "Tarifs");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/client/index.php", "Clients");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/ligne/index.php", "Lignes");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/facture/", "Factures");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/fournisseurs.php", "Fournisseurs");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/stats/", "Stats");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/clients/", "Clients");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/commerciaux/", "Commerciaux");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/lignes/", "Lignes");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/statca/", "Chiffre d'affaire");
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user