|
|
|
การออกรายงาน Error ไม่แสดงหน้าถัดไป รบกวนช่วยแก้ไขหน่อยครับ |
|
|
|
|
|
|
|
ปกติที่ Form ผมใช้โค้ด
Code
<form name="frSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>">
สามารถที่จะแสดงรายงานหน้าถัดไปได้เมื่อเลือกเลขหน้าที่ต้องการ (โดยเลือกภาคก่อน แล้วเลือกจังหวัดจะไม่กรองข้อมูลถ้าใช้คำสั่ง form) แต่พอผมเปลี่ยนโค้ดเป็น
Code
<form name="fmain" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>" enctype="multipart/form-data" onSubmit="return chfdep()" >
เพื่อให้เลือกข้อมูลที่จะกรองก่อน (โดยเลือกภาคก่อน แล้วเลือกจังหวัด ข้อมูลจะกรอง) เมื่อเลือกเลขหน้ากลับไม่ไปหน้าถัดไป ผมจะต้องแก้ไขอย่างไรครับ
โค้ดทั้งหมด
Code (PHP)
<?
ob_start();
include("config.inc.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>:: ระบบฐานข้อมูลทะเบียนเพิกถอนสิทธิเลือกตั้ง :: [สำนักงานคณะกรรมการการเลือกตั้ง]</title>
<style type="text/css">
<!--
.style5 {font-family: sans-serif, Tahoma; font-size: 12px; }
.style6 {font-size: 12px}
.style7 {
font-family: sans-serif, Tahoma;
font-weight: bold;
font-size: 12px;
}
-->
</style>
</script>
<script language="JavaScript" src="calendar.js"></script>
<link href="calendar-mos.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style14 {font-family: sans-serif, Tahoma; }
.style15 {color: #000000}
.style16 {color: #990000}
.style17 {color: #3300CC}
.style18 {color: #0000FF}
.style12 {font-family: sans-serif, Tahoma; font-size: 10px; }
.style19 {font-family: sans-serif, Tahoma; font-size: 12px; color: #FF0000; }
.style11 {font-size: 10px}
-->
</style>
</head>
<body>
<table width="1100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1100"><img src="images/Banner.gif" width="1100" height="223" /></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">
<?php include("menu1.php"); ?> </td>
</tr>
<tr>
<td bgcolor="#eaf8ff"><div align="center" class="style7">
<p> </p>
</div></td>
</tr>
<tr>
<script language="javascript">
function page(no){
document.frSearch.page.value=no;
document.frSearch.submit();
}
function PrintWindow() {
window.print();
}
</script>
<?
$page=$_GET["page"];
if(count($_GET)==0 || !isset($_GET["page"]) ){ $page=1; }
$Per_Page=20; //ขนาดต่อหน้า
if ($page>0){
$Page_start=(($page-1)*$Per_Page);
}else{
$Page_start=($page)*$Per_Page-1;
}
$page_stop=$Page_start+$Per_Page;
if(count($arr_rec)==0)$page_stop=0;
if($page_stop>count($arr_rec))$page_stop=count($arr_rec);
?>
<td height="271" bgcolor="#eaf8ff">
<form name="fmain" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>" enctype="multipart/form-data" onSubmit="return chfdep()" >
<table height="318" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td height="19" colspan="2" bgcolor="#95c6e3" class="style6"><div align="center" class="style7 style17">ค้นหาข้อมูลผู้ถูกเพิกถอนสิทธิเลือกตั้ง</div></td>
</tr>
<tr>
<td width="136" height="25" bgcolor="#eaf8ff" class="style6"><div align="right" class="style5 style14">
<div align="right">เลขประจำตัวประชาชน :</div>
</div></td>
<td width="430" bgcolor="#eaf8ff" class="style6"><span class="style5 style14">
<label>
<input name="txtKeyword[]" type="text" id="txtKeyword[]" value="<?=$_GET["txtKeyword"][0];?>" maxlength="13" />
</label>
</span> </td>
</tr>
<tr>
<td height="25" bgcolor="#eaf8ff" class="style6"><div align="right" class="style5 style14">
<div align="right">ชื่อ :</div>
</div></td>
<td bgcolor="#eaf8ff" class="style6"><input name="txtKeyword[]" type="text" id="txtKeyword[]" value="<?=$_GET["txtKeyword"][1];?>" /> </td>
</tr>
<tr>
<td height="25" bgcolor="#eaf8ff" class="style6"><div align="right" class="style5 style14">
<div align="right"> สกุล : </div>
</div></td>
<td bgcolor="#eaf8ff" class="style6"><input name="txtKeyword[]2" type="text" id="txtKeyword[]2" value="<?=$_GET["txtKeyword"][2];?>" /></td>
</tr>
<tr>
<td height="25" bgcolor="#eaf8ff" class="style6"><div align="right" class="style14 style18">ภูมิภาค : </div></td>
<td bgcolor="#eaf8ff" class="style6"><span class="style12">
<label>
<select name="slact_id" id="slact_id" onchange="return(clicklist(this));">
<option value="">- ภูมิภาค -</option>
<?
include "config.inc.php";
$sql="select * from TypeProvince order by TypeProvince_Id ASC";
$dbquery=mysql_db_query($dbname,$sql);$str_combo_arr .="a[0] = new Array(\"\", \" - การกระทำผิด - \");\n";
$i=1;
while($result=mysql_fetch_array($dbquery)){
$str_combo_arr .="a[$i] = new Array(";
$str_combo_arr .="\"\",\" - จังหวัด - \"";
$sql="select * from Province where TypeProvince_Id='$result[TypeProvince_Id]' order by Province_Id ";
$dbquery2=mysql_db_query($dbname,$sql);
while($result2=mysql_fetch_array($dbquery2)){
$str_combo_arr .=",";
$str_combo_arr .="\"$result2[Province_Id]\",\"$result2[Province_Name]\"";
if($data['Province_Id'] !="" ){
$select_off="";
if("$data[Province_Id]" == "$result2[Province_Id]") //เพื่อให้ แสดง $cat_id ที่ส่งค่ามาให้
$select_off=" selected=\"selected\"";
if($result2[TypeProvince_Id]==$data[TypeProvince_Id])
$str_combo .="<option value=\"$result2[Province_Id]\"$select_off $data[Province_Id]>$result2[Province_Name]</option>\n";
}
}
$str_combo_arr .=");\n";
if($data['TypeProvince_Id'] == $result[TypeProvince_Id]){ //เพื่อให้ แสดง $cat_id ที่ส่งค่ามาให้
?>
<option value="<?=$result[TypeProvince_Id];?>" selected="selected">
<?=$result[TypeProvince_Name];?>
</option>
<?
}else{?>
<option value="<?=$result[TypeProvince_Id];?>">
<?=$result[TypeProvince_Name];?>
</option>
<?
}
$i++;
}
?>
</select>
</label>
</span>
<label>
<input name="select_portionid_tmp" type="hidden" id="select_portionid_tmp" />
</label></td>
</tr>
<tr>
<td height="25" bgcolor="#eaf8ff" class="style6"><div align="right" class="style5 style14">
<div align="right">จังหวัดที่กระทำความผิด : </div>
</div></td>
<td bgcolor="#eaf8ff" class="style6"><span class="style12">
<? //<select name="sloffence_id" id="sloffence_id">?>
<select name="sloffence_id" id="sloffence_id" onchange="return(clicklist2(this));">
<option value="" selected="selected">- จังหวัด -</option>
<?=$str_combo;?>
</select>
<input name="select_provinceid_tmp" type="Hidden" id="select_provinceid_tmp" />
</span></td>
</tr>
<tr>
<td bgcolor="#eaf8ff" class="style5"><div align="right">สถานะ :</div></td>
<td height="16" colspan="3" bgcolor="#eaf8ff" class="style5"><span class="style6">
<select name="txtKeyword[5]" id="txtKeyword[5]">
<option value="">กรุณาเลือกสถานะ</option>
";
<?
$sql = "SELECT * FROM statusdisfranchisedvoter Order by SDV_Name ";
$res1 = mysql_query ($sql);
while ($row = mysql_fetch_assoc($res1)) {
$select="";
if($_GET["txtKeyword"][5]==$row[SDV_Id]) $select=" selected=\"selected\"";
echo "<option value=\"$row[SDV_Id]\"$select>$row[SDV_Name]</option>";
}
?>
</select>
</span></td>
</tr>
<tr>
<td bgcolor="#eaf8ff" class="style5"><div align="right">ประเภทการเลือกตั้ง : </div></td>
<td height="16" colspan="3" bgcolor="#eaf8ff" class="style5"><span class="style6">
<select name="txtKeyword[6]" id="txtKeyword[6]">
<option value="">กรุณาเลือกประเภทการเลือกตั้ง</option>
";
<?
$sql = "SELECT * FROM Election order by Election_Id ASC";
$res1 = mysql_query ($sql);
while ($row = mysql_fetch_assoc($res1)) {
$select="";
if($_GET["txtKeyword"][6]==$row[Election_Id]) $select=" selected=\"selected\"";
echo "<option value=\"$row[Election_Id]\"$select>$row[Election_Name]</option>";
}
?>
</select>
</span></td>
</tr>
<tr>
<td bgcolor="#eaf8ff" class="style5"><div align="right">พระราชบัญญัติ : </div></td>
<td height="16" colspan="3" bgcolor="#eaf8ff" class="style5"><span class="style6">
<select name="txtKeyword[7]" id="txtKeyword[7]">
<option value="">กรุณาเลือกพระราชบัญญัติ</option>
";
<?
$sql = "SELECT * FROM Act order by Act_Id ASC";
$res1 = mysql_query ($sql);
while ($row = mysql_fetch_assoc($res1)) {
$select="";
if($_GET["txtKeyword"][7]==$row[Act_Id]) $select=" selected=\"selected\"";
echo "<option value=\"$row[Act_Id]\"$select>$row[Act_Name]</option>";
}
?>
</select>
</span></td>
</tr>
<tr>
<td bgcolor="#eaf8ff" class="style5"><div align="left" class="style14">
<div align="right">วันที่บันทึก : </div>
</div></td>
<td height="16" colspan="3" bgcolor="#eaf8ff" class="style5"><span class="style5 style14">
<input name="txtKeyword[8]" type="text" id="txtKeyword[8]" value="<?=$_GET["txtKeyword"][8];?>" readonly="true" />
<input type="button" name="Submit4" value="..." onclick="showCalendar('txtKeyword[8]','DD-MM-YYYY')" />
ถึง
<input name="txtKeyword[9]" type="text" id="txtKeyword[9]" value="<?=$_GET["txtKeyword"][9];?>" readonly="true" />
<input type="button" name="Submit43" value="..." onclick="showCalendar('txtKeyword[9]','DD-MM-YYYY')" />
<input name="page" type="hidden" id="page" value="<?=$page?>" />
</span></td>
</tr>
<tr>
<td height="27" bgcolor="#eaf8ff" class="style6"><div align="right" class="style5 style14"> วันที่ถูกเพิกถอนสิทธิ :</div></td>
<td bgcolor="#eaf8ff" class="style6 style14">
<input name="txtKeyword[10]" type="text" id="txtKeyword[10]"value="<?=$_GET["txtKeyword"][10];?>" readonly="true" />
<input type="button" name="Submit42" value="..." onclick="showCalendar('txtKeyword[10]','DD-MM-YYYY')" /> </span>ถึง
<input name="txtKeyword[11]" type="text" id="txtKeyword[11]" value="<?=$_GET["txtKeyword"][11];?>" readonly="true" />
<input type="button" name="Submit222" value="..." onclick="showCalendar('txtKeyword[11]','DD-MM-YYYY')" /> </td>
</tr>
<tr>
<td height="26" colspan="2" bgcolor="#CCCCCC"><div align="center">
<div align="center">
<input type="submit" name="Submit" value=" ค้นหา " />
</label>
<a href="searchAllNewProT.php"><img src="images/cancel.jpg" width="60" height="26" border="0" align="top" /></a> </div>
<div align="center"></div></td>
</tr>
</table>
<br />
</form> </td>
</tr>
<tr>
<td bgcolor="#eaf8ff"><div align="center">
<?
//echo $select_portionid_tmp=$_GET["select_portionid_tmp"] ;
//echo $select_provinceid_tmp=$_GET["select_provinceid_tmp"];
$_GET["txtKeyword"][3] = $select_portionid_tmp;
$_GET["txtKeyword"][4] = $select_provinceid_tmp;
$_SESSION['allid'] =$_GET["txtKeyword"][0] ;
$_SESSION['allfname'] =$_GET["txtKeyword"][1] ;
$_SESSION['alllname'] =$_GET["txtKeyword"][2] ;
$_SESSION['alltypeprovince'] =$_GET["txtKeyword"][3] ;
$_SESSION['allprovince'] =$_GET["txtKeyword"][4] ;
echo $_SESSION['allstatus'] =$_GET["txtKeyword"][5] ;
$_SESSION['allelection'] =$_GET["txtKeyword"][6] ;
$_SESSION['allact'] =$_GET["txtKeyword"][7] ;
$_SESSION['allinput'] =$_GET["txtKeyword"][8] ;
$_SESSION['allinpute'] =$_GET["txtKeyword"][9] ;
$_SESSION['alldates'] =$_GET["txtKeyword"][10] ;
$_SESSION['alldatee'] =$_GET["txtKeyword"][11] ;
$condition="";
// $field=array(0=>"ID",1=>"DFV_FName",2=>"DFV_LName",3=>"Province_Id", 4=>"DFV_DateInput",5=>"DFV_DateS",6=>"DFV_DateE");
$field=array(0=>"ID",1=>"DFV_FName",2=>"DFV_LName", 3=>"province.TypeProvince_Id",4=>"disfranchisedvoter.Province_Id", 5=>"disfranchisedvoter.SDV_Id",6=>"disfranchisedvoter.Election_Id",7=>"disfranchisedvoter.Act_Id", 8=>"DFV_DateInput",9=>"DFV_DateInput",10=>"DFV_DateS");
for($i=0;$i<=10;$i++){
if($_GET["txtKeyword"][$i]!=""){
$txtdate=explode("-",$_GET["txtKeyword"][$i]);
$date=($txtdate[2]-543). "-". $txtdate[1]."-".$txtdate[0];
if($condition!="" && $i!=9) $condition.=" and ";
if($i<3 ){
$condition.= $field[$i] ." LIKE '%".$_GET["txtKeyword"][$i] ."%'";
// $condition.= $field[$i] ." = '".$_GET["txtKeyword"][$i] ."'";
}elseif($i==3){
$condition.= $field[$i] ." = '".$_GET["txtKeyword"][$i] ."'";
}elseif($i==4){
$condition.= $field[$i] ." = '".$_GET["txtKeyword"][$i] ."'";
// noi************** New
}elseif($i==5){
$condition.= $field[$i] ." = '".$_GET["txtKeyword"][$i] ."'";
}elseif($i==6){
$condition.= $field[$i] ." = '".$_GET["txtKeyword"][$i] ."'";
}elseif($i==7){
$condition.= $field[$i] ." = '".$_GET["txtKeyword"][$i] ."'";
//noi**********************
//}elseif($i==6||$i==5){
}elseif($i==8 || $i==9 ){
$txtdate2=explode("-",$_GET["txtKeyword"][9]);
$date2=($txtdate2[2]-543). "-". $txtdate2[1]."-".$txtdate2[0];
if($i==8 ){
if( $_GET["txtKeyword"][9]==""){
$condition.= $field[$i] ." = '".$date ."'";
}else{
$condition.= $field[$i] ." >= '".$date ."'";
}
}
// }elseif($i==6){
// if($_GET["txtKeyword"][6]!="")
if($i==9 && $_GET["txtKeyword"][8]!=""){
$condition.= " and ". $field[9] ." <= '".$date ."'";
}
}elseif($i==10){
// $condition.= $field[$i-1] ." >= '".$date ."'";
if($_GET["txtKeyword"][$i]!=""){
$txtdate2=explode("-",$_GET["txtKeyword"][$i]);
$date2=($txtdate2[2]-543). "-". $txtdate2[1]."-".$txtdate2[0];
if($_GET["txtKeyword"][11]==""){
$condition.=" ". $field[$i] ." = '".$date2 ."'";
}else{
$condition.=" ". $field[$i] ." >= '".$date2 ."'";
}
}
if($_GET["txtKeyword"][11]!=""){
$txtdate2=explode("-",$_GET["txtKeyword"][11]);
$date2=($txtdate2[2]-543). "-". $txtdate2[1]."-".$txtdate2[0];
$condition.=" and DFV_DateS <= '".$date2 ."'";
// if($condition!="" && $i==11 ) $condition.=" and "; // noi
}
}
}
}
//if($condition!="") $condition=" and " .$condition;
if($condition!= "")
{
$strSQL = "SELECT * FROM disfranchisedvoter,offence,act ,title,year,section,section2,province,statusdisfranchisedvoter,election WHERE ";
$strSQL.= " disfranchisedvoter.Title_Id = title.Title_Id and disfranchisedvoter.YearId = year.YearId";
$strSQL.= " and disfranchisedvoter.Act_Id = act.Act_Id and disfranchisedvoter.Offence_Id = offence.Offence_Id";
$strSQL.= " and disfranchisedvoter.Section_Id = section.Section_Id and disfranchisedvoter.SDV_Id = statusdisfranchisedvoter.SDV_Id"; //edit by chai
$strSQL.= " and disfranchisedvoter.Election_Id = election.Election_Id ";
$strSQL.= " and disfranchisedvoter.Section_Id2 = section2.Section_Id2 and disfranchisedvoter.Province_Id = province.Province_Id";
$strSQL.= " and ($condition) order by `SDV_Name` DESC, Province_Name ASC ";
// echo $strSQL;
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$totalRows=mysql_num_rows($objQuery);
$totalRowsT=mysql_num_rows($objQuery);
if($Page_start>$totalRows)$Page_start=0;
$objQuery = mysql_query($strSQL ." LIMIT $Page_start , $Per_Page ") or die ("Error Query [".$strSQL."]");
$sql = $strSQL ." LIMIT $Page_start , $Per_Page ";
$rec = mysql_query($sql)or die ("Error Query [".$sql."]");
while($obj1 = mysql_fetch_array($rec)){
$total[$obj1["SDV_Name"]]=$total[$obj1["SDV_Name"]]+1;
}
?><table width="1100" border="0">
<tr>
<td width="1107" align="right"><span class="style5 ">จำนวนข้อมูลทั้งหมด : <?echo $totalRows?> Recode</span> <a href="psearchtrimas.php"><img src="images/p.gif" width="16" height="17" border="0" /></a></td>
</tr>
<tr>
<th colspan="10" bgcolor="#95c6e3"><div align="center" class="style7"><span class="style17">ผลการค้นหาข้อมูลผู้ถูกเพิกถอนสิทธิการเลือกตั้ง</span></span><span class="style17"></span></span></div></th>
</tr>
</table>
<table width="1090" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CC33FF">
<tr>
<td width="92" bgcolor="#CCCCCC" class="style5"><div align="center">สถานะการเพิกถอนสิทธิ์</div></td>
<td width="40" bgcolor="#CCCCCC" class="style5"><div align="center">ลำดับที่</div></td>
<td width="124" bgcolor="#CCCCCC" class="style5"><div align="center">เลขประจำตัวประชาชน</div></td>
<td width="159" bgcolor="#CCCCCC" class="style5"><div align="center">ชื่อตัว - สกุล </div></td>
<td width="95" bgcolor="#CCCCCC" class="style5"><div align="center">จังหวัด<br />ที่กระทำความผิด</div></td>
<td width="92" bgcolor="#CCCCCC" class="style5"><div align="center">วันที่บันทึก</div></td>
<td width="77" bgcolor="#CCCCCC" class="style5"><div align="center">วันที่ถูกเพิก<br />ถอนสิทธิ</div></td>
<td width="79" bgcolor="#CCCCCC" class="style5"><div align="center">ระยะเวลาที่ถูกเพิกถอน (ปี)</div></td>
<td width="74" bgcolor="#CCCCCC" class="style5"><div align="center">วันที่พ้น<br /> การถูกเพิกถอนสิทธิ์</div></td>
<td width="90" bgcolor="#CCCCCC" class="style5"><div align="center">มาตราความผิด</div></td>
<td width="121" bgcolor="#CCCCCC" class="style5"><div align="center">พระราชบัญญัติ</div></td>
</tr>
<? $totalRows=0; $a=0;
$Page_start+1;
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<?
if($totalRows==0){
$totalRows=$total[$objResult["SDV_Name"]];
echo '<td bgcolor="#eaf8ff" class="style5" align="center" rowspan="'.$totalRows.'"valign="top"><div align="center" class="style5" >';
echo $objResult["SDV_Name"];
echo '</div></td>';
}
?>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<?=$k+1+($Page_start );?>
</div></td>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<?//=$objResult["ID"];?>
<?=substr($objResult["ID"],0,1);?>-<?=substr($objResult["ID"],1,4);?>-<?=substr($objResult["ID"],5,5);?>-<?=substr($objResult["ID"],10,2);?>-<?=substr($objResult["ID"],12,1);?>
</div></td>
<td bgcolor="#eaf8ff" class="style5"><a href="disfranchisedvoterdetailtwo.php?id=<?=$objResult["DFV_No"]; ?> <div align=" target="_blank"" class="style5"left>
<?=$objResult["Title_Name"];?><?=$objResult["DFV_FName"];?>
<?=$objResult["DFV_LName"];?>
<a href="disfranchisedvoterdetailtwo.php?id=<?=$objResult["DFV_No"]; ?> <div align=" target="_blank"" class="style5"left><a href="disfranchisedvoterdetailtwo.php?id=<?=$objResult["DFV_No"]; ?> <div align=" target="_blank"" class="style5"left>
<? //$tam = $objResult["tumbon_id"]; ?>
</a></a>
<input name="txtKeyword3" type="hidden" id="txtKeyword3">
<? $_GET["txtKeyword3"] = $tam; ?>
<? $sql="SELECT tumbon_name FROM Tumbon WHERE tumbon_id = '".$_GET["txtKeyword3"]."' ";
$res=mysql_query($sql);
$data=mysql_fetch_assoc($res);
echo $_SESSION['tumbon'] = $data['tumbon_name']; ?>
</a></td>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<?=$objResult["Province_Name"];?>
<?$DFV_DateInput=explode("-",$objResult['DFV_DateInput']);$objResult['DFV_DateInput']=$DFV_DateInput[2]. "-". $DFV_DateInput[1]."-".($DFV_DateInput[0]+543);?>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<?=$objResult["DFV_DateInput"];?>
<?$DFV_DateS=explode("-",$objResult['DFV_DateS']);$objResult['DFV_DateS']=$DFV_DateS[2]. "-". $DFV_DateS[1]."-".($DFV_DateS[0]+543);?>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<?=$objResult["DFV_DateS"];?>
</div></td>
<? $DFV_DateE=explode("-",$objResult['DFV_DateE']);$objResult['DFV_DateE']=$DFV_DateE[2]. "-". $DFV_DateE[1]."-".($DFV_DateE[0]+543);?>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<?=$objResult["YearName"];?>
</div></td>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<?=$objResult["DFV_DateE"];?>
</div></td>
<td bgcolor="#eaf8ff" class="style5"><div align="center" class="style5">
<a href="#" title="<?//=$objResult["Section_Detail"];?>"><?=$objResult["Section_No"];?></a><br/>
<a href="#" title="<?//=$objResult["Section_Detail2"];?>"><?=$objResult["Section_No2"];?></a>
</div></td>
<td bgcolor="#eaf8ff" class="style5"><div align="left" class="style5">
<?=$objResult["Act_Name"];?>
</div></td>
</tr>
<? $totalRows--; $a++; $totalRows0--;
$n++;$k++;
}
?>
</table> </td>
</tr>
<tr bgcolor="#eaf8ff">
<td> </td>
<tr bgcolor="#eaf8ff">
<td><div align="center"><span class="style5"><span class="style16">หน้าที่
>></span>
<? $p=floor($totalRowsT/$Per_Page) ;
if(count($_GET)==0 || !isset($_GET["page"]) ){ $p=1; }
if($totalRowsT%$Per_Page>0) $p++;
while($p>0){
if($ps!="")$ps=" | ".$ps;
if($page==$p){
$ps="<strong>$p</strong>".$ps;
}else{
$ps="<a href=\"#\" onclick=\"page('$p');\">$p</a>".$ps;
}
$p--;
} echo $ps;?>
</span></div></td>
<tr bgcolor="#eaf8ff">
<td><div align="center"><span class="style5">
<?
//mysql_close($objConnect);
//}
?>
</div></td>
</tr>
<?
include "config.inc.php";
// $sql = mysql_query("SELECT * FROM `disfranchisedvoter`");
if($condition!= "")
{
$sql = mysql_query("SELECT * FROM disfranchisedvoter,offence,act ,title,year,section,section2,province WHERE disfranchisedvoter.Title_Id = title.Title_Id and disfranchisedvoter.YearId = year.YearId and disfranchisedvoter.Act_Id = act.Act_Id and disfranchisedvoter.Offence_Id = offence.Offence_Id and disfranchisedvoter.Section_Id = section.Section_Id and disfranchisedvoter.Section_Id2 = section2.Section_Id2 and disfranchisedvoter.Province_Id = province.Province_Id and ($condition) and (SDV_Id = 1)order by Province_Name");
$records = mysql_num_rows($sql);
}
//echo $records;
?>
<td width="994" align="right" bgcolor="#eaf8ff"><div align="right"><span class="style5 style6 style15">อยู่ระหว่างเพิกถอนสิทธิฯ : <?echo $records?> Recode</span> </div></td>
</tr>
<tr>
<?
include "config.inc.php";
// $sql2 = mysql_query("SELECT * FROM `disfranchisedvoter`");
if($condition!= "")
{
$sql2 = mysql_query("SELECT * FROM disfranchisedvoter,offence,act ,title,year,section,section2,province WHERE disfranchisedvoter.Title_Id = title.Title_Id and disfranchisedvoter.YearId = year.YearId and disfranchisedvoter.Act_Id = act.Act_Id and disfranchisedvoter.Offence_Id = offence.Offence_Id and disfranchisedvoter.Section_Id = section.Section_Id and disfranchisedvoter.Section_Id2 = section2.Section_Id2 and disfranchisedvoter.Province_Id = province.Province_Id and ($condition) and (SDV_Id = 2)order by Province_Name");
$records2 = mysql_num_rows($sql2);
}
//echo $records2;
?>
<td width="994" align="right" bgcolor="#eaf8ff"><div align="right"><span class="style5 style6 style15">พ้นจากการเพิกถอนสิทธิฯ : <?echo $records2?> Recode</span> </div></td>
</tr>
</table>
<?
// mysql_close($objConnect);
}
?></td>
</tr>
<tr>
<td bgcolor="#eaf8ff"> </td>
</tr>
<tr>
<tr>
<td bgcolor="#eaf8ff"><div align="center" class="style5">| <a href="menu.php">กลับเมนูหลัก</a> | </div></td>
</tr>
<tr>
<td bgcolor="#eaf8ff"> </td>
</tr>
<tr>
<td bgcolor="#d5efff"><div align="center">
<?PHP include("foot.php"); ?>
</div></td>
</tr>
</table>
</body>
</html>
<script language="javascript">
<!--
var a = new Array();
<?=$str_combo_arr?>
function clearcombo(elem){
var i;
for (i = elem.options.length - 1; i >= 0; i--) elem.options[i] = null;
elem.selectedIndex = -1;
}
function populatesubcategoryID(elem, index){
for (var i = 0; i < a[index].length; i= i + 2){
elem.options[elem.options.length] = new Option(a[index][i + 1], a[index][i]);
}
}
function clicklist(elem){
clearcombo(document.fmain.sloffence_id)
populatesubcategoryID(document.fmain.sloffence_id, parseInt(elem[elem.selectedIndex].value));
document.fmain.select_portionid_tmp.value=elem[elem.selectedIndex].value;
return true;
}
function clicklist2(elem){
document.fmain.select_provinceid_tmp.value=elem[elem.selectedIndex].value;
return true;
}
-->
</script>
<script type="text/javascript">
//AJAX
function Inint_AJAX()
{
try
{
return new ActiveXObject( "Msxml2.XMLHTTP" );
}
catch ( e )
{
};
try
{
return new ActiveXObject( "Microsoft.XMLHTTP" );
}
catch ( e )
{
};
try
{
return new XMLHttpRequest();
}
catch ( e )
{
};
alert( "XMLHttpRequest not supported" );
return null;
};
function dochange( obj )
{
var req = Inint_AJAX();
var province = document.getElementById( 'province' ).value;
var tumbon = document.getElementById( 'tumbon' ).value;
if ( obj && obj.name == 'province' ) //
{
var amphur = "";
}
else //
{
var amphur = document.getElementById( 'amphur' ).value;
};
var data = "province=" + province + "&hur=" + amphur + "&tumbon=" + tumbon;
req.onreadystatechange = function()
{
if ( req.readyState == 4 )
{
if ( req.status == 200 )
{
var datas = eval( '(' + req.responseText + ')' ); // JSON
document.getElementById( 'provinceDiv' ).innerHTML = datas[0].province;
document.getElementById( 'amphurDiv' ).innerHTML = datas[0].amphur;
document.getElementById( 'tumbonDiv' ).innerHTML = datas[0].tumbon;
};
};
};
req.open( "post" , "province_ajax.php" , true ); //edit voi
req.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" );
req.send( data );
};
window.onload = function()
{
dochange( '' );
};
function chkidcard(){
var xmlhttp = Inint_AJAX();
var txtid = document.getElementById('txtid').value;
if(txtid =="") return false;
var url = "checkstatus.php?id="+txtid;
document.getElementById("txtStatus").value ="";
xmlhttp.open("GET", url, false);
xmlhttp.send(null);
var txt=xmlhttp.responseText.replace(/^\s+|\s+$/g,"");
if(txt!=""){
var col_array=txt.split(",");
document.getElementById("txtStatus").value = col_array[1];
alert(col_array[0]);
}else document.getElementById("txtStatus").value ="ไม่เคยถูกเพิกถอนสิทธิ";
document.getElementById('chkuser').value=1;
}
</script>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2012-03-11 21:15:50 |
By :
ninja436 |
View :
1162 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code เยอะจะให้ดูตรงไหนครับ ถ้าหน้าถัดไปมันไม่แสดงผลก็น่าจะเป็ฯตรงอ่านค่าครับ ลอง echo $sql; ดูก็ได้ครับ จะได้รู้ว่ามันต่างกับหน้าแรกตรงไหน
|
|
|
|
|
Date :
2012-03-12 06:13:15 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|