เวลาดึงข้อมูลขึ้นมาจาก base ตัวที่เป็น checkbox มันไม่แสดง checkbox ให้อะครับทำไงดีครับ
คุณเขียน code ไว้อย่างไรบ้างครับ กำลัง งง
Date :
2011-09-08 16:45:06
By :
webmaster
Code (PHP)
<?php
@session_start();
?>
<?php
include('connect.php');
$Company = $_COOKIE["CustID"];
$sql = "SELECT CustID FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query1");
$cus_id = mysql_fetch_array($query);
$id1 = $cus_id[0];
$sql = "SELECT Company FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id2 = $cus_id[0];
$sql = "SELECT Credit FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id3 = $cus_id[0];
$sql = "SELECT CurAdd1 FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id4 = $cus_id[0];
$sql = "SELECT ContactPerson1 FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id5 = $cus_id[0];
$sql = "SELECT ContactPosition1 FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id6 = $cus_id[0];
$sql = "SELECT Tel FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id7 = $cus_id[0];
$sql = "SELECT Fax FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id8 = $cus_id[0];
$sql = "SELECT Email FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id9 = $cus_id[0];
$sql = "SELECT Website FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id10 = $cus_id[0];
$sql = "SELECT Remark FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id11 = $cus_id[0];
$sql = "SELECT Active FROM tbcustomer WHERE CustID = $CustID";
$query = mysql_db_query($dbname, $sql) or die("Can't Query");
$cus_id = mysql_fetch_array($query);
$id12 = $cus_id[0];
?>
</table>
<!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>ข้อมูลลูกค้า</title>
<script type="text/javascript">
function onAdd(){
window.location='formB1_editcode.php';
}
function onCancle(){
window.location='formB1.php';
}
function onBack(){
window.location='menu_formB.php';
}
</script>
<style type="text/css">
<!--
.style1 {color: #FFFF00}
.style3 {font-size: 18px}
-->
</style>
</head>
<body>
<form name="form1" method="post" action="formB1_editcode.php">
<table width="1024" height="650" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<!--DWLayoutTable-->
<tr>
<td valign="top"><img src="images/banner.png" width="100%" height="100" /></td>
</tr>
<tr>
<td valign="top"><table width="100%" height="20" border="0" bordercolor="#0000FF">
<tr>
<td><div align="right">[ ชื่อผู้เข้าใช้ : <?php echo $_SESSION['user_login']; ?> ] [ วัน : <?php echo date("d/m/y", time()); ?> ] [ เวลา : <?php echo date("H:i:s", time()); ?> ]</div></td>
</tr>
</table>
<table width="100%" height="500" border="1" bordercolor="#0000FF">
<tr>
<td height="213" valign="top"><div align="center">
<div align="center">
<table width="446" border="0">
<tr>
<td><div align="center" class="style3">ข้อมูลลูกค้า</div></td>
</tr>
</table>
<table width="100%" border="1" align="center" bordercolor="#0099FF" bgcolor="#CCFFFF">
<tr>
<td width="128"><div align="right">รหัสลูกค้า :</div></td>
<td width="153"><div align="left">
<label>
<input name="txtName" type="text" size="20" readonly="readonly" value="<? echo $id1; ?>"/>
</label>
</div></td>
<td colspan="3"><div align="right">วันที่ปรับปรุง :</div></td>
<td width="267"><div align="left">
<?php echo date("d/m/y", time()); ?></div></td>
</tr>
<tr>
<td><div align="right">ชื่อลูกค้า :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtName" type="text" size="100" value="<? echo $id2; ?>"/>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ที่อยู่ :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtAddress" type="text" size="100" value="<? echo $id3; ?>"/>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">โทรศัพท์ :</div></td>
<td><div align="left">
<label>
<input type="text" name="txtPhone" value="<? echo $id4; ?>"/>
</label>
</div></td>
<td><div align="right">โทรสาร :</div></td>
<td width="167"><div align="left">
<label>
<input type="text" name="txtFax"value="<? echo $id5; ?>" />
</label>
</div></td>
<td width="142"><div align="right">Email :</div></td>
<td><div align="left">
<label>
<input type="text" name="txtEmail" value="<? echo $id6; ?>"/>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">Website :</div></td>
<td colspan="3"><div align="left">
<label>
<input name="txtWeb" type="text" size="72" value="<? echo $id7; ?>"/>
</label>
</div>
<label></label></td>
<td><div align="right">บุคคลที่ติดต่อ :</div></td>
<td><div align="left">
<label>
<input type="text" name="txtConnect" value="<? echo $id8; ?>"/>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ตำแหน่ง :</div></td>
<td><div align="left">
<label>
<input type="text" name="txtPosition"value="<? echo $id9; ?>"/>
</label>
</div>
<label></label></td>
<td width="121"><div align="right">ปล่อยเครดิต :</div></td>
<td colspan="3"><label></label>
<div align="left">
<label>
<input type="text" name="txtCredit"value="<? echo $id10; ?>" />
</label>
วัน </div></td>
</tr>
<tr>
<td><div align="right">หมายเหตุ :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtComment" type="text" size="100" value="<? echo $id11; ?>"/>
</label>
<label></label>
</div></td>
</tr>
<tr>
<td colspan="6"><label>
<div align="right">
<input type="checkbox" name="checkbox" value="<? echo $id12; ?>"/>
เลิกติดต่อแล้ว </div>
</label></td>
</tr>
<tr>
<td colspan="6"><table width="206" border="0" align="center">
<tr>
<td width="53"><div align="center">
<label>
<input input type="submit" name="btnSubmit" value="ยืนยัน" style="width:100px"/>
</label>
</div></td>
</form>
<td width="53"><div align="center">
<label>
<input type="button" name="btnCancel" value="ยกเลิก" style="width:100px" onclick="JavaScript:onCancel();"/>
</label>
</div></td>
<td width="42"><div align="center">
<label>
<input type="button" name="btnBack" value="กลับ" style="width:100px" onclick="JavaScript:onBack();"/>
</label>
</div></td>
</tr>
</table></td>
</tr>
</table>
<?
$sql = "SELECT CustID, Company FROM tbcustomer";
$query = mysql_db_query($dbname, $sql) or die("Can't Query1");
?>
<table width="1100" border="1">
<tr>
<th width="100"> <div align="center">Company </div></th>
<th width="100"> <div align="center">แก้ไข </div></th>
<th width="100"> <div align="center">ลบ </div></th>
</tr>
<?
while($CustID = mysql_fetch_array($query))
{
?>
<tr>
<td><div align="center"><?=$CustID["Company"];?></div></td>
<td align="center"><a href="formB1_edit.php?CustID=<?=$CustID["CustID"];?>">แก้ไข</a></td>
<td align="center"><a href="#" name="btnButton1" onclick="fncConfirm1('<?=$Company["Company"];?>')"><img src="images/close.png" /></a></td>
</tr>
</form>
</tr>
<?
}
?>
</div>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" valign="top" bgcolor="#3366CC"><div align="center" class="style1">บริษัท เอ.ที. พริ้นติ้ง จำกัด </div></td>
</tr>
</table>
</body>
</html>
Date :
2011-09-08 17:29:22
By :
tangsupap
Load balance : Server 05