Exemplo n.º 1
0
function showfield($columnid)
{
    $result = getresult("select * from I_field where columnid={$columnid}");
    if (getresultnumrows($result) < 1) {
        echo "<tr>";
        echo "<td colspan='6' height='25' align='center'>" . gettext_r("haveNot") . gettext_r("field") . "</td>";
        echo "<tr>";
        return;
    }
    while ($row = getresultarray($result)) {
        echo "<tr class='list'>";
        echo "<td align='center'>" . $row["id"] . "</td>\n";
        echo "<td align='center'>" . $row["fieldname"] . "</td>";
        echo "<td align='center'>" . $row["info"] . "</td>";
        echo "<td align='center' width='100'>";
        echo "<a href=\"admin_field.php?action=modify&fieldid=" . $row["id"] . "&columnid={$columnid}\">" . gettext_r("update") . "</a>";
        echo " | ";
        echo "<a href=\"javascript:if(confirm('" . gettext_r("ifDelete") . "'))jump('admin_field.php','delete'," . $row["id"] . ")\">" . gettext_r("delete") . "</a>";
        echo "</td>\n";
        echo "</tr>";
    }
}
Exemplo n.º 2
0
function showcomment($columnid, $currentpage, $pagesize = 10)
{
    global $childcolumnString;
    getchildcolumnid_improveed($columnid);
    $result = getresult("select * from I_comment where articleid in (" . getarticleidlist($columnid) . ") order by id desc limit " . ($currentpage - 1) * $pagesize . "," . "{$pagesize}");
    //echo "select * from I_comment where articleid in (".getarticleidlist($columnid).") limit ".($currentpage-1)*$pagesize.","."$pagesize";
    if ($currentpage > 1 && getresultNumrows($result) < 1) {
        echo "<script type=\"text/javascript\">window.location='admin_comment.php?columnid={$columnid}&currentpage=" . ($currentpage - 1) . "'</script>";
        return;
    }
    if (getresultnumrows($result) < 1) {
        echo "<tr>";
        echo "<td colspan='6' height='25' align='center'>" . gettext_r("haveNot") . gettext_r("comment") . "</td>";
        echo "<tr>";
        return;
    }
    while ($row = getresultarray($result)) {
        echo "<tr class='list'>";
        echo "<td align='center'><input type='checkbox'  name='list'  value='" . $row["id"] . "'></td>\n";
        echo "<td align='center'>" . $row["id"] . "</td>\n";
        echo "<td align='center'>";
        echo getresultData(getresult("select title from I_article where id=" . $row["articleid"]), 0, "title");
        echo "</td>\n";
        echo "<td align='center'>" . $row["commentcontent"] . "</td>\n";
        echo "<td align='center'>" . $row["username"] . "</td>\n";
        echo "<td align='center'>";
        if ($row["ifpass"] === "0") {
            echo gettext_r("notPass");
        } else {
            echo gettext_r("havePass");
        }
        echo "</td>\n";
        echo "<td align='center' width='100'><a href=\"javascript:if(confirm('" . gettext_r("ifDelete") . "'))jump('admin_comment.php','delete'," . $row["id"] . ")\">" . gettext_r("delete") . "</a></td>\n";
        echo "</tr>";
    }
}