Lekjew.com
Manage Product
No |
ProductGroup |
ProductName |
|
|
|
|
|
|
Product Group
Product Name
ManageProduct_save.php
RUNNING;
$product_code = "W". sprintf("%06d", $running);
$INSPRODUCT = "INSERT INTO product (product_code,group_code, product_name ) values ( '$product_code','$group_code','$product_name' )";
$RSINS = sqlsrv_prepare($ConnDB, $INSPRODUCT);
if (!$RSINS) { throw new Exception($INSPRODUCT); $result[] = array("ERR" => $INSPRODUCT, "CSS" => "text-danger"); }
if (!sqlsrv_execute($RSINS)) { throw new Exception( $INSPRODUCT); $result[] = array("ERR" => $INSPRODUCT, "CSS" => "text-danger"); }
break;
}
} catch (Exception $ex) {
$result[] = array("ERR" => $ex->getMessage(), "CSS" => "text-danger");
sqlsrv_rollback($ConnDB);
sqlsrv_close($ConnDB);
}
sqlsrv_close($ConnDB);
}else{
$result[] = array("ERR" =>"ERROR CONNECTION SQL", "CSS" => "text-danger");
}
$json = array( 'result' => $result);
echo json_encode($json, JSON_UNESCAPED_UNICODE);
?>ManageProduct_data.php
$rowp->product_code
, "product_name" => $rowp->product_name
, "group_name" => $rowp->group_name
);
}
echo json_encode($data, JSON_UNESCAPED_UNICODE);
sqlsrv_close($ConnDB);
?>ManageProductGroup_data.php
$rowp->group_code
, "group_name" => $rowp->group_name
);
}
echo json_encode($data, JSON_UNESCAPED_UNICODE);
sqlsrv_close($ConnDB);
?>leftmenu.php
connectDBMS.php
DATABASENAME,"UID"=>UID,"PWD"=>PWD,"MultipleActiveResultSets"=>true,"CharacterSet"=> CHARSET);
$ConnDB = sqlsrv_connect(SERVERNAME, $connect1);
if(!$ConnDB){
echo "Fail Connection";
}
?>