Advertisement
ahoj111

php

Apr 24th, 2022
1,151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.  
  4. <head>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.     <title>Untitled Document</title>
  7.  
  8.  
  9.  
  10.     <style type="text/css">
  11.         * {
  12.             padding: 0;
  13.             margin: 0;
  14.         }
  15.  
  16.         .pozadi {
  17.             height: 200px;
  18.             width: 800px;
  19.             background-color: #696;
  20.             margin-top: 25px;
  21.             margin-left: 400px;
  22.         }
  23.  
  24.         .foto {
  25.             height: 100px;
  26.             width: 100px;
  27.             margin-top: 40px;
  28.             margin-left: 150px;
  29.         }
  30.  
  31.         .polozka {
  32.             font-size: 22px;
  33.             color: #666;
  34.             background-color: #0F0;
  35.             margin-top: 20px;
  36.             float: left;
  37.             margin-left: 350px;
  38.             position: absolute;
  39.         }
  40.  
  41.         .block {
  42.             position: relative;
  43.             display: inline-block;
  44.         }
  45.  
  46.         .cancel {
  47.             position: absolute;
  48.             top: 10px;
  49.             right: 10px;
  50.             font-size: 22px;
  51.             background-color: #E7F3DB;
  52.         }
  53.  
  54.         .cancel ul {
  55.             list-style: none;
  56.         }
  57.  
  58.         .cancel ul ul {
  59.             display: none;
  60.         }
  61.  
  62.         .cancel ul ul {
  63.             color: #600;
  64.         }
  65.  
  66.         .cancel ul li:hover>ul {
  67.             display: block;
  68.         }
  69.  
  70.         .po2 {
  71.             background-color: #699;
  72.             height: 200px;
  73.             width: 450px;
  74.             margin-top: 20px;
  75.             margin-left: 400px;
  76.         }
  77.  
  78.         .odhl {
  79.             font-size: 26px;
  80.             color: #603;
  81.             margin-left: 1000px;
  82.             margin-top: 5px;
  83.             position: absolute;
  84.             background-color: #399;
  85.             width: 300px;
  86.         }
  87.  
  88.         .prihla {
  89.             color: #FC6;
  90.             position: absolute;
  91.             font-size: 25px;
  92.             background-color: #F69;
  93.             float: left;
  94.             margin-top: 5px;
  95.             margin-left: 822px;
  96.         }
  97.  
  98.         .opavdu {
  99.             font-size: 22px;
  100.             color: #30C;
  101.             margin-top: 20px;
  102.             margin-left: 32px;
  103.             float: left;
  104.         }
  105.  
  106.         #sel {
  107.             font-size: 15px;
  108.             float: left;
  109.             margin-top: 25px;
  110.             margin-left: 15px;
  111.         }
  112.  
  113.         #buon {
  114.             font-size: 22px;
  115.             float: left;
  116.             margin-top: 100px;
  117.             margin-left: -250px;
  118.         }
  119.     </style>
  120. </head>
  121.  
  122. <body>
  123.  
  124.     <?php
  125.     if (isset($_GET['delete'])) {
  126.         $cela_cesta= $_GET['delete'];
  127.         $bbbb=unlink($cela_cesta);
  128.    
  129.           function is_dir_empty($cela_cesta,$bbbb)
  130.         {
  131.             if (!is_readable($cela_cesta))
  132.            
  133.             return null;
  134.        
  135.             return (scandir($bbbb)==2);
  136.         }
  137.      $xx=is_dir_empty($cela_cesta,$bbbb);
  138.      if ($xx) {
  139.             echo "Složka je prázdná"; //Vůbec nefunguje.
  140.         } else {
  141.             echo "Ve složce jsou obrázky";  //To funguje dobře
  142.         }
  143.        
  144.        
  145.        
  146.        
  147.        
  148.        
  149.         }
  150.                
  151.     ?>
  152.  
  153.  
  154.  
  155.     <?php
  156.     $adresar = '.';
  157.     $cesta = scandir($adresar, SCANDIR_SORT_DESCENDING);
  158.     foreach ($cesta as $doadresare) {
  159.         if (is_dir($doadresare)) {
  160.             if ($doadresare != '.' &&   $doadresare != '..') { ?>
  161.                 <div class='pozadi'>
  162.                     <div class="polozka"> <?php echo $doadresare; ?></div>
  163.  
  164. <div class='block'>
  165.                     <?php
  166.                     if (is_dir($adresar)) {
  167.                         $cestaq = scandir($doadresare);
  168.                         for ($i = 0; $i < count($cestaq); $i++) {
  169.                             if ($cestaq[$i] != '.' && $cestaq[$i] != '..') { ?>
  170.                                
  171.  
  172.                                     <img src="<?php echo $doadresare . '/' . $cestaq[$i] ?>" class="foto" />
  173.                                     <div class='cancel'>
  174.                                         <ul>
  175.                                             <li>Menu<ul>
  176.                                                     <li><a href="?delete=<?php echo $doadresare . '/' . $cestaq[$i] ?>">Delete</a></li>
  177.                                                 </ul>
  178.                                             </li>
  179.                                         </ul>
  180.                                     </div>
  181.                                 </div>
  182.  
  183.  
  184.             <?php  }
  185.                         }
  186.                     }
  187.                 }
  188.             } ?>
  189.                 </div>
  190.                 <span class="pozadi">
  191.                 <?php } ?>
  192.                 </span>
  193. </body>
  194.  
  195. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement