  | 
              
	              
	                
  
    
	 
        ถามเรื่อง barcode ครับ สอบถานิดครับ พอดีว่า ผมทำวนลูปมา ในตารางนะครับ พอมาถึงให้ โชว์ ส่วนของ barcode ด้วย แต่ใช่     | 
   
  
    |   | 
   
 
 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 repeat5(str_barcode); 
 ตอนสนลูป ก็ส่ง parameter เข้าไปด้วยสิครับ 
Code (PHP) 
<script>
                 var repeat5 = function(str_barcode)
		{
			
                 JsBarcode("#barcode2",str_barcode,{width:2,height:18,displayValue:true,fontSize:10});
                 };
                 setInterval(repeat5,5000);   
                 repeat5(str_barcode);
                 </script> 
                        
               
               | 
             
            
              
			                
  ประวัติการแก้ไข 2018-05-07 11:49:21              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-07 11:48:34 | 
                        By :
                            mongkon.k | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 อีกนิดครับ แล้ว str_barcode เราไปเอามาจากใหนอ่ะครับ ผมที่วนมาเป็นแบบนี้ครับ หรือ เราต้อง แทนค่าไปก่อนครับ  
 
 
<?php echo $testquery['barcode'];?>                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-07 13:42:55 | 
                        By :
                            owenback | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ลองแล้วอันนี้ไม่ขึ้นเลยครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-07 15:40:54 | 
                        By :
                            owenback | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ยังไม่ขึ้นเลยครับ ช่วยทีครับ ผม ขอบคุณครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-08 08:31:37 | 
                        By :
                            owenback | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 บรรทัดที่ 84 -90 ครับ 
