2011-11-24 7 views
-1

페이지 매김이 작동하지 않는 이유를 모르겠습니다! 기본적으로 ok로 표시되지만 '다음'페이지 또는 일부 페이지 번호를 클릭해도 아무런 변화가 없으며 페이지가 전혀 변경되지 않습니다. pagination.js 또는 pagination_class.php를 인식하지 않는 것과 같습니다. 사이트의 다른 부분이 잘 작동하고있어 확실하지는 않습니다. 동일한 폴더에이 파일과 관련된 4 개의 파일이 있습니다. myaccount_betinghistory.php, myaccount_bettinghistory_sub.php, pagination.js, pagination_class.php.페이지 매김 - 작동하지 않음

여기 모든 파일을 볼 수있는 모든 코드가 있습니다. 거기에 버그를 찾을 수 있기를 바랍니다.

myaccount_bettinghistory.php :

<?php 

error_reporting(E_ALL^E_NOTICE); 
include('pagination_class.php'); 

?> 

<script language="JavaScript" src="pagination.js"></script> 
<link rel="stylesheet" type="text/css" href="style.css" /> 


<?PHP 

//Session start 
@session_start(); 

//Path to root 
$root = realpath($_SERVER["DOCUMENT_ROOT"]); 

//Require Init 
$mode = array(); 
$mode[] = 'nohtml'; 
require_once $root . "/inc/php/init.php"; 

{ 

?> 

<?PHP 

} 

?> 

<? 
$qry = " 
SELECT timelive,bidprice,match_title,selection,winnings_with_startamount,odds,odds*10 AS gainedodds,username, 
CASE 
WHEN each_bid_recorded_Part2.result liKE '' AND each_bid_recorded_Part2.status LIKE 'E' THEN 'pending' 
WHEN each_bid_recorded_Part2.result liKE '' AND each_bid_recorded_Part2.status NOT LIKE 'E' THEN 'active' 
WHEN each_bid_recorded_Part2.result liKE each_bid_recorded_Part2.selection THEN 'WON' 
WHEN each_bid_recorded_Part2.result NOT liKE each_bid_recorded_Part2.selection THEN 'LOST' 
END AS result 
FROM each_bid_recorded_Part2 WHERE each_bid_recorded_Part2.username LIKE '" . $_SESSION['username'] . "' 

"; 

$qry .= " ORDER BY timelive DESC"; 


//for pagination 
$starting=0; 
$recpage = 4;//number of records per page 

$obj = new pagination_class($qry,$starting,$recpage);  
$result = $obj->result; 



function getStyleColorForStatus($status) { 
    if ($status == 'WON') { 
return '#99ff99'; 
    } 
    else if ($status == 'LOST') { 
return '#ff9999'; 
    } 
    else if ($status == 'pending') { 
return '#e5e5e5'; 
    } 
    else if ($status == 'active') { 
return '#ffffcc'; 
    } 
    return ''; 
} 



?> 


<div> 
    <div class="pageTop"><img src="images/icons/faqicon.png" width="37" height="37" align=absbottom>  Betting History</div> 
    <tr> 
    <td>&nbsp;</td> 
    </tr> 
</div> 
    <div> 
<p style="font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #535252; text-align: left;">Check your bets with you as a last bidder.</p> 
</div> 
<table width="600" border="0" cellspacing="0" cellpadding="0" style="font-size:11px; color: #535252;"> 
     <form name="form1" action="myaccount_bettinghistory.php" method="POST" style="background-color:#f9f9f9; -webkit-box-shadow: 0 1px 10px rgba(0,0,0,.1); -moz-box-shadow: 0 1px 10px rgba(0,0,0,.1); box-shadow: 0 1px 10px rgba(0,0,0,.1);"> 

     <table border="0" align="left" width="500px" padding-left="0px" style="background:#F9F9F9;"> 



     <tr><TD colspan="0"> 

     <div id="page_contents"> 

      <table width="755px" cellspacing="0" cellpadding="5" align="center" frame="box" rules="none" style="padding-bottom:2px; margin-bottom:0px; margin-top:3px; -webkit-box-shadow: 0 1px 10px rgba(0,0,0,.1); -moz-box-shadow: 0 1px 10px rgba(0,0,0,.1); box-shadow: 0 1px 10px rgba(0,0,0,.1); border: 1px solid #cccccc;"> 
      <tr style="height: 40px;"> 
