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 > ช่วยดูโค๊ตให้หน่อยครับ เกี่ยวกับ innerhtml พอดีว่าผมอยากให้มันดึงข้อมูลใหม่มาโชทุก 10 วินาทีอะครับแต่มันดันไม่ดึงมา<br /> แสดงอะครับ และไม่มี error ใน JavaScript ด้วยอะครั



 

ช่วยดูโค๊ตให้หน่อยครับ เกี่ยวกับ innerhtml พอดีว่าผมอยากให้มันดึงข้อมูลใหม่มาโชทุก 10 วินาทีอะครับแต่มันดันไม่ดึงมา<br /> แสดงอะครับ และไม่มี error ใน JavaScript ด้วยอะครั

 



Topic : 020902

Guest




พอดีว่าผมอยากให้มันดึงข้อมูลใหม่มาโชทุก 10 วินาทีอะครับแต่มันดันไม่ดึงมา
แสดงอะครับ และไม่มี error ใน JavaScript ด้วยอะครับ


<?php require_once("lib.db.php"); ?>
<?php require_once("lib.sess.php"); ?>
<?php require_once("lib.datetime.php"); ?>
<?php require_once("lib.perms.php"); ?>
<?php //require_once("lib.mustlogin.php"); ?>
<?php require_once("lib.report.php"); ?>
<? $i = 0;?>
<?php pageperm()?>
<?
$jobid = reqvar("jobid") + 0 ;
$showall = reqvar("showall") + 0;
$sort = " order by t.batchid DESC ,txnseq DESC ,t.pan ASC";
$rowtop = getcfg("RECENT TRANSACTION LIST SIZE",50);
$batchid = "";
$txnid = "";
$payid = "";
$amt = "";
$txnseq = "";
$invoice = "";
$respcode = "";
$merid = "";;
$cardno = "";
$termid = "";
$i =0;
$found = false;
$sql = "select top ".$rowtop." t.txnid ,t.batchid,t. txnseq, t.jobid ,t.pan as cardno, t.merid,t.termid ,t.voided , t.blocked,
t.respcode, t.processed , m.mername,t. invoice, t.amt, t.payid , t.respcode from txn t inner join mer m on t.merid = m.merid ";
if($showall == "0"){
$where = " where jobid = '".$jobid."' and respcode <> '00' and (respcode <> null or respcode <> '' or respcode is not null ) ";
}else{
$where = " where jobid = '".$jobid."' and (respcode <> null or respcode <> '' or respcode is not null ) ";
}
//$where = " where jobid = '".$jobid."'";
$sql = $sql.$where.$sort;
//debug($sql2);
$rs = sqlquery($sql);
//debug($rs);
?>

<html>
<head>
<title>Merchant Report</title>
<Script Language="JavaScript" src=lib.utils.js.php></script>
<link href="lib.rps.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<script language="JavaScript" src="function/calendar.js"></script>
<link href="function/calendar-mos.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0" onload="a();">
<script>
var MAXROWS = <?=$rowtop;?>;
var TABLEHEAD = "<table cellpadding=1px cellspacing=0 border=1px style=\"border: 1px solid #20085d;\" align=center><tr class=\"tableHeader2\">";
TABLEHEAD = TABLEHEAD + "<td align=center style=\"width:20px;\" nowrap >Batch ID</td><td align=center style=\"width:20px;\" nowrap >";
TABLEHEAD = TABLEHEAD + "TXN Seq. </td> <td align=center style=\"width:100px;\"> Card No</td><td align=center style=\"width:100px;\">";
TABLEHEAD = TABLEHEAD + "Terminal id</td> <td align=center style=\"width:100px;\">Payment id</td><td align=center style=\"width:100px;\" >";
TABLEHEAD = TABLEHEAD + "Amount </td> <td align=center style=\"width:100px;\">Invoice</td><td align=center style=\"width:50px;\">Resp. Code</td></tr>";
var rows = new Array(MAXROWS);
for (var i = 0; i < MAXROWS; i++)
{
// make all elements defined
rows = "";
}
var rnd1 = "", rnd2 = "";
<?
if($rs){
while($row = sqlfetch($rs)){
$found = true;
$batchid = $row["batchid"];
$txnid = $row["txnid"];
$payid = $row["payid"];
$amt = $row["amt"];
$txnseq = $row["txnseq"];
$invoice = $row["invoice"];
$respcode = $row["respcode"];
$merid = $row["merid"];
$cardno = $row["cardno"];
$termid = $row["termid"];

?>
rows[<?=$i?>] = "<tr class=cellContent onMouseOver=\"this.className = 'cellContent2 hand'\" onMouseOut=\"this.className = 'cellContent hand'\"><td align=right><?=$batchid?>&nbsp;</td><td align=\"right\"><?=number_format($txnseq)?></td><td align=left><?=$cardno?>&nbsp;</td><td align=left><?=$termid?>&nbsp;</td><td align=left><?=$payid?></td><td align=right><?=number_format($amt,2)?></td><td align=left><?=invoicelength($invoice)?>&nbsp;</td><td align=center><?=$respcode?>&nbsp; </td></tr>";
<?
$i++;
}
}
if(!$found){
?>
rows[0] = "<tr><td colspan=8 class=msg > No Found Transections</td>";
<?
}
?>

function writetable()
{
var tblholder = document.getElementById("tblholder");
var html = TABLEHEAD;
for (var i = 0; i < MAXROWS; i++)
{
if (rows == "")
break;
html += rows;
}
html += "</table>";
tblholder.innerHTML = html;
}

function randomizerows()
{
<?
$sql = "select top ".$rowtop." t.txnid ,t.batchid,t. txnseq, t.jobid ,t.pan as cardno, t.merid,t.termid ,t.voided , t.blocked,
t.respcode, t.processed , m.mername,t. invoice, t.amt, t.payid , t.respcode from txn t inner join mer m on t.merid = m.merid ";
if($showall == "0"){
$where = " where jobid = '".$jobid."' and respcode <> '00' and (respcode <> null or respcode <> '' or respcode is not null ) ";
}else{
$where = " where jobid = '".$jobid."' and (respcode <> null or respcode <> '' or respcode is not null ) ";
}
$sql = $sql.$where.$sort;
$rs2 = sqlquery($sql);

$j=0;
if($rs2){
while($row2 = sqlfetch($rs2)){
$batchid = $row2["batchid"];
$txnid = $row2["txnid"];
$payid = $row2["payid"];
$amt = $row2["amt"];
$txnseq = $row2["txnseq"];
$invoice = $row2["invoice"];
$respcode = $row2["respcode"];
$merid = $row2["merid"];
$cardno = $row2["cardno"];
$termid = $row2["termid"];

?>
rows[<?=$j?>] = "<tr class=cellContent onMouseOver=\"this.className = 'cellContent2 hand'\" onMouseOut=\"this.className = 'cellContent hand'\"><td align=right><?=$batchid?>&nbsp;</td><td align=\"right\"><?=number_format($txnseq)?></td><td align=left><?=$cardno?>&nbsp;</td><td align=left><?=$termid?>&nbsp;</td><td align=left><?=$payid?></td><td align=right><?=number_format($amt,2)?></td><td align=left><?=invoicelength($invoice)?>&nbsp;</td><td align=center><?=$respcode?>&nbsp; </td></tr>";
<?
$j++;
}
}
?>
writetable();
a();
}

</script>
<body>
<?
debug($sql);
?>
<span id=tblholder></span>
</body>
<script>
writetable();
</script>
</body>
<script>
var re;
function a(){
clearTimeout(re);
re = setTimeout("randomizerows();" ,2000);
}
</script>
</html>


Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 8 ก.ค. 2551 09:46:10 By : windersun View : 1281 Reply : 1
 

 

No. 1

Guest


ใช้ AJAX จะง่ายกว่ามั๊ย






Date : 8 ก.ค. 2551 18:59:45 By : Apache
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยดูโค๊ตให้หน่อยครับ เกี่ยวกับ innerhtml พอดีว่าผมอยากให้มันดึงข้อมูลใหม่มาโชทุก 10 วินาทีอะครับแต่มันดันไม่ดึงมา<br /> แสดงอะครับ และไม่มี error ใน JavaScript ด้วยอะครั
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 04
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 อัตราราคา คลิกที่นี่