Exemple #1
0
<?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>";
                        } else {
                            $new = "";
                        }
                        $opcje = "\n\t\t\t\t\t\t<a href='?akcja=poczta&id=" . $wiadomosc['id'] . "&czytaj=1' >[ czytaj ]</a> | \n\t\t\t\t\t\t<a href='?akcja=poczta&do=" . $wiadomosc['login'] . "&nowa=ok' >[ odpowiedz ]</a> | \n\t\t\t\t\t\t<a href='?akcja=poczta&del=" . $wiadomosc['id'] . "' >[ usuń ]</a> | \n\t\t\t\t\t\t<a href='?akcja=poczta&del_all=1' >[ usuń wszystkie ]</a> \n\t\t\t\t\t";
Exemple #2
0
    $typ = 4;
} else {
    $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'], $typ);
}
if (!empty($_GET['usun_wszystkie'])) {
    fx('wiadomosc_usun_wszystkie');
    $msg = wiadomosc_usun_wszystkie($gracz['gracz'], $typ);
}
if (empty($_GET['nowa'])) {
    if (empty($_GET['czytaj'])) {
        if (isset($_GET['nadawcza'])) {
            $poczta = all("select id, login, data, status from driver_wiadomosci inner join driver_gracze on do = gracz where od = " . $gracz['gracz'] . "  and typ = 2 order by status asc, id desc");
        } elseif (isset($_GET['admin'])) {
            $poczta = all("select id, login, data, status from driver_wiadomosci inner join driver_gracze on od = gracz where do = " . $gracz['gracz'] . "  and typ = 4 order by status asc, id desc");
        } else {
            $poczta = all("select id, login, data, status from driver_wiadomosci inner join driver_gracze on od = gracz where do = " . $gracz['gracz'] . "  and typ = 1 order by status asc, id desc");
        }
    }
    $echo = "<table>\n\t<tr align=center>\n\t\t<th>Od:</th>\n\t\t<th>Data:</th>\n\t\t<th></th>\n\t</tr>\n\t";
    if (is_array($poczta) && empty($_GET['czytaj'])) {
        foreach ($poczta as $wiadomosc) {
            if ($wiadomosc['status'] == 0) {