linccce

Stupid layout at the result

Oct 9th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <?php
  2.  
  3. $q = sqlUktX("SELECT DISTINCT gamintojas as gami FROM gaia_text WHERE gamintojas != '' AND akcija = '1'");
  4. if ($q['total'] > "0") {
  5.     foreach($q['result'] as $key => $val) {
  6.         $kintamasis = $key;
  7.                 echo  '<div class="Prekiu-grupe">';
  8.                 $t = sqlUktX("SELECT id FROM gaia_text WHERE gamintojas = '".$val['gami']."' AND akcija = '1'");
  9.                     if ($t['total'] > 0) {
  10.                         $counter = 0;
  11.                         ?>
  12.                         <div class="katalogo-tipo-antraste">
  13.                             <div class="antrastes-tekstas"><span class="priedas"></span>
  14.                                 <span><?php echo $val['gami']; ?></span>
  15.                             </div>
  16.                         </div>
  17.                         <?php
  18.                         end($t['result']);
  19.                         $last = key($t['result']);
  20.                         reset($t['result']);
  21.                         $first = key($t['result']);
  22.                         foreach ($t['result'] as $key => $vv) {
  23.                             if ($key == 0 || $key > 4 && $key < $last){
  24.                                 echo '<div class="prekiu-eile">';
  25.                             }
  26.  
  27.                             //showPreke($vv['id'], "mini");
  28.                             echo '<div id="'.$key.'" style="display: inline-block; height: 200px; width: 200px; background: red; border: 3px solid black; margin: 10px; font-size: 50px; line-height: 200px; text-align: center;">'.$key.'</div>';
  29.  
  30.                             if ($key == 4 || $key == $last){
  31.                                 echo '</div><div class="isvalyti"></div>';
  32.                             }
  33.                         }
  34.  
  35.                     }
  36.                 echo '</div><div class="isvalyti"></div>';             
  37.     }
  38. }
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment