<?php error_reporting(1); header('Content-type: text/html; charset=utf-8'); include "_plugins/smarty/Smarty.class.php"; include "_configs/config.php"; function __autoload($class_name) { require_once '_classes/' . $class_name . '.php'; } $smarty = new Smarty(); $sesja = new cSession(); $grupa = new cGroup(); $user = new cUser(); $finger = new cFinger(); $log = new cLog(); $czytnik = new cCzytnik(); $smarty->template_dir = '_skins/first'; $smarty->compile_dir = '_var/tmp_c'; $smarty->cache_dir = '_var/cache'; $smarty->config_dir = '_configs'; $smarty->caching = 0; $smarty->compile_check = true; //sprawdza czy plik szablonu lub konfiguracja uleg�y zmienie $smarty->cache_lifetime = 3600; //czas �ycia pliku w cache 1 godzina $sesja->start(); $opcja = $_GET[opcja]; $rodzaj = $_GET[rodzaj]; $sortuj = ''; if ($_GET[sortuj]) {
require_once "_classes/cGroup.php"; require_once "_classes/cUser.php"; $fp = fopen('delete.log', 'a'); if (isset($_POST['id'], $_POST['tab'])) { $id = (int) $_POST['id']; $tabela = $_POST['tab']; fwrite($fp, "[ii] tabela: {$tabela}, id: {$id}\n"); switch ($tabela) { case "uzytkownik": $sql = new cUser(); $sql->delete($id); $sql->close(); fwrite($fp, "[ii] usunieto uzytkownika o ID = {$id}\n"); break; case "grupa": $sql = new cGroup(); $sql->delete($id); $sql->close(); fwrite($fp, "[ii] usunieto grupe o ID = {$id}\n"); break; default: fwrite($fp, "[ee] Niepoprawna nazwa tabeli!\n"); break; } } else { fwrite($fp, "[ee] coś nie tak z POST!\n"); } fclose($fp); ?>
require_once "_classes/cUser.php"; require_once "_classes/cGroup.php"; if (isset($_POST['tab'])) { $tabela = $_POST['tab']; switch ($tabela) { case 'uzytkownik': $sql = new cUser(); $imie = $_POST['name']; $nazwisko = $_POST['surname']; $opis = $_POST['desc']; $grupa = $_POST['group']; $id = $sql->add($imie, $nazwisko, $opis, 1); $sql->close(); //fwrite($fp, "[ii] dodalem uzytkownika o ID = $id\n"); break; case 'grupa': $sql = new cGroup(); $nazwa = $_POST['name']; $opis = $_POST['desc']; $id = $sql->add($nazwa, $opis, 1); $sql->close(); //fwrite($fp, "[ii] dodalem grupe o ID = $id\n"); break; default: //fwrite($fp, "[ee] Niepoprawna tabela\n"); break; } } ?>
default: break; } } else { if (isset($_POST['ids'], $_POST['tab'])) { $ids = explode(',', $_POST['ids']); $tabela = $_POST['tab']; switch ($tabela) { case "uzytkownik": $sql = new cUser(); foreach ($ids as $id) { $sql->delete((int) $id); } $sql->close(); break; case "grupa": $sql = new cGroup(); foreach ($ids as $id) { $sql->delete((int) $id); } $sql->close(); break; default: //fwrite($fp, "[ee] Niepoprawna nazwa tabeli!\n"); break; } } } ?>
<?php error_reporting(1); header('Content-type: text/html; charset=utf-8'); include "_plugins/smarty/Smarty.class.php"; include "_configs/config.php"; function __autoload($class_name) { require_once '_classes/' . $class_name . '.php'; } $smarty = new Smarty(); $sesja = new cSession(); $grupa = new cGroup(); $user = new cUser(); $finger = new cFinger(); $log = new cLog(); $czytnik = new cCzytnik(); $smarty->template_dir = '_skins/first'; $smarty->compile_dir = '_var/tmp_c'; $smarty->cache_dir = '_var/cache'; $smarty->config_dir = '_configs'; $smarty->caching = 0; $smarty->compile_check = true; //sprawdza czy plik szablonu lub konfiguracja uleg�y zmienie $smarty->cache_lifetime = 3600; //czas �ycia pliku w cache 1 godzina $sesja->start(); $opcja = $_GET['opcja']; $rodzaj = $_GET['rodzaj']; $sortuj = ''; if ($_GET[sortuj]) {