Code (PHP) 
$page = 1;
        $perpage = 8;
        	while($resultpoonline=sqlsrv_fetch_array($querypoonline))
            {
        
        
            if ($k == 1 or $k == 9 )
            { 
		
		?>	
		<div align='left' style='width:1350;'>
		<?php	
		if($page%10==1 && $page!=1) $continue=$page; //case (11,21,31,...)
		else 
		{ 
			if($page%10==0) $continue=$page-9; /*case (10,20,30,...)*/ else $continue=($page-($page%10))+1; /*case (1,2,3,4,...)*/
		}
		$linkpage="print_edit.php?material&drawing=&to=&pono=&page=";
		echo "<font color='Black'>Page: </font>";
		for($j = $continue; $j <= $all_page; $j++)
		{
			if($j>10 && $j==$continue) 
			{ 
				$prev=$continue-1; echo "<mark style='background-color:#A4A4A4; color:Black;'><a href='$linkpage"."1"."'><u>1</u></a></mark>|<a href='$linkpage".$prev."'><u>....</u></a>|";
			}
			if($page == $j)
			{
				echo(" <font color='Black'>".$j."</font> ");
			} else
			{
				echo"<mark style='background-color:#A4A4A4; color:Black;'><a href='$linkpage".$j."'>$j</a></mark>";
			}
			echo "<font color='Black'>|</font>";
			if($j%10==0) 
			{ 
				$next=$j+1; 
				if($next<=$all_page) echo "<a href='$linkpage".$next."'><u>....</u></a>|<mark style='background-color:#A4A4A4; color:Black;' ><a href='$linkpage".$all_page."'><u>$all_page</u></a></mark>"; 
				break;
			}
		}
		?>
	</div>
		<!--<div class="page-break<?=($i==1)?"-no":""?>"> </div> -->
		<div class="page-break"> </div>
		        <table class="tb" width="100%;" style="margin-bottom: 20px;">
                <tr>
                    <td width="4%" rowspan="2" align="center" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;">No. </td>
                    <td width="18%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> PO No. : <?php echo $resultalldata['allrecord'] ;?> </td>
                    <td width="11%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Material No. <?php echo $B ;?> </td>
                    <td width="13%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Drawing No.</td>
                    <td width="8%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Open QTY</td>
                    <td width="10%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Del.Date</td>
                    <td width="10%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Comf.Date</td>
                    <td colspan="2" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Comf.QTY</td>
                </tr>
                <tr>
                    <td class="td" align="left" bgcolor="#e5e5e5" style=" font-weight: bold; font-size: 12px;"> PO Line</td>
                    <td colspan="3" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;">  Description</td>
                    <td colspan="2" align="left" bgcolor="#e5e5e5" class="td" style="font-weight: bold; font-size: 12px;"> Notes</td>
                    <td align="left" bgcolor="#e5e5e5" class="td" style="font-weight: bold; font-size: 12px;"> INV.NO</td>
                
                </tr>
            <?php
            
            ++$page;
            }
            
            /*while($resultpoonline=sqlsrv_fetch_array($querypoonline))
            { */
            	$B = $resultpoonline['PONO']; 
            				
            ?>      
				<tr>
                    <td rowspan="2" align="center" valign="middle" class="td" style="font-size: 12px;"><?php echo $x;?></td>
                    
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode1"/>
                    
	[font=Verdana]	<script>
                    var repeat5 = function()
					{
                    JsBarcode("#barcode1","<?php echo $resultpoonline['PONO'];?>",{width:2,height:20, displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000000);   
                    repeat5();
                    </script>  [/font]    /* ส่วนนี้ครับที่แสดง Barcode นะครับ แต่ว่า วนลูปมา แล้วแสดง แค่ ตัสสุดท้ายนะครับ */         
                    </td> 
                    
                    <td class="td" style="font-size: 12px;"><?php echo $resultpoonline['MATERIAL'];?></td>
                    <td class="td" style="font-size: 12px;"><?php echo $resultpoonline['DRAWNO'];?></td>
                    <td class="td" align="center" style="font-size: 12px;"><?php echo $resultpoonline['OPENQTY'];?></td>
                    <td class="td" align="center" style="font-size: 12px;"><?php echo date_format($resultpoonline['DELDATE'],'d/m/Y'); ?></td>
                    <td class="td" align="center" style="font-size: 12px;"><?php echo date_format($resultpoonline['VCONFDATE'],'d/m/Y');?></td>    
                    
                  	<td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode2"/>
                    
<script>
                    var repeat5 = function()
					{
                    JsBarcode("#barcode2","<?php echo $resultpoonline['VCONFQTY'];?>",{width:2,height:20,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,500000);   
                    repeat5();
                    </script>               
                    </td>   
                    
                </tr>
                
                <tr>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode3"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode3","<?php echo $resultpoonline['POLINE'];?>",{width:2,height:20,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,500000);   
                    repeat5();
                    </script>               
                    </td> 
                    <td colspan="3" class="td" style="font-size: 12px;"><?php echo $resultpoonline['DESCR'];?></td>
                    <td colspan="2" class="td" style="font-size: 12px;"><?php echo $resultpoonline['NOTELINE'], $n;?></td>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode4"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode4","<?php echo $resultpoonline['VINVNO'];?>",{width:2,height:20,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,500000);   
                    repeat5();
                    </script>               
                    </td> 
                </tr>
                
            	}
            	           	             	
            }	
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-08 09:30:41 | 
                        By :
                            owenback | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 Code (PHP) 
<script>
function repeat(obj,str_barcode)
{
 JsBarcode(obj,str_barcode,{width:2,height:20, displayValue:true,fontSize:10});
}
</script>
</script>
		$page = 1;
        $perpage = 8;
        	while($resultpoonline=sqlsrv_fetch_array($querypoonline))
            {
        
        
            if ($k == 1 or $k == 9 )
            { 
		
		?>	
		<div align='left' style='width:1350;'>
		<?php	
		if($page%10==1 && $page!=1) $continue=$page; //case (11,21,31,...)
		else 
		{ 
			if($page%10==0) $continue=$page-9; /*case (10,20,30,...)*/ else $continue=($page-($page%10))+1; /*case (1,2,3,4,...)*/
		}
		$linkpage="print_edit.php?material&drawing=&to=&pono=&page=";
		echo "<font color='Black'>Page: </font>";
		for($j = $continue; $j <= $all_page; $j++)
		{
			if($j>10 && $j==$continue) 
			{ 
				$prev=$continue-1; echo "<mark style='background-color:#A4A4A4; color:Black;'><a href='$linkpage"."1"."'><u>1</u></a></mark>|<a href='$linkpage".$prev."'><u>....</u></a>|";
			}
			if($page == $j)
			{
				echo(" <font color='Black'>".$j."</font> ");
			} else
			{
				echo"<mark style='background-color:#A4A4A4; color:Black;'><a href='$linkpage".$j."'>$j</a></mark>";
			}
			echo "<font color='Black'>|</font>";
			if($j%10==0) 
			{ 
				$next=$j+1; 
				if($next<=$all_page) echo "<a href='$linkpage".$next."'><u>....</u></a>|<mark style='background-color:#A4A4A4; color:Black;' ><a href='$linkpage".$all_page."'><u>$all_page</u></a></mark>"; 
				break;
			}
		}
		?>
	</div>
		<!--<div class="page-break<?=($i==1)?"-no":""?>"> </div> -->
		<div class="page-break"> </div>
		        <table class="tb" width="100%;" style="margin-bottom: 20px;">
                <tr>
                    <td width="4%" rowspan="2" align="center" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;">No. </td>
                    <td width="18%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> PO No. : <?php echo $resultalldata['allrecord'] ;?> </td>
                    <td width="11%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Material No. <?php echo $B ;?> </td>
                    <td width="13%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Drawing No.</td>
                    <td width="8%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Open QTY</td>
                    <td width="10%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Del.Date</td>
                    <td width="10%" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Comf.Date</td>
                    <td colspan="2" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;"> Comf.QTY</td>
                </tr>
                <tr>
                    <td class="td" align="left" bgcolor="#e5e5e5" style=" font-weight: bold; font-size: 12px;"> PO Line</td>
                    <td colspan="3" align="left" bgcolor="#e5e5e5" class="td" style=" font-weight: bold; font-size: 12px;">  Description</td>
                    <td colspan="2" align="left" bgcolor="#e5e5e5" class="td" style="font-weight: bold; font-size: 12px;"> Notes</td>
                    <td align="left" bgcolor="#e5e5e5" class="td" style="font-weight: bold; font-size: 12px;"> INV.NO</td>
                
                </tr>
            <?php
            
            ++$page;
            }
            
            /*while($resultpoonline=sqlsrv_fetch_array($querypoonline))
            { */
            	$B = $resultpoonline['PONO']; 
            				
            ?>      
				<tr>
                    <td rowspan="2" align="center" valign="middle" class="td" style="font-size: 12px;"><?php echo $x;?></td>
                    
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode1"/>
                    
					[font=Verdana]	
					<script>  
                    	setInterval(repeat("#barcode1",<?php echo $resultpoonline['PONO'];?>),500000);  
                    </script>
                    [/font]    /* ส่วนนี้ครับที่แสดง Barcode นะครับ แต่ว่า วนลูปมา แล้วแสดง แค่ ตัสสุดท้ายนะครับ */         
                    </td> 
                    
                    <td class="td" style="font-size: 12px;"><?php echo $resultpoonline['MATERIAL'];?></td>
                    <td class="td" style="font-size: 12px;"><?php echo $resultpoonline['DRAWNO'];?></td>
                    <td class="td" align="center" style="font-size: 12px;"><?php echo $resultpoonline['OPENQTY'];?></td>
                    <td class="td" align="center" style="font-size: 12px;"><?php echo date_format($resultpoonline['DELDATE'],'d/m/Y'); ?></td>
                    <td class="td" align="center" style="font-size: 12px;"><?php echo date_format($resultpoonline['VCONFDATE'],'d/m/Y');?></td>    
                    
                  	<td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode2"/>
                    
					<script>
                    setInterval(repeat("#barcode2","<?php echo $resultpoonline['VCONFQTY'];?>"),500000);   
                    </script>               
                    </td>   
                    
                </tr>
                
                <tr>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode3"/>
					<script>  
                    	setInterval(repeat("#barcode3",<?php echo $resultpoonline['POLINE'];?>),500000);  
                    </script>               
                    </td> 
                    <td colspan="3" class="td" style="font-size: 12px;"><?php echo $resultpoonline['DESCR'];?></td>
                    <td colspan="2" class="td" style="font-size: 12px;"><?php echo $resultpoonline['NOTELINE'], $n;?></td>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <img id="barcode4"/>  
					<script>  
                    	setInterval(repeat("#barcode4",<?php echo $resultpoonline['VINVNO'];?>),500000);  
                    </script>              
                    </td> 
                </tr>
                
            	}
            	           	             	
            }	
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-08 10:59:11 | 
                        By :
                            mongkon.k | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ขึ้นโชว์ครับ แต่ว่ายังไม่เปลี่ยน ตาม ลูปอ่ะครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-08 11:46:56 | 
                        By :
                            owenback | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ลอง งมอยู่นานล่ะครับ ยังไม่ได้เลยครับ ตามที่ท่าน Mongkon.k ให้มา ก็เหมือน ของผมอันแรก เลยครับ คือว่า รันครับ แต่ไม่เปลี่ยน เอาแถวสุดท้ายมาโชว์ให้อ่ะครับ แล้วก็เป็น ข้อมูลเดียวเลยครับ ไม่เปลี่ยน ตามที่ loop มานะครับ  ตามที่ผมเข้าใจไม่รู้ว่าถูกเปล่านะครับ เพราะว่ามี  
 <img id = "barcode1"/>  	ตัวเดียว เลย ทำเป็นรูปภาพมาให้แค่รูปเดียวรึเปล่าครับ ท่านใดพอช่วยได้บ้างครับ รบกวนด้วยครับ 	   
	<script>   
                    	setInterval(repeat("#barcode1","<?php echo $resultpoonline['PONO'];?>"),500000);   
                   </script>                        
               
               | 
             
            
              
			                
  ประวัติการแก้ไข 2018-05-08 19:25:26              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-05-08 19:24:15 | 
                        By :
                            owenback | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |