|
 |
|
Not found user_id= แต่ไม่ทราบว่าโค้ด error ตรงส่วนไหน |
|
 |
|
|
 |
 |
|
จากรูป พอคลิ้กเลือก รูปที่ 1 ก็จะไปยังรูปที่ 2 แต่ มันบอกว่าไม่เจอ user_id='0013'


loanpay.php
<? include "func.php" ?>
<? include "connect.php" ?>
<?
$strSQL2 = "SELECT * FROM rateloan a,req_loan r WHERE r.interest = a.loa_id" ;
$objQuery2 = mysql_query($strSQL2);
$n=mysql_num_rows($objQuery2);
//echo $nn;
while($row2=mysql_fetch_array($objQuery2)){
$loa_name = $row2["loa_name"];
$loa_year = $row2["loa_year"];
}?>
<div id="right_block"><br>
<font size="18" color="#993300"><b><center>รายชื่อสมาชิกชำระเงินกู้</center></b></font>
<div align="right"><b>อัตราดอกเบี้ยเงินกู้ปี <font color="#006600"><?=$loa_year?></font> :::</b><font color="#006600"><b> <?=$loa_name?></b></font> <b>ต่อปี</b></div>
<p>
<br>
<table width="100%" border="0" align="center">
<tr bgcolor="#99ffff" >
<th width="46" height="23" align="center"><strong></strong> ลำดับ</th>
<th width="90" height="23" align="center"> หมายเลขบัญชี</th>
<th width="150" align="center">ชื่อ -สกุล</th>
<th width="100" align="center">เงินต้นกู้ยืม </th>
<th width="100" align="center">จำนวนงวด </th>
<th width="100" align="center">ยอดเงินกู้คงเหลือ </th>
<th width="100" align="center">คำสั่ง </th>
</tr>
<?
$strSQL = "SELECT * FROM user u ,req_loan r,prefix p
WHERE u.prefix = p.prefix_id AND u.user_id = r.user_id AND u.status_loan1 = '2' " ;
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$n=mysql_num_rows($objQuery);
//echo $n;
if($n!= 0){
$a =1;
while($data = mysql_fetch_array($objQuery))
{
$fname = $data['prefix_name'].$data['fname']." ".$data['lname'];
$i++;
if($i%2==0)
{
$bg = "#ccffcc";
}
else
{
$bg = "#FFFFFF";
}
?>
<tr bgcolor="<?=$bg;?>">
<td><div align="center"><? echo $a++; ?></div></td>
<td><div align="center"><? echo $data['user_id'] ?></div></td>
<td><div align="center"><?=$fname;?></div></td>
<?
$loan_mount = $data['loan_mount'];
$strSQL2 = "SELECT * FROM rateloan ORDER BY loa_id DESC LIMIT 0,1" ;
$objQuery2 = mysql_query($strSQL2);
$n=mysql_num_rows($objQuery2);
//echo $nn;
while($row2=mysql_fetch_array($objQuery2)){
$loa_name = $row2["loa_name"];
$loan_mount = $data['loan_mount'];
$pay_remain = ($loa_name * $loan_mount) + $loan_mount ;
}?>
<td><div align="center"><?=number_format($loan_mount,2,'.',',')?></div></td>
<td><div align="center"><? echo $data['capital'] ?></div></td>
<td><div align="center"><?=number_format($pay_remain,2,'.',',')?></div></td>
<td><div align="center"><a href="viewloanpay.php?uID=<?=$data["user_id"];?> ">เลือก</a></div> </td>
</tr>
<?
}
}
mysql_close($objConnect);
?>
</table>
viewloanpay.php
<?
include "headlog.php" ;
include "connect.php" ;
include "func.php" ;
$strSQL = "SELECT * FROM user u,req_loan r,prefix p,pay a
WHERE u.prefix = p.prefix_id AND u.user_id = r.user_id AND u.user_id='".$_GET['uID']."'";
$uID=$_GET["uID"];
//echo $uID;
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if(!$objResult)
{
echo "Not found user_id=".$_GET["uID"];
}
else
{
?>
<title>..:::ระบบจัดการกลุ่มออมทรัพย์เพื่อการผลิต:::..</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="main_style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #0000FF}
.style2 {color: #FF0000}
-->
</style>
</head>
<body>
<div class="warp" >
<div class="body" >
<div id="left_block1">
<p style=" clear:both;margin:10px 0 0;">
<div class="manu_list" style="margin-top:1px;">
<td colspan="2"><img src="images/menu.gif" width="220" height="30" /></td>
<a href="authloanindex.php">หน้าแรก</a>
<a href="authloanprofile.php">ข้อมูลส่วนตัว</a>
<a href="changepassloan.php">เปลี่ยนรหัสผ่าน</a>
<a href="authloancontract">ข้อมูลสัญญาเงินกู้</a>
<a href="authloanpay.php">ชำระเงินกู้</a>
<a href="authloanremain">ข้อมูลการค้างชำระเงินกู้</a>
<a href="authloancal">คำนวณการผ่อนชำระเงินกู้</a>
<a href="authloannews">จัดการข้อมูลข่าวประชาสัมพันธ์</a>
<a href="logout.php">ออกจากระบบ</a>
</div>
</p>
</div>
</div>
<div id="right_block"><br>
<font size="18" color="#993300"><b><center> ชำระค่างวดเงินกู้ </center></b></font>
<br/>
<table width = "744" border="0" cellpadding="3" cellspacing="1" align="center">
<tr>
<th width="141" bgcolor="#CCCCCC"><div align="right">สมาชิกเลขที่ :</div></th>
<td width="158" bgcolor="#CCFFCC"><input type="text" value="<?=$objResult["user_id"];?>" size="3" readonly="readonly"></td>
<th width="231" bgcolor="#CCCCCC"><div align="right" class="style1">ชำระงวดที่ :</div></th>
<td width="185" bgcolor="#CCFFCC"><input type="text" class="style1" value="<?=$capital."/".$objResult["capital"];?>" size="3" readonly="readonly"></td>
</tr>
<tr>
<?
$strSQL2 = "SELECT * FROM rateloan a,req_loan r WHERE r.interest = a.loa_id" ;
$objQuery2 = mysql_query($strSQL2);
$n=mysql_num_rows($objQuery2);
//echo $nn;
while($row2=mysql_fetch_array($objQuery2)){
$loa_name = $row2["loa_name"];
$loan_mount = $objResult['loan_mount'];
$interest_pay = $loa_name*$loan_mount;//ดบ.ทั้งหมด
$total_pay = $loan_mount + $interest_pay;//รวมจ่าย
$capital = $objResult['capital']; //จำนวนงวด
$capital1 = $_POST['txtcapital'];
$period_pay = $total_pay / $capital;//ชำระงวดละ
$pay_remain = $total_pay - $pay_remain ;//ยอดเงินคงเหลือที่ต้องชำระเพิ่ม
$capital1=0;
$capital1 = $capital1+1;//จ่ายงวดที่เท่าไหร่
}
?>
<th bgcolor="#CCCCCC"><div align="right">เลขที่สัญญาเงินกู้ :</div></th>
<td bgcolor="#CCFFCC"><input type="text" value="<?=$objResult["loan_id"];?>" size="3" readonly="readonly"></td>
<th bgcolor="#CCCCCC"><div align="right">ยอดเงินคงเหลือทั้งหมดก่อนชำระ :</div></th>
<td bgcolor="#CCFFCC"><input type="text" value="<?=number_format($total_pay,2,'.',',')?>" readonly="readonly" size="6"> บาท</td>
<?
$pay_due_date = $objResult["pay_due_date"];
$pay_due_date=displaydate($pay_due_date);
?>
</tr>
<tr>
<th bgcolor="#CCCCCC"><div align="right">ชื่อผู้กู้ :</div></th>
<td bgcolor="#CCFFCC"><input type="text" value="<?=$objResult["prefix_name"].$objResult["fname"]." ".$objResult["lname"];?>" readonly="readonly"></td>
<th bgcolor="#CCCCCC"><div align="right">วันที่ครบกำหนดชำระเงิน :</div></th>
<td bgcolor="#CCFFCC"><input type="text" value="<?=$pay_due_date?>" size="13" readonly="readonly"></td>
</tr>
<tr>
<?
$capital = $objResult["capital"];
$loan_mount = $objResult["loan_mount"];
$capital = 1;
?>
<th bgcolor="#CCCCCC"><div align="right">จำนวนเงินที่กู้ :</div></th>
<td bgcolor="#CCFFCC"><input type="text" value="<?=number_format($loan_mount,2,'.',',')?>" size="3">
บาท</td>
<?
$pay_date = date('Y-m-d ');
$pay_date=displaydate($pay_date);
?>
<th bgcolor="#CCCCCC"><div align="right" class="style2">วันที่จ่ายจริง :</div></th>
<td bgcolor="#CCFFCC"><input name="pay_date" type="text" id="pay_date" value="<?=$pay_date?>" size="13"> </td>
</tr>
<tr>
<th> </th>
<td> </td>
<th bgcolor="#CCCCCC"><div align="right">จำนวนเงินที่ชำระ :</div></th>
<td bgcolor="#CCFFCC"><input type="text" name="pay_date" id="pay_date" size="7" value="<?=number_format($period_pay,2,'.',',')?>">
บาท
<td> </td>
</tr>
<tr>
<th> </th>
<td> </td>
<th bgcolor="#CCCCCC"><div align="right" class="style2">ค่าปรับ :</div></th>
<td bgcolor="#CCFFCC"><span class="style2">
<input type="text" name="pay_date" id="pay_date" size="7" value="<?=number_format($fine,2,'.',',')?>">
บาท
</span>
<td> </td>
</tr>
<tr>
<th> </th>
<td> </td>
<th bgcolor="#CCCCCC"><div align="right" class="style1">จำนวนเงินที่ต้องชำระทั้งสิ้น :</div></th>
<?
$fine=$fine+$period_pay;
?>
<td bgcolor="#CCFFCC"><span class="style1">
<input type="text" name="pay_date" id="pay_date" size="7" value="<?=number_format($fine,2,'.',',')?>">
บาท
</span>
<td> </td>
</tr>
<tr>
<th colspan="4"> </th>
</tr>
<tr>
<th colspan="4">
<div align="center">
<input type="button" value="ชำระเงิน" >
<input type="submit" value="พิมพ์เอกสารการชำระ">
</div></th>
</tr>
</table>
<?
}
mysql_close($objConnect);
?>
</div>
<div class="footer_page">
</div>
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2012-03-18 10:58:51 |
By :
lookpla26 |
View :
872 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$strSQL = "SELECT * FROM user u,req_loan r,prefix p,pay a
WHERE u.prefix = p.prefix_id AND u.user_id = r.user_id AND u.user_id='".$_GET['uID']."'";
$uID=$_GET["uID"];
//echo $uID;
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if(!$objResult)
{
echo "Not found user_id=".$_GET["uID"];
}
มันไม่มีค่าหรือ where ไม่ถูกต้องครับ
|
 |
 |
 |
 |
Date :
2012-03-18 12:06:50 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำได้เเล้ว ขอบคุณมากค่ะ
|
 |
 |
 |
 |
Date :
2012-03-18 15:30:02 |
By :
lookpla26 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|