<?php
/*
	CMS ,,Black Min''  Został stworzony przez di_Timonix'a
	
	ten plik służy do pbieranie wszystkich postów
	
	Black Min cms,
	
	#plik: 1.1
*/

	// ładowanie jądra black mina
	require_once "../black-min.php";
	
	
	
	$dodaj_x = $_SESSION['dodaj_x']+=50;
	//$dodaj_x = $dodaj_x + 20;
	//echo $dodaj_x;
	
	function cut($tekst,$ile){
	 
	//$tekst = strip_tags($tekst);
	 
	   if (strlen($tekst) > $ile) {
		  $tekst=substr($tekst, 0, $ile);
		  for ($a=strlen($tekst)-1;$a>=0;$a--) {
			 if ($tekst[$a]==" ") {
			 $tekst=substr($tekst, 0, $a)."...";
			 break;
			 };
		  };
	   };
	return $tekst;
	}
	
	function textWrap($text) { 
        $new_text = ''; 
        $text_1 = explode('>',$text); 
        $sizeof = sizeof($text_1); 
        for ($i=0; $i<$sizeof; ++$i) { 
            $text_2 = explode('<',$text_1[$i]); 
            if (!empty($text_2[0])) { 
                $new_text .= preg_replace('#([^\n\r .]{25})#i', '\\1  ', $text_2[0]); 
            } 
            if (!empty($text_2[1])) { 
                $new_text .= '<' . $text_2[1] . '>';    
            } 
        } 
        return $new_text; 
    } 	

	$polaczenie = @new mysqli($host, $db_user, $db_password, $db_name);
	
	if ($polaczenie->connect_errno!=0)
	{
		echo "Error: ".$polaczenie->connect_errno;
	}
	else
	{
	
		mysqli_query($polaczenie, "SET CHARSET utf8");
		mysqli_query($polaczenie, "SET NAMES 'utf8' COLLATE 'utf8_polish_ci'");			
		
		
		if ($rezultat = @$polaczenie->query(
		sprintf("SELECT * FROM `".$prefix_table."data_post`")
		 ));
		{
		
			$ile_cal = mysqli_num_rows($rezultat);
			//echo $ile_cal;
			

			
			if ($ile_cal>=1) 
			{
echo<<<END

END;
			};
		};			
		


		if ($rezultat = @$polaczenie->query(
		sprintf("SELECT * FROM `".$prefix_table."bm_data_posty` ORDER BY `id`DESC, `datetime` DESC LIMIT $dodaj_x")
		 ))
		{
		
			$ile = mysqli_num_rows($rezultat);
			
			$ile2 = $ile-1;
			
			$one = 1;	
			
			if ($ile>=1) 
			{
echo<<<END

END;
			}
			for ($i = 1; $i <= $ile; $i++) 
			{
				
				
				$row = mysqli_fetch_assoc($rezultat);
				$id_post = $row['id'];
				$dodajacy_post = $row['dodajacy'];
				$tytul_post = $row['tytul'];
				$url_post = $row['url'];
				$kategoria_post = $row['kategoria'];
				$kategoria_post_post = $row['kategoria_post'];
				$status_post = $row['status'];
				$tagi_post = $row['tagi'];
				$datetime_post = $row['datetime'];
				$datetime_zmiany_post = $row['datetime_zmiany'];
				$kto_edit_post = $row['kto_edit'];
				$tresc_post= $row['tresc'];		
				
				$data_post = date('d-m-Y',strtotime($datetime_post));
				$godzina_post = date('H:i',strtotime($datetime_post));
				$data_zmiany_post = date('d-m-Y',strtotime($datetime_zmiany_post));
				$godzina_zmiany_post = date('H:i',strtotime($datetime_zmiany_post));
				
				$url_post = str_replace(" ","-",$url_post);
				
				$ile_all = $one++;

				$tresc_post = cut($tresc_post, 800);
				$tresc_post = textWrap($tresc_post,150);				
							
				if($ile == "1"){
				
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800" id="container_delte_post_$id_post">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>
					
					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte_post = "$id_post";
						console.log("test");
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte_post:delte_post,
							}
						})
						.done(function(info){
							$('#container_delte_post_$id_post').text("");
							$('#container_delte_post_$id_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>			

END;

				}				
				
				
				if($ile == "2"){
					if($ile_all == "1"){
				
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800" id="container_delte_post_$id_post">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>
					<section class="lin2 tsr">
					</section>
					
					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte_post = "$id_post";
						console.log("test");
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte_post:delte_post,
							}
						})
						.done(function(info){
							$('#container_delte_post_$id_post').text("");
							$('#container_delte_post_$id_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>			

END;

					}
					
					if($ile_all == "2"){
				
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800" id="container_delte_post_$id_post">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>
					
					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte_post = "$id_post";
						console.log("test");
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte_post:delte_post,
							}
						})
						.done(function(info){
							$('#container_delte_post_$id_post').text("");
							$('#container_delte_post_$id_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>			

END;

					}					
				}

				if($ile == "3"){
					if($ile_all == "1"){
				
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800" id="container_delte_post_$id_post">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>
					<section class="lin2 tsr">
					</section>
					
					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte_post = "$id_post";
						console.log("test");
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte_post:delte_post,
							}
						})
						.done(function(info){
							$('#container_delte_post_$id_post').text("");
							$('#container_delte_post_$id_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>			

END;

					}

					if($ile_all == "2"){
				
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800" id="container_delte_post_$id_post">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>
					<section class="lin2 tsr">
					</section>
					
					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte_post = "$id_post";
						console.log("test");
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte_post:delte_post,
							}
						})
						.done(function(info){
							$('#container_delte_post_$id_post').text("");
							$('#container_delte_post_$id_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>			

END;

					}
					
					if($ile_all == "3"){
				
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>

					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte-post = "<?php echo $id_post; ?>";
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte-post:delte-post,
							}
						})
						.done(function(info){
							$('#contajner_all_post').text("");
							$('#contajner_all_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>		

END;

					}	
					
				}else{
				
					if($ile >= "4"){
						
						if($ile_all <= $ile2){
				
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800" id="container_delte_post_$id_post">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>
					<section class="lin2 tsr">
					</section>
					
					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte_post = "$id_post";
						console.log("test");
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte_post:delte_post,
							}
						})
						.done(function(info){
							$('#container_delte_post_$id_post').text("");
							$('#container_delte_post_$id_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>						

END;




						}else{
					
							if($ile = $ile_all){
echo<<<END

					<section class="tsr fs-80 l-0 tsr-mt-10 tsr-post-auto" data-aos="zoom-in" data-aos-duration="800">
						<section class="tsr">
							<section class="fs-110">
								$tytul_post
							</section>
							<section class="fs-70">
								opublikowano dnia $data_post o godzinie $godzina_post przez $dodajacy_post
							</section>
							<section class="fs-80 tsr-mt-10 tsr-post-auto tsr-za-wi">
								$tresc_post
							</section>
							<section class="fs-70 r-0">
								<a href="$url_serwera_bm$id_post/$url_post/">
									Pokaż więcej!
								</a>
							</section>
						</section>
						<section class="tsr tsr-height-100">
							<section class="tsr tsr-height-100 tsr-mt-10 fs-70">
								
								<a href="#ptw_delte_post_$id_post" rel="modal:open">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer depresed-red destroy-$id_post">Usuń</section>
								</a>	
								<a href="$url_serwera_bm$id_post/$url_post/">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Zobacz</section>
								</a>
								<a href="admin-edit-post.php?edit=$id_post">
									<section class="r-0 tsr-fr tsr-p-10px cursor-pointer">Edytuj</section>
								</a>
								
							</section>
						</section>
					</section>

					<div id="ptw_delte_post_$id_post" class="tsr modal modal-auto" style="max-width: 350px;">
						<section class="tsr">
							<section class="col-2 fs-70 tsr-p-5px">
								<span id="ptw_t_delte_post_$id_post" class="cursor-pointer">
									Tak, usuń post!
							</span>
							</section>
							<section class="col-2 error">
								<a href="#" rel="modal:close">
									Anuluj!
								</a>
							</section>
							<section class="tsr">
							</section>
						</section>
						<a href="" class="close-modal2 tsr-aufle-close " rel="modal:close"><img src="$url_serwera_bm/pliki/img/control-img/zamknij.png" class="img" /></a>
					</div>	

					<script type="text/javascript">
						$('#ptw_t_delte_post_$id_post').click('submit', function(evt1){
						evt1.preventDefault();
						var delte-post = "<?php echo $id_post; ?>";
						
						$.ajax({
							type:"POST",
							url:"data/delte-post-data.php",
							data:{
								delte-post:delte-post,
							}
						})
						.done(function(info){
							$('#contajner_all_post').text("");
							$('#contajner_all_post').append(info);
						})
						.fail(function(){
							alert("Wystąpił błąd. Spróbuj ponownie później");
						});
						});	
					</script>					
					
END;
							}
						}
					}
				}
				
				//$rezultat->free_result(); 
			};		
		};

		$polaczenie->close();
	}

?>