Files
kucherenko__jscpd/fixtures/cfml/file1.cfm
apk 3170a849dd feat: add Apex and CFML language support with fixtures (#83, #619)
- apex: add extensions cls, trigger, apex (was empty)
- cfml: new format mapping .cfm to markup grammar
- fixtures/apex: two .cls files with cloneable Salesforce Apex code
- fixtures/cfml: two .cfm files with cloneable ColdFusion templates
2026-05-09 11:12:51 +02:00

50 lines
1.2 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<title>Product Listing</title>
</head>
<body>
<cfset datasource = "myDSN">
<cfset category = url.category ?: "all">
<cfquery name="getProducts" datasource="#datasource#">
SELECT ProductID, ProductName, Price, StockQty, CategoryID
FROM Products
WHERE IsActive = 1
<cfif category NEQ "all">
AND CategoryID = <cfqueryparam value="#category#" cfsqltype="CF_SQL_INTEGER">
</cfif>
ORDER BY ProductName ASC
</cfquery>
<h2>Product Listing</h2>
<cfif getProducts.RecordCount EQ 0>
<p>No products found.</p>
<cfelse>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Price</th>
<th>Stock</th>
</tr>
</thead>
<tbody>
<cfloop query="getProducts">
<tr>
<td><cfoutput>#getProducts.ProductID#</cfoutput></td>
<td><cfoutput>#getProducts.ProductName#</cfoutput></td>
<td><cfoutput>#NumberFormat(getProducts.Price, '9,999.99')#</cfoutput></td>
<td><cfoutput>#getProducts.StockQty#</cfoutput></td>
</tr>
</cfloop>
</tbody>
</table>
</cfif>
</body>
</html>