qsadfasdgfgads

Untitled

Jul 20th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.39 KB | None | 0 0
  1. <?php
  2. require 'db.php';
  3. $timetableQuery = $db->query("SELECT * FROM weekend ORDER BY `intday`");
  4. $timetable = [];
  5. while ($row = $timetableQuery->fetch_assoc()) {
  6.     $timetable[$row['day']][] = $row;
  7. }
  8. $weekDays = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье', "Нестабильные релизы"];
  9.  ?>
  10. <!DOCTYPE html>
  11. <html lang="en">
  12.  
  13. <head>
  14.     <meta charset="UTF-8">
  15.     <title>Document</title>
  16. </head>
  17.  
  18. <body>
  19.     <style>
  20.     * {
  21.         margin: 0;
  22.         padding: 0;
  23.     }
  24.  
  25.     .timetable-block {
  26.         width: 250px;
  27.         padding-bottom: 2%;
  28.         background: #FDE1C5;
  29.     }
  30.  
  31.     #timetable-title {
  32.         padding: 11px 0px;
  33.         display: block;
  34.         text-align: center;
  35.         color: #c97e09;
  36.         font-size: 18px;
  37.         border-bottom: 1px solid #fbc167;
  38.     }
  39.  
  40.     #timetable-descr {
  41.         padding: 8px 0px;
  42.         display: block;
  43.         text-align: center;
  44.         color: #825001;
  45.         font-weight: bold;
  46.         font-size: 12px;
  47.     }
  48.  
  49.     #attention {
  50.         padding: 6px 4px 7px 4px;
  51.         display: block;
  52.         text-align: center;
  53.         color: red;
  54.         font-weight: bold;
  55.         font-size: 14px;
  56.         margin-top: 2%;
  57.     }
  58.  
  59.  
  60.     }
  61.  
  62.     .static h1 {
  63.         text-align: center;
  64.         padding: 11px 0px;
  65.     }
  66.  
  67.     .static p {
  68.         text-align: center;
  69.         padding: 8px 0px;
  70.     }
  71.  
  72.     .timetable-accordeon {
  73.         margin-top: 5%;
  74.     }
  75.  
  76.     .acc-head {
  77.         display: block;
  78.         background: #ffb84d;
  79.         color: #fff;
  80.         font-weight: bold;
  81.         text-transform: uppercase;
  82.         font-size: 15px;
  83.         height: 40px;
  84.         margin-top: 3%;
  85.         width: 100%;
  86.         text-align: center;
  87.     }
  88.  
  89.     .acc-head h1 {
  90.         font-size: 18px;
  91.     }
  92.  
  93.     .acc-body {
  94.         display: none;
  95.     }
  96.  
  97.     .acc-body .anime {
  98.         position: relative;
  99.  
  100.  
  101.     }
  102.  
  103.     .acc-body .anime a {
  104.         display: block;
  105.         padding: 7px;
  106.         margin-top: 2px;
  107.         background: rgb(250, 212, 144);
  108.         color: rgb(175, 120, 23);
  109.         position: relative;
  110.         text-decoration: none;
  111.     }
  112.  
  113.     .descr {
  114.         display: none;
  115.         margin-left: 200px;
  116.         padding: 10px;
  117.  
  118.         background: #f3f3f3;
  119.         height: auto;
  120.         -moz-box-shadow: 0 5px 5px rgba(0, 0, 0, 0.3);
  121.         -webkit-box-shadow: 0 5px 5px rgba(0, 0, 0, 0.3);
  122.         box-shadow: 0 5px 5px rgba(0, 0, 0, 0.3);
  123.     }
  124.  
  125.     .descr .descr-container {
  126.         display: flex;
  127.     }
  128.  
  129.     .anime:hover .descr {
  130.         display: block;
  131.         position: absolute;
  132.         background: #FDE5C4;
  133.         z-index: 9999;
  134.         width: 600px;
  135.     }
  136.  
  137.     .anime:hover .descr .descr-container .text-block {
  138.         color: #3d3d3d;
  139.     }
  140.  
  141.     .descr .descr-container .media-block .timer p {
  142.         border: 1px solid #FFB84D;
  143.         padding: 10px;
  144.         background: #FFB84D;
  145.         border-radius: 2px;
  146.     }
  147.  
  148.     .acc-body a {
  149.         display: block;
  150.         padding: 7px;
  151.         margin-top: 2px;
  152.         background: rgb(250, 212, 144);
  153.         color: rgb(175, 120, 23);
  154.         position: relative;
  155.         text-decoration: none;
  156.     }
  157.     </style>
  158.     <div class="timetable-block">
  159.         <div class="static">
  160.             <h1 id="timetable-title">Расписание</h1>
  161.             <hr>
  162.             <p id="timetable-descr">Представлены только те аниме, которые озвучивает сайт animevost.</p>
  163.  
  164.             <div class="timetable-accordeon">
  165.                 <?php
  166.                 $i=0;
  167.                 ?><pre><?php print_r($timetable) ?></pre><?php die;
  168.                 foreach ($timetable as $day => $animes) {
  169.                    
  170.                      
  171.                  
  172. ?>
  173.                 <div class="acc-head">
  174.  
  175.                     <h1><?php echo $weekDays[$i]; $i++; ?></h1>
  176.                 </div>
  177.                 <?php  foreach ($animes as $key => $anime) { ?>
  178.  
  179.                 <div class="acc-body">
  180.  
  181.                     <div class="anime">
  182.                         <a href=""><?php echo $anime['name']; ?></a>
  183.                         <div class="descr">
  184.                             <div class="descr-container">
  185.                                 <div class="text-block">
  186.                                     Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit, quos incidunt earum commodi. Recusandae optio neque ullam ab, animi quibusdam, beatae illum quisquam rerum minus, magni totam molestias deserunt esse nisi eos. Quae ipsum consequuntur excepturi magnam eveniet totam incidunt autem at natus nesciunt, voluptates, libero, aliquam doloremque! Accusamus sequi doloribus fugit aliquid nihil, quas harum, similique voluptatem placeat exercitationem dolores perferendis ratione ex voluptates saepe iusto quidem asperiores praesentium ipsum excepturi. Numquam dignissimos voluptas, ab illum voluptatum natus temporibus corporis adipisci fuga qui, animi doloremque velit repudiandae incidunt nostrum laudantium veritatis similique accusamus dicta delectus eaque sunt, ipsam odit.
  187.                                 </div>
  188.                                 <div class="media-block">
  189.                                     <img src="https://a8.agorov.org/uploads/posts/2019-07/1562792792_1.jpg" alt="">
  190.                                     <div class="timer">
  191.                                         <p>До новой серии осталось 00:00:00</p>
  192.                                     </div>
  193.                                 </div>
  194.                             </div>
  195.                         </div>
  196.                     </div>
  197.                    
  198.                 </div>
  199.            
  200.              
  201.                
  202.             <?php }} ?>
  203.             </div>
  204.             <p id="attention">Указано время выхода релиза в русской озвучке. (Московское)</p>
  205.         </div>
  206.     </div>
  207.     <script src="https://yastatic.net/jquery/3.3.1/jquery.min.js"></script>
  208.     <script>
  209.     $(document).ready(function() {
  210.         $('.timetable-accordeon .acc-head').on('click', f_acc);
  211.     });
  212.  
  213.     function f_acc() {
  214.         $('.timetable-accordeon .acc-body').not($(this).next()).slideUp(500);
  215.         $(this).next().slideToggle(500);
  216.     }
  217.     </script>
  218. </body>
  219.  
  220. </html>
Advertisement
Add Comment
Please, Sign In to add comment