Пример #1
0
        echo "<td class='even' align='center'>" . $partnersObj[$i]->hits() . "</td>";
        echo "<td class='even' align='center'>" . $statustxt . "</td>";
        echo "<td class='even' align='center'> " . $approve . $modify . $delete . "</td>";
        echo "</tr>";
    }
} else {
    // that is, $numrows = 0, there's no entries yet
    echo "<tr>";
    echo "<td class='head' align='center' colspan= '7'>" . _AM_SPARTNER_NOPARTNERS . "</td>";
    echo "</tr>";
}
echo "</table>\n";
echo "<span style=\"color: #567; margin: 3px 0 18px 0; font-size: small; display: block; \">{$status_explaination}</span>";
$pagenav = new XoopsPageNav($numrows, $xoopsModuleConfig['perpage_admin'], $startentry, 'startentry', "statussel={$statussel}&amp;sortsel={$sortsel}&amp;ordersel={$ordersel}");
if ($xoopsModuleConfig['useimagenavpage'] == 1) {
    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderImageNav() . '</div>';
} else {
    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderNav() . '</div>';
}
// ENDs code to show active entries
echo "</div>";
// Close the collapsable div
// Check Path Configuration
if (smartpartner_admin_getPathStatus('images', true) > 0 && smartpartner_admin_getPathStatus('images', true) > 0) {
    pathConfiguration();
}
echo "</div>";
echo "</div>";
$modfooter = smartpartner_modFooter();
echo "<div align='center'>" . $modfooter . "</div>";
xoops_cp_footer();
Пример #2
0
function xhelp_default()
{
    global $xoopsModuleConfig, $oAdminButton;
    xoops_cp_header();
    echo $oAdminButton->renderButtons('index');
    $displayName =& $xoopsModuleConfig['xhelp_displayName'];
    // Determines if username or real name is displayed
    $stylePath = XHELP_BASE_URL . '/styles/xhelp.css';
    echo '<link rel="stylesheet" type="text/css" media="all" href="' . $stylePath . '" /><!--[if gte IE 5.5000]><script src="iepngfix.js" language="JavaScript" type="text/javascript"></script><![endif]-->';
    global $xoopsUser, $xoopsDB;
    $hTickets =& xhelpGetHandler('ticket');
    $hStatus =& xhelpGetHandler('status');
    $crit = new Criteria('', '');
    $crit->setSort('description');
    $crit->setOrder('ASC');
    $statuses =& $hStatus->getObjects($crit);
    $table_class = array('odd', 'even');
    echo "<table border='0' width='100%'>";
    echo "<tr><td width='50%' valign='top'>";
    echo "<div id='ticketInfo'>";
    echo "<table border='0' width='95%' cellspacing='1' class='outer'>\r\n          <tr><th colspan='2'>" . _AM_XHELP_TEXT_TICKET_INFO . "</th></tr>";
    $class = "odd";
    $totalTickets = 0;
    foreach ($statuses as $status) {
        $crit = new Criteria('status', $status->getVar('id'));
        $numTickets =& $hTickets->getCount($crit);
        $totalTickets += $numTickets;
        echo "<tr class='" . $class . "'><td>" . $status->getVar('description') . "</td><td>" . $numTickets . "</td></tr>";
        if ($class == "odd") {
            $class = "even";
        } else {
            $class = "odd";
        }
    }
    echo "<tr class='foot'><td>" . _AM_XHELP_TEXT_TOTAL_TICKETS . "</td><td>" . $totalTickets . "</td></tr>";
    echo "</table></div><br />";
    $hStaff =& xhelpGetHandler('staff');
    $hResponses =& xhelpGetHandler('responses');
    echo "</td><td valign='top'>";
    // Outer table
    echo "<div id='timeSpent'>";
    // Start inner top-left cell
    echo "<table border='0' width='100%' cellspacing='1' class='outer'>\r\n          <tr><th colspan='2'>" . _AM_XHELP_TEXT_RESPONSE_TIME . "</th></tr>";
    $sql = sprintf('SELECT u.uid, u.uname, u.name, (s.responseTime / s.ticketsResponded) as AvgResponseTime FROM %s u INNER JOIN %s s ON u.uid = s.uid WHERE ticketsResponded > 0 ORDER BY AvgResponseTime', $xoopsDB->prefix('users'), $xoopsDB->prefix('xhelp_staff'));
    $ret = $xoopsDB->query($sql, MAX_STAFF_RESPONSETIME);
    $i = 0;
    while (list($uid, $uname, $name, $avgResponseTime) = $xoopsDB->fetchRow($ret)) {
        $class = $table_class[$i % 2];
        echo "<tr class='{$class}'><td>" . xhelpGetDisplayName($displayName, $name, $uname) . "</td><td align='right'>" . xhelpFormatTime($avgResponseTime) . "</td></tr>";
        $i++;
    }
    echo "</table></div><br />";
    // End inner top-left cell
    echo "</td></tr><tr><td valign='top'>";
    // End first, start second cell
    //Get Calls Closed block
    $sql = sprintf('SELECT SUM(callsClosed) FROM %s', $xoopsDB->prefix('xhelp_staff'));
    $ret = $xoopsDB->query($sql);
    if (list($totalStaffClosed) = $xoopsDB->fetchRow($ret)) {
        if ($totalStaffClosed) {
            $sql = sprintf('SELECT u.uid, u.uname, u.name, s.callsClosed FROM %s u INNER JOIN %s s ON u.uid = s.uid WHERE s.callsClosed > 0 ORDER BY s.callsClosed DESC', $xoopsDB->prefix('users'), $xoopsDB->prefix('xhelp_staff'));
            $ret = $xoopsDB->query($sql, MAX_STAFF_CALLSCLOSED);
            echo "<div id='callsClosed'>";
            echo "<table border='0' width='95%' cellspacing='1' class='outer'>\r\n                  <tr><th colspan='2'>" . _AM_XHELP_TEXT_TOP_CLOSERS . "</th></tr>";
            $i = 0;
            while (list($uid, $uname, $name, $callsClosed) = $xoopsDB->fetchRow($ret)) {
                $class = $table_class[$i % 2];
                echo "<tr class='{$class}'><td>" . xhelpGetDisplayName($displayName, $name, $uname) . "</td><td align='right'>" . $callsClosed . ' (' . round($callsClosed / $totalStaffClosed * 100, 2) . "%)</td></tr>";
                $i++;
            }
            echo "</table></div><br />";
            // End inner table top row
            echo "</td><td valign='top'>";
            // End top row of outer table
            $sql = sprintf('SELECT u.uid, u.uname, u.name, (s.responseTime / s.ticketsResponded) as AvgResponseTime FROM %s u INNER JOIN %s s ON u.uid = s.uid WHERE ticketsResponded > 0 ORDER BY AvgResponseTime DESC', $xoopsDB->prefix('users'), $xoopsDB->prefix('xhelp_staff'));
            $ret = $xoopsDB->query($sql, MAX_STAFF_RESPONSETIME);
            echo "<div id='leastCallsClosed'>";
            echo "<table border='0' width='100%' cellspacing='1' class='outer'>\r\n                  <tr><th colspan='2'>" . _AM_XHELP_TEXT_RESPONSE_TIME_SLOW . "</th></tr>";
            $i = 0;
            while (list($uid, $uname, $name, $avgResponseTime) = $xoopsDB->fetchRow($ret)) {
                $class = $table_class[$i % 2];
                echo "<tr class='{$class}'><td>" . xhelpGetDisplayName($displayName, $name, $uname) . "</td><td align='right'>" . xhelpFormatTime($avgResponseTime) . "</td></tr>";
                $i++;
            }
            echo "</table></div>";
            // End first cell, second row of inner table
        }
    }
    echo "</td></tr></table><br />";
    // End second cell, second row of inner table
    $crit = new Criteria('state', '2', '<>', 's');
    $crit->setSort('priority');
    $crit->setOrder('ASC');
    $crit->setLimit(10);
    $highPriority =& $hTickets->getObjects($crit);
    $has_highPriority = count($highPriority) > 0;
    if ($has_highPriority) {
        echo "<div id='highPriority'>";
        echo "<table border='0' width='100%' cellspacing='1' class='outer'>\r\n              <tr><th colspan='8'>" . _AM_XHELP_TEXT_HIGH_PRIORITY . "</th></tr>";
        echo "<tr class='head'><td>" . _AM_XHELP_TEXT_PRIORITY . "</td><td>" . _AM_XHELP_TEXT_ELAPSED . "</td><td>" . _AM_XHELP_TEXT_STATUS . "</td><td>" . _AM_XHELP_TEXT_SUBJECT . "</td><td>" . _AM_XHELP_TEXT_DEPARTMENT . "</td><td>" . _AM_XHELP_TEXT_OWNER . "</td><td>" . _AM_XHELP_TEXT_LAST_UPDATED . "</td><td>" . _AM_XHELP_TEXT_LOGGED_BY . "</td></tr>";
        $i = 0;
        foreach ($highPriority as $ticket) {
            if ($ticket->isOverdue()) {
                $class = $table_class[$i % 2] . " overdue";
            } else {
                $class = $table_class[$i % 2];
            }
            $priority_url = "<img src='" . XHELP_IMAGE_URL . "/priority" . $ticket->getVar('priority') . ".png' alt='" . $ticket->getVar('priority') . "' />";
            $subject_url = sprintf("<a href='" . XHELP_BASE_URL . "/ticket.php?id=" . $ticket->getVar('id') . "' target='_BLANK'>%s</a>", $ticket->getVar('subject'));
            if ($dept = $ticket->getDepartment()) {
                $dept_url = sprintf("<a href='" . XHELP_BASE_URL . "/index.php?op=staffViewAll&amp;dept=" . $dept->getVar('id') . "' target='_BLANK'>%s</a>", $dept->getVar('department'));
            } else {
                $dept_url = _AM_XHELP_TEXT_NO_DEPT;
            }
            if ($ticket->getVar('ownership') != 0) {
                $owner_url = sprintf("<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $ticket->getVar('uid') . "' target='_BLANK'>%s</a>", xhelpGetUsername($ticket->getVar('ownership'), $displayName));
            } else {
                $owner_url = _AM_XHELP_TEXT_NO_OWNER;
            }
            $user_url = sprintf("<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $ticket->getVar('uid') . "' target='_BLANK'>%s</a>", xhelpGetUsername($ticket->getVar('uid'), $displayName));
            echo "<tr class='{$class}'><td>" . $priority_url . "</td>\r\n                         <td>" . $ticket->elapsed() . "</td>\r\n                         <td>" . xhelpGetStatus($ticket->getVar('status')) . "</td>\r\n                         <td>" . $subject_url . "</td>\r\n                         <td>" . $dept_url . "</td>\r\n                         <td>" . $owner_url . " </td>\r\n                         <td>" . $ticket->lastUpdated() . "</td>\r\n                         <td>" . $user_url . "</td>\r\n                     </tr>";
            $i++;
        }
        echo "</table></div>";
    }
    pathConfiguration();
    xhelpAdminFooter();
    xoops_cp_footer();
}