function selectProductUsingId($uID) { global $msg; global $prodNo; global $prodID; global $prodName; global $prodDescr; global $prodCat; global $prodPrice; global $prodQuan; $sqlExistProd = mysql_query("select * from tblproduct where prod_id = '{$uID}'") or die(mysql_error()); if (mysql_num_rows($sqlExistProd) >= 1) { $getRowProd = mysql_fetch_array($sqlExistProd); $prodNo = $getRowProd["prod_no"]; $prodID = $getRowProd["prod_id"]; $prodName = $getRowProd["prod_name"]; $prodDescr = $getRowProd["prod_descr"]; $prodCat = $getRowProd["prod_cat"]; $prodPrice = $getRowProd["prod_price"]; $prodQuan = $getRowProd["prod_quan"]; enableProductComponents(); } else { $msg = "No record found"; disableProductComponents(); } }
$msg = "Successfully updated the record!"; if ($_FILES['fileField']['tmp_name'] != "") { $newname = "{$imgID}.jpg"; move_uploaded_file($_FILES['fileField']['tmp_name'], "../images/product/{$newname}"); } disableProductComponents(); } else { if ($submit2 == "Delete") { $imgID = $_POST['txtHoldProdNo']; mysql_query("delete from tblproduct where prod_id = '{$_POST['txtProdId']}'") or die(mysql_error()); $msg = "Successfully deleted the record!"; $pictodelete = "../images/product/{$imgID}.jpg"; if (file_exists($pictodelete)) { unlink($pictodelete); } disableProductComponents(); } } } ?> <!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" /> <link href="css/styles.css" rel="stylesheet" type="text/css" /> <title>Dadads - Administrator</title> </head> <body id="adminpage"> <div id="main_wrapper"> <div id="main_header">