$typ = 2; } elseif (isset($_GET['raporty'])) { $typ = 3; } elseif (isset($_GET['admin'])) { $typ = 4; } else { $typ = 1; } $msg = ''; if (!empty($_POST['do']) && !empty($_POST['tekst'])) { require_once 'funkcje/wiadomosc_wyslij.php'; $msg = wiadomosc_wyslij($User['gracz'], $_POST['do'], $_POST['tekst']); } if (!empty($_GET['del'])) { require_once 'funkcje/wiadomosc_usun.php'; $msg = wiadomosc_usun($User['gracz'], $_GET['del'], $typ); } if (!empty($_GET['usun_wszystkie'])) { require_once 'funkcje/wiadomosc_usun_wszystkie.php'; $msg = wiadomosc_usun_wszystkie($User['gracz'], $typ); } if (empty($_GET['nowa'])) { if (empty($_GET['czytaj'])) { if (isset($_GET['nadawcza'])) { $poczta = mysql_query("select id, login, data, status from tribal_wiadomosci inner join tribal_gracze on do = gracz where od = " . $User['gracz'] . " and typ = 2 order by status asc, id desc"); } elseif (isset($_GET['raporty'])) { $poczta = mysql_query("select id, login, data, status from tribal_wiadomosci inner join tribal_gracze on od = gracz where do = " . $User['gracz'] . " and typ = 3 order by status asc, id desc"); } elseif (isset($_GET['admin'])) { $poczta = mysql_query("select id, login, data, status from tribal_wiadomosci inner join tribal_gracze on od = gracz where do = " . $User['gracz'] . " and typ = 4 order by status asc, id desc"); } else { $poczta = mysql_query("select id, login, data, status from tribal_wiadomosci inner join tribal_gracze on od = gracz where do = " . $User['gracz'] . " and typ = 1 order by status asc, id desc");
<a href='?akcja=poczta&typ=4'>administracyjne</a> | <a href='?akcja=poczta&nowa=ok'>nowa wiadomość</a> </div> <?php if (empty($_GET['typ'])) { $_GET['typ'] = 1; } $msg = ''; if (!empty($_POST['do']) && !empty($_POST['tekst'])) { fx('wiadomosc_wyslij'); $msg = wiadomosc_wyslij($gracz['gracz'], $_POST['do'], $_POST['tekst']); } if (!empty($_GET['del'])) { fx('wiadomosc_usun'); $msg = wiadomosc_usun($gracz['gracz'], $_GET['del'], $_GET['typ']); } if (!empty($_GET['del_all'])) { fx('wiadomosc_usun_wszystkie'); $msg = wiadomosc_usun_wszystkie($gracz['gracz'], $_GET['typ']); } if (empty($_GET['nowa'])) { if (empty($_GET['czytaj'])) { switch ($_GET['typ']) { case 1: $query = mysql_query($q = "select id, login, data, status from planetx_wiadomosci inner join planetx_gracze on od = gracz where do = " . $gracz['gracz'] . " and typ = 1 order by status asc, id desc"); if (mysql_num_rows($query) > 0) { $echo = "<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Od:</th>\n\t\t\t\t\t<th>Data:</th>\n\t\t\t\t\t<th></th>\n\t\t\t\t</tr>\n\t\t\t\t"; while ($wiadomosc = mysql_fetch_array($query)) { if ($wiadomosc['status'] == 0) { $new = "<br/><span style='color:#339900'>[ nowa ]</span>";
zmien_ustawienia(); } if ($_GET['akcja'] == 'wiad_pokaz') { wiadomosc_pokaz(); } if ($_GET['akcja'] == 'wiad_nowa') { wiadomosc_napisz(); if (isset($_POST['wyslij'])) { wiadomosc_wyslij(); } } if ($_GET['akcja'] == 'wiad_usun' && isset($_GET['wiad_id'])) { $zapytanie = "select odbiorca_ID from wiadomosc where odbiorca_ID=" . $_SESSION['id'] . ""; $wynik = mysql_query($zapytanie); if ($row = mysql_fetch_row($wynik)) { wiadomosc_usun($_GET['wiad_id']); } else { echo '<h1>brak uprawnień</h1>'; } } if ($prawa == 'administrator') { if ($_GET['akcja'] == 'nowy_user') { add_user(); } if ($_GET['akcja'] == 'strona_glowna') { // kod strony głównej } if ($_GET['akcja'] == 'usun_user') { delete_user(); } }