<?php
$user=$_GET[\"user\"];
$pass=$_GET[\"pass\"];
if(($user === \"ADeM\") && ($pass === \"adam\"))
{
switch ($_GET['arty'])
{
case (\"do_edycji\"):
include(\"gora.php\");
$dane=file(\"data.txt\"); for($i=0;$i<count($dane);$i++)
{
$linia=explode(\"|\",$dane[$i]); <TABLE border=\"0\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"> <font color=\"white\"><b><a name=\"$linia[0]\"></a> $linia[0] - $linia[1] </td></tr>
<TABLE BORDER=\"0\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD bgcolor=\"black\" WIDTH=\"465\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"><font color=\"#FFFFFF\">
<p style=\"margin: 10px\">
$linia[2]
</p>
</div></b></font>
</td></tr>
<TABLE BORDER=\"0\" height=\"30\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<font size=\"3\" color=\"white\"><div align=\"right\"></b><a href=\"case.php?arty=edycja&id=$i&user=$user&pass=$pass\"><b>Edytuj</b></a> dodał: <i><b><a href=\"mailto:$linia[4]\">$linia[3]</a></b></i>
</td></tr>
</table></table></table>
<br />
\";
}
break;
case (\"edycja\"):
$oo=file(\"data.txt\"); $id=$_GET['id'];
include(\"gora.php\");
$lina=explode(\"|\", $oo[$id]); <TABLE border=\"0\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"> <font color=\"white\"><b> Edytuj !</td></tr>
<TABLE BORDER=\"0\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD bgcolor=\"black\" WIDTH=\"465\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"center\"><font color=\"#FFFFFF\">
<p style=\"margin: 10px\">
<form method=\"POST\" action=\"case.php?arty=edytuj&id=$id&user=$user&pass=$pass\">
<strong>Temat</strong>:<br>
<input type=\"text\" name=\"costam1\" style=\"width: 300px;\" value=\"$lina[0]\"><br>
<strong>Tresc</strong>:<br>
<textarea type=\"text\" name=\"costam2\" style=\"height: 250px; width: 300px\">$lina[2]</textarea><br>
<strong>Dodał</strong>:<br>
<input type=\"text\" name=\"costam3\" style=\"width: 300px;\" value=\"$lina[3]\"><br>
<strong>Data</strong>:<br>
<input type=\"text\" name=\"costam4\" style=\"width: 300px;\" value=\"$lina[1]\" DISABLED><br>
<strong>e-mail</strong>:<br>
<input type=\"text\" name=\"costam5\" style=\"width: 300px;\" value=\"$lina[4]\"><br>
<input type=\"submit\" value=\" Zmień \"><br>
</form>
</p>
</div></b></font>
</td></tr>
<TABLE BORDER=\"0\" height=\"30\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<font size=\"3\" color=\"white\"><div align=\"right\"></b>
</td></tr>
</table></table></table>
<br />
\";
break;
case (\"edytuj\"):
$ile = $_GET['id'];
$ty=$_POST[\"costam1\"];
$ty2=$_POST[\"costam2\"];
$ty3=$_POST[\"costam4\"];
$ty4=$_POST[\"costam3\"];
$ty5=$_POST[\"costam5\"];
$filename = \"data.txt\";
//zdefiniuj nowy wiersz
$nowy = \"$ty|$ty3|$ty2|$ty4|$ty5rn\";
$nr_y = $ile;
$plik = file ($filename); $plik[$nr_y] = $nowy;
$fp = fopen ($filename , \"w\"); echo(\"Artykuł został zmieniony! <a href=\"case.php?arty=do_edycji&user=$user&pass=$pass\">Powrót do administracij</a>\"); break;
case (\"dodaj\"):
include(\"gora.php\");
<TABLE border=\"0\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"> <font color=\"white\"><b> Dodaj !</td></tr>
<TABLE BORDER=\"0\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD bgcolor=\"black\" WIDTH=\"465\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"center\"><font color=\"#FFFFFF\">
<p style=\"margin: 10px\">
<form method=\"POST\" action=\"case.php?arty=nowy&user=$user&pass=$pass\">
<strong>Temat</strong>:<br>
<input type=\"text\" name=\"tytul\" style=\"width: 300px;\"><br>
<strong>Tresc</strong>:<br>
<textarea type=\"text\" name=\"tresc\" style=\"height: 250px; width: 300px\">$lina[2]</textarea><br>
<strong>Dodał</strong>:<br>
<input type=\"text\" name=\"imie\" style=\"width: 300px;\" value=\"$lina[3]\"><br>
<strong>e-mail</strong>:<br>
<input type=\"text\" name=\"mail\" style=\"width: 300px;\" value=\"$lina[4]\"><br>
<input type=\"submit\" value=\" Dodaj \"><br>
</form>
</p>
</div></b></font>
</td></tr>
<TABLE BORDER=\"0\" height=\"30\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<font size=\"3\" color=\"white\"><div align=\"right\"></b>
</td></tr>
</table></table></table>
<br />
\";
break;
case (\"nowy\"):
$date = date(\"j.m.Y G:i\"); $tytul=$_POST[\"tytul\"];
$autor=$_POST[\"imie\"];
$tresc=str_replace(\"nr\", \"<br>\", $_POST['tresc']); $mail=$_POST[\"mail\"];
$filename = \"data.txt\";
$nowy = \"$tytul|$date|$tresc|$autor|$mail\";
$plik = $nowy.\"rn\".$plik;
$fp = fopen($filename , \"w\");flock($fp,2); flock($fp,3
);fclose
($fp); echo(\"Artykuł został dodany! <a href=\"case.php?arty=do_edycji&user=$user&pass=$pass\">Powrót do administracji</a>\"); break;
case (\"usunac\"):
$dane=file(\"data.txt\"); for($i=0;$i<count($dane);$i++)
{
$linia=explode(\"|\",$dane[$i]); <TABLE border=\"0\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"> <font color=\"white\"><b><a name=\"$linia[0]\"></a> $linia[0] - $linia[1]</td></tr>
<TABLE BORDER=\"0\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD bgcolor=\"black\" WIDTH=\"465\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"><font color=\"#FFFFFF\">
<p style=\"margin: 10px\">
$linia[2]
</p>
</div></b></font>
</td></tr>
<TABLE BORDER=\"0\" height=\"30\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<font size=\"3\" color=\"white\"><div align=\"right\"></b><a href=\"case.php?arty=usun&id=$i&user=$user&pass=$pass\"><b>Usuń</b></a> dodał: <i><b><a href=\"mailto:$linia[4]\">$linia[3]</a></b></i>
</td></tr>
</table></table></table>
<br />
\";
}
break;
case (\"usun\"):
$filename = \"data.txt\";
$id=$_GET['id'];
$to_delete = $id;
$plik[$to_delete] = \"\";
$fp = fopen($filename , \"w\");flock($fp,2); flock($fp,3
);fclose
($fp); echo(\"Artykuł usunięty! <a href=\"logowanie.php?user=$user&pass=$pass\">Powrót do administracij</a>\"); break;
default:
<a name=\"top\"></a>
<TABLE border=\"0\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"> <font color=\"white\"><b> Opowiadania</td></tr>
<TABLE BORDER=\"0\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD bgcolor=\"black\" WIDTH=\"465\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"><font color=\"#FFFFFF\">
<p style=\"margin: 10px\">
\");
$dane=file(\"data.txt\"); for($i=0;$i<count($dane);$i++)
{
$linia=explode(\"|\",$dane[$i]); <a href=\"#$linia[0]\"><font color=\"white\">$linia[0]</font></a>
<br>
\";
}
</p>
</div></b></font>
</td></tr>
<TABLE BORDER=\"0\" height=\"30\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<font size=\"3\" color=\"white\"><div align=\"right\"></b> <i><b></b></i>
</td></tr>
</table></table></table>
<br />
\");
$dane=file(\"data.txt\"); for($i=0;$i<count($dane);$i++)
{
$linia=explode(\"|\",$dane[$i]); <TABLE border=\"0\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"> <font color=\"white\"><b><a name=\"$linia[0]\"></a> $linia[0] - $linia[1]</td></tr>
<TABLE BORDER=\"0\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD bgcolor=\"black\" WIDTH=\"465\" ALIGN=\"center\" VALIGN=\"top\">
<div align=\"left\"><font color=\"#FFFFFF\">
<p style=\"margin: 10px\">
$linia[2]
</p>
</div></b></font>
</td></tr>
<TABLE BORDER=\"0\" height=\"30\" WIDTH=\"465\" ALIGN=\"center\" CELLSPACING=\"0\" CELLPADDING=\"1\">
<TD background=\"tytul.gif\" WIDTH=\"465\" height=\"30\" ALIGN=\"center\" VALIGN=\"top\">
<font size=\"3\" color=\"white\"><div align=\"right\"></b><a href=\"#top\"><font color=\"white\">do góry</font></a> dodał: <i><b><a href=\"mailto:$linia[4]\">$linia[3]</a></b></i>
</td></tr>
</table></table></table>
<br />
\";
}
}
else
{
include(\"zaloguj1.php\")
}
}
?>