<td width="30%" align="center" td class="winheader"><div class="glowtext">Event Start Time</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Bid Cost</div></td></td> 
<td width="35%" align="center" td class="winheader"><div class="glowtext">Market/Event</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Selection</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Winnings</div></td></td> 
<td width="5%" align="center" td class="winheader"><div class="glowtext">Odds</div></td></td> 
<td width="5%" align="center" td class="winheader"><div class="glowtext">Gained Odds</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Winning Bidder</div></td></td> 
<td width="5%" align="center" td class="winheader"><div class="glowtext">Final Result</div></td></td> 
      </tr> 
      <?if(mysql_num_rows($result)!=0){ 
       $counter = $starting + 1; 
       while($data = mysql_fetch_array($result)) {?> 



    <tr class="initial" onMouseOver="this.className='highlight'" onMouseOut="this.className='normal'"> 



        <td align="center"><font color="#333"><? echo $data['timelive']; ?></TD> 
        <td align="center">&euro; <? echo $data['bidprice']; ?></TD>   
        <td align="left"><font color="#0070c0"><? echo $data['match_title']; ?></TD>     
        <td align="left"><? echo $data['selection']; ?></TD> 
        <td align="center"><font color="green">&euro; <? echo $data['winnings_with_startamount']; ?></TD> 
        <td align="center"><? echo $data['odds']; ?></TD> 
        <td align="center"><? echo $data['gainedodds']; ?></TD> 
        <td align="center"><? echo $data['username']; ?></TD> 
        <td align="center" style="background-color:<?php echo getStyleColorForStatus($data['result']); ?>"><? echo $data['result']; ?></td> 
        </tr> 


       <? 
        $counter ++; 
       } ?> 


       <tr><TD align="center" colspan="10" style="padding-bottom:1px; padding-top:10px; color:#333;"><? echo $obj->anchors; ?></TD></tr> 
       <tr><TD align="center" colspan="10" style="padding-bottom:10px; padding-top:5px; color:#333;"><? echo $obj->total; ?></TD></tr> 
      <?}else{?> 
       <tr><TD align="center" colspan="10" style="padding-bottom:10px padding-top:10px; color:red;">No Data Found</TD></tr> 
      <?}?> 
      </TD></tr> 
      </table> 
     </div> 
     </tr> 
     </TD> 
    </form> 
</table> 

<STYLE> 

*{ margin-bottom:0; } 



#pagination-flickr li{ 
margin:0px; 
padding:0px; 
float:left; 
font-size:10px; 
} 
#pagination-flickr a{ 
float:left; 
padding:5px 7px; 
margin-right:5px; 
border:solid 1px #4d7dc5; 
text-decoration:none; 
background:#FFFFFF; 
color:#4d7dc5; 
font-size:10px; 
} 
#pagination-flickr .previous-off, 
#pagination-flickr .next-off { 
border:solid 1px #DDDDDD; 
cursor:default; 
background:#FFFFFF; 
border:solid 1px #BBBBBB; 
color:#BBBBBB; 
padding:4px 6px; 
margin-right:5px; 
font-size:10px; 
} 
#pagination-flickr .next a, 
#pagination-flickr .previous a { 
background:#FFFFFF; 
border:solid 1px #BBBBBB; 
color:#BBBBBB; 
font-size:10px; 
} 
#pagination-flickr .active{ 
cursor:default; 
background:#4d7dc5; 
color:#FFFFFF; 
padding:4px 6px; 
margin-right:5px; 
border:solid 1px #4d7dc5; 
font-size:10px; 
} 
#pagination-flickr a:link, 
#pagination-flickr a:visited { 
padding:4px 6px; 
margin-right:5px; 
border:solid 1px #4d7dc5; 
background:#FFFFFF; 
color:#4d7dc5; 
font-size:10px; 
} 
#pagination-flickr a:hover{ 
padding:4px 6px; 
margin-right:5px; 
border:solid 1px #4d7dc5; 
background:#ffc04a; 
color:#000; 
font-size:10px; 
} 


