PHP site 3 5/3/2017


SUBMITTED BY: canonical

DATE: May 3, 2017, 11:35 p.m.

FORMAT: PHP

SIZE: 2.3 kB

HITS: 455

  1. If you want more of my pastes visit: https://randompaste.000webhostapp.com/index.html
  2. --------------------------------------------------------------------------------------
  3. view my last post at: https://bitbin.it/gWG48q34/
  4. --------------------------------------------------------------------------------------
  5. <?php
  6. /* Alle Sub Rubrieken*/
  7. $query = mysql_query("SELECT * FROM tbl_sub_rubriek WHERE rubrieken_id='".$urls['cat']."' ORDER BY titel ASC");
  8. $array = array();
  9. while (($list = mysql_fetch_assoc($query)) != null) {
  10. $array[] = array('id' => $list['id'] ,
  11. 'title' => $list['titel'],
  12. 'scode' => $list['scode']
  13. );
  14. }
  15. /* Alle advertenties */
  16. $query_ad = mysql_query("SELECT * FROM tbl_advertenties WHERE sub_rubriek_id='".$array[$j]['id']."' ORDER BY titel ASC");
  17. $array_ad = array();
  18. while (($list_ad = mysql_fetch_assoc($query_ad)) != null) {
  19. $array_ad[] = array('id' => $list_ad['id'] ,
  20. 'title' => $list_ad['titel'],
  21. 'scode' => $list_ad['scode']
  22. );
  23. }
  24. $titel_advertentie = $array[$j]['titel'];
  25. print '<table border="0" cellspacing="5" cellpadding="0">';
  26. for ($i = 0, $size = count($array); $i < $size; $i += 2) {
  27. $scode = array();
  28. print '<tr>';
  29. for ($j = $i, $count = $i + 2; $j < $count; $j++) {
  30. if (!isset($array[$j])) {
  31. break;
  32. }
  33. $scode[$array[$j]['id']] = $array[$j]['scode'];
  34. $titel_rubriek = $array[$j]['title'];
  35. printf('<td width="300" height="25" class="titel_rubrieken" valign="middle">- '.$titel_rubriek.'</td>', $array[$j]['id'], $array[$j]['title']) or die (mysql_error());
  36. }
  37. print '</tr><tr>';
  38. foreach ($scode as $id => $item) {
  39. $titel_advertentie = $array_ad[$j]['titel'];
  40. //printf('<td width="300" height="25" class="titel_rubrieken" valign="middle">- '.$titel_advertentie.'</td>', $array[$j]['id'], $array[$j]['title']) or die (mysql_error());
  41. printf('<td width="300" height="100" valign="top" class="bg_rubrieken">'.$titel_advertentie.'</td>', $id, $item);
  42. }
  43. print '</tr>';
  44. }
  45. print '</table>';
  46. ?>

comments powered by Disqus