File size: 1.41Kb
<?
include("rat.php");
include("function.php");
include ("../modules/info.php");
mysql_connect($host,$user,$parol);
mysql_select_db($database);
if (@$edit) {
$query="UPDATE `pet_users` SET `login`='$login',`password`='$password',`tamagochi`='$tamagochi' WHERE `id`='$id'";
mysql_query($query);
}
if (@$del) {
$query="DELETE FROM `pet_users` WHERE `id`='$id'";
mysql_query($query);
}
//постраничный вывод
$query="SELECT * FROM `pet_users` ORDER BY 'id' DESC";
$sql=mysql_query($query);
$records=mysql_num_rows($sql);
if (!@$_GET["r_start"]) {$r_start=0;}
$URL="users_edit.php?r_start=";
$inpage=25;
echo other_pages($records,$r_start,$URL,$inpage);
$start=$r_start*$inpage;
//конец постраничный вывод
$query="SELECT * FROM `pet_users` ORDER BY 'id' DESC LIMIT $start,$inpage";
$sql=mysql_query($query);
if (mysql_num_rows($sql)!="0") {
echo "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\"></head><body>";
while ($row=mysql_fetch_assoc($sql)) {
$id=$row["id"];
$login=$row["login"];
$password=$row["password"];
$tamagochi=$row["tamagochi"];
$skin=file("skin/users_edit.htm");
for ($i=0;$i<count($skin);$i++) {
$skin[$i]=str_replace("%id%",$id,$skin[$i]);
$skin[$i]=str_replace("%login%",$login,$skin[$i]);
$skin[$i]=str_replace("%password%",$password,$skin[$i]);
$skin[$i]=str_replace("%tamagochi%",$tamagochi,$skin[$i]);
print $skin[$i];
}
}
echo "</body></html>";
}
mysql_close();
?>