body,table 
{ 

font-family:Verdana, Arial, Helvetica, sans-serif; 
font-size:11px; 
padding-bottom:5px; 
empty-cells: show; 


} 

.glowtext 
{ 
text-shadow: 0 0 20px white; 
color:#333; 
font-weight:bold; 
} 


</STYLE> 

myaccount_bettinghistory_sub.php :

<?php 
error_reporting(E_ALL^E_NOTICE); 
include('pagination_class.php'); 

?> 

<script language="JavaScript" src="pagination.js"></script> 
<link rel="stylesheet" type="text/css" href="style.css" /> 

<?PHP 

//Session start 
@session_start(); 

//Path to root 
$root = realpath($_SERVER["DOCUMENT_ROOT"]); 

//Require Init 
$mode = array(); 
$mode[] = 'nohtml'; 
require_once $root . "/inc/php/init.php"; 


{ 
?> 

<?PHP 
} 

?> 


<? 
$qry = " 
SELECT timelive,bidprice,match_title,selection,winnings_with_startamount,odds,odds*10 AS gainedodds,username, 
CASE 
WHEN each_bid_recorded_Part2.result liKE '' AND each_bid_recorded_Part2.status LIKE 'E' THEN 'pending' 
WHEN each_bid_recorded_Part2.result liKE '' AND each_bid_recorded_Part2.status NOT LIKE 'E' THEN 'active' 
WHEN each_bid_recorded_Part2.result liKE each_bid_recorded_Part2.selection THEN 'WON' 
WHEN each_bid_recorded_Part2.result NOT liKE each_bid_recorded_Part2.selection THEN 'LOST' 
END AS result 
FROM each_bid_recorded_Part2 WHERE each_bid_recorded_Part2.username LIKE '" . $_SESSION['username'] . "' 

"; 

$qry .= " ORDER BY timelive DESC"; 


//for pagination 
if(isset($_GET['starting'])&& !isset($_REQUEST['submit'])){ 
$starting=$_GET['starting']; 
}else{ 
$starting=0; 
} 
$recpage = 4;//number of records per page 

$obj = new pagination_class($qry,$starting,$recpage);   
$result = $obj->result; 



function getStyleColorForStatus($status) { 
    if ($status == 'WON') { 
return '#99ff99'; 
    } 
    else if ($status == 'LOST') { 
return '#ff9999'; 
    } 
    else if ($status == 'pending') { 
return '#e5e5e5'; 
    } 
return ''; 
} 



?> 


<div> 
    <div class="pageTop"><img src="images/icons/faqicon.png" width="37" height="37" align=absbottom>  Betting History</div> 
    <tr> 
    <td>&nbsp;</td> 
    </tr> 
</div> 
    <div> 
<p style="font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #535252; text-align: left;">Check your bets with you as a last bidder.</p> 
    </div> 
<table width="600" border="0" cellspacing="0" cellpadding="0" style="font-size:11px; color: #535252;"> 
    </div>   
</div>   
     <table border="0" align="left" width="500px" padding-left="0px" style="background:#F9F9F9;"> 



     <tr><TD colspan="0"> 

     <div id="page_contents"> 

      <table width="98%" cellspacing="0" cellpadding="5" align="center" frame="box" rules="none" style="padding-bottom:2px; margin-bottom:0px; margin-top:3px; -webkit-box-shadow: 0 1px 10px rgba(0,0,0,.1); -moz-box-shadow: 0 1px 10px rgba(0,0,0,.1); box-shadow: 0 1px 10px rgba(0,0,0,.1); border: 1px solid #cccccc;"> 
      <tr style="height: 40px;"> 
<td width="30%" align="center" td class="winheader"><div class="glowtext">Event Start Time</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Bid Cost</div></td></td> 
<td width="35%" align="center" td class="winheader"><div class="glowtext">Market/Event</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Selection</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Winnings</div></td></td> 
<td width="5%" align="center" td class="winheader"><div class="glowtext">Odds</div></td></td> 
<td width="5%" align="center" td class="winheader"><div class="glowtext">Gained Odds</div></td></td> 
<td width="10%" align="center" td class="winheader"><div class="glowtext">Winning Bidder</div></td></td> 
<td width="5%" align="center" td class="winheader"><div class="glowtext">Final Result</div></td></td> 
      </tr> 
      <?if(mysql_num_rows($result)!=0){ 
       $counter = $starting + 1; 
       while($data = mysql_fetch_array($result)) {?> 



    <tr class="initial" onMouseOver="this.className='highlight'" onMouseOut="this.className='normal'"> 


        <td align="center"><font color="#333"><? echo $data['timelive']; ?></TD> 
        <td align="center">&euro; <? echo $data['bidprice']; ?></TD>   
        <td align="left"><font color="#0070c0"><? echo $data['match_title']; ?></TD>     
        <td align="left"><? echo $data['selection']; ?></TD> 
        <td align="center"><font color="green">&euro; <? echo $data['winnings_with_startamount']; ?></TD> 
        <td align="center"><? echo $data['odds']; ?></TD> 
        <td align="center"><? echo $data['gainedodds']; ?></TD> 
        <td align="center"><? echo $data['username']; ?></TD> 
        <td align="center" style="background-color:<?php echo getStyleColorForStatus($data['result']); ?>"><? echo $data['result']; ?></td> 
        </tr> 


       <? 
        $counter ++; 
       } ?> 


       <tr><TD align="center" colspan="10" style="padding-bottom:1px; padding-top:10px; color:#333;"><? echo $obj->anchors; ?></TD></tr> 
       <tr><TD align="center" colspan="10" style="padding-bottom:10px; padding-top:5px; color:#333;"><? echo $obj->total; ?></TD></tr> 
      <?}else{?> 
       <tr><TD align="center" colspan="10" style="padding-bottom:10px padding-top:10px; color:red;">No Data Found</TD></tr> 
      <?}?> 
      </TD></tr> 
      </table> 
     </div> 
     </tr> 
     </TD> 

    </table> 

pagination.js :

var xmlHttp 

function pagination(page) 
{ 
xmlHttp=GetXmlHttpObject(); 
if (xmlHttp==null) 
    { 
    alert ("Your browser does not support AJAX!"); 
    return; 
    } 
var url="myaccount_bettinghistory_sub.php"; 
url = url+"?starting="+page; 
url = url+"&search_text="+document.form1.search_text.value; 
url=url+"&sid="+Math.random(); 
xmlHttp.onreadystatechange=stateChanged; 
xmlHttp.open("GET",url,true); 
xmlHttp.send(null); 
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4) 
{ 
document.getElementById("page_contents").innerHTML=xmlHttp.responseText; 
} 
} 

function GetXmlHttpObject() 
{ 
var xmlHttp=null; 
try 
    { 
    // Firefox, Opera 8.0+, Safari 
    xmlHttp=new XMLHttpRequest(); 
    } 
catch (e) 
    { 
    // Internet Explorer 
    try 
    { 
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
    } 
    catch (e) 
    { 
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    } 
return xmlHttp; 
} 

pagination_class.php :

0
+0

웹 서버 오류 로그 및/또는 JavaScript 콘솔에 어떤 것이 있습니까? – Trott

+0

어, 미안해, 어리석은 소리가 난다. 그러나 실제로 그렇게 많이 경험하지는 않았으므로 그 순간을 확인하는 방법을 모른다. ( – Ivy

+2

당신이하려고하는 모든 것을 멈추고 그 두 가지를 알아 내야한다 : (1) 웹 서버 로그가있는 위치와 방법 및 (2) 자바 스크립트 콘솔을 보는 방법 – Trott

답변

0

는이

&& !isset($_REQUEST['submit']) 

사용하지 않을 제거!

+0

삭제되었지만 도움이되지 않아도 여전히 페이지가 작동하지 않음 – Ivy

+0

Firefox가 firebug를 사용하여 자바 스크립트를 보내고 있습니다. 어떤 유형의 응답을 얻었습니까? 직접 스크립트를 실행하려고 시도합니다. – ddjikic

+0

Google 크롬 '요소 검사'에서이 오류가 발생했습니다. '잡히지 않은 유형 오류 : 속성'값 '이 정의되지 않음 페이지 매김 (익명 함수)' – Ivy