jamesmva

modal not looping

Nov 17th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.16 KB | None | 0 0
  1.  
  2. <?php
  3.     function Modal_Color(){
  4.         global $conn;
  5.        
  6.            
  7.        $get_color = "SELECT * FROM gallery2 WHERE number_='$number'";  /// $number is not defined here,but it is on the other funtion
  8.       $run_color = mysqli_query($conn,$get_color);
  9.       while ($rows = mysqli_fetch_assoc($run_color)){
  10.       $id=$rows['id']   ;
  11.       $color=$rows['image'] == '' ? '' : ' <div class="col-sm-3 col-md-3">
  12.  
  13.       <div class="thumbnail" >
  14.       <h4 class="text-center"><span class="label label-info center-block" style="background-color:#CF000F;">Liso '.$number.'</span></h4>
  15.       <a id="carousel-selector-0" ><img src="../'.$rows['image'].'" ></a>
  16.  
  17.      <div class="caption">
  18.     <div class="row">
  19.                                
  20.      <button type="button" class="btn btn-primary actions add btn-block " data-action="add"   product_id="'.$id.'"  ><i class="fa fa-cart-plus" aria-hidden="true"></i></span>&nbsp;Adicionar</button>
  21.                         </div>
  22.                                
  23.                     </div>
  24.  
  25.                        
  26.                 </div>
  27.             </div>';
  28.  
  29.  
  30.             }
  31.  
  32.  
  33.         $sql = "SELECT * FROM gallery2 WHERE liso = 1 ";
  34.         $run = mysqli_query($conn,$sql);
  35.         while ($rows = mysqli_fetch_assoc($run)){
  36.         $vari = $rows['variante'];
  37.         $num = $rows['title'];
  38.         $isLiso = $rows['liso'];
  39.  
  40.         $id=$rows['id'];
  41.         if($vari< 1){
  42.         $dash="";
  43.          $vari="";
  44.         }else{
  45.          $dash="-";
  46.         $vari = $rows['variante'];
  47.             }
  48.  
  49.        $dashcol="-";
  50.       $variI = $rows['variante'];
  51.       $number=$num.$dashcol.$variI;
  52.                
  53.       echo '<div class="modal fade" id="lisos'.$number.'" role="dialog">
  54.  
  55.     <div class="modal-dialog modal-xl">
  56.     <div class="modal-content">
  57.     <div class="modal-header">
  58.  
  59.    <div class="btn-group pull-right">
  60.     <button type="button" class="btn btn-default pull-right" data-dismiss="modal" aria-hidden="true">×</button>
  61.     </div>
  62.  
  63.         <h3 class="modal-title">'.$num.''.$dash.''.$vari.'</h3>
  64.  
  65.                
  66.         </div>
  67.        <div class="modal-body">
  68.         <div class="col-md-12">
  69.  
  70.              '.$color.' ///////// i am trying to loop this
  71.  
  72.                  
  73.         </div>
  74.            
  75.    
  76.         <div class="clearfix"></div>
  77.  
  78.  
  79.         </div>
  80.         </div><!-- /.modal-content -->
  81.                        
  82.        </div><!-- /.modal-dialog--->
  83.        
  84.         </div><!-- /.modal ending  -->
  85.  
  86. ';}
  87.  
  88.     }
  89.  
  90.  
  91.  
  92.  
  93.  
  94. ?>
Advertisement
Add Comment
Please, Sign In to add comment