|
@ -6,84 +6,23 @@ |
|
|
**/ |
|
|
**/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT * FROM `photos` $limit"; |
|
|
|
|
|
|
|
|
$sql = "SELECT * FROM `photos` ORDER BY `id` $limit"; |
|
|
if (!$result = $DB->query($sql)) |
|
|
if (!$result = $DB->query($sql)) |
|
|
{ |
|
|
{ |
|
|
blad('Nie mozna pobrac zdjec uzytkownikow!'); |
|
|
blad('Nie mozna pobrac zdjec uzytkownikow!'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isset($_POST['nick'])) |
|
|
|
|
|
{ |
|
|
|
|
|
$_POST['nick'] = addslashes(strip_tags(trim($_POST['nick']))); |
|
|
|
|
|
$_POST['email'] = addslashes(strip_tags(trim($_POST['email']))); |
|
|
|
|
|
|
|
|
|
|
|
#sprawdzanie, czy nick nie jest zajety
|
|
|
|
|
|
$sql = "SELECT `id` FROM `admins` WHERE `nick` ='".$_POST['nick']."';"; |
|
|
|
|
|
if (!$result = $DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna sprawdzic, czy nick nie zostal zajety.'); |
|
|
|
|
|
} |
|
|
|
|
|
if ($result->num_rows>0) |
|
|
|
|
|
{ |
|
|
|
|
|
$reserved = true; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
$reserved = false; |
|
|
|
|
|
} |
|
|
|
|
|
$result->free(); |
|
|
|
|
|
|
|
|
|
|
|
if (strlen($_POST['nick']) > 0 && trim($_POST['nick']) != $row['nick'] && ~$reserved) |
|
|
|
|
|
{ |
|
|
|
|
|
$sql = "UPDATE `admins` SET `nick`='".$_POST['nick']."' WHERE `id`='$id'"; |
|
|
|
|
|
if (!$DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna zaaktualizowac nicku administratora.'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (strlen($_POST['email']) > 0 && trim($_POST['nick']) != $row['email']) |
|
|
|
|
|
{ |
|
|
|
|
|
if (ereg ("^.+@.+\..+$", $_POST['email'])) |
|
|
|
|
|
{ |
|
|
|
|
|
$sql = "UPDATE `admins` SET `email`='".$_POST['email']."' WHERE `id`='$id'"; |
|
|
|
|
|
if (!$DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna zaaktualizowac emaila administratora.'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
$msg = 'Adres email jest nieprawidłowy! (przykład: [email protected])'; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (strlen(trim($_POST['pass'])) > 0 && md5(trim($_POST['pass'])) != $row['password']) |
|
|
|
|
|
{ |
|
|
|
|
|
$_POST['pass'] = md5(addslashes(strip_tags(trim($_POST['pass'])))); |
|
|
|
|
|
$sql = "UPDATE `admins` SET `password`='".$_POST['pass']."' WHERE `id`='$id'"; |
|
|
|
|
|
if (!$DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna zaaktualizowac hasla administratora.'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($msg == '') |
|
|
|
|
|
{ |
|
|
|
|
|
Przekieruj('index.php?mode=admin_users', 'Użytkownik został zaaktualizowany! Powrót...'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
NaglowekPA('Listowanie galerii'); |
|
|
NaglowekPA('Listowanie galerii'); |
|
|
?>
|
|
|
?>
|
|
|
<br /> |
|
|
<br /> |
|
|
<br /> |
|
|
<br /> |
|
|
|
|
|
<div align="right"><a href="index.php?mode=admin_gallery&submode=add">Dodaj nowe zdjęcie...</a></div> |
|
|
<table width="900" border="1" style="border-color: gray; border-style: solid; border-collapse: collapse"> |
|
|
<table width="900" border="1" style="border-color: gray; border-style: solid; border-collapse: collapse"> |
|
|
<tr> |
|
|
<tr> |
|
|
<td colspan="6" bgcolor="yellow">Lista zdjęć (strona <?php echo $page; ?>)</td>
|
|
|
<td colspan="6" bgcolor="yellow">Lista zdjęć (strona <?php echo $page; ?>)</td>
|
|
|
</tr> |
|
|
</tr> |
|
|
<tr> |
|
|
<tr> |
|
|
<td class="b">Id</td> |
|
|
|
|
|
|
|
|
<td class="b" width="30">Id</td> |
|
|
<td class="b" width="190">Miniatura</td> |
|
|
<td class="b" width="190">Miniatura</td> |
|
|
<td class="b" width="150">Autor</td> |
|
|
<td class="b" width="150">Autor</td> |
|
|
<td class="b">Opis</td> |
|
|
<td class="b">Opis</td> |
|
@ -97,16 +36,12 @@ while ($row = $result->fetch_assoc()) |
|
|
<td><?php echo $row['id']; ?></td>
|
|
|
<td><?php echo $row['id']; ?></td>
|
|
|
<td><img src="../images/upload/<?php echo $row['thumb_name']; ?>" alt="Zdjęcie" /></td> |
|
|
<td><img src="../images/upload/<?php echo $row['thumb_name']; ?>" alt="Zdjęcie" /></td> |
|
|
<td><?php if ($row['author']!='') { echo $row['author']; } else { echo 'Autor nieznany'; } ?></td>
|
|
|
<td><?php if ($row['author']!='') { echo $row['author']; } else { echo 'Autor nieznany'; } ?></td>
|
|
|
<td><?php echo $row['description']; ?></td>
|
|
|
|
|
|
|
|
|
<td><?php if ($row['description']!='') { echo $row['description']; } else { echo 'Brak opisu'; } ?></td>
|
|
|
<td width="50"><a href="index.php?mode=admin_gallery&submode=edit&id=<?php echo $row['id']; ?>">Popraw</td> |
|
|
<td width="50"><a href="index.php?mode=admin_gallery&submode=edit&id=<?php echo $row['id']; ?>">Popraw</td> |
|
|
<td width="50"><a href="index.php?mode=admin_gallery&submode=delete&id=<?php echo $row['id']; ?>">Usuń</td> |
|
|
<td width="50"><a href="index.php?mode=admin_gallery&submode=delete&id=<?php echo $row['id']; ?>">Usuń</td> |
|
|
</tr> |
|
|
</tr> |
|
|
<?php } ?>
|
|
|
<?php } ?>
|
|
|
</table> |
|
|
</table> |
|
|
<div align="left">Strony: <?php GenerujListeStron(); ?></div>
|
|
|
|
|
|
|
|
|
<div align="left">Strony: <?php GenerujListeStron(true); ?></div>
|
|
|
<div align="right"><a href="index.php?mode=admin_gallery&submode=add">Dodaj nowe zdjęcie...</a></div> |
|
|
<div align="right"><a href="index.php?mode=admin_gallery&submode=add">Dodaj nowe zdjęcie...</a></div> |
|
|
<?php StopkaPA(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
<? |
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
<?php StopkaPA(); ?>
|