  | 
              
	              
	                
  
    
	 
        สอบถามการส่งค่า จากปุ่ม คลิก  ไปยัง modal ใน bootstrap หน่อยครับ     | 
   
  
    |   | 
   
 
 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 17.<a data-toggle="modal"  href="#detail_req<?=$rstReq["ReqID"];?>"><?=$rstReq["ReqName"];?></a> 
18.<div class="modal fade" id="detail_req<?=$rstReq["ReqID"];?>"> 
 
แบบนี้หรือเปล่า                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2015-03-22 12:05:21 | 
                        By :
                            Chaidhanan | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ของผมก็อเป็น เปลี่ยนตรงไหนหรอครับ มันแสดงรายการเดี๋ยวกันหมด ทุกบรรทัดเลย ขอบคุณครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2015-07-13 10:07:15 | 
                        By :
                            Narongrit | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 จะส่งค่า GET ผ่าน ปุ่มให้ไปแสดงใน modal ยังไงครับ โดยไม่ใช้ ajax                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-03-19 02:44:21 | 
                        By :
                            TEST | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 <h3>เลือกโต๊ะอาหาร</h3> 
<form> 
<small>จำนวนลูกค้า : </small> 
<input></input> 
<form> 
<?php 
 
// $chksta = mysql_query("SELECT table_status FROM tbl_table"); 
// list($sta)=mysql_fetch_row($chksta); 
 
$i=0; 
 
$table =mysql_query("SELECT * FROM tbl_table WHERE zone_id = '$_GET[get_zid]'") or dir (mysql_error()); 
echo "<center><br><br>"; 
While(list($tid,$tn,$zis,$sta)=mysql_fetch_row($table)){ 
 
if($sta==1){ 
  $_SESSION['get_tid'][$i]=$tid; 
  print_r($_SESSION['get_tid'][$i]); 
echo " 
 
<button OnChange='document.submit();'' type='button' class='btn btn-success pull-center' data-toggle='modal' data-target='#modal-default' style='margin-right: 50px; margin-top: 5px;''><i class='fa fa-dot-circle-o'></i> $tn</button> 
"; 
 
} 
else{ 
  echo " 
  <a style='color:white;' href='admin.php?page=odr&get_id=$tid'><button type='button' class='btn btn-primary pull-center' data-toggle='modal' data-target='#modal-default' style='margin-right: 50px; margin-top: 5px;''> 
  <i class='fa fa-dot-circle-o'></i> $tn </a> 
  </button>"; 
 
} 
} 
$i++; 
?> 
 
 
<div class="modal fade" id="modal-default"> 
  <div class="modal-dialog"> 
    <div class="modal-content"> 
      <div class="modal-body"><h3>ชำระเงิน</h3> 
        <p> 
        <div class="box"> 
 
           <div class="box-body no-padding"> 
 
             <table class="table table-condensed"> 
               <tr> 
                 <th>รายการอาหาร</th> 
                 <th>ราคา</th> 
                 <th>จำนวน</th> 
               </tr> 
        <?php 
        $gett_id=$_SESSION["get_tid"]; 
 
        $listodr = mysql_query ("SELECT  order_id FROM order_id WHERE table_id ='$gett_id' "); 
        // $get_id=$_GET["get_id"]; 
        While(list($order)=mysql_fetch_row($listodr)){ 
 
        $listmnu = mysql_query ("SELECT  order_id, product_name, order_amount, order_price FROM order_detail WHERE order_id ='$order' AND status='0' "); 
        While(list($id, $pname, $am, $price)=mysql_fetch_row($listmnu)){ 
        echo "<tr> 
                <td>$pname</td> 
                <td>$am</td> 
                <td>$price</td> 
              </tr>"; 
        } 
        if(empty($total)) 
        { 
        $total = ""; 
        } 
        $total += $am*$price; 
        } 
         ?> 
              <tr> 
              <td colspan="2" align=left><strong>รวมทั้งหมด :</strong> </td> 
              <td align=center> <?php echo number_format($total,2); ?> บาท</td> 
              </tr> 
                              </table> 
                            </div> 
                          </div></p> 
        <?php 
 
 
        $empname=$_SESSION["empname"]; 
            echo  "<strong>แคชเชียร์ : </strong> $empname "; 
        ?> 
 
      </div> 
      <div class="modal-footer"> 
        <button type="button" class="btn btn-danger pull-left" data-dismiss="modal">ยกเลิก</button> 
        <a href="chk_bill.php?bill=<?php echo $gett_id; ?>&sta=<?php echo $_SESSION["status"]; ?>"><button type="button" class="btn btn-primary">ชำระเงิน</button></a> 
      </div> 
    </div> 
    <!-- /.modal-content --> 
  </div> 
  <!-- /.modal-dialog --> 
