Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="https://conpromo.ru/web/js/jquery-1.11.3.min.js"></script>
- </head>
- <body>
- <div style='text-align: center; font-size: 70px; width: 40%; margin-top: 10px; margin-bottom: 30px; margin-left: 30%; margin-right: 30%; border-radius: 5px'>
- События
- </div>
- <?php
- $host = 'ra-ms.ru';
- $user = 'u0018_me';
- $pass = '545537';
- $db = 'u0018154_my_db';
- include 'safemysql.class.php';
- $db = new SafeMysql(array('host' => $host, 'user' => $user, 'pass' => $pass, 'db' => $db, 'charset' => 'UTF8'));
- $events = $db -> getAll("SELECT * FROM events ORDER BY event_date");
- for($i = 0; $i < count($events); $i++){
- echo "<div id='event" .$i. "' style='border: 1px black solid; opacity: 0; width: 40%; margin-top: 10px; margin-left: 30%; margin-right: 30%; background: rgb(230, 230, 230); border-radius: 5px; padding: 5px'>";
- $curr_date = $events[$i]["event_date"];
- $dj = ($db -> getCol("SELECT `dj_alias` FROM `djs` WHERE `date` = ?s", $curr_date));
- $dj = $dj[0];
- echo '<div style="font-size: 30px">' . $events[$i]["title"] . '</div>'.
- '<div style="font-size: 20px">' . $curr_date . '</div>'.
- '<div style="font-size: 20px">' . (count($dj) > 0 ? "Диджей: ".$dj : "") . '</div>'.
- '<div style="font-size: 20px">' . $events[$i]["description"] . '</div>';
- echo '</div>';
- }
- ?>
- <script type="text/javascript">
- function animate_event(id_num) {
- setTimeout(function() {
- id = "#event" + id_num;
- $(id).animate({opacity:'1'}, 1000)
- }, id_num * 500);
- }
- $(document).ready(function() {
- for(var i = 0; i < <?php echo count($events)?>; i++){
- animate_event(i);
- }
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement