Hi again,

I'm stuck again. Not sure I'm going about this in the right way.

I'm querying the following database which has a listing of over 2000+ fonts.


<cfquery name="GetFontFamily" datasource="fontstyles">
        SELECT      sti, ID
        FROM        fontsti
        ORDER BY sti
</cfquery>


I then read in an external file which has a listing of only 5 font names

<cffile action="READ"
          file="c:\text.txt"
          variable="ReadMe">

Output:
----------
Hamburg
Palatino
Ultimate
Limerick

What I want to do is pluck out the corresponding .pfbs from the file I'm 
reading in against the above database.

The code below  (index.cfm) does a listing of all the fonts in my database 
with a checkbox. The fonts checked are then passed to another page 
(create-list.cfm) which pulls all the corresponding .pfb files and displays 
the results.

index.cfm
-------------

<cfform action="create-list.cfm" name="checkboxform" method="POST">
        <cfquery name="GetFontFamily" datasource="fontstyles">
                SELECT      sti, ID
                FROM        fontsti
                ORDER BY sti
        </cfquery>

        <td class="dirlinks">
        <cfoutput query="GetFontFamily">
                <cfif #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'BorderPi-15159' 
OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Bundesbahn-Pi' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'CCH-Australia-Logos' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'CCH-Folio-Views' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCH-Logos' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'CCH-Logos-PH' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'CCHFM-Lawlines' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'CCHFM-Logos' 
OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Carta' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Century' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Custom' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Environmental Logo' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Euro' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'European-Pi' 
OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Garamond' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Helvetica' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Linotype-Decoration-Pi' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Linotype 
Holiday-Pi' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Lucida-Math-Extension' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Mathematical-Pi' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Old-Style-Seven' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Symbol' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 'Times' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Times-Serials' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Wood-Ornaments' OR
                          #LCase(ListGetAt(GetFontFamily.sti,1,'.'))# IS 
'Zapf-Chancery-Dingbats'>
                        <input type="Checkbox" name="select" 
value="#GetFontFamily.ID#" 
checked="Yes" required="Yes" onclick="this.checked=true;"><img 
src="../../images/blank.gif" width="3" height="14" alt="" border="0"><font 
color="red">&nbsp;#LCase(ListGetAt(GetFontFamily.sti,1,'.'))#</font><br>
                        <input type="hidden" name="ID" value="#GetFontFamily.ID#">
                <cfelse>
                        <cfinput type="Checkbox" name="select" 
value="#GetFontFamily.ID#">&nbsp;#LCase(ListGetAt(GetFontFamily.sti,1,'.'))#<br>
                </cfif>
        </cfoutput>
        </td>
</tr>
<tr>
<td class="navlinks">
<input class="navlinks" type="submit" name="Action" value=" Generate ">
&nbsp;<input class="navlinks" type="submit" name="Action" value="Clear" 
OnClick="window.close()">
&nbsp;<input class="navlinks" type="submit" name="Action" value="Close" 
OnClick="window.close()">
<br>


create-list.cfm
--------------------

<cfquery name="GetMyFonts" datasource="fontstyles">
        SELECT          fontsti.sti, fontsti.ID, fontspecs.pfb
        FROM            fontsti, fontspecs
        WHERE           fontsti.ID = fontspecs.fontsti_ID
        AND     fontsti.ID IN (#form.select#)
        ORDER BY        sti
</cfquery>

<cfoutput query="GetMyFonts" group="ID">
        <font class="navlinks">#LCase(ListGetAt(GetMyFonts.sti,1,'.'))#</font><br>
        <cfoutput><font class="navlinks">[#GetMyFonts.pfb#]</font></cfoutput>
        <hr>
</cfoutput>



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to