Advertisement
jamesmva

gallery full

Nov 17th, 2016
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.50 KB | None | 0 0
  1. <?php
  2.  
  3. function gallery_full() {
  4. global $conn;
  5. global $page;
  6. global $per_page;
  7. $per_page = 16;
  8. if(isset($_GET['page'])){
  9. $page = $_GET['page'];
  10. }else{
  11. $page = 1 ;
  12. }
  13. $limit = 'LIMIT '.(($page - 1) * $per_page).', '.$per_page;
  14. $start_from = ($page > 1) ? ( $page * $per_page  ) - $per_page : 0;
  15.  
  16.  
  17.  
  18.  
  19.          
  20.           $sql = "SELECT * FROM gallery2 WHERE liso = 0 ORDER BY title ASC,variante ASC LIMIT $start_from, $per_page";
  21.           $run = mysqli_query($conn,$sql);
  22.            
  23.             while ($rows = mysqli_fetch_assoc($run))
  24.             {  
  25.                 $lisos_ativo = $rows['liso'];
  26.                 $vari = $rows['variante'];
  27.                 $num = $rows['title'];
  28.                 $id=$rows['id'];
  29.                 $num_id=$rows['id'];
  30.                 $dashcol="-";
  31.                 $variI = $rows['variante'];
  32.                
  33.                 $number=$rows['title'].$dashcol.$variI;
  34.                
  35.                 //Buttons in the gallery product box
  36.             $add_btn='<a type="button" class="btn btn-primary btn-sm pull-right btn_add add actions add" data-action="add" product_id="'.$id.'" ><i class="fa fa-cart-plus" aria-hidden="true"></i></span>&nbsp;Adicionar</a>';
  37.             $info_btn ='<button type="button" class="btn btn-danger btn-sm btn_info" data-toggle="modal" data-target="#info'.$rows['id'].'" ><span class="glyphicon glyphicon-info-sign"></span>&nbsp; Info</button>';
  38.             $lisos='<button type="button" class="btn-red btn-xs btn btn-default" data-toggle="modal" data-target="#lisos'.$number.'" style="background-color:#CF000F; color:white; margin-right:-10px; "><span class="glyphicon glyphicon-info-sign"></span>&nbsp; Cores Lisas</button>';
  39.  
  40.                if($rows['variante'] < 1){
  41.  
  42.                      $dash="";
  43.                      $vari="";
  44.  
  45.                   }else{
  46.  
  47.                      $dash="-";
  48.                      $vari =$rows['variante'];
  49.                   }
  50.  
  51.  
  52.                
  53.                 //natsort($rows);
  54.  
  55.                 echo'
  56.          
  57.  
  58. <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
  59.     <div class="thumbnail" id="real-estates-columns">
  60.  
  61.         <div class="text-center thumb_p">'.($rows['image'] == '' ? 'No Image' : '<img src="../'.$rows['image'].'" width="100%" >').'</div>
  62.     <span class="label label-danger info pull-right">
  63.     <span data-toggle="tooltip" title="viewed"><b class="glyphicon glyphicon-filter"></b></span>
  64.     <span data-toggle="tooltip" title="category">'.ucfirst($rows['category']).' </span>
  65.     </span>
  66.    
  67. <div class="title-realestates-columns caption">
  68.     <h3><a><strong>'.$num.''.$dash.''.$vari.'</strong></a><a class="pull-right">'.$lisos.'</a></h3>
  69.    
  70.    
  71.        
  72.  
  73.     </br>
  74. <div class="row">
  75.  
  76.  
  77.         '.$info_btn.''.$add_btn.'
  78.        
  79.  
  80.  
  81.     </div>
  82. </div>  
  83. </div>
  84. </br>
  85. </div>
  86. ';
  87.                
  88.         }
  89.             }
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement