|
|
|
ขอความกรุณาด้วยเถีดคะ ไม่รู้จะแก้ไขอย่างไงช่วยเข้ามาดู code ไห้ด้วยคะลองแก้แล้วไม่ได้คะ |
|
|
|
|
|
|
|
ที่จะไห้ดูนี้มีอยู่ 3 code นะคะ
1......inter.php
Code (PHP)
<?
ob_start();
session_start();
?>
<!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=utf-8" />
<title>Untitled Document
</title>
<style type="text/css">
.style1 {
font-family: "Saysettha OT";
font-size: 16px;
}
.style2 {
font-family: "Saysettha OT";
font-size: 12px;
}
</style>
</head>
<body>
<?
if(!empty($_POST['ddlSelect'])){
$_SESSION['conditionSelect'] = $_POST['ddlSelect'];
} else {
session_destroy();
}
?>
<form name="frmSearch" method="post" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="images/b1.png" >
<tr>
<th width="71%" height="10"><p><span class="style1">ເລືອກສະແດງຂໍ້ມູນປະເພດ
</span>
<select name="ddlSelect" id="ddlSelect" >
<option>- Select -</option>
<option value="Shortcode" <? if(@$_POST["ddlSelect"]=="Shorcode"){ echo"selected='selected'"; } ?>>shorcode</option>
<option value="CRBT" <? if(@$_POST["ddlSelect"]=="CRBT"){ echo"selected='selected'"; } ?>>CRBT</option>
</select>
<input type="submit" value="Submit" />
</p></th>
<th width="8%" align="center" class="style2"><a href="adddata.php"><img src="images/bullet_plus.gif" width="16" height="16" /> ເພີ່ມຂໍ້ມູນ</a></font></th>
<th width="9%" abbr="center" class="style2"><a href="searchCRBT.php"><img src="images/Search.png" width="16" height="16" />ຊອກຂໍ້ມູນ CRBT</a></font></th>
<th width="12%" abbr="center" class="style2"><a href="searchShortcode.php"><img src="images/Search.png" width="16" height="16" />ຊອກຂໍ້ມູນ Shortcode</a></font></th>
</tr>
</table>
</form>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
mysql_query("SET NAMES UTF8");
mysql_query("SET character_set_results=UTF8");
if($_SESSION['conditionSelect']==""){
$strSQL = "SELECT * FROM shortcode order by ShortcodeName DESC";
}
//if(!empty($_SESSION['conditionSelect'])){
if($_SESSION['conditionSelect']=="Shortcode"){
$strSQL = "SELECT * FROM shortcode order by ShortcodeName DESC";
} else if($_SESSION['conditionSelect']=="CRBT"){
$strSQL = "SELECT * FROM crbt order by CRBT_ID DESC";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
if($_SESSION['conditionSelect']=="Shortcode" or $_SESSION['conditionSelect']==""){?>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" height="50" class="style2">
<tr bgcolor="#999999"> <B>
<th width="15" ><div align="center">No</div></font></th>
<th width="55" ><div align="center">Shortcode</div></font></th>
<th width="200" ><div align="center">ຊື່ບໍລິສັດ</div></font></th>
<th width="55"><div align="center">ເລີ່ມຕົ້ນ</div></font></th>
<th width="55"><div align="center">ໝົດອາຍຸ</div></font></th>
<th width="55" ><div align="center">ສັນຍາເລກທີ</div></font></th>
<th width="55" ><div align="center">ລາຄາ/sms</div></font></th>
<th width="55" ><div align="center">ອາກອນ</div></font></th>
<th width="55" ><div align="center">ສ່ວນແບ່ງ ETL</div></font></th>
<th width="55" ><div align="center">ສ່ວນແບ່ງ Partner</div></font></th>
<th width="55" ><div align="center">ເບີຕິດຕໍ່</div></font></th>
<th width="50" ><div align="center">ໝາຍເຫດ</div></font></th>
<th width="20" ><div align="center">Delete</div></font></th>
<th width="20"><div align="center">Edit</div></font></th>
</B></tr>
<?
$x = 0;
while($objResult = mysql_fetch_array($objQuery))
{
$x =$x+1;
if($bg =="#D2D2FF")
{
$bg = "#FFFFCC";
}
else
{
$bg = "#D2D2FF";
}
?>
<tr bgcolor="<?=$bg;?>">
<td height="23"><div align="center"><? echo "$x";?></div></td>
<td><div align="center"><?=$objResult["ShortcodeName"];?></div></td>
<td><div align="center"><?=$objResult["Company"];?></div></td>
<td><div align="center"><?=$objResult["Effect_time"];?></div></td>
<td><div align="center"><?=$objResult["Expire_time"];?></div></td>
<td><div align="center"><?=$objResult["Reference"];?></div></td>
<td><div align="center"><?=$objResult["Price"];?></div></td>
<td><div align="center"><?=$objResult["Tax"];?></div></td>
<td><div align="center"><?=$objResult["Share_ETL"];?></div></td>
<td><div align="center"><?=$objResult["Share_partner"];?></div></td>
<td align="center"><?=$objResult["Tel"];?></td>
<td><div align="center"><?=$objResult["Note"];?></div></td>
<td align="center"><font size="1"><a href="JavaScript:if(confirm('Confirm Delete?')==true) {window.location='phpMySQLDeleteRecord.php?ShortID=<?=$objResult["ShortcodeName"]; ?>&ddlSelect=<?=$_SESSION['conditionSelect']; ?>';}"><img src="images/del.png" width="16" height="16" /></a></td>
<td align="center" ><font size="1"><a href="phpMySQLEditRecordForm.php?ShortID=<?=$objResult["ShortcodeName"];?>"><img src="images/edit.png" width="16" height="16" /></a></font></td>
</tr>
<?
}
?>
</table>
<?
} else if($_SESSION['conditionSelect']=="CRBT"){
?>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" height="50" class="style2">
<tr bgcolor="#999999" > <B>
<th width="15"><div align="center">No</div></font></th>
<th width="200" ><div align="center">ຊື່ບໍລິສັດ</div></font></th>
<th width="55" ><div align="center">ເລີ່ມຕົ້ນ</div></font></th>
<th width="55"><div align="center">ໝົດອາຍຸ</div></font></th>
<th width="55" ><div align="center">ສັນຍາເລກທີ</div></font></th>
<th width="55"><div align="center">ລາຄາ/sms</div></font></th>
<th width="55"><div align="center">ອາກອນ</div></font></th>
<th width="55" ><div align="center">ສ່ວນແບ່ງ ETL</div></font></th>
<th width="55" ><div align="center">ສ່ວນແບ່ງ Partner</div></font></th>
<th width="55"><div align="center">ເບີຕິດຕໍ່</div></font></th>
<th width="50"><div align="center">ໝາຍເຫດ</div></font></th>
<th width="20" bgcolor="#999999" bordercolor="#006666"><font size="2"> <div align="center">Delete</div></font></th>
<th width="20" bgcolor="#999999" bordercolor="#006666"><font size="2"> <div align="center">Edit</div></font></th>
</B></tr>
<?
$x = 0;
while($objResult = mysql_fetch_array($objQuery))
{
$x =$x+1;
if($bg =="#D2D2FF")
{
$bg = "#FFFFCC";
}
else
{
$bg = "#D2D2FF";
}
?>
<tr bgcolor="<?=$bg;?>">
<td height="23"><div align="center"><? echo "$x";?></div></td>
<td><div align="center"><?=$objResult["Company"];?></div></td>
<td><div align="center"><?=$objResult["Start"];?></div></td>
<td><div align="center"><?=$objResult["End"];?></div></td>
<td><div align="center"><?=$objResult["Refer"];?></div></td>
<td><div align="center"><?=$objResult["Price"];?></div></td>
<td><div align="center"><?=$objResult["Tax"];?></div></td>
<td><div align="center"><?=$objResult["ETL"];?></div></td>
<td><div align="center"><?=$objResult["partner"];?></div></td>
<td align="center"><?=$objResult["Tel"];?></td>
<td><div align="center"><?=$objResult["Note"];?></div></td>
<td align="center"><font size="1"><a href="JavaScript:if(confirm('Confirm Delete?')==true) {window.location='phpMySQLDeleteRecordCRBT.php?crbtID=<?=$objResult["Company"]; ?>&ddlSelect=<?=$_SESSION['conditionSelect']; ?>';}"><img src="images/del.png" width="16" height="16" /></a></td>
<td align="center" ><font size="1"><a href="phpMySQLEditRecordFormCRBT.php?crbtID=<?=$objResult["Company"];?>&ddlSelect=<?=$_SESSION['conditionSelect'];?>"><img src="images/edit.png" width="16" height="16" /></a></font>
</td>
</tr>
<?
}
?>
</table>
<?
} else {
echo "Please select table.";
}
mysql_close($objConnect);
?>
</body>
</html>
ถ้าเลือกเอา CRBT แล้ว กด submit แล้วก็จะโช ตรางของ CRBT ออกมา และถ้าอยากแก้ไขหลืลีบข้อมูลก็เลือกคีกที่ด้านขวามีอนะคะ
ปันหาก็มีอยู่ว่าเวลาที่กด ลืบข้อมูลมันก็ลืบไห้และจะอยู่หน้าเดีมก่อนลืบคะ แต่ถ้ากดลืบข้อมูลอีกคั้ง(แบบว่า2ครั้งช้อนกัน)มันก็จะ link ไปหาหน้า inter.php อีกคะ แล้วก็ต้องมาเลือกเอา CRBT อีกเพี่อจะดูว่าข้อมูลที่ลืบคั้รงที่2มันออกไปแล้วหลืยัง อยากไห้มันอยู่หน้าเดีมก็คือ CRBT นี้จนกว่าเราจะไช้งานหน้านี้พออล้วจี่งค่อยเลือกไปหน้าอี่นได้ไหมคะ
ถ้าเลือก edit ก็เหมือนกันคะ เวลาแก้ไขแล้วถ้ากด save คั้งแรกยังอยู่หน้าเดีมคะ แต่คั้งที่2 นี้ มันก็ Link ไปหา inter.php แล้วต้องมาเลือกที่ list menu ไห่มเอา CRBT อีกเพี่อจะดูข้อมูลว่า edit สำเลัดไหม แบบว่าอยากไห้มันทำงานอยู่ หน้า ที่เลือกคือ CRBT จนสำเลัดนะคะ...เวลากด Backก็เหมือนกัน....
พะยายามอ่านด้วยนะคะ
2.....phpMySQLDeleteRecordCRBT.php
Code (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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
$strSQL = "DELETE FROM crbt ";
$strSQL .="WHERE Company = '".$_GET["crbtID"]."' "; //เพาะกำนด ShortID=<?=$objResult["ShortcodeName"];
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "<script language='javascript'>alert('ลืบข้อมูลเรียบร้อยแล้ว'); window.location = 'inter.php'; </script>";
}
else
{
echo "Error Delete [".$strSQL."]";
}
mysql_close($objConnect);
?>
</body>
</html>
3.....phpMySQLEditRecordSaveCRBT.php
Code (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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
mysql_query("SET NAMES UTF8");
mysql_query("SET character_set_results=UTF8");
$sql = "select * from crbt where CRBT_ID = '".$_GET["crbtID"]."' " ;
$obgsql = mysql_query($sql);
$strSQL = "UPDATE crbt SET ";
$strSQL .="Company = '".$_POST["txtCompany"]."' ";
$strSQL .=",Start = '".$_POST["txtStart"]."' ";
$strSQL .=",End = '".$_POST["txtEnd"]."' ";
$strSQL .=",Refer = '".$_POST["txtRefer"]."' ";
$strSQL .=",Price = '".$_POST["txtPrice"]."' ";
$strSQL .=",Tax = '".$_POST["txtTax"]."' ";
$strSQL .=",ETL = '".$_POST["txtETL"]."' ";
$strSQL .=",partner = '".$_POST["txtpartner"]."' ";
$strSQL .=",Tel = '".$_POST["txtTel"]."' ";
$strSQL .=",Note = '".$_POST["txtNote"]."' ";
$strSQL .="WHERE Company = '".$_GET["crbtID"]."' " ;
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "<script language='javascript'>alert('Edit data successful'); window.location = 'inter.php'; </script>";
}
else
{
echo "<script language='javascript'>alert('can not edit'); window.location = 'inter.php'; </script>";
}
mysql_close($objConnect);
?>
</body>
</html>
4....phpMySQLEditRecordFormCRBT
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
082.
<html xmlns="http://www.w3.org/1999/xhtml">
083.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="phpMySQLEditRecordSaveCRBT.php?crbtID=<?=$_GET["crbtID"];?>" name="frmEdit" method="post">
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
mysql_query("SET NAMES UTF8");
mysql_query("SET character_set_results=UTF8");
$strSQL = "SELECT * FROM crbt WHERE Company = '".$_GET["crbtID"]."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if(!$objResult)
{
echo "Not found Shortcode ID=".$_GET["crbtID"];
}
else
{
?>
<!--ส่ง $_GET["ShortID"] ไปกับฟอร์มด้วย //เพาะว่าภ้าบ่อใส่-->
<input type="hidden" name="ShortID" value="<?=$_GET["crbtID"]?>">
<table border="1" cellpadding="0" cellspacing="2" width="50%" align="center">
<tr>
<td height="30" colspan="0" align="center" bgcolor="#B0B0FF"><font size="4" >ດັດແກ້ຂໍ້ມູນ CRBT</font></td>
</tr>
<table border="1" cellpadding="0" cellspacing="2" width="50%" align="center">
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ຊື່ບໍລິສັດ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtCompany" type="text" id="txtCompany" style="border-color:#CCF" value="<?=$objResult["Company"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ເລີ່ມຕົ້ນ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtStart" type="text" id="txtStart" style="border-color:#CCF" value="<?=$objResult["Start"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ສິ້ນສຸດ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtEnd" type="text" id="txtEnd" style="border-color:#CCF" value="<?=$objResult["End"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ສັນຍາເລກທີ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtRefer" type="text" id="txtRefer" style="border-color:#CCF" value="<?=$objResult["Refer"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ລາຄາ / ຄັ້ງ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtPrice" type="text" id="txtPrice" style="border-color:#CCF" value="<?=$objResult["Price"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ອາກອນ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtTax" type="text" id="txtTax" style="border-color:#CCF" value="<?=$objResult["Tax"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ສ່ວນແບ່ງ ETL : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtETL" type="text" id="txtETL" style="border-color:#CCF" value="<?=$objResult["ETL"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ສ່ວນແບ່ງ Partner : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtpartner" type="text" id="txtpartner" style="border-color:#CCF" value="<?=$objResult["partner"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ເບີຕິດຕໍ່ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtTel" type="text" id="txtTel" style="border-color:#CCF" value="<?=$objResult["Tel"];?>" size="50" />
</span></td>
</tr>
<tr>
<td class="tbl1" style="white-space: nowrap;"><div align="right">ໝາຍເຫດ : </div></td>
<td class="tbl1" style="white-space: nowrap;"><span class="tbl1" style="white-space: nowrap;">
<input name="txtNote" type="text" id="txtNote" style="border-color:#CCF" value="<?=$objResult["Note"];?>" size="50" />
</span></td>
</tr>
</table>
<?
}
mysql_close($objConnect);
?>
<p></p>
<tr>
<td><div align="center"><input type="submit" name="button" id="button" value="Save" style="width:100px;height:30px" >
<input type=button onClick="parent. location.href='inter.php'"'inter.php'" value="Back" style="width:100px;height:30px">
</div></td>
<td><div align="center"></div></td>
</tr>
</table>
</form>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2012-06-15 10:20:41 |
By :
Cat |
View :
1144 |
Reply :
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Error อะไรครับน้อง Cat
|
|
|
|
|
Date :
2012-06-15 10:52:05 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
พอคลิกฟอร์ม แล้วไปหน้า search.php แล้วมันไม่เด้งกลับมาหน้าเดิมเหรอครับ
|
|
|
|
|
Date :
2012-06-17 23:34:56 |
By :
Pine |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inter.php บรรทัดที่ 40 เพิ่มชื่อปุ่มเข้าไปด้วยครับ
Code (PHP)
<input type="submit" value="Submit" name="submit" />
หรือถ้าไม่เพิ่มก็แก้ไฟล์ search.php
Code (PHP)
$_SESSION['conditionSelect'] = $_POST['ddlSelect'];
header('Location: inter.php');
|
|
|
|
|
Date :
2012-06-18 13:10:34 |
By :
Pine |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คือว่ามันไม่ได้คะลองดู code ด้วยนะคะว่าผิดตัรงไหนทะย่างนี้แล้ว เวลา เลือกที่ list menu แล้ว submit มันไม่ไปหน้าที่เลือกคะมันจะยู่หน้าเดีมตะหลอดเลีย
1..inter.php
Code (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=utf-8" />
<title>Untitled Document
</title>
<style type="text/css">
.style1 {
font-family: "Saysettha OT";
font-size: 16px;
}
.style2 {
font-family: "Saysettha OT";
font-size: 12px;
}
.style3 {
font-family: "Saysettha OT";
font-size: 8px;
}
</style>
</head>
<body>
<form name="frmSearch" method="post" action="listchoose.php">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="images/b1.png" >
<tr>
<th width="71%" height="10"><p><span class="style1">ເລືອກສະແດງຂໍ້ມູນປະເພດ
</span>
<select name="ddlSelect" id="ddlSelect" >
<option>- Select -</option>
<option value="Shortcode" <? if(@$_POST["ddlSelect"]=="Shorcode"){ echo"selected='selected'"; } ?>>shorcode</option>
<option value="CRBT" <? if(@$_POST["ddlSelect"]=="CRBT"){ echo"selected='selected'"; } ?>>CRBT</option>
</select>
<input type="submit" value="Submit" name="submit" />
</p></th>
<th width="8%" align="center" class="style2"><a href="adddata.php"><img src="images/bullet_plus.gif" width="16" height="16" /> ເພີ່ມຂໍ້ມູນ</a></font></th>
<th width="9%" abbr="center" class="style2"><a href="searchCRBT.php"><img src="images/Search.png" width="16" height="16" />ຊອກຂໍ້ມູນ CRBT</a></font></th>
<th width="12%" abbr="center" class="style2"><a href="searchShortcode.php"><img src="images/Search.png" width="16" height="16" />ຊອກຂໍ້ມູນ Shortcode</a></font></th>
</tr>
</table>
</form>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
mysql_query("SET NAMES UTF8");
mysql_query("SET character_set_results=UTF8");
if($_SESSION['conditionSelect']==""){
$strSQL = "SELECT * FROM shortcode order by ShortcodeName DESC";
}
//if(!empty($_SESSION['conditionSelect'])){
if($_SESSION['conditionSelect']=="Shortcode"){
$strSQL = "SELECT * FROM shortcode order by ShortcodeName DESC";
} else if($_SESSION['conditionSelect']=="CRBT"){
$strSQL = "SELECT * FROM crbt order by CRBT_ID DESC";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
if($_SESSION['conditionSelect']=="Shortcode" or $_SESSION['conditionSelect']==""){?>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" height="50" class="style2">
<tr bgcolor="#999999"> <B>
<th width="18" ><div align="center">No</div></font></th>
<th width="69" ><div align="center">Shortcode</div></font></th>
<th width="216" ><div align="center">ຊື່ບໍລິສັດ</div></font></th>
<th width="59"><div align="center">ເລີ່ມຕົ້ນ</div></font></th>
<th width="59"><div align="center">ໝົດອາຍຸ</div></font></th>
<th width="72" ><div align="center">ສັນຍາເລກທີ</div></font></th>
<th width="65" ><div align="center">ລາຄາ/sms</div></font></th>
<th width="59" ><div align="center">ອາກອນ</div></font></th>
<th width="64" ><div align="center">ສ່ວນແບ່ງ ETL</div></font></th>
<th width="64" ><div align="center">ສ່ວນແບ່ງ Partner</div></font></th>
<th width="59" ><div align="center">ເບີຕິດຕໍ່</div></font></th>
<th width="66" ><div align="center">ໝາຍເຫດ</div></font></th>
<th width="28" class="style3" ><div align="center">Delete</div></font></th>
<th width="20" class="style3"><div align="center">Edit</div></font></th>
</B></tr>
<?
$x = 0;
while($objResult = mysql_fetch_array($objQuery))
{
$x =$x+1;
if($bg =="#D2D2FF")
{
$bg = "#FFFFCC";
}
else
{
$bg = "#D2D2FF";
}
?>
<tr bgcolor="<?=$bg;?>">
<td height="23"><div align="center"><? echo "$x";?></div></td>
<td><div align="center"><?=$objResult["ShortcodeName"];?></div></td>
<td><div align="center"><?=$objResult["Company"];?></div></td>
<td><div align="center"><?=$objResult["Effect_time"];?></div></td>
<td><div align="center"><?=$objResult["Expire_time"];?></div></td>
<td><div align="center"><?=$objResult["Reference"];?></div></td>
<td><div align="center"><?=$objResult["Price"];?></div></td>
<td><div align="center"><?=$objResult["Tax"];?></div></td>
<td><div align="center"><?=$objResult["Share_ETL"];?></div></td>
<td><div align="center"><?=$objResult["Share_partner"];?></div></td>
<td align="center"><?=$objResult["Tel"];?></td>
<td><div align="center"><?=$objResult["Note"];?></div></td>
<td align="center"><a href="JavaScript:if(confirm('Confirm Delete?')==true) {window.location='phpMySQLDeleteRecord.php?ShortID=<?=$objResult["ShortcodeName"]; ?>&ddlSelect=<?=$_SESSION['conditionSelect']; ?>';}"><img src="images/del.png" width="16" height="16" /></a></td>
<td align="center" ><a href="phpMySQLEditRecordForm.php?ShortID=<?=$objResult["ShortcodeName"];?>"><img src="images/edit.png" width="16" height="16" /></a></font></td>
</tr>
<?
}
?>
</table>
<?
} else if($_SESSION['conditionSelect']=="CRBT"){
?>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" height="50" class="style2">
<tr bgcolor="#999999" > <B>
<th width="15"><div align="center">No</div></th>
<th width="200" ><div align="center">ຊື່ບໍລິສັດ</div></th>
<th width="55" ><div align="center">ເລີ່ມຕົ້ນ</div></font></th>
<th width="55"><div align="center">ໝົດອາຍຸ</div></font></th>
<th width="55" ><div align="center">ສັນຍາເລກທີ</div></font></th>
<th width="55"><div align="center">ລາຄາ/sms</div></font></th>
<th width="55"><div align="center">ອາກອນ</div></font></th>
<th width="55" ><div align="center">ສ່ວນແບ່ງ ETL</div></font></th>
<th width="55" ><div align="center">ສ່ວນແບ່ງ Partner</div></font></th>
<th width="55"><div align="center">ເບີຕິດຕໍ່</div></font></th>
<th width="50"><div align="center">ໝາຍເຫດ</div></font></th>
<th width="28" class="style3" ><div align="center">Delete</div></font></th>
<th width="20" class="style3"><div align="center">Edit</div></font></th>
</B></tr>
<?
$x = 0;
while($objResult = mysql_fetch_array($objQuery))
{
$x =$x+1;
if($bg =="#D2D2FF")
{
$bg = "#FFFFCC";
}
else
{
$bg = "#D2D2FF";
}
?>
<tr bgcolor="<?=$bg;?>">
<td height="23"><div align="center"><? echo "$x";?></div></td>
<td><div align="center"><?=$objResult["Company"];?></div></td>
<td><div align="center"><?=$objResult["Start"];?></div></td>
<td><div align="center"><?=$objResult["End"];?></div></td>
<td><div align="center"><?=$objResult["Refer"];?></div></td>
<td><div align="center"><?=$objResult["Price"];?></div></td>
<td><div align="center"><?=$objResult["Tax"];?></div></td>
<td><div align="center"><?=$objResult["ETL"];?></div></td>
<td><div align="center"><?=$objResult["partner"];?></div></td>
<td align="center"><?=$objResult["Tel"];?></td>
<td><div align="center"><?=$objResult["Note"];?></div></td>
<td align="center"><a href="JavaScript:if(confirm('Confirm Delete?')==true) {window.location='phpMySQLDeleteRecordCRBT.php?crbtID=<?=$objResult["Company"]; ?>&ddlSelect=<?=$_SESSION['conditionSelect']; ?>';}"><img src="images/del.png" width="16" height="16" /></a></td>
<td align="center"><a href="phpMySQLEditRecordFormCRBT.php?crbtID=<?=$objResult["Company"];?>&ddlSelect=<?=$_SESSION['conditionSelect'];?>"><img src="images/edit.png" width="16" height="16" /></a></font>
</td>
</tr>
<?
}
?>
</table>
<?
} else {
echo "Please select table...";
}
mysql_close($objConnect);
?>
</body>
</html>
2..listchoose.php
Code (PHP)
<?
ob_start();
session_start();
?>
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
if(!empty($_POST['ddlSelect'])){
$_SESSION['conditionSelect'] = $_POST['ddlSelect'];
} else {
session_destroy();
}
?>
<?
if(isset($_POST['submit']))
{
$_SESSION['conditionSelect'] = $_POST['ddlSelect'];
header('Location: inter.php');
}
?>
</body>
</html>
|
ประวัติการแก้ไข 2012-06-18 14:04:37
|
|
|
|
Date :
2012-06-18 13:55:50 |
By :
Cat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<form name="frmSearch" method="post" action="search.php">
|
|
|
|
|
Date :
2012-06-18 14:24:51 |
By :
Pine |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันไม่ออกคะ ลองเอาไป run ไห้หน่อยคะ
|
|
|
|
|
Date :
2012-06-18 14:40:28 |
By :
Cat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<input type="submit" value="Submit" name="submit" />
เอา /ออก
เป็น
<input type="submit" value="Submit" name="submit">
|
|
|
|
|
Date :
2012-06-18 15:08:07 |
By :
sambrazil |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไฟล์ search.php ที่ให้ไป มันคือ listchoose.php ของคุณใช่มั้ยครับ
ผมสงสัยเพราะเนื้อหากระทู้ ไฟล์แรก มัน action ที่ไฟล์ตัวเอง ($_SERVER['SCRIPT_NAME'])
ไฟล์ search.php ที่ให้ไป มันมีการ redirect กลับมาไฟล์เดิมอยู่แล้วครับ ถ้ามันไม่กลับ ผมไม่แน่ใจว่าเกิดจากอะไร เพราะเป็นโค้ดพื้นๆ
ตรง input /> กับ ไม่มี / ไม่ต่างกันครับ
ผมไม่ได้แนะนำ มันคนละคน
|
|
|
|
|
Date :
2012-06-18 15:30:40 |
By :
Pine |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|