Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- window.onload = function() {
- var a = false;
- var collapse = "p"+ "<?php echo $collapse ?>";
- var collapse2 = "btn"+"<?php $collapse ?>";
- document.getElementById(collapse2).onclick = function (){
- if(a== false){
- document.getElementById(collapse).style.height = "auto";
- a =true;
- }else{
- document.getElementById(collapse).style.height = "0px";
- a =false;
- }
- }
- }
- </script>
- <?php
- if ($result = mysqli_query($con, "SELECT * FROM stellingen WHERE REGIOID=1;")) {
- $amountOfStellingen = 0;
- while ($amountOfStellingen < 4) {
- mysqli_data_seek($result, $amountOfStellingen);
- $row = mysqli_fetch_assoc($result);
- $collapse = $amountOfStellingen;
- $stellingid = $row["Stelling_ID"];
- echo '<div class="stelling-wrapper" id="btn' . $collapse . '">
- <img src="images/button.svg" alt="Show more..." class="btn" id="bton">
- <p class="stelling">';
- echo "<p>{$row["Stelling"]}</p>";
- echo '<div id="p' . $collapse . '">
- <table id="tabel" border=1px class="data">
- <tr>
- <th>Title</th>
- <th>Source</th>
- <th>Weight</th>
- <th>Date</th>
- </tr>
- </div>
- </div>';
- echo '<script type="text/javascript" src="script/collapse.js">';
- echo '</script>';
- $sql1 = "SELECT * FROM stelling WHERE stelling_iD=$stellingid;";
- $records1 = mysqli_query($con, $sql1);
- $recordscheck = mysqli_num_rows($records1);
- if ($recordscheck > 0) {
- while ($stelling = mysqli_fetch_assoc($records1)) {
- echo "<tr>";
- echo "<td>" . $stelling['Title'] . "</td>";
- echo "<td>" . $stelling['Source'] . "</td>";
- echo "<td>" . $stelling['Wheight'] . "</td>";
- echo "<td>" . $stelling['Timer'] . "</td>";
- echo "</tr>";
- }
- }
- $amountOfStellingen += 1;
- echo '</table>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement