Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ท่านใดช่วยต่อให้ด้วยครับ ปัญหาเดิมครับ วนลูป Barcode แล้ว ยังไม่เปลี่ยน ตาม ที่วนครับ



 

ท่านใดช่วยต่อให้ด้วยครับ ปัญหาเดิมครับ วนลูป Barcode แล้ว ยังไม่เปลี่ยน ตาม ที่วนครับ

 



Topic : 131009



โพสกระทู้ ( 370 )
บทความ ( 0 )



สถานะออฟไลน์




คือว่ลองทำมาอยู่นานแล้วครับ ไม่สามารถทำได้ มีอีกแบบ คือว่า ทำได้ วนตาม แต่ barcode ยิงได้ บ้างอัน คือแบบนี้ครับ
Code (PHP)
<script language="JavaScript">document.open();Code39(500,100,30,5,"<?php echo $resultpoonline['PONO'];?>",2);</script>


แต่ถ้าอันล่างยิงได้หมดเลย เพราะเป็นรูปภาพ แต่ก็ ข้อมูลมาแค่บรรทัดเดียวนะครับ รบกวนช่วยด้วยครับ ได้อย่างไม่ได้อย่าง เซงจริงๆๆ อยากได้แบบที่ 2 ยิงได้หมด แต่ข้อมูลออกบรรทัดเดียวนะครับ

Code (PHP)

<td height="36" valign="top" class="td" style="font-size: 38px;" >					
                   <img id ="barcode">  		  
					<script language="JavaScript">  
					function  repeat(obj,str_barcode)
						{
							JsBarcode(obj,str_barcode,{width:2,height:20,displayValue:true,fontSize:10});
						}
                    	document.open();repeat("#barcode","<?php echo $resultpoonline['PONO'];?>");  
                    </script>   
				   </td> 	




Tag : PHP, Ms SQL Server 2005









ประวัติการแก้ไข
2018-05-09 11:20:14
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2018-05-09 11:19:11 By : owenback View : 592 Reply : 7
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ขอภาพประกอบหน่อยครับ ยังงงๆ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-05-10 10:07:19 By : mr.win
 


 

No. 2



โพสกระทู้ ( 370 )
บทความ ( 0 )



สถานะออฟไลน์


อันนี้รูปครับ

Error


Code แบบนี้ครับ

Code (PHP)
<img id ="barcode">  		  
					<script language="JavaScript">  
					function  repeat(obj,str_barcode)
						{
							JsBarcode(obj,str_barcode,{width:2,height:20,displayValue:true,fontSize:10});
						}
                    	document.open();repeat("#barcode","<?php echo $resultpoonline['PONO'];?>");  
                    </script>  


รบกวนด้วยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-05-10 11:15:49 By : owenback
 

 

No. 3



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


คุณเอา php ไปผสมกับ javascript

ให้ตรวจสอบชุดคำสั่ง javascript ที่ได้ฝั่ง client ว่ามาถูกต้องหรือไม่ โดยใช้คำสั่ง view source ของ browser
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-05-10 14:13:44 By : Chaidhanan
 


 

No. 4



โพสกระทู้ ( 370 )
บทความ ( 0 )



สถานะออฟไลน์


ผมลอง view source ตามที่ Chaidhanan ว่า ก็ออกมาวนออกมานะครับ


Code (PHP)
  <img id ="barcode">  		  
					<script language="JavaScript">  
					function  repeat(obj,str_barcode)
						{
							JsBarcode(obj,str_barcode,{width:2,height:20,displayValue:true,fontSize:10});
						}
                    	document.open();repeat("#barcode","1100107440");  
                    </script>  
				   </td> 					
                    <td class="td" style="font-size: 12px;">122020C</td>
                    <td class="td" style="font-size: 12px;">MT300398C</td>
                    <td class="td" align="center" style="font-size: 12px;">12.000</td>
                    <td class="td" align="center" style="font-size: 12px;">23/03/2018</td>
                    <td class="td" align="center" style="font-size: 12px;">26/04/2018</td>    
                    
                  	<td height="36" valign="top" class="td" style="font-size: 38px;" >
					
                    <!--<img id="barcode2"/>
									
                    <script>
                    var repeat5 = function()
					{
						
                    JsBarcode("#barcode2","12",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"12",2);</script>
                    </td>   
                    
                </tr>               
                <tr>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                   <!-- <img id="barcode3"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode3","10",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
                        <script language="JavaScript">document.open();Code39(500,100,30,5,"10",2);</script>					
                    </td> 

                    <td colspan="3" class="td" style="font-size: 12px;">PIPE(TOWER)[EDW(ST)]</td>
                    <td colspan="2" class="td" style="font-size: 12px;">1</td>

                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <!--<img id="barcode4"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode4","AAAA",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script> -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"AAAA",2);</script>
                    </td> 

                </tr>              
                  
				<tr>
                    <td rowspan="2" align="center" valign="middle" class="td" style="font-size: 12px;">2</td>
                    
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <!--<img id="barcode1"/>
                   <!--<script language="JavaScript">           
                    document.open();JsBarcode("#barcode1","1100108682",{width:2,height:18, displayValue:true,fontSize:10});                   
                    </script>--> 
					<!--<script language="JavaScript">document.open();Code39(500,100,30,5,"1100108682",1);</script>-->
                  <img id ="barcode">  		  
					<script language="JavaScript">  
					function  repeat(obj,str_barcode)
						{
							JsBarcode(obj,str_barcode,{width:2,height:20,displayValue:true,fontSize:10});
						}
                    	document.open();repeat("#barcode","1100108682");  
                    </script>  
				   </td> 					
                    <td class="td" style="font-size: 12px;">22225FA</td>
                    <td class="td" style="font-size: 12px;">MT513178A</td>
                    <td class="td" align="center" style="font-size: 12px;">7.000</td>
                    <td class="td" align="center" style="font-size: 12px;">07/03/2018</td>
                    <td class="td" align="center" style="font-size: 12px;">26/04/2018</td>    
                    
                  	<td height="36" valign="top" class="td" style="font-size: 38px;" >
					
                    <!--<img id="barcode2"/>
									
                    <script>
                    var repeat5 = function()
					{
						
                    JsBarcode("#barcode2","7",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"7",2);</script>
                    </td>   
                    
                </tr>               
                <tr>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                   <!-- <img id="barcode3"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode3","320",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
                        <script language="JavaScript">document.open();Code39(500,100,30,5,"320",2);</script>					
                    </td> 

                    <td colspan="3" class="td" style="font-size: 12px;">BOSS M3 OD4 H5.8[SL400/600G(WELD)]</td>
                    <td colspan="2" class="td" style="font-size: 12px;">2</td>

                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <!--<img id="barcode4"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode4","TTTT",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script> -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"TTTT",2);</script>
                    </td> 

                </tr>              
                  
				<tr>
                    <td rowspan="2" align="center" valign="middle" class="td" style="font-size: 12px;">3</td>
                    
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <!--<img id="barcode1"/>
                   <!--<script language="JavaScript">           
                    document.open();JsBarcode("#barcode1","1100114066",{width:2,height:18, displayValue:true,fontSize:10});                   
                    </script>--> 
					<!--<script language="JavaScript">document.open();Code39(500,100,30,5,"1100114066",1);</script>-->
                  <img id ="barcode">  		  
					<script language="JavaScript">  
					function  repeat(obj,str_barcode)
						{
							JsBarcode(obj,str_barcode,{width:2,height:20,displayValue:true,fontSize:10});
						}
                    	document.open();repeat("#barcode","1100114066");  
                    </script>  
				   </td> 					
                    <td class="td" style="font-size: 12px;">HA4195B</td>
                    <td class="td" style="font-size: 12px;">FY501709B=</td>
                    <td class="td" align="center" style="font-size: 12px;">14.000</td>
                    <td class="td" align="center" style="font-size: 12px;">20/04/2018</td>
                    <td class="td" align="center" style="font-size: 12px;">26/04/2018</td>    
                    
                  	<td height="36" valign="top" class="td" style="font-size: 38px;" >
					
                    <!--<img id="barcode2"/>
									
                    <script>
                    var repeat5 = function()
					{
						
                    JsBarcode("#barcode2","1",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"1",2);</script>
                    </td>   
                    
                </tr>               
                <tr>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                   <!-- <img id="barcode3"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode3","20",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
                        <script language="JavaScript">document.open();Code39(500,100,30,5,"20",2);</script>					
                    </td> 

                    <td colspan="3" class="td" style="font-size: 12px;">ARM SEAL[SL400/600Q]</td>
                    <td colspan="2" class="td" style="font-size: 12px;">3</td>

                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <!--<img id="barcode4"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode4","TEST1",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script> -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"TEST1",2);</script>
                    </td> 

                </tr>              
                  
				<tr>
                    <td rowspan="2" align="center" valign="middle" class="td" style="font-size: 12px;">4</td>
                    
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <!--<img id="barcode1"/>
                   <!--<script language="JavaScript">           
                    document.open();JsBarcode("#barcode1","1100114066",{width:2,height:18, displayValue:true,fontSize:10});                   
                    </script>--> 
					<!--<script language="JavaScript">document.open();Code39(500,100,30,5,"1100114066",1);</script>-->
                  <img id ="barcode">  		  
					<script language="JavaScript">  
					function  repeat(obj,str_barcode)
						{
							JsBarcode(obj,str_barcode,{width:2,height:20,displayValue:true,fontSize:10});
						}
                    	document.open();repeat("#barcode","1100114066");  
                    </script>  
				   </td> 					
                    <td class="td" style="font-size: 12px;">J26906B</td>
                    <td class="td" style="font-size: 12px;">MW503736B</td>
                    <td class="td" align="center" style="font-size: 12px;">18.000</td>
                    <td class="td" align="center" style="font-size: 12px;">20/04/2018</td>
                    <td class="td" align="center" style="font-size: 12px;">26/04/2018</td>    
                    
                  	<td height="36" valign="top" class="td" style="font-size: 38px;" >
					
                    <!--<img id="barcode2"/>
									
                    <script>
                    var repeat5 = function()
					{
						
                    JsBarcode("#barcode2","1",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"1",2);</script>
                    </td>   
                    
                </tr>               
                <tr>
                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                   <!-- <img id="barcode3"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode3","10",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script>  -->
                        <script language="JavaScript">document.open();Code39(500,100,30,5,"10",2);</script>					
                    </td> 

                    <td colspan="3" class="td" style="font-size: 12px;">DIES TOOL G[LOWER GUIDE DIES G]</td>
                    <td colspan="2" class="td" style="font-size: 12px;">4</td>

                    <td height="36" valign="top" class="td" style="font-size: 38px;" >
                    <!--<img id="barcode4"/>
                    <script>
                    var repeat5 = function(){
                    JsBarcode("#barcode4","TEST2",{width:2,height:18,displayValue:true,fontSize:10});
                    };
                    setInterval(repeat5,5000);   
                    repeat5();
                    </script> -->
					<script language="JavaScript">document.open();Code39(500,100,30,5,"TEST2",2);</script>
                    </td> 

                </tr>              
              
            </table>          


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-05-10 19:11:52 By : owenback
 


 

No. 5



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


Code (JavaScript)
<!-- <img id="barcode3"/>
<script>
  var repeat5 = function(){
    JsBarcode("#barcode3","10",{width:2,height:18,displayValue:true,fontSize:10});
  };
  setInterval(repeat5,5000);  
  repeat5();
</script>  -->


Code ข้างบน มาร์ค ไม่ใช้ถูกต้องไหม

แต่ถ้าใช้พอเอามาร์คออก

ให้เอา setInterval(repeat5, 5000); ออกซะ
เพราะ คำสั่ง repeat5 จะทำงาน ทุกๆ 5 วิ
ซึ่งนั่นมากพอที่จะทำให้ ตัวแปร repeat5 ถูกเปลี่ยน เป็นฟังก์ชั่นสุดท้าย

และให้ดี ก็อ่าน document สำหรับคำสั่ง setInterval setTimeout มาอ่านดูนะครับ ว่ามันทำอะไร
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-05-10 20:32:24 By : Chaidhanan
 


 

No. 6



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


และถ้าจะเขียนให้มันใช้งานครั้งเดียว ลองเขียนแบบนี้ดู
Code (JavaScript)
<script>
setTimeout(
  ()=>{
    JsBarcode("#barcode2",,"7",{width:2,height:18,displayValue:true,fontSize:10});
  }
, 5000);
</script>


และถ้า function jsBarcode อยู่ข้างบน ก่อน <body>
ก็ลองแบบนี้
Code (JavaScript)
<script>
(()=>{JsBarcode("#barcode2",,"7",{width:2,height:18,displayValue:true,fontSize:10}); })();
</script>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-05-10 20:44:30 By : Chaidhanan
 


 

No. 7



โพสกระทู้ ( 370 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณครับ เดี๋ยวลองดูตามคำแนะนำครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-05-11 08:19:17 By : owenback
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ท่านใดช่วยต่อให้ด้วยครับ ปัญหาเดิมครับ วนลูป Barcode แล้ว ยังไม่เปลี่ยน ตาม ที่วนครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่