PATH:
root
/
paleypartneradmin1234slider2
<?php if(!isset($_SESSION["id_konta"])) { header("Location: ../index.php"); } include_once 'connection.php'; connection(); class slider{ private $id; private $tytul; private $tresc; public function id(){ return $this->id; } public function tytul(){ return $this->tytul; } public function tresc(){ return $this->tresc; } public function getSlide($id,$lang){ $this->id = $id; $zapytanie ="SELECT `tytul`, `tresc` FROM slider2$lang WHERE id = $this->id"; $result = mysql_query($zapytanie)or die(mysql_error()); while($result_oferta = mysql_fetch_array($result)) { $this->tytul = $result_oferta[0]; $this->tresc = $result_oferta[1]; } } public function saveSlide($tyt,$tre, $lang){ $zapytanie = "INSERT INTO slider2$lang (tytul, tresc) VALUES ('".$tyt."','".$tre."')"; mysql_query($zapytanie) or die (mysql_error()); } public function saveSlideLang($tyt,$tre, $lang, $id){ $zapytanie = "INSERT INTO slider2$lang (id, tytul, tresc) VALUES ('".$id."','".$tyt."','".$tre."')"; mysql_query($zapytanie) or die (mysql_error()); } public function maxID(){ $zapytanie ="SELECT max(id) FROM slider2"; $result = mysql_query($zapytanie)or die(mysql_error()); while($result_oferta = mysql_fetch_array($result)) { $id = $result_oferta[0]; } return $id; } public function editSlide($id, $tyt,$tre, $lang){ $zapytanie = "UPDATE slider2$lang SET tytul = '".$tyt."', tresc = '".$tre."' WHERE id = '".$id."'"; mysql_query($zapytanie) or die (mysql_error()); } public function delSlide($id,$lang){ $this->id = $id; $zapytanie ="DELETE FROM slider2$lang WHERE id = $this->id LIMIT 1"; $result = mysql_query($zapytanie) or die(mysql_error()); } } if(isset ($_GET["o"])) { $opcja = $_GET["o"]; } else { $opcja = 0; } switch ($opcja){ case 1: include_once 'dodaj_slider.php'; break; case 2: include_once 'edytuj_slider.php'; break; default: include_once 'slidery.php'; break; } ?>
[+]
..
[-] slidery.php
[edit]
[-] edytuj_slider.php
[edit]
[-] dodaj_slider.php
[edit]
[-] index.php
[edit]