mirror of
https://github.com/kucherenko/jscpd.git
synced 2026-09-19 08:11:03 +08:00
3170a849dd
- 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
50 lines
1.2 KiB
Plaintext
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>
|