Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
menotti08 #1
Filter Query
ok i have this
<cfset mypdf = "name">
<cfset mypdf = GetToken(mypdf, 1, "_")>
<cfoutput>#mypdf#</cfoutput>
<cfset session.fkcliente = "name">
<cfset DirList = 'D:\MyAccount\admin\Facturas'>
<cfscript>
if (NOT structKeyExists(form, 'fileExt')) form.fileExt = "*";
</cfscript>
<!--- get the list of text files. this assumes they will all be in a directory
called 'textfiles' under the web root --->
<cfdirectory action="list" directory="#DirList#" name="fileList"
filter="#form.fileExt#">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana;
font-size: 12px;
color: #006699;
}
a:link {
color: #006699;
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>
<table style="width:500px;" cellpadding="1" cellspacing="1">
</table>
<table style="width:500px; border:1px #000000 solid;" cellpadding="1"
cellspacing="1">
<tr style="background-color:#cccccc;">
<td style="font-weight:bold;">File Name </td>
<td style="font-weight:bold; width:80px; text-align:right;">File
Size </td>
<td style="font-weight:bold; width:150px;">Last Modified </td>
</tr>
<cfoutput query="fileList">
<cfif left(fileList.name, 1) IS NOT ".">
<!--- this condition does NOT need to be included in CF MX!! --->
<tr style="background-color:<cfif currentRow MOD
2>##ffffff<cfelse>##ececec</cfif>;">
<td><a href="facturas/#name#">#name#</a> </td>
<td style="text-align:right;">#int(evaluate(size/1024))#
KB </td>
<td>#dateFormat(dateLastModified, 'mm/dd/yyyy')#
#timeFormat(dateLastModified, 'h:mm tt')# </td>
</tr>
</cfif>
</cfoutput>
</table>
it work, but i get this query
[url]http://img332.imageshack.us/img332/4696/query4ta.jpg[/url]
but i only want the initial number depend of the user id
if i login with an id like 206 i only wnat to show the pdf files that start
with 206
menotti08 Guest
-
#40499 [NEW]: filter sapi does not register any highlightning filter
From: php at henke37 dot cjb dot net Operating system: any PHP version: 6CVS-2007-02-15 (CVS) PHP Bug Type: Apache2 related... -
Filter by MshORAddresses in an LDAP query
I am trying to query an LDAP server, and search for part of a string within the mshORAddresses field. This field is a string that is comma delimited... -
How to filter one database query by another
What I am hoping to do is filter one database query by another. I have two databases and they both have a field call vehicle_type. What I want to... -
Dynamic Query Filter
I have a query which returns a very long list of my members, and would like to create a select box at the top of the page that allows the user to... -
Query Filter
I have a salesman who mostly reports information outside of the US, but occasionly, he will put in a report for a company in the US. He also needs... -
mxstu #2
Re: Filter Query
Use a Query of Query to filter the listing on the current #loginID# (ex. 206)
<cfdirectory action="list" directory="#DirList#" name="fileList"
filter="#form.fileExt#">
<cfquery name="filteredList" dbtype="query">
SELECT *
FROM fileList
WHERE Name LIKE '#loginID#%'
</cfquery>
mxstu Guest
-
-
mxstu #4
Re: Filter Query
Are you using the new query "filteredList" in your CFOUTPUT statement?
<cfoutput query="filteredList">
<cfif left(fileList.name, 1) IS NOT ".">
... other code ....
</cfif>
</cfoutput>
mxstu Guest



Reply With Quote

