|  | 
	                
  
    | 
	 
        Update ไม่ได้ช่วยหน่อยคับ ช่วยที่คับคือทำ Project ยุ ขอบคุณมาก ๆ เลยถ้าช่วยเหลือ     |  
    |  |  
 
	
		|  |  |  |  |  
		|  |  | 
          
            | Code (PHP) 
 function modifyADD()
{
    date_default_timezone_set('Asia/Bangkok');
	$catId       = (int)$_GET['id'];
	$id      	 = $_POST['txtId'];
    $number      = $_POST['txtNumber'];
	$namepj      = $_POST['txtNamePJ'];
	$name        = $_POST['txtNamePro'];
	$amount      = $_POST['txtN'];
	$unit        = $_POST['txtUn'];
    
     
    $sql    = "UPDATE tbl_purchase SET pur_id = '$id', pur_number = '$number', pur_partners = '$namepj',pur_id_product = 0, pur_partners = '$name', pur_amount = '$amount' , pur_unit = '$unit' WHERE pur_id = $catId";
           
    $result = dbQuery($sql) or die('Cannot update category. ' . mysql_error());
    header('Location: index.php');              
}
 
 
 Tag : PHP, MySQL, HTML/CSS, JavaScript, Action Script, CakePHP
 
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2016-05-05 13:31:47 | By :
                          sorrasich | View :
                          839 | Reply :
                          1 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |  
		|  |  |  |  |  
  
    | 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | อันนี้ ไฟล์ modify 
 Code (PHP)
 
 <meta charset="utf-8">
<?php
if (!defined('WEB_ROOT')) {
	exit;
}
// ตรวจสอบให้แน่ใจว่ารหัสประเภทสินค้า หรือ  category id ได้ถูกส่งมา
if (isset($_GET['catId']) && (int)$_GET['catId'] > 0) {
	$catId = (int)$_GET['catId'];
} else {
	header('Location:index.php');
}	
	
	
$sql = "SELECT pur_id,pur_number , pur_partners, pur_id_product, pur_name, pur_amount, pur_unit, pur_date
        FROM tbl_purchase
		WHERE pur_id = $catId";
$result = dbQuery($sql);
$row = dbFetchAssoc($result);
extract($row);
?>
<p> </p>
<form action="processADD.php?action=modify&catId=<?php echo $catId; ?>" method="post" enctype="multipart/form-data" name="frmADD" id="frmADD">
 <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
  <tr> 
   <td width="150" class="label">เลขที่ใบสั่งซื้อ</td>
   <td class="content" align="left"> <input name="txtNumber"  class="box" value="<?php echo $pur_id; ?>" id="txtNumber" size="10" maxlength="50"></td>
  </tr>
  <tr> 
   <td width="150" class="label">รหัสสินค้า</td>
   <td class="content" align="left"><input name="txtId" type="text" class="box" value="<?php echo $pur_number; ?>" id="txtId" size="10" maxlength="50"></td>
  </tr>
  </tr>
  <tr> 
   <td width="150" class="label">บริษัทคู่ค้า</td>
   <td class="content" align="left"> <input name="txtNamePJ" type="text" class="box" value="<?php echo $pur_partners; ?>" id="txtNamePJ" size="30" maxlength="50"></td>
  </tr>
  <tr> 
   <td width="150" class="label">ชื่อสินค้า</td>
   <td class="content" align="left"> <input name="txtNamePro" type="text" class="box" value="<?php echo $pur_name; ?>" id="txtNamePro" size="30" maxlength="50"></td>
  </tr>
  <tr> 
   <td width="150" class="label">จำนวน</td>
   <td class="content" align="left"> <input name="txtN" type="text" class="box" value="<?php echo $pur_amount; ?>" id="txtN" size="10" maxlength="50"></td>
  </tr>
  <tr> 
   <td width="150" class="label">หน่วย</td>
   <td class="content" align="left"> <input name="txtUn" type="text" class="box" value="<?php echo $pur_unit; ?>" id="txtUn" size="10" maxlength="50"></td>
  </tr>
 </table>
 <p align="center"> 
  <input name="btnModify" type="button" id="btnModify" value="Save Modification" onClick="checkADDForm();" class="box">
    <input name="btnCancel" type="button" id="btnCancel" value="Cancel" onClick="window.location.href='index.php';" class="box">
 </p>
</form>
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2016-05-05 13:42:00 | By :
                            sorrasich |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  |  |