Bugfix
This commit is contained in:
parent
992872d349
commit
120f22ec06
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -21,7 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
|
|
||||||
$page = $_GET["page"];
|
$page = $_GET["page"];
|
||||||
$sortorder = $_GET["sortorder"];
|
$sortorder = $_GET["sortorder"];
|
||||||
$sortfield = $_GET["sortfield"];
|
$sortfield = $_GET["sortfield"];
|
||||||
@ -46,7 +45,6 @@ if ($sortfield == "") {
|
|||||||
/*
|
/*
|
||||||
* Recherche
|
* Recherche
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($page == -1) { $page = 0 ; }
|
if ($page == -1) { $page = 0 ; }
|
||||||
@ -59,22 +57,14 @@ $pagenext = $page + 1;
|
|||||||
* Mode Liste
|
* Mode Liste
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT s.idp as socid, s.nom, count(l.ligne) as ligne, cs.ca";
|
$sql = "SELECT s.idp as socid, s.nom, count(l.ligne) as ligne, cs.ca";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ",".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perms as sp ON sp.fk_soc = s.idp ";
|
||||||
$sql .= ",".MAIN_DB_PREFIX."societe_perms as sp";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."telephonie_client_stats as cs ON cs.fk_client_comm = s.idp";
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."telephonie_societe_ligne as l ON l.fk_client_comm = s.idp";
|
||||||
|
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."telephonie_client_stats as cs ON s.idp=cs.fk_client_comm";
|
$sql .= " WHERE sp.fk_user = ".$user->id." AND sp.pread = 1";
|
||||||
|
|
||||||
$sql .= " WHERE l.fk_client_comm = s.idp ";
|
|
||||||
|
|
||||||
$sql .= " AND s.idp = sp.fk_soc";
|
|
||||||
$sql .= " AND sp.fk_user = ".$user->id." AND sp.pread = 1";
|
|
||||||
|
|
||||||
if ($_GET["search_client"])
|
if ($_GET["search_client"])
|
||||||
{
|
{
|
||||||
@ -83,7 +73,6 @@ if ($_GET["search_client"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " GROUP BY s.idp";
|
$sql .= " GROUP BY s.idp";
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -107,15 +96,11 @@ if ($result)
|
|||||||
print '<form action="liste.php" method="GET">';
|
print '<form action="liste.php" method="GET">';
|
||||||
print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="12"></td>';
|
print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="12"></td>';
|
||||||
print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td><td> </td>';
|
print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td><td> </td>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
$ligne = new LigneTel($db);
|
|
||||||
|
|
||||||
while ($i < min($num,$conf->liste_limit))
|
while ($i < min($num,$conf->liste_limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($i);
|
$obj = $db->fetch_object($i);
|
||||||
@ -131,8 +116,6 @@ if ($result)
|
|||||||
print '<td align="center">'.$obj->ligne."</td>\n";
|
print '<td align="center">'.$obj->ligne."</td>\n";
|
||||||
|
|
||||||
print '<td align="right">'.price($obj->ca)." euros HT</td>\n";
|
print '<td align="right">'.price($obj->ca)." euros HT</td>\n";
|
||||||
|
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user