【php开源代码栏目提醒】:网学会员为广大网友收集整理了,shopadmin.php,希望对大家有所帮助!
<?php if ($index_refer <> 1) { exit; } ?>
<?php include ("checklogin.php"); ?>
<?php
if (!empty($_POST['adminaction'])) {
$adminaction=$_POST['adminaction'];
}
if ($adminaction == "optimize_tables") {
echo "<b>Optimizing all database tables...</b><br><br>";
//get all tables
$alltables = mysql_query("SHOW TABLES");
//go trough them, save as an array
while($table = my
sql_fetch_assoc($alltables)){
//go through the array ( $db => $tablename )
foreach ($table as $db => $tablename) {
//optimize every table
echo "Optimizing ".$tablename.".. ";
mysql_query("OPTIMIZE TABLE `".$tablename."`") or die(mysql_error());
echo "<b>Done!</b><br>";
}
}
echo "<br><a href=?page=shopadmin>".$txt['general4']."</a>";
exit;
}
?>
<?php
if (IsAdmin() == false) {
PutWindow ($txt['general1'], $txt['general2'], "warning.gif", "50");
exit;
}
// show options
echo "<div align=center>[<a href=index.php?page=admin>".$txt['general4']."</a>]</div><br><br>";
?>
<table width=50% border=0 cellpadding=1 cellspacing=1 bgcolor=<?php echo $tb_bordercolor ?>>
<tr><td align=left bgcolor=<?php echo $tb_title_bgcolor ?>>
<img src=<?php echo $gfx_dir ?>/login.gif border=0 align=absmiddle>
<font color=<?php echo $tb_title_textcolor ?>><b>ShopAdmin</b></font>
</td>
</tr>
<tr><td bgcolor=<?php echo $tb_cell_bgcolor ?> align=center>
<table border=0 width=100%><tr>
<td align=center><a href=?page=shopadmin&adminaction=optimize_tables><img src=gfx/optimize.gif border=0><br>Optimize DB</a></td>
<td align=center><a href=?page=editsettings><img src=gfx/settings.gif border=0><br>Change settings</a></td>
</tr></table>
</tr>
</table>