Files
kucherenko__jscpd/fixtures/cfml/file2.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

59 lines
1.5 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<title>Order 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>
<cfquery name="getOrders" datasource="#datasource#">
SELECT OrderID, CustomerName, OrderDate, TotalAmount, Status
FROM Orders
WHERE IsActive = 1
ORDER BY OrderDate DESC
</cfquery>
<h2>Order Listing</h2>
<cfif getOrders.RecordCount EQ 0>
<p>No orders found.</p>
<cfelse>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Customer</th>
<th>Date</th>
<th>Total</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<cfloop query="getOrders">
<tr>
<td><cfoutput>#getOrders.OrderID#</cfoutput></td>
<td><cfoutput>#getOrders.CustomerName#</cfoutput></td>
<td><cfoutput>#DateFormat(getOrders.OrderDate, 'mm/dd/yyyy')#</cfoutput></td>
<td><cfoutput>#NumberFormat(getOrders.TotalAmount, '9,999.99')#</cfoutput></td>
<td><cfoutput>#getOrders.Status#</cfoutput></td>
</tr>
</cfloop>
</tbody>
</table>
</cfif>
</body>
</html>