diff --git a/htdocs/telephonie/stats/consultation/index.php b/htdocs/telephonie/stats/consultation/index.php new file mode 100644 index 00000000000..83722a79d80 --- /dev/null +++ b/htdocs/telephonie/stats/consultation/index.php @@ -0,0 +1,75 @@ + + * + * 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"); + +if (!$user->rights->telephonie->lire) accessforbidden(); +if (!$user->rights->telephonie->stats->lire) accessforbidden(); + +llxHeader('','Telephonie - Statistiques - Consultations'); + +/* + * + * + */ + +include "./onglets.php"; +dolibarr_fiche_head($head, $hselected, "Consultations"); + +print '
'; + +print ''; +print '
'; + +$sql = "SELECT u.name, u.firstname, count(distinct(sc.fk_soc)) as dam"; +$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; +$sql .= ",".MAIN_DB_PREFIX."societe_consult as sc"; +$sql .= " WHERE sc.fk_user = u.rowid"; +$sql .= " GROUP BY u.rowid"; +$sql .= " ORDER BY dam DESC"; +$resql = $db->query($sql); +print ''; +print ''; +if ($resql) +{ + while ($row = $db->fetch_row($resql)) + { + print ''; + print ''; + } +} +print '
UtilisateurFiches client
'.$row[1].' '.$row[0].''.$row[2].'
'; + +print '
'; + + + +/* + * + * + */ + +print '
'; + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/stats/consultation/onglets.php b/htdocs/telephonie/stats/consultation/onglets.php new file mode 100644 index 00000000000..6771842c7ae --- /dev/null +++ b/htdocs/telephonie/stats/consultation/onglets.php @@ -0,0 +1,34 @@ + + * + * 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$ + * + */ +$h = 0; +$head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/contrats/index.php'; +$head[$h][1] = "Global"; +$h++; + +for ($hii = 0 ; $hii < sizeof($head) ; $hii++) +{ + if ($_SERVER["PHP_SELF"] == $head[$hii][0]) + { + $hselected = $hii; + } +} +?> diff --git a/htdocs/telephonie/stats/consultation/pre.inc.php b/htdocs/telephonie/stats/consultation/pre.inc.php new file mode 100644 index 00000000000..89ee8dfe60a --- /dev/null +++ b/htdocs/telephonie/stats/consultation/pre.inc.php @@ -0,0 +1,42 @@ + + * + * 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"); + +$user->getrights('telephonie'); + +function llxHeader($head = "", $title="") { + global $user; + + /* + * + * + */ + top_menu($head, $title); + + $menu = new Menu(); + + include "../menus.php"; + + left_menu($menu->liste); +} + +?>