Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default 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&nbsp;&nbsp;</td>
    <td style="font-weight:bold; width:80px; text-align:right;">File
    Size&nbsp;&nbsp;</td>
    <td style="font-weight:bold; width:150px;">Last Modified&nbsp;&nbsp;</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>&nbsp;&nbsp;</td>
    <td style="text-align:right;">#int(evaluate(size/1024))#
    KB&nbsp;&nbsp;</td>
    <td>#dateFormat(dateLastModified, 'mm/dd/yyyy')#
    #timeFormat(dateLastModified, 'h:mm tt')#&nbsp;&nbsp;</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

  2. Similar Questions and Discussions

    1. #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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default Re: Filter Query

    i put your code and he post all the files yet
    menotti08 Guest

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139