コード例 #1
0
    $bx->box_begin();
    $bx->box_title($t->translate("Users"));
    $bx->box_body_begin();
    ?>
<table border=0 align=center cellspacing=1 cellpadding=1 width=100%>
<?php 
    echo "<tr><td><b>" . $t->translate("No") . ".</b></td><td><b>#&nbsp;" . $t->translate("Con") . "</b></td><td><b>" . $t->translate("Username") . "</b></td><td><b>" . $t->translate("Realname") . "</b></td><td><b>" . $t->translate("E-Mail") . "</b></td></tr>\n";
    $i = 1;
    while ($db->next_record()) {
        $columns = "COUNT(*)";
        $tables = "contact";
        $where = "user=\"" . $db->f("username") . "\" AND status=\"A\"";
        $num = "";
        $dbn = new DB_SourceContact();
        if ($dbn->query("SELECT {$columns} AS cnt FROM {$tables} WHERE {$where}")) {
            $dbn->next_record();
            $num = "[" . sprintf("%03d", $dbn->f("cnt")) . "]";
        }
        echo "<tr><td>" . sprintf("%d", $i) . "</td>\n";
        echo "<td><a href=\"" . $sess->url("index.php") . $sess->add_query(array("by" => "filter", "author" => $db->f("username"))) . "\">{$num}</a></td>\n";
        echo "<td>" . $db->f("username") . "</td>\n";
        echo "<td>" . $db->f("realname") . "</td>";
        echo "<td>&lt;<a href=\"mailto:" . $db->f("email_usr") . "\">" . ereg_replace("@", " at ", htmlentities($db->f("email_usr"))) . "</a>&gt;</td>";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
}
$bx->box_body_end();
$bx->box_end();
?>
コード例 #2
0
# This is the text backend of the system
#
# 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 or later of the GPL.
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session"));
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
}
header("Content-Type: text/plain");
// Disabling cache
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// HTTP/1.0
require "./include/config.inc";
require "./include/lib.inc";
$db = new DB_SourceContact();
$db->query("SELECT * FROM contact WHERE contact.status='A' ORDER BY contact.modification DESC limit 10");
$i = 0;
while ($db->next_record()) {
    echo $db->f("name") . "\n";
    $timestamp = mktimestamp($db->f("modification"));
    echo timestr($timestamp) . "\n";
    echo $sys_url . "conbyconid.php?id=" . $db->f("conid") . "\n";
    $i++;
}
@page_close();
コード例 #3
0
 $where = "conid='{$id}'";
 if (!$db->query("SELECT {$columns} FROM {$tables} WHERE {$where}")) {
     mysql_die($db);
 } else {
     // If contact in table
     if ($db->next_record()) {
         // If contact owner is logged in user
         if ($db->f("user") == $auth->auth["uname"] || $perm->have_perm("admin")) {
             // Look if clasifications are already in table
             $dbcla = new DB_SourceContact();
             $columns = "*";
             $tables = "classifications,contact";
             $where = "classifications.conid='{$id}' AND classifications.type = '{$type}' AND contact.conid = classifications.conid";
             if ($dbcla->query("SELECT {$columns} FROM {$tables} WHERE {$where}")) {
                 // If classifications are in table
                 if ($dbcla->next_record()) {
                     // Modify existing classifications
                     clamod($dbcla);
                 } else {
                     // Insert new classifications
                     claform($db);
                 }
             } else {
                 mysql_die($db);
             }
         } else {
             $be->box_full($t->translate("Error"), $t->translate("Access denied") . ".");
         }
         // If contact not in table
     } else {
         $be->box_full($t->translate("Error"), $t->translate("Contact") . " (ID: {$id}) " . $t->translate("does not exist") . ".");