|
From: <zy...@us...> - 2014-12-22 19:53:30
|
Revision: 12916
http://sourceforge.net/p/xoops/svn/12916
Author: zyspec
Date: 2014-12-22 19:53:04 +0000 (Mon, 22 Dec 2014)
Log Message:
-----------
Added Paths:
-----------
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/admin_list_functions.inc.php
Added: XoopsModules/rw_banner/branches/zyspec/rwbanner/include/admin_list_functions.inc.php
===================================================================
--- XoopsModules/rw_banner/branches/zyspec/rwbanner/include/admin_list_functions.inc.php (rev 0)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/include/admin_list_functions.inc.php 2014-12-22 19:53:04 UTC (rev 12916)
@@ -0,0 +1,375 @@
+<?php
+/*
+ RW-Banner
+ Copyright (c) 2006 BrInfo
+ <http://www.brinfo.com.br>
+ 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.
+
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting
+ source code which is considered copyrighted (c) material of the
+ original comment or credit authors.
+
+ 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
+*/
+/**
+ * XOOPS rwbanner Category, User, & Banner List Functions
+ *
+ * @copyright:: {@link www.brinfo.com.br BrInfo - Soluções Web}
+ * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
+ * @author:: Rodrigo Pereira Lima aka RpLima (http://www.brinfo.com.br)
+ * @package:: rwbanner
+ * @version:: $Id: $
+ *
+ */
+
+defined('XOOPS_ROOT_PATH') or exit('Restricted access');
+
+include_once "../class/class.banner.php";
+
+/**
+ *
+ * List Banners
+ * @param string $order database field to use for sorting
+ * @param string $seq 'ASC' or 'DESC' sort
+ * @param int|null $cat category id
+ * @param int $limit number of categories to show
+ * @param int $start starting place in return values
+ */
+function lista_banners($order=null, $seq=null, $cat=null, $limit=10, $start=0, $expand=false)
+{
+ global $pathIcon16;
+
+ $banner = new RWbanners();
+ $total = $banner->getRowNum($cat);
+ $ord = $order;
+ $order = "ORDER BY {$order} {$seq}";
+ $img = ('ASC' == $seq) ? "<img src='../assets/images/asc.gif' />" : "<img src='../assets/images/desc.gif' />";
+ $img_cod = ('codigo' == $ord) ? $img : '';
+ $img_cli = ('idcliente' == $ord) ? $img : '';
+ $img_cat = ('categoria' == $ord) ? $img : '';
+ $img_exib = ('exibicoes' == $ord) ? $img : '';
+ $img_click = ('clicks' == $ord) ? $img : '';
+ $img_dat = ('data' == $ord) ? $img : '';
+ $img_sts = ('status' == $ord) ? $img : '';
+ $categoria = (null == $cat) ? null : (int) $cat;
+ $start = (int) $start;
+
+ $lista_banners = $banner->getBanners(true, $order, $categoria, $limit, $start);
+ $extra_sel = (0 != $start) ? "&start={$start}" : '';
+ $seq = ('ASC' == $seq) ? 'DESC' : 'ASC';
+ $in_cat = (null == $cat) ? '' : " in this category";
+
+ if ($expand) {
+ $expand_img = 'close12.gif';
+ $div_disp = '';
+ } else {
+ $expand_img = 'open12.gif';
+ $div_disp = "style='display: none;'";
+ }
+
+ rwbanner_collapsableBar('banners', 'bannersicon');
+ echo "<img id='bannersicon' name='bannersicon' src='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/assets/images/icon/{$expand_img}") . "' alt='' /></a> " . _AM_RWBANNER_LIST_BANNER . "{$in_cat}</h3>\n"
+ . "<span style='color: #567; margin: 3px 0 12px 0; font-size: small; display: block; text-align:justify;'>" . _AM_RWBANNER_LIST_BANNER_DESC . "</span>\n"
+ . "<div id='banners'{$div_disp}>\n"
+ . "<table style='font-size:10px; width: 100%;' class='outer'>\n"
+ . "<thead>\n"
+ . "<tr class='head'>\n"
+ . " <th class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?order=codigo&seq={$seq}{$extra_sel}") . "'>" . _AM_RWBANNER_TITLE2 . "{$img_cod}</a></th>\n"
+ . " <th class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?order=idcliente&seq={$seq}{$extra_sel}") . "'>" . _AM_RWBANNER_TITLE3 . "{$img_cli}</a></th>\n"
+ . " <th class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?order=categoria&seq={$seq}{$extra_sel}") . "'>" . _AM_RWBANNER_TITLE4 . "{$img_cat}</a></th>\n"
+ . " <th class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?order=exibicoes&seq={$seq}{$extra_sel}") . "'>" . _AM_RWBANNER_TITLE5 . "{$img_exib}</a></th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE6 . "</th>\n"
+ . " <th class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?order=clicks&seq={$seq}{$extra_sel}") . "'>" . _AM_RWBANNER_TITLE7 . "{$img_click}</a></th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE39 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE8 . "</th>\n"
+ . " <th class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?order=data&seq={$seq}{$extra_sel}") . "'>" . _AM_RWBANNER_TITLE9 . "{$img_dat}</a></th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE99 . "</th>\n"
+ . " <th class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?order=status&seq={$seq}{$extra_sel}'") . ">" . _AM_RWBANNER_TITLE10 . "{$img_sts}</a></th>\n"
+ . " <th class='center' style='width: 12%;'>" . _AM_RWBANNER_TITLE11 . "</th>\n"
+ . "</tr>\n"
+ . "</thead>\n"
+ . "<tbody>\n";
+ $class = "even";
+ $lista_banners_count = count($lista_banners);
+ for ($i = 0; $i < $lista_banners_count; ++$i) {
+ if (1 == $lista_banners[$i]->getStatus()) { //active
+ $status = "<img src='{$pathIcon16}/green.gif' style='width: 16px; height: 16px; border-width: 0[x;' alt='" . _AM_RWBANNER_BANNER_STATUS1 . "' title='" . _AM_RWBANNER_BANNER_STATUS1 . "' />\n";
+ $estilo = '';
+ } elseif (2 == $lista_banners[$i]->getStatus()) { //waiting approval
+ $status = "<img src='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . '/assets/images/wait.gif') . "' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_BANNER_STATUS3 . "' title='" . _AM_RWBANNER_BANNER_STATUS3 . "' />\n";
+ $estilo = '';
+ } else { // inactive
+ $status = "<img src='{$pathIcon16}/red.gif' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_BANNER_STATUS2 . "' title='" . _AM_RWBANNER_BANNER_STATUS2 . "' />\n";
+ $estilo = " style='color: red;'";
+ }
+ $class = ($class == "even") ? "odd" : "even";
+ if (0 == $lista_banners[$i]->getMaxexib()) {
+ $exibrest = _AM_RWBANNER_UNLIMIT;
+ } else {
+ $exibrest = round($lista_banners[$i]->getMaxexib()-$lista_banners[$i]->getExibicoes());
+ }
+ if (0 == $lista_banners[$i]->getMaxclick()) {
+ $exibrestclick = _AM_RWBANNER_UNLIMIT;
+ } else {
+ $exibrestclick = round($lista_banners[$i]->getMaxclick()-$lista_banners[$i]->getClicks());
+ }
+ if (0 != $lista_banners[$i]->getClicks() && 0 != $lista_banners[$i]->getExibicoes()) {
+ $perc = round(($lista_banners[$i]->getClicks() / $lista_banners[$i]->getExibicoes()) * 100, 2);
+ } else {
+ $perc = '0';
+ }
+ $data = $lista_banners[$i]->getData();
+ $periodo = $lista_banners[$i]->getPeriodo();
+ $maxdata = somaData($data,$periodo);
+ if (0 == $periodo) {
+ $periodo = _AM_RWBANNER_UNLIMIT;
+ } else {
+ $periodo = converte($maxdata, false);
+ }
+ $titulo = ('' != $lista_banners[$i]->getBannnerCategName()) ? $lista_banners[$i]->getBannnerCategName() : _AM_RWBANNER_NO_CATEG;
+ $cliente = $lista_banners[$i]->getBannnerClientName();
+ $lista_banners[$i]->clearDb();
+ $data_cad = converte($lista_banners[$i]->getData(), false);
+ echo "<tr class='{$class}'{$estilo}>\n"
+ . " <td class='center'>" . $lista_banners[$i]->getCodigo() . "</td>\n"
+ . " <td class='center'><a href='" . $GLOBALS['xoops']->url('www/userinfo.php?uid=' . $lista_banners[$i]->getIdcliente()) . "'>{$cliente}</a></td>\n"
+ . " <td class='center'>{$titulo}</td>\n"
+ . " <td class='center'>" . $lista_banners[$i]->getExibicoes() . "</td>\n"
+ . " <td class='center'>{$exibrest}</td>\n"
+ . " <td class='center'>" . $lista_banners[$i]->getClicks() . "</td>\n"
+ . " <td class='center'>{$exibrestclick}</td>\n"
+ . " <td class='center'>{$perc}%</td>\n"
+ . " <td class='center'>{$data_cad}</td>\n"
+ . " <td class='center'>{$periodo}</td>\n"
+ . " <td class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?op=mudastatus&id=" . $lista_banners[$i]->getCodigo()) . "'>{$status}</a></td>\n"
+ . " <td class='center' style='width: 10%;'>\n"
+ . " <a href='javascript:;' onClick=\"javascript: window.open('exibe.php?id=" . $lista_banners[$i]->getCodigo() . "','editar','width=" . ($lista_banners[$i]->getLargura() + 20) . ",height=" . $lista_banners[$i]->getAltura() . ",toolbar=no');\"><img src='{$pathIcon16}/search.png' style='width: 16px; height: 16px; border-with: 0px;' alt='" . _AM_RWBANNER_VALUE_BTN2 . "' title='" . _AM_RWBANNER_VALUE_BTN2 . "' /></a>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/banners.php?id=" . $lista_banners[$i]->getCodigo() . "&op=editar") . "'><img src='{$pathIcon16}/edit.png' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_VALUE_BTN3 . "' title='" . _AM_RWBANNER_VALUE_BTN3 . "' /></a>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?id=" . $lista_banners[$i]->getCodigo() . "&op=deletar") . "'><img src='{$pathIcon16}/delete.png' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_VALUE_BTN4 . "' title='" . _AM_RWBANNER_VALUE_BTN4 . "' /></a>\n"
+ . " </td>\n"
+ . "</tr>\n";
+ }
+ echo "</tbody>\n";
+ if (substr($_SERVER['QUERY_STRING'], 0, 5) != 'start') {
+ $arr_qs = explode('&', $_SERVER['QUERY_STRING']);
+ $n = (substr($arr_qs[count($arr_qs)-1], 0, 5) != 'start') ? 1 : 2;
+ $extra_pag = '';
+ $arr_qs_count = count($arr_qs) - $n;
+ for ($i = 0; $i <= $arr_qs_count; ++$i) {
+ $extra_pag .= $arr_qs[$i] . '&';
+ }
+ $extra_pag = substr($extra_pag, 0, strlen($extra_pag)-1);
+ } else {
+ $extra_pag = '';
+ }
+ $pagenav = new XoopsPageNav($total, $limit, $start, 'start', $extra_pag);
+ $pag = $pagenav->renderNav();
+ echo "<tfoot>\n"
+ . "<tr class='head'>\n"
+ . " <td class='left' colspan='12' nowrap='nowrap'>" . _AM_RWBANNER_TOTAL_BANNER_LEG . " {$total}{$in_cat}<br />\n"
+ . " <div class='center'>{$pag}</div>\n"
+ . " </td>\n"
+ . "</tr>\n"
+ . "</tfoot>\n"
+ . "</table>\n"
+ . "</div><br />\n";
+}
+
+function lista_categs($expand=false)
+{
+
+ $categ = new Categoria();
+ $lista_categs = $categ->getCategorias('ORDER BY cod ASC');
+ global $pathIcon16;
+
+ if ($expand) {
+ $expand_img = 'close12.gif';
+ $div_disp = '';
+ } else {
+ $expand_img = 'open12.gif';
+ $div_disp = "style='display: none;'";
+ }
+
+
+ rwbanner_collapsableBar('categs', 'categsicon');
+ echo "<img id='categssicon' name='categsicon' src=" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/assets/images/icon/{$expand_img}") . " alt='' /></a> " . _AM_RWBANNER_LIST_CATEG . "</h3>\n"
+ . "<span style='color: #567; margin: 3px 0 12px 0; font-size: small; display: block; text-align: justify;'>" . _AM_RWBANNER_LIST_CATEG_DESC . "</span>\n"
+ . "<div id='categs'{$div_disp}>\n"
+ . "<table style='font-size:10px; width: 100%;' class='outer'>\n"
+ . "<thead>\n"
+ . "<tr class='head'>\n"
+ . " <th class='center' style='width: 10%;'>" . _AM_RWBANNER_TITLE2 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE13 . "</th>\n"
+ . " <th class='center' style='width: 10%;'>" . _AM_RWBANNER_CAT_WIDTH . "</th>\n"
+ . " <th class='center' style='width: 10%;'>" . _AM_RWBANNER_CAT_HEIGHT . "</th>\n"
+ . " <th class='center' style='width: 10%;'>" . _AM_RWBANNER_TITLE14 . "</th>\n"
+ . " <th class='center' style='width: 10%;'>" . _AM_RWBANNER_TITLE11 . "</th>\n"
+ . "</tr>\n"
+ . "</thead>\n"
+ . "<tbody>\n";
+ $class = "even";
+ $lista_categs_count = count($lista_categs);
+ for ($i = 0; $i < $lista_categs_count; ++$i) {
+ $class= ($class == "even") ? "odd" : "even";
+ $banner = new RWbanners();
+ $qtde = 0;
+ $qtde = $banner->getRowNum($lista_categs[$i]->getCod());
+ $banner->clearDb();
+
+ echo "<tr class='{$class}'>\n"
+ . " <td class='center'>" . $lista_categs[$i]->getCod() . "</td>\n"
+ . " <td class='center' style='width: 40%;'>" . $lista_categs[$i]->getTitulo() . "</td>\n"
+ . " <td class='center'>" . $lista_categs[$i]->getLarg() . "px</td>\n"
+ . " <td class='center'>" . $lista_categs[$i]->getAlt() . "px</td>\n"
+// . " <td class='center'>{$qtde}</td>\n"
+ . " <td class='center'>{$qtde}</td>\n"
+ . " <td class='center' style='width: 10%;'>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/categories.php?id=" . $lista_categs[$i]->getCod() . "&op=editar_categ") . "'><img src='{$pathIcon16}/edit.png' style='width: 16px; height: 16px; border-width: 0px; alt='" . _AM_RWBANNER_VALUE_BTN6 . "' title='" . _AM_RWBANNER_VALUE_BTN6 . "' /></a>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?id=" . $lista_categs[$i]->getCod() . "&op=deletar_categ") . "'><img src='{$pathIcon16}/delete.png' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_VALUE_BTN7 . "' title='" . _AM_RWBANNER_VALUE_BTN7 . "' /></a>\n"
+ . " </td>\n"
+ . "</tr>\n";
+ }
+ echo "</tbody>\n"
+ . "</table>\n"
+ . "</div><br />\n";
+}
+
+function lista_tags($expand=false)
+{
+ global $pathIcon16;
+
+ $tag = new RWTag();
+ $lista_tags = $tag->getTags('ORDER BY id ASC');
+
+ if ($expand) {
+ $expand_img = 'close12.gif';
+ $div_disp = '';
+ } else {
+ $expand_img = 'open12.gif';
+ $div_disp = "style='display: none;'";
+ }
+
+ rwbanner_collapsableBar('tags', 'tagsicon');
+ echo "<img id='tagsicon' name='tagsicon' src=" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/assets/images/icon/{$expand_img}") . " alt='' /></a> " . _AM_RWBANNER_LIST_TAG . "</h3>\n"
+ . "<span style='color: #567; margin: 3px 0 12px 0; font-size: small; display: block; text-align: justify;'>" . _AM_RWBANNER_LIST_TAG_DESC . "</span>\n"
+ . "<div id='tags'{$div_disp}>\n"
+ . "<table style='font-size:10px; width: 100%;' class='outer'>\n"
+ . "<thead>\n"
+ . "<tr class='head'>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE01 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE02 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE03 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE04 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE19 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE05 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE06 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TAG_TITLE07 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE11 . "</th>\n"
+ . "</tr>\n"
+ . "</thead>\n"
+ . "<tbody>\n";
+ $class = "even";
+ $lista_tags_count = count($lista_tags);
+ for ($i = 0; $i < $lista_tags_count; ++$i) {
+ $class = ($class == "even") ? "odd" : "even";
+ if (1 == $lista_tags[$i]->getStatus()) {
+ $status = "<img src='{$pathIcon16}/green.gif' style='width: 16px; height: 16px; border-width: 0px; alt='" . _AM_RWBANNER_TAG_STATUS1 . "' title='" . _AM_RWBANNER_TAG_STATUS1 . "' />\n";
+ $estilo = '';
+ } else {
+ $status = "<img src='{$pathIcon16}/red.gif' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_TAG_STATUS2 . "' title='" . _AM_RWBANNER_TAG_STATUS2 . "' />\n";
+ $estilo = " style='color:red;'";
+ }
+ $categ = (0 != $lista_tags[$i]->getCateg()) ? $lista_tags[$i]->getTagCategName() : _AM_RWBANNER_TAG_TITLE13;
+ $mods = ($lista_tags[$i]->getModuleName()) ? $lista_tags[$i]->getModuleName() : _AM_RWBANNER_TAG_TITLE17;
+ echo "<tr class='{$class}'{$estilo}>\n"
+ . " <td class='center'>" . $lista_tags[$i]->getId() . "</td>\n"
+ . " <td class='left' style='width: 40%;'>" . $lista_tags[$i]->getTitle() . "</td>\n"
+ . " <td class='center' style='width:40%;'><{\$" . $lista_tags[$i]->getName() . "}></td>\n"
+ . " <td class='center'>{$categ}</td>\n"
+ . " <td class='center'>{$mods}</td>\n"
+ . " <td class='center' >" . $lista_tags[$i]->getQtde() . "</td>\n"
+ . " <td class='center'>" . $lista_tags[$i]->getCols() . "</td>\n"
+ . " <td class='center'><a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/main.php?op=mudastatus_tag&id=" . $lista_tags[$i]->getId()) . "'>{$status}</a></td>\n"
+ . " <td class='center' style='width: 10%;'>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/tags.php?id=" . $lista_tags[$i]->getId() . "&op=editar_tag'") . "><img src='{$pathIcon16}/edit.png' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_VALUE_BTN6 . "' title='" . _AM_RWBANNER_VALUE_BTN6 . "' /></a>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/modules/" . $GLOBALS['xoopsModule']->dirname() . "/admin/main.php?id=" . $lista_tags[$i]->getId() . "&op=deletar_tag") . "'><img src='{$pathIcon16}/delete.png' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _AM_RWBANNER_VALUE_BTN7 . "' title='" . _AM_RWBANNER_VALUE_BTN7 . "' /></a>\n"
+ . " </td>\n"
+ . "</tr>\n";
+ }
+ echo "</tbody>\n"
+ . "</table>\n"
+ . "</div><br />\n";
+}
+
+function lista_users($expand=false)
+{
+ global $pathIcon16;
+
+ $categ = new Categoria();
+ $lista_categs = $categ->getCategorias('ORDER BY cod ASC');
+
+ if ($expand) {
+ $expand_img = 'close12.gif';
+ $div_disp = '';
+ } else {
+ $expand_img = 'open12.gif';
+ $div_disp = "style='display: none;'";
+ }
+
+ rwbanner_collapsableBar('users', 'usersicon');
+ echo "<img id='userssicon' name='usersicon' src=" . $GLOBALS['xoops']->url("modules/" . $GLOBALS['xoopsModule']->dirname() . "/assets/images/icon/{$expand_img}") . " alt='' /></a> " . _AM_RWBANNER_LIST_USERS . "</h3>\n"
+ . "<span style='color: #567; margin: 3px 0 12px 0; font-size: small; display: block; text-align: justify;'>" . _AM_RWBANNER_LIST_USERS_DESC . "</span>\n"
+ . "<div id='users'{$div_disp}>\n"
+ . "<table style='font-size:10px; width: 100%;' class='outer'>\n"
+ . "<thead>\n"
+ . "<tr class='head'>\n"
+ . " <th class='center'>" ._AM_RWBANNER_TITLE2 . "</th>\n"
+ . " <th class='left'>" . _AM_RWBANNER_TITLE17 . "</th>\n"
+ . " <th class='left'>" . _AM_RWBANNER_TITLE18 . "</th>\n"
+ . " <th class='left'>" . _AM_RWBANNER_TITLE19 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE20 . "</th>\n"
+ . " <th class='center'>" . _AM_RWBANNER_TITLE11 . "</th>\n"
+ . "</tr>\n"
+ . "</thead>\n"
+ . "<tbody>\n";
+ $class = "even";
+ $query = $GLOBALS['xoopsDB']->queryF("SELECT uid, uname, name, email FROM " . $GLOBALS['xoopsDB']->prefix('users'));
+ while (list($uid, $uname, $name, $email) = $GLOBALS['xoopsDB']->fetchRow($query)) {
+ $query1 = $GLOBALS['xoopsDB']->queryF("SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('rw_banner') . " WHERE idcliente={$uid}");
+ $qtbanners = $GLOBALS['xoopsDB']->getRowsNum($query1);
+ if ($qtbanners > 0) {
+ $class = ($class == "even") ? "odd" : "even";
+ $name = (!empty($name)) ? $name : $uname;
+ echo "<tr class='{$class}'>\n"
+ . " <td style='text-align: center;'>{$uid}</td>\n"
+ . " <td style='text-align: left;'><a href='" . $GLOBALS['xoops']->url("www/userinfo.php?uid={$uid}") . "'>{$uname}</a>\n"
+// . " <td style='text-align: left;'>{$uname}</td>\n"
+ . " <td style='text-align: left;'>{$name}</td>\n"
+ . " <td style='text-align: left;'><a href='mailto:{$email}'>{$email}</a></td>\n"
+ . " <td style='text-align: center;'>{$qtbanners}</td>\n"
+ . " <td style='text-align: center;'>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/userinfo.php?uid={$uid}") ."'><img src='{$pathIcon16}/search.png' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _SEARCH . "' title='" . _SEARCH . "' /></a>\n"
+ . " <a href='" . $GLOBALS['xoops']->url("www/modules/system/admin.php?fct=users&op=modifyUser&uid={$uid}") . "'><img src='{$pathIcon16}/edit.png' style='width: 16px; height: 16px; border-width: 0px;' alt='" . _EDIT . "' title='" . _EDIT . "' /></a>\n"
+ . " </td>\n"
+ . "</tr>\n";
+ } else {
+ echo "<tr class='odd'>\n"
+ . " <td colspan='6' class='center'>" . _AM_RWBANNER_NO_USERS . "</td>\n"
+ . "</tr>\n";
+ }
+ }
+ echo "</tbody>\n"
+ . "</table>\n"
+ . "</div><br />\n";
+}
|