|
 |
|
ช่วยมาแก้ใข code ที่โชข้อมูล list menu ด้วยคะ คืออยากไห้มันโชข้อมูลก่อนจะมีกานเลือกที่ list คะ |
|
 |
|
|
 |
 |
|
เพี่มเตีมนะคะ เมี่อเวลาหนูกด delete ข้อมูล มันก็จะกับไปไห้หนูเลือกข้อมูนที่ list อีกคะ มีวิทีทำไห้หน้ามัน refresh เอง แล้วยังคงเปันหน้าเดีมก่อนที่จะ delete ได้ไหม
เพาะหนูกำนด
echo "<script>alert('ลืบข้อมูลเรียบร้อยแล้ว');window.location = 'win2.php';</script>";
|
 |
 |
 |
 |
Date :
2012-06-04 12:05:55 |
By :
Cat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2012-06-04 12:37:36 |
By :
ปลอดภัย |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาไปไว้ก่อนบรรทัด 041
Code (PHP)
if($_SESSION['conditionSelect']==""){
$strSQL = "SELECT * FROM shortcode order by ShortcodeName DESC";
}
ตรงส่วนลบ
Code (PHP)
<a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='phpMySQLDeleteRecord.php?ShortID=<?=$objResult["ShortcodeName"]; ?>&ddlSelect=<?=$_SESSION['conditionSelect']; ?>';}">Delete</a>
หลังจากลบแล้ว
Code (PHP)
echo "<script>alert('ลืบข้อมูลเรียบร้อยแล้ว');window.location = 'win2.php?ddlSelect=$_SESSION['conditionSelect']';</script>";
ลองดูครับ
|
 |
 |
 |
 |
Date :
2012-06-04 14:33:07 |
By :
บังเอิญผ่านมาเห็น |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองดูว่าได้ป่าว
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();
}
?>
<form name="frmSearch" method="post" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<table width="932" border="1">
<tr>
<th>ເລືອກຂໍ້ມູນ
<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" /></th>
</tr>
</table>
</form>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
if($_SESSION['conditionSelect']==""){
$Qu =mysql_query("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_Name DESC";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
if($_SESSION['conditionSelect']=="Shortcode" or $Qu!=""){
?>
<table width="932" border="1" align="center" cellpadding="1" cellspacing="0">
<tr>
<td height="40" colspan="50" align="center" bgcolor="#CCCCCC">ສະຫຼຸບການນຳໃຊ້ Short Code ໃນເດືອນ 01 ປີ 2012</td>
</tr>
<tr> <B>
<th width="64" bgcolor="#999999" bordercolor="#006666"><font size="4"><div align="center">No</div></font></th>
<th width="137" bgcolor="#999999" bordercolor="#006666"><font size="4"><div align="center">Shortcode_id</div></font></th>
<th width="138" bgcolor="#999999" bordercolor="#006666"><font size="4"> <div align="center">Company_name</div></font></th>
<th width="125" bgcolor="#999999" bordercolor="#006666"><font size="4"> <div align="center">Effect-time</div></font></th>
<th width="108" bgcolor="#999999" bordercolor="#006666"><font size="4"> <div align="center">Expire-time</div></font></th>
<th width="108" bgcolor="#999999" bordercolor="#006666"><font size="4"> <div align="center">tel</div></font></th>
<th width="108" bgcolor="#999999" bordercolor="#006666"><font size="4"> <div align="center">Delete</div></font></th>
<th width="110" bgcolor="#999999" bordercolor="#006666"><font size="4"> <div align="center">Edit</div></font></th>
</B></tr>
<?
$x = 0;
while($objResult = mysql_fetch_array($objQuery)){
$x =$x+1;
if($bg =="#CCFF99"){
$bg = "#FFFFCC";
} else {
$bg = "#CCFF99";
}
?>
<tr>
<tr bgcolor="<?=$bg;?>">
<td><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 align="center"><?=$objResult["Tel"];?></td>
<td align="center"><font size="2" color="#FF0000"><a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='phpMySQLDeleteRecord.php?ShortID=<?=$objResult["ShortcodeName"];?>';}">Delete</a></font></td>
<td align="center" ><font size="2" color="#FF0000"><a href="phpMySQLEditRecordForm.php?ShortID=<?=$objResult["ShortcodeName"];?>">Edit</a></font></td>
</tr>
<?
}
?>
</table>
<?
} else if($_SESSION['conditionSelect']=="CRBT"){
?>
<table width="932" border="2">
<tr> <B>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"> <div align="center">Company_name</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"> <div align="center">Effect-time</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"> <div align="center">Expire-time</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"> <div align="center">Delete</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"> <div align="center">Edit</div></font></th>
</B></tr>
<?
while($objResult = mysql_fetch_array($objQuery)){
?>
<tr>
<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 align="center"><a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='phpMySQLDeleteRecord.php?ShortID=<?=$objResult["ShortcodeName"];?>';}">Delete</a></td>
<td align="center" ><font size="1" color="#FF0000"><a href="phpMySQLEditRecordForm.php?ShortID=<?=$objResult["ShortcodeName"];?>">Edit</a></font></td>
</tr>
<?
}
?>
</table>
<?
} else {
echo "Please select table.";
}
mysql_close($objConnect);
/*} else {
echo "";
}*/
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2012-06-04 22:31:10 |
By :
บังเอิญผ่านมาเห็น |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอลองอีกครั้ง
039 เปลี่ยนเป็น
Code (PHP)
$strSQL = "SELECT * FROM shortcode order by ShortcodeName DESC";
051 เปลี่ยนเป็น
Code (PHP)
if($_SESSION['conditionSelect']=="Shortcode" or $_SESSION['conditionSelect']==""){
|
 |
 |
 |
 |
Date :
2012-06-05 09:00:35 |
By :
บังเอิญผ่านมาเห็น |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเปลี่ยน ????????????? เป็นข้อความที่ต้องการแล้วหรือยังครับ
ที่เครื่องก็แสดงภาษาลาวได้นะครับ
|
 |
 |
 |
 |
Date :
2012-06-05 13:49:53 |
By :
บังเอิญผ่านมาเห็น |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|