Ejemplo n.º 1
0
    if (!empty($_GET['del'])) {
        echo usun($oUser, 2, $_GET['del']);
    } elseif (isset($_GET['delA'])) {
        echo usunA($oUser, 2);
    }
    $wiadomosci = mysql_query("select login, tresc, data, id from poczta2 inner join users on do = user where od = " . $oUser['user'] . " and typ = 2 order by data desc");
    if (mysql_num_rows($wiadomosci) == 0) {
        echo "<p class='note'>brak wiadomości</p>";
    } else {
        while ($w = mysql_fetch_array($wiadomosci)) {
            echo "\n\t\t\t\t\t<div style='width:100%;'>\n\t\t\t\t\t\t<div style=' padding:3px;background:#000; color:#fff;'>\n\t\t\t\t\t\t\twiadomość do <b>" . $w['login'] . "</b> ( " . date("d-m-Y H:i:s", $w['data']) . " ) \n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div style=' padding:10px;background:#787878; color:#fff;'>\n\t\t\t\t\t\t\t" . $w['tresc'] . " \n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=' padding:3px;background:#330000; color:#fff;'>\n\t\t\t\t\t\t\t<a href='?act=poczta&acts=wyslane&del=" . $w['id'] . "'>usuń</a> | \n\t\t\t\t\t\t\t<a href='?act=poczta&acts=wyslane&delA'>usuń wszystkie</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<hr style='margin:20px'/>\n\t\t\t";
        }
    }
} else {
    if (!empty($_GET['del'])) {
        echo usun($oUser, 1, $_GET['del']);
    } elseif (isset($_GET['delA'])) {
        echo usunA($oUser, 1);
    }
    mysql_query("update poczta2 set status = 1 where do = " . $oUser['user'] . " and typ = 1 and status = 0");
    $wiadomosci = mysql_query("select login, tresc, data, status, id from poczta2 inner join users on od = user where do = " . $oUser['user'] . " and typ = 1 order by status asc, data desc");
    if (mysql_num_rows($wiadomosci) == 0) {
        echo "<p class='note'>brak wiadomości</p>";
    } else {
        while ($w = mysql_fetch_array($wiadomosci)) {
            if ($w['status'] == 0) {
                $nowa = "<b style='color:#009900'>[nowa]</b>";
            } else {
                $nowa = "";
            }
            echo "\n\t\t\t<div style='width:100%;'>\n\t\t\t\t<div style=' padding:3px;background:#000; color:#fff;'>\n\t\t\t\twiadomość od <b>" . $w['login'] . "</b> ( " . date("d-m-Y H:i:s", $w['data']) . " ) " . $nowa . "\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div style=' padding:10px;background:#787878; color:#fff;'>\n\t\t\t\t\t\t\t" . $w['tresc'] . " \n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=' padding:3px;background:#330000; color:#fff;'>\n\t\t\t\t\t\t\t<a href='?act=poczta&acts=nowa&do=" . $w['login'] . "'>odpisz</a> | \n\t\t\t\t\t\t\t<a href='?act=poczta&del=" . $w['id'] . "'>usuń</a> | \n\t\t\t\t\t\t\t<a href='?act=poczta&delA'>usuń wszystkie</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t\t<hr style='margin:20px'/>\n\t\t\t";
Ejemplo n.º 2
0
    mysql_query("DELETE FROM KK_products_types\n\t\t\t\t\tWHERE id_KK_products_types = '{$id}'");
    header("location: add_category.html");
}
function deleteItem($id)
{
    mysql_query("DELETE FROM KK_products\n\t\t\t\t\tWHERE id_KK_products = '{$id}'");
    $_SESSION['alert']['text'] = "Produkt został usunięty";
    header("location: add_item.html");
}
function usun($id)
{
    mysql_query("DELETE FROM KK_carts WHERE id_KK_cart='{$id}' ");
    header("location: cart.html");
}
if (isset($_GET['delete'])) {
    usun($_GET['delete']);
}
if (isset($_GET['delete_category'])) {
    deleteCategory($_GET['delete_category']);
}
if (isset($_GET['delete_item'])) {
    deleteItem($_GET['delete_item']);
}
if (!empty($_SESSION["role"])) {
    $role = $_SESSION["role"];
} else {
    $role = "guest";
}
$zalogowany = $_SESSION["zalogowany"];
$smarty->assign("zalogowany", $zalogowany);
$smarty->assign("role", $role);