PATH:
root
/
alutechnikadmin1234kolekcje
<?php if(!isset($_SESSION["id_konta"])) { header("Location: ../index.php"); } if(isset($_POST['anuluj'])) { header("Location: content.php?k={$a->ref}"); } else if(isset($_POST['delete'])) { if (isset($_POST['delete']) && $_POST['delete'] != NULL && $_POST['delete'] != "") $a->deleteAllLang($_POST['delete']); header("Location: content.php?k={$a->ref}"); } else if(isset($_POST['submit'])) { $qLang = []; foreach ($_SESSION['POST'] as $key => $value) { if ($key == 'id') continue; if (isset($value['lang'])) { if (!isset($qLang[$value['lang']])) $qLang[$value['lang']] = []; $qLang[$value['lang']][$value['column']] = $_POST[$key]; } else { foreach($a->langs as $lang) { $qLang[$lang][$value['column']] = $_POST[$key]; } } } foreach ($qLang as $key => $value) { if (isset($_SESSION['POST']['id']) && $_SESSION['POST']['id'] != NULL) { $a->update($_SESSION['POST']['id'], $value, $key); } else { $a->add($value, $key); } } unset($_SESSION['POST']); header("Location: content.php?k={$a->ref}"); } ?> <?php date_default_timezone_set('Europe/Warsaw'); function dateV($format,$timestamp=null){ $to_convert = array( 'l'=>array('dat'=>'N','str'=>array('Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota','Niedziela')), 'F'=>array('dat'=>'n','str'=>array('styczeń','luty','marzec','kwiecień','maj','czerwiec','lipiec','sierpień','wrzesień','październik','listopad','grudzień')), 'f'=>array('dat'=>'n','str'=>array('stycznia','lutego','marca','kwietnia','maja','czerwca','lipca','sierpnia','września','października','listopada','grudnia')) ); if ($pieces = preg_split('#[:/.\-, ]#', $format)){ if ($timestamp === null) { $timestamp = time(); } foreach ($pieces as $datepart){ if (array_key_exists($datepart,$to_convert)){ $replace[] = $to_convert[$datepart]['str'][(date($to_convert[$datepart]['dat'],$timestamp)-1)]; }else{ $replace[] = date($datepart,$timestamp); } } $result = strtr($format,array_combine($pieces,$replace)); return $result; } } ?> <script> $(function() { $( "#datepicker" ).datepicker( { monthNames: [ "Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień" ], dayNames: [ "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota", "Niedziela" ], dayNamesShort: [ "Pn", "Wt", "Śr", "Cz", "Pt", "So", "Nd" ], dateFormat: "d/m/yy" } ); }); </script> <header> <h1><?php echo isset($_POST['id']) ? "Edytuj" : "Dodaj"; ?> kolekcję</h1> <a href="index.php?logout=1"><span>wyloguj</span><img src="images/close.jpg" alt="wyloguj"/></a> </header> <div id="content"> <?php $p->renderEditor([ "nazwa" => [ "lang" => "single", "displayName" => "Nazwa", "displayStyles" => "width: 150px", "type" => "text" ], "podpis" => [ "lang" => "single", "displayName" => "Podpis", "displayStyles" => "width: 150px", "type" => "text" ], "zdjecie" => [ "lang" => "all", "displayName" => "Zdjęcie", "displayStyles" => "width: 150px", "type" => "file", "buttonStyles" => "margin-left: 20px" ], "dane_techniczne" => [ "lang" => "all", "displayName" => "Dane techniczne", "displayStyles" => "width: 150px", "type" => "file", "buttonStyles" => "margin-left: 20px" ] ], NULL, isset($_POST['id']) ? $_POST['id'] : NULL); ?> </div> <script type="text/javascript"> $(document).ready(function(){ $(".tabContents").hide(); // Hide all tab conten divs by default $(".tabContents:first").show(); // Show the first div of tab content by default $("#tabContaier ul li a").click(function(e){ //Fire the click event e.preventDefault(); var activeTab = $(this).attr("href"); // Catch the click link $("#tabContaier ul li a").removeClass("active"); // Remove pre-highlighted link $(this).addClass("active"); // set clicked link to highlight state $(".tabContents").hide(); // hide currently visible tab content div $(activeTab).fadeIn(); // show the target tab content div by matching clicked link. }); }); </script>
[+]
..
[-] kolekcja.php
[edit]
[-] dodaj_kolekcje.php
[edit]
[-] index.php
[edit]