Exemplo n.º 1
0
 $where = "entid='{$id}'";
 if (!$db->query("SELECT {$columns} FROM {$tables} WHERE {$where}")) {
     mysql_die($db);
 } else {
     // If enterprise in table
     if ($db->next_record()) {
         // If enterprise owner is logged in user
         if ($db->f("user") == $auth->auth["uname"] || $perm->have_perm("admin")) {
             // Look if profile is already in table
             $dbprf = new DB_SourceBiz();
             $columns = "*";
             $tables = "profile,enterprise";
             $where = "entid_prf='{$id}' AND enterprise.entid = profile.entid_prf";
             if ($dbprf->query("SELECT {$columns} FROM {$tables} WHERE {$where}")) {
                 // If profile in table
                 if ($dbprf->next_record()) {
                     // Modify existing profile
                     prfmod($dbprf);
                 } else {
                     // Insert new profile
                     prfform($db);
                 }
             } else {
                 mysql_die($db);
             }
         } else {
             $be->box_full($t->translate("Error"), $t->translate("Access denied") . ".");
         }
         // If enterprise not in table
     } else {
         $be->box_full($t->translate("Error"), $t->translate("Enterprise") . " (ID: {$id}) " . $t->translate("does not exist") . ".");
Exemplo n.º 2
0
echo "  <image>\n";
echo "    <title>" . htmlspecialchars($sys_name) . "</title>\n";
echo "    <url>http:" . $sys_url . $sys_logo_small_image . "</url>\n";
echo "    <link>http:" . $sys_url . "</link>\n";
echo "    <description>" . htmlspecialchars($sys_name . " - " . $sys_title) . "</description>\n";
echo "    <width>66</width>\n";
echo "    <height>73</height>\n";
echo "  </image>\n";
echo "  <item>\n";
echo "    <title><b>News:</b></title>\n";
echo "    <link>http:" . $sys_url . "news.php</link>\n";
echo "  </item>\n";
$db = new DB_SourceBiz();
$db->query("SELECT * FROM news WHERE news.status_new='A' ORDER BY news.modification_new DESC limit 5");
$i = 0;
while ($db->next_record()) {
    echo "  <item>\n";
    echo "    <title>" . htmlspecialchars($db->f("subject_new")) . "</title>\n";
    echo "    <link>http:" . $sys_url . "newbynewid.php?id=" . $db->f("newid") . "</link>\n";
    echo "  </item>\n";
    $i++;
}
$blklen = 5;
$time = floor(time() / 5);
$db->query("SELECT COUNT(*) as cnt FROM enterprise WHERE enterprise.status='A'");
$db->next_record();
$entcnt = $db->f("cnt");
$blkcnt = floor($entcnt / $blklen);
if ($entcnt % $blklen > 0) {
    $blkcnt += 1;
}
Exemplo n.º 3
0
    }
    $bx->box_title($t->translate("Users") . ": " . $bystr);
    $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("Ent") . "</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 = "enterprise";
        $where = "user=\"" . $db->f("username") . "\" AND status=\"A\"";
        $num = "";
        $dbn = new DB_SourceBiz();
        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("enterprises.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:" . mailtoencode($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();
?>