</div>                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-03-19 02:45:21 | 
                        By :
                            TEST | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 Code (PHP) 
<h3>เลือกโต๊ะอาหาร</h3>
<form>
<small>จำนวนลูกค้า : </small>
<input></input>
<form>
<?php
// $chksta = mysql_query("SELECT table_status FROM tbl_table");
// list($sta)=mysql_fetch_row($chksta);
$i=0;
$table =mysql_query("SELECT * FROM tbl_table WHERE zone_id = '$_GET[get_zid]'") or dir (mysql_error());
echo "<center><br><br>";
While(list($tid,$tn,$zis,$sta)=mysql_fetch_row($table)){
if($sta==1){
  $_SESSION['get_tid'][$i]=$tid;
  print_r($_SESSION['get_tid'][$i]);
echo "
<button OnChange='document.submit();'' type='button' class='btn btn-success pull-center' data-toggle='modal' data-target='#modal-default' style='margin-right: 50px; margin-top: 5px;''><i class='fa fa-dot-circle-o'></i> $tn</button>
";
}
else{
  echo "
  <a style='color:white;' href='admin.php?page=odr&get_id=$tid'><button type='button' class='btn btn-primary pull-center' data-toggle='modal' data-target='#modal-default' style='margin-right: 50px; margin-top: 5px;''>
  <i class='fa fa-dot-circle-o'></i> $tn </a>
  </button>";
}
}
$i++;
?>
<div class="modal fade" id="modal-default">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-body"><h3>ชำระเงิน</h3>
        <p>
        <div class="box">
           <div class="box-body no-padding">
             <table class="table table-condensed">
               <tr>
                 <th>รายการอาหาร</th>
                 <th>ราคา</th>
                 <th>จำนวน</th>
               </tr>
        <?php
        $gett_id=$_SESSION["get_tid"];
        $listodr = mysql_query ("SELECT  order_id FROM order_id WHERE table_id ='$gett_id' ");
        // $get_id=$_GET["get_id"];
        While(list($order)=mysql_fetch_row($listodr)){
        $listmnu = mysql_query ("SELECT  order_id, product_name, order_amount, order_price FROM order_detail WHERE order_id ='$order' AND status='0' ");
        While(list($id, $pname, $am, $price)=mysql_fetch_row($listmnu)){
        echo "<tr>
                <td>$pname</td>
                <td>$am</td>
                <td>$price</td>
              </tr>";
        }
        if(empty($total))
        {
        $total = "";
        }
        $total += $am*$price;
        }
         ?>
              <tr>
              <td colspan="2" align=left><strong>รวมทั้งหมด :</strong> </td>
              <td align=center> <?php echo number_format($total,2); ?> บาท</td>
              </tr>
                              </table>
                            </div>
                          </div></p>
        <?php
        $empname=$_SESSION["empname"];
            echo  "<strong>แคชเชียร์ : </strong> $empname ";
        ?>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger pull-left" data-dismiss="modal">ยกเลิก</button>
        <a href="chk_bill.php?bill=<?php echo $gett_id; ?>&sta=<?php echo $_SESSION["status"]; ?>"><button type="button" class="btn btn-primary">ชำระเงิน</button></a>
      </div>
    </div>
    <!-- /.modal-content -->
  </div>
  <!-- /.modal-dialog -->
</div>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-03-19 02:45:51 | 
                        By :
                            TEST | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |