function showpowerlist($adminid = 0) { if ($adminid != 0) { $tempresult = getresult("select * from I_admin where id={$adminid}"); $functioncode = getresultData($tempresult, 0, "functioncode"); $functionarray = translatefunctioncode($functioncode); $result = getresult("select * from I_column where parentid=0"); while ($row = getresultArray($result)) { if ($functionarray[$row["id"]] === "1") { echo "<tr>\n"; echo "<td><input checked=\"true\" type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnname"] . "</td>"; echo "<td><input checked=\"checked\" type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } elseif ($functionarray[$row["id"]] === "2") { echo "<tr>\n"; echo "<td><input checked=\"true\" type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnname"] . "</td>"; echo "<td><input type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input checked=\"checked\" type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } else { echo "<tr>\n"; echo "<td><input type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnname"] . "</td>"; echo "<td><input type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } } if ($functionarray["vote"] === "1") { echo " <tr>"; echo " <td colspan=\"2\"><input type=\"checkbox\" checked=\"true\" name=\"voteadmin\" value=\"1\" />" . gettext_r("vote") . gettext_r("manage") . "</td>"; echo " </tr>"; } else { echo " <tr>"; echo " <td colspan=\"2\"><input type=\"checkbox\" name=\"voteadmin\" value=\"1\" />" . gettext_r("vote") . gettext_r("manage") . "</td>"; echo " </tr>"; } return; } $result = getresult("select * from I_column where parentid=0"); while ($row = getresultArray($result)) { echo "<tr>\n"; echo "<td><input type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnnamezh"] . "</td>"; echo "<td><input type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } echo " <tr>"; echo " <td colspan=\"2\"><input type=\"checkbox\" name=\"voteadmin\" value=\"1\" />" . gettext_r("vote") . gettext_r("manage") . "</td>"; echo " </tr>"; }
<?php $functionarray = translatefunctioncode($_SESSION["functioncode"]); ?> <?php /*showtemplatelist显示后台模板列表*/ function showtemplatelist($type) { $tempresult = getresult("select count(*) as countoftemplate from I_template where templatetype={$type}"); $countoftemplate = getresultData($tempresult, 0, "countoftemplate"); if ($countoftemplate < 1) { echo "<tr class='list'>\n"; echo "<td colspan='4' align='center'>" . gettext_r("haveNot") . gettext_r("template") . "</td>\n"; echo "</tr>"; return; } $query = "select * from I_template where templatetype={$type}"; $result = getresult($query); while ($row = getresultArray($result)) { echo "<tr class='list'>\n"; echo "<td> " . $row["id"] . "</td>"; echo "<td> " . $row["templatename"] . "</td>"; echo "<td> " . $row["path"] . "</td>"; echo "<td align='center'>"; echo "<a href=\"admin_template.php?type={$type}&action=modify&id=" . $row["id"] . "\">" . gettext_r("update") . "</a> | <a href=\"javascript:if(confirm('" . gettext_r("ifDelete") . "'))jump('admin_template.php','delete'," . $row["id"] . ")\">" . gettext_r("delete") . "</a>"; echo "</td>"; echo "</tr>\n"; } }