Search the web
Sign In
New User? Sign Up
cfajax
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 2021 - 2032 of 2032   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#2032 From: Keith Henderson <head_java@...>
Date: Wed Nov 11, 2009 4:48 pm
Subject: Re: Re : Re : Re : Re : cfajax+dbqueries
head_java
Offline Offline
Send Email Send Email
 
Can't help you there never had issues using #arguments.xyz# in queries (MySQL). Don't understand the <cfoutput>. This is a server-side call, your only output is a data query object. I never use cfouput in any of my server-side code called by ajax.

--- On Wed, 11/11/09, onomo joel <joelonomo@...> wrote:

From: onomo joel <joelonomo@...>
Subject: Re : Re : Re : Re : [cfajax] cfajax+dbqueries
To: cfajax@yahoogroups.com
Date: Wednesday, November 11, 2009, 8:05 AM

 
Sorry, but i forgot the cfouput around the cfscript. Now it works only when i put static values in the query. When i use #arguments.year# ..... it doesn't work. What's wrong with #arguments.values# as filter of the query?
 




De : onomo joel <joelonomo@yahoo. fr>
À : cfajax@yahoogroups. com
Envoyé le : Mer 11 Novembre 2009, 10 h 22 min 30 s
Objet : Re : Re : Re : [cfajax] cfajax+dbqueries

I solved the problem with the database, but it looks like the results of the cfquery are not copied in the QueryNew. I don't know why. Thank you
This is the code:

<cfinclude template="ajax/ core/cfajax. cfm">

<cffunction name="statistics" returntype=" query">
 
    <cfargument name="mois" required="no" type="string">
    <cfargument name="annee" required="no" type="string">
    <cfargument name="usage" required="no" type="string">
   
   
           
          <cfquery  name="Qresult" datasource=" kpimage" >
         
            SELECT DATEPART(year, sdate) as yeardate, DATEPART(month, sdate) as monthdate, count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATEPART(year, sdate), DATEPART(month, sdate), suse
            HAVING DATEPART(year, sdate) = #arguments.annee#
            AND DATEPART(month, sdate)= '#arguments. mois#'
            AND suse = '#arguments. usage#';                  
          </cfquery>
         
           <cfset WorkQuery = QueryNew("month, year, usage, result")>
          
          <cfscript>
            nrow=QueryAddRow( WorkQuery) ;
            temp=QuerySetCell( WorkQuery, "month",#Qresult. monthdate# );
            temp=QuerySetCell( WorkQuery, "year",#Qresult. yeardate# );
            temp=QuerySetCell( WorkQuery, "usage",#Qresult. suse#);
            temp=QuerySetCell( WorkQuery, "result",#Qresult. result#);
         
          </cfscript>
         
                
          <cfreturn WorkQuery>
     
  </cffunction>
 





#2031 From: onomo joel <joelonomo@...>
Date: Wed Nov 11, 2009 2:06 pm
Subject: Re : Re : Re : cfajax+dbqueries
joelonomo
Offline Offline
Send Email Send Email
 
Good morning,
When i do that, i have a message saying that WorkQuery.result is undefined. Also, i think that my query doesn't return any result and i don't know. I think the problem is coming from there, because when i go on the firebug response, the query has no value after execution. I am using that query on Sql Server. If you know Sql Server, i would be glad to receive your help on that cfquery. Thank you for all
 

Joël B ONOMO



De : Keith Henderson <head_java@...>
À : cfajax@yahoogroups.com
Envoyé le : Mer 11 Novembre 2009, 8 h 58 min 01 s
Objet : Re: Re : Re : [cfajax] cfajax+dbqueries

 

Almost there
 
 document.getElement ById("info" ).innerHTML =WorkQuery[0] .result;
 should be
 document.getElement ById("info" ).innerHTML = WorkQuery.result[ 0];

--- On Tue, 11/10/09, onomo joel <joelonomo@yahoo. fr> wrote:

From: onomo joel <joelonomo@yahoo. fr>
Subject: Re : Re : [cfajax] cfajax+dbqueries
To: cfajax@yahoogroups. com
Date: Tuesday, November 10, 2009, 11:15 AM

 
Right now i have void results, but the post has the right values. When i check response with firebug, all the queries column are there but they are void. and on the page to be displayed i have the message: undefined.

the code is below:

//functions. cfm

<cfinclude template="ajax/ core/cfajax. cfm">

<cffunction name="statistics" returntype=" query">
 
    <cfargument name="mois" required="no" type="string">
    <cfargument name="annee" required="no" type="string">
    <cfargument name="usage" required="no" type="string">
    <cfset WorkQuery = QueryNew("month, year, usage, result")>
   

   
   
      <!---<cfif isDefined(#argument s.mois#) AND isDefined(#argument s.annee#) AND isDefined(#argument s.usage#)>  --->
         
          <cfquery name="Qresult" datasource=" kpimage" >
         
            SELECT DATENAME(year, sdate) as yeardate, DATENAME(month, sdate) as monthdate, count(suse) as result, suse
            FROM dbo.TBL_imgusage
            GROUP BY DATENAME(year, sdate), DATENAME(month, sdate), suse
            HAVING (DATENAME(year, sdate) = '#arguments. annee#')
            AND (DATENAME(month, sdate)= '#arguments. mois#')
            AND (suse = '#arguments. usage#');                  
          </cfquery>
          
          <cfscript>
         
          nrow=QueryAddRow( WorkQuery) ;
          temp=QuerySetCell( WorkQuery, "month", Qresult.monthdate) ;
          temp=QuerySetCell( WorkQuery, "result", Qresult.result) ;
          temp=QuerySetCell( WorkQuery, "usage", Qresult.suse) ;
          temp=QuerySetCell( WorkQuery, "year", Qresult.yeardate) ;     
         
          </cfscript>
        
                
          <cfreturn WorkQuery>
</cffunction>

// page
http://www.w3. org/TR/html4/ loose.dtd">
<html>
<head>
<title>BUGWOOD IMAGES STATISTICS</title>

        <script type='text/javascri pt' src='ajax/core/ engine.js'></script>
        <script type='text/javascri pt' src='ajax/core/ util.js'></script>
        <script type='text/javascri pt' src='ajax/core/ settings. js'></script>
       
        <script language="javascrip t" type="text/javascri pt">
       
            function loadInfo()
            {
                var mois = DWRUtil.getValue( "mois");
                var annee = DWRUtil.getValue( "annee");
                var usage = DWRUtil.getValue( "usage");
                DWREngine._execute( _cfscriptLocatio n, null, 'statistics' , mois, annee, usage, getResultData) ;
               
               
            }
           
           
            function getResultData( WorkQuery)
            {
                document.getElement ById("info" ).innerHTML =WorkQuery[0] .result;
               
            }
           
           

            function init()
            {
                DWRUtil.useLoadingM essage();
                DWREngine._errorHan dler =  errorHandler;
                loadInfo();
            }
           
        </script>
               
</head>


<body onLoad="init( )">

    <p>&nbsp;</p>
    <hr color="#060" style="color: #060" />
    <h3 align="center"  style="color: #060;  font-size:26px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;  " >BUGWOOD IMAGES STATISTICS</h3>
    <hr color="#060" style="color: #060" />
    <cfquery name="totalhits" datasource=" kpimage">
    select count(useid) AS hits
    from TBL_imgusage
    </cfquery>
    <p style="font- size:26px; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;">
   
    <strong><em><u>Overall Number of Hits:</u></em></strong><cfoutput query="totalhits"><em style="color: ##F60">&nbsp;&nbsp;#hits#</em></cfoutput>
    </p>
   
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center" style="font- size:18px"><strong>You Can Apply The Filters Below According To Your Search</strong>...</p>
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center"></p>
   
   
      <table width="50%" border="1" bordercolor= "#CCCCCC" cellspacing= "0" align="center">
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Month</em></th>
          <td>
          <select id="mois" name="month"  >
          <option ></option>
          <option value="1">January</option>
          <option value="2">February</option>
          <option value="3">March</option>
          <option value="4">April</option>
          <option value="5">May</option>
          <option value="6">June</option>
          <option value="7">July</option>
          <option value="8">August</option>
          <option value="9">September&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
          <option value="10">October</option>
          <option value="11">November</option>
          <option value="12">December</option>
          </select>
          <cfoutput><em style="color: ##060"><strong>...(If selected, You must select a Year)</strong></em></cfoutput></td>
        </tr>
        <tr>
          <th width="23%" align="right" bgcolor="#F2FFFF" scope="row"><em>Year</em></th>
          <td width="77%">
          <select name="year" id="annee" onChange="loadInfo( )">
          <option></option>
          <option value="2004">2004</option>
          <option value="2005">2005</option>
          <option value="2006">2006</option>
          <option value="2007">2007</option>
          <option value="2008">2008</option>
          <option value="2009">2009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </option>
          </select>
          </td>
        </tr>
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Image Usage</em></th>
          <td><select name="usage" id="usage" onChange="loadInfo( )" >
          <option></option>
          <option>Commercial</option>
          <option>Educational</option>
          <option>Personal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
         
          </select></td>
        </tr>
      </table>
     
   
    <p align="center"><strong>Your search's results below</strong></p>
    <table width="400" border="1" align="center" bordercolor= "#CCCCCC" cellspacing= "0">
            <thead>
                <tr>
                    <th width="69">Month</th>
                    <th width="78">Year</th>
                    <th width="133">Usage</th>
                    <th width="92">Result</th>
                </tr>
            </thead>
            <tbody id="teamsBody">
            </tbody>
        </table>
   
<p align="center"><span name="info" id="info" ></span></p>
   
    </body>
</html>




#2030 From: onomo joel <joelonomo@...>
Date: Wed Nov 11, 2009 4:05 pm
Subject: Re : Re : Re : Re : cfajax+dbqueries
joelonomo
Offline Offline
Send Email Send Email
 
Sorry, but i forgot the cfouput around the cfscript. Now it works only when i put static values in the query. When i use #arguments.year#..... it doesn't work. What's wrong with #arguments.values# as filter of the query?
 




De : onomo joel <joelonomo@...>
À : cfajax@yahoogroups.com
Envoyé le : Mer 11 Novembre 2009, 10 h 22 min 30 s
Objet : Re : Re : Re : [cfajax] cfajax+dbqueries

I solved the problem with the database, but it looks like the results of the cfquery are not copied in the QueryNew. I don't know why. Thank you
This is the code:

<cfinclude template="ajax/core/cfajax.cfm">

<cffunction name="statistics" returntype="query">
 
    <cfargument name="mois" required="no" type="string">
    <cfargument name="annee" required="no" type="string">
    <cfargument name="usage" required="no" type="string">
   
   
           
          <cfquery  name="Qresult" datasource="kpimage" >
         
            SELECT DATEPART(year, sdate) as yeardate, DATEPART(month, sdate) as monthdate, count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATEPART(year, sdate), DATEPART(month, sdate), suse
            HAVING DATEPART(year, sdate) = #arguments.annee#
            AND DATEPART(month, sdate)= '#arguments.mois#'
            AND suse = '#arguments.usage#';                  
          </cfquery>
         
           <cfset WorkQuery = QueryNew("month, year, usage, result")>
          
          <cfscript>
            nrow=QueryAddRow(WorkQuery);
            temp=QuerySetCell(WorkQuery, "month",#Qresult.monthdate#);
            temp=QuerySetCell(WorkQuery, "year",#Qresult.yeardate#);
            temp=QuerySetCell(WorkQuery, "usage",#Qresult.suse#);
            temp=QuerySetCell(WorkQuery, "result",#Qresult.result#);
         
          </cfscript>
         
                
          <cfreturn WorkQuery>
     
  </cffunction>
 




#2029 From: onomo joel <joelonomo@...>
Date: Wed Nov 11, 2009 3:22 pm
Subject: Re : Re : Re : cfajax+dbqueries
joelonomo
Offline Offline
Send Email Send Email
 
I solved the problem with the database, but it looks like the results of the cfquery are not copied in the QueryNew. I don't know why. Thank you
This is the code:

<cfinclude template="ajax/core/cfajax.cfm">

<cffunction name="statistics" returntype="query">
 
    <cfargument name="mois" required="no" type="string">
    <cfargument name="annee" required="no" type="string">
    <cfargument name="usage" required="no" type="string">
   
   
           
          <cfquery  name="Qresult" datasource="kpimage" >
         
            SELECT DATEPART(year, sdate) as yeardate, DATEPART(month, sdate) as monthdate, count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATEPART(year, sdate), DATEPART(month, sdate), suse
            HAVING DATEPART(year, sdate) = #arguments.annee#
            AND DATEPART(month, sdate)= '#arguments.mois#'
            AND suse = '#arguments.usage#';                  
          </cfquery>
         
           <cfset WorkQuery = QueryNew("month, year, usage, result")>
          
          <cfscript>
            nrow=QueryAddRow(WorkQuery);
            temp=QuerySetCell(WorkQuery, "month",#Qresult.monthdate#);
            temp=QuerySetCell(WorkQuery, "year",#Qresult.yeardate#);
            temp=QuerySetCell(WorkQuery, "usage",#Qresult.suse#);
            temp=QuerySetCell(WorkQuery, "result",#Qresult.result#);
         
          </cfscript>
         
                
          <cfreturn WorkQuery>
     
  </cffunction>
 



#2028 From: Keith Henderson <head_java@...>
Date: Wed Nov 11, 2009 1:58 pm
Subject: Re: Re : Re : cfajax+dbqueries
head_java
Offline Offline
Send Email Send Email
 
Almost there
 
 document.getElement ById("info" ).innerHTML =WorkQuery[0] .result;
 should be
 document.getElement ById("info" ).innerHTML = WorkQuery.result[0];

--- On Tue, 11/10/09, onomo joel <joelonomo@...> wrote:

From: onomo joel <joelonomo@...>
Subject: Re : Re : [cfajax] cfajax+dbqueries
To: cfajax@yahoogroups.com
Date: Tuesday, November 10, 2009, 11:15 AM

 
Right now i have void results, but the post has the right values. When i check response with firebug, all the queries column are there but they are void. and on the page to be displayed i have the message: undefined.

the code is below:

//functions. cfm

<cfinclude template="ajax/ core/cfajax. cfm">

<cffunction name="statistics" returntype=" query">
 
    <cfargument name="mois" required="no" type="string">
    <cfargument name="annee" required="no" type="string">
    <cfargument name="usage" required="no" type="string">
    <cfset WorkQuery = QueryNew("month, year, usage, result")>
   

   
   
      <!---<cfif isDefined(#argument s.mois#) AND isDefined(#argument s.annee#) AND isDefined(#argument s.usage#)>  --->
         
          <cfquery name="Qresult" datasource=" kpimage" >
         
            SELECT DATENAME(year, sdate) as yeardate, DATENAME(month, sdate) as monthdate, count(suse) as result, suse
            FROM dbo.TBL_imgusage
            GROUP BY DATENAME(year, sdate), DATENAME(month, sdate), suse
            HAVING (DATENAME(year, sdate) = '#arguments. annee#')
            AND (DATENAME(month, sdate)= '#arguments. mois#')
            AND (suse = '#arguments. usage#');                  
          </cfquery>
          
          <cfscript>
         
          nrow=QueryAddRow( WorkQuery) ;
          temp=QuerySetCell( WorkQuery, "month", Qresult.monthdate) ;
          temp=QuerySetCell( WorkQuery, "result", Qresult.result) ;
          temp=QuerySetCell( WorkQuery, "usage", Qresult.suse) ;
          temp=QuerySetCell( WorkQuery, "year", Qresult.yeardate) ;     
         
          </cfscript>
        
                
          <cfreturn WorkQuery>
</cffunction>

// page
http://www.w3. org/TR/html4/ loose.dtd">
<html>
<head>
<title>BUGWOOD IMAGES STATISTICS</title>

        <script type='text/javascri pt' src='ajax/core/ engine.js'></script>
        <script type='text/javascri pt' src='ajax/core/ util.js'></script>
        <script type='text/javascri pt' src='ajax/core/ settings. js'></script>
       
        <script language="javascrip t" type="text/javascri pt">
       
            function loadInfo()
            {
                var mois = DWRUtil.getValue( "mois");
                var annee = DWRUtil.getValue( "annee");
                var usage = DWRUtil.getValue( "usage");
                DWREngine._execute( _cfscriptLocatio n, null, 'statistics' , mois, annee, usage, getResultData) ;
               
               
            }
           
           
            function getResultData( WorkQuery)
            {
                document.getElement ById("info" ).innerHTML =WorkQuery[0] .result;
               
            }
           
           

            function init()
            {
                DWRUtil.useLoadingM essage();
                DWREngine._errorHan dler =  errorHandler;
                loadInfo();
            }
           
        </script>
               
</head>


<body onLoad="init( )">

    <p>&nbsp;</p>
    <hr color="#060" style="color: #060" />
    <h3 align="center"  style="color: #060;  font-size:26px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;  " >BUGWOOD IMAGES STATISTICS</h3>
    <hr color="#060" style="color: #060" />
    <cfquery name="totalhits" datasource=" kpimage">
    select count(useid) AS hits
    from TBL_imgusage
    </cfquery>
    <p style="font- size:26px; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;">
   
    <strong><em><u>Overall Number of Hits:</u></em></strong><cfoutput query="totalhits"><em style="color: ##F60">&nbsp;&nbsp;#hits#</em></cfoutput>
    </p>
   
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center" style="font- size:18px"><strong>You Can Apply The Filters Below According To Your Search</strong>...</p>
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center"></p>
   
   
      <table width="50%" border="1" bordercolor= "#CCCCCC" cellspacing= "0" align="center">
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Month</em></th>
          <td>
          <select id="mois" name="month"  >
          <option ></option>
          <option value="1">January</option>
          <option value="2">February</option>
          <option value="3">March</option>
          <option value="4">April</option>
          <option value="5">May</option>
          <option value="6">June</option>
          <option value="7">July</option>
          <option value="8">August</option>
          <option value="9">September&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
          <option value="10">October</option>
          <option value="11">November</option>
          <option value="12">December</option>
          </select>
          <cfoutput><em style="color: ##060"><strong>...(If selected, You must select a Year)</strong></em></cfoutput></td>
        </tr>
        <tr>
          <th width="23%" align="right" bgcolor="#F2FFFF" scope="row"><em>Year</em></th>
          <td width="77%">
          <select name="year" id="annee" onChange="loadInfo( )">
          <option></option>
          <option value="2004">2004</option>
          <option value="2005">2005</option>
          <option value="2006">2006</option>
          <option value="2007">2007</option>
          <option value="2008">2008</option>
          <option value="2009">2009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </option>
          </select>
          </td>
        </tr>
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Image Usage</em></th>
          <td><select name="usage" id="usage" onChange="loadInfo( )" >
          <option></option>
          <option>Commercial</option>
          <option>Educational</option>
          <option>Personal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
         
          </select></td>
        </tr>
      </table>
     
   
    <p align="center"><strong>Your search's results below</strong></p>
    <table width="400" border="1" align="center" bordercolor= "#CCCCCC" cellspacing= "0">
            <thead>
                <tr>
                    <th width="69">Month</th>
                    <th width="78">Year</th>
                    <th width="133">Usage</th>
                    <th width="92">Result</th>
                </tr>
            </thead>
            <tbody id="teamsBody">
            </tbody>
        </table>
   
<p align="center"><span name="info" id="info" ></span></p>
   
    </body>
</html>



#2027 From: onomo joel <joelonomo@...>
Date: Tue Nov 10, 2009 7:15 pm
Subject: Re : Re : cfajax+dbqueries
joelonomo
Offline Offline
Send Email Send Email
 
Right now i have void results, but the post has the right values. When i check response with firebug, all the queries column are there but they are void. and on the page to be displayed i have the message: undefined.

the code is below:

//functions.cfm

<cfinclude template="ajax/core/cfajax.cfm">

<cffunction name="statistics" returntype="query">
 
    <cfargument name="mois" required="no" type="string">
    <cfargument name="annee" required="no" type="string">
    <cfargument name="usage" required="no" type="string">
    <cfset WorkQuery = QueryNew("month, year, usage, result")>
   

   
   
      <!---<cfif isDefined(#arguments.mois#) AND isDefined(#arguments.annee#) AND isDefined(#arguments.usage#)>  --->
         
          <cfquery name="Qresult" datasource="kpimage" >
         
            SELECT DATENAME(year, sdate) as yeardate, DATENAME(month, sdate) as monthdate, count(suse) as result, suse
            FROM dbo.TBL_imgusage
            GROUP BY DATENAME(year, sdate), DATENAME(month, sdate), suse
            HAVING (DATENAME(year, sdate) = '#arguments.annee#')
            AND (DATENAME(month, sdate)= '#arguments.mois#')
            AND (suse = '#arguments.usage#');                  
          </cfquery>
          
          <cfscript>
         
          nrow=QueryAddRow(WorkQuery);
          temp=QuerySetCell(WorkQuery, "month", Qresult.monthdate);
          temp=QuerySetCell(WorkQuery, "result", Qresult.result);
          temp=QuerySetCell(WorkQuery, "usage", Qresult.suse);
          temp=QuerySetCell(WorkQuery, "year", Qresult.yeardate);     
         
          </cfscript>
        
                
          <cfreturn WorkQuery>
</cffunction>

// page
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>BUGWOOD IMAGES STATISTICS</title>

        <script type='text/javascript' src='ajax/core/engine.js'></script>
        <script type='text/javascript' src='ajax/core/util.js'></script>
        <script type='text/javascript' src='ajax/core/settings.js'></script>
       
        <script language="javascript" type="text/javascript">
       
            function loadInfo()
            {
                var mois = DWRUtil.getValue("mois");
                var annee = DWRUtil.getValue("annee");
                var usage = DWRUtil.getValue("usage");
                DWREngine._execute(_cfscriptLocation, null, 'statistics', mois, annee, usage, getResultData);
               
               
            }
           
           
            function getResultData( WorkQuery)
            {
                document.getElementById("info").innerHTML =WorkQuery[0].result;
               
            }
           
           

            function init()
            {
                DWRUtil.useLoadingMessage();
                DWREngine._errorHandler =  errorHandler;
                loadInfo();
            }
           
        </script>
               
</head>


<body onLoad="init()">

    <p>&nbsp;</p>
    <hr color="#060" style="color:#060" />
    <h3 align="center"  style="color:#060;  font-size:26px; font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;  " >BUGWOOD IMAGES STATISTICS</h3>
    <hr color="#060" style="color:#060" />
    <cfquery name="totalhits" datasource="kpimage">
    select count(useid) AS hits
    from TBL_imgusage
    </cfquery>
    <p style="font-size:26px;font-family:'Palatino Linotype', 'Book Antiqua', Palatino, serif;">
   
    <strong><em><u>Overall Number of Hits:</u></em></strong><cfoutput query="totalhits"><em style="color:##F60">&nbsp;&nbsp;#hits#</em></cfoutput>
    </p>
   
    <p align="center" style="font-size:18px">&nbsp;</p>
    <p align="center" style="font-size:18px"><strong>You Can Apply The Filters Below According To Your Search</strong>...</p>
    <p align="center" style="font-size:18px">&nbsp;</p>
    <p align="center"></p>
   
   
      <table width="50%" border="1" bordercolor="#CCCCCC" cellspacing="0" align="center">
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Month</em></th>
          <td>
          <select id="mois" name="month"  >
          <option ></option>
          <option value="1">January</option>
          <option value="2">February</option>
          <option value="3">March</option>
          <option value="4">April</option>
          <option value="5">May</option>
          <option value="6">June</option>
          <option value="7">July</option>
          <option value="8">August</option>
          <option value="9">September&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
          <option value="10">October</option>
          <option value="11">November</option>
          <option value="12">December</option>
          </select>
          <cfoutput><em style="color:##060"><strong>...(If selected, You must select a Year)</strong></em></cfoutput></td>
        </tr>
        <tr>
          <th width="23%" align="right" bgcolor="#F2FFFF" scope="row"><em>Year</em></th>
          <td width="77%">
          <select name="year" id="annee" onChange="loadInfo()">
          <option></option>
          <option value="2004">2004</option>
          <option value="2005">2005</option>
          <option value="2006">2006</option>
          <option value="2007">2007</option>
          <option value="2008">2008</option>
          <option value="2009">2009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </option>
          </select>
          </td>
        </tr>
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Image Usage</em></th>
          <td><select name="usage" id="usage" onChange="loadInfo()" >
          <option></option>
          <option>Commercial</option>
          <option>Educational</option>
          <option>Personal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
         
          </select></td>
        </tr>
      </table>
     
   
    <p align="center"><strong>Your search's results below</strong></p>
    <table width="400" border="1" align="center" bordercolor="#CCCCCC" cellspacing="0">
            <thead>
                <tr>
                    <th width="69">Month</th>
                    <th width="78">Year</th>
                    <th width="133">Usage</th>
                    <th width="92">Result</th>
                </tr>
            </thead>
            <tbody id="teamsBody">
            </tbody>
        </table>
   
<p align="center"><span name="info" id="info" ></span></p>
   
    </body>
</html>


#2026 From: Keith Henderson <head_java@...>
Date: Tue Nov 10, 2009 6:39 pm
Subject: Re: Re : cfajax+dbqueries
head_java
Offline Offline
Send Email Send Email
 
I not longer use CFajax, I use ajaxCFC, this is a different ajax coldfusion project. ajaxCFC has some quick ways of building tables, selects etc using your returned query object.
However, if you have a field named xyz in your returned query object, then you could reference that field value DataQuery.xyz[0]. or something like var returnxyz = DataQuery.xyz[0]. If you return more than one record in your query you can set up a for loop in javascript to access each record in the query array. In the example below I'm returning only one record.
 
function getData () {
  DWREngine._execute(_ajaxConfig._cfscriptLocation, null, 'getWorkClientData', companynojs, workidjs, loadData);}
function loadData (DataQuery) {
  document.getElementById("infodiv").style.height = 75;
  DWRUtil.setValue(companyspan,DataQuery.comname[0]);DWRUtil.setValue(workref,DataQuery.refwork[0]);DWRUtil.setValue(phaseopt,DataQuery.phaseoption[0]);
  var man = DataQuery.workmanref[0] + " :<font size='2'> " + DataQuery.workman[0];
  var site = DataQuery.workonsiteref[0] + " :   <font size='2'> " + DataQuery.workonsite[0];
  var workdesc = DataQuery.refwork[0] + " : " + workidjs + " -- " + DataQuery.workname[0] + " / " + DataQuery.workclass[0];
  str='';
  str+='<TABLE width="70%"><TR>';
  str+='<TR><TD width="70%"><font face="arial" size="3"><b>' + workdesc + '<\/TD>';
  str+='<\/TD><\/TR><\/TABLE>';
  document.getElementById("workdataspan1").innerHTML = str;
  str='';
  str+='<TABLE width="70%"><TR>';
  str+='<TR><TD width="25%"><font face="arial" size="1"><b>' + man + '<\/TD>';
  str+='<TD width="25%"><font face="arial" size="1"><b>' + site + '<\/TD>';
  str+='<TD width="25%"><font face="arial" size="1"><b>Client :<font size="2"> ' + DataQuery.clientname[0] + '<\/TD><\/TR><\/TABLE>';
  document.getElementById("workdataspan2").innerHTML = str;
  loadAttach();}
 
Feel free to contact with other ?s

--- On Tue, 11/10/09, onomo joel <joelonomo@...> wrote:

From: onomo joel <joelonomo@...>
Subject: Re : [cfajax] cfajax+dbqueries
To: cfajax@yahoogroups.com
Date: Tuesday, November 10, 2009, 9:01 AM

 
Thank you for your answer,
Please can i have an example where to access to those values in the  javascript function to be called by DWREngine._execute? Thank you
 



De : Keith Henderson <head_java@yahoo. com>
À : cfajax@yahoogroups. com
Envoyé le : Mar 10 Novembre 2009, 11 h 30 min 38 s
Objet : Re: [cfajax] cfajax+dbqueries

 
It appears you are trying to return a variable and not a query object.
See example:
<cffunction name="getWorkOption s" access="private" returntype=" query">
 <cfargument name="curcom" type="string" required="Yes">
 <cfargument name="curwork" type="string" required="Yes">
 <cfset WorkQuery = QueryNew("workonsit e,workpre, workconst, workmarkup" )>
   <cfquery name="get_worksq" dataSource=" XXX_MAST">
  select WORKMASTER_COMPANY_ NO, WORKMASTER_ID, WORKMASTER_ONSITE_ RATE_OPTION, WORKMASTER_PRE_ CONST_BILLING_ TYPE,
         WORKMASTER_CONST_ BILLING_TYPE, WORKMASTER_MARKUP_ BILLING
  from WORKMASTER
        where  WORKMASTER_COMPANY_ NO = '#arguments. curcom#' and WORKMASTER_ID = '#arguments. curwork#'
 </cfquery>
    <cfloop query="get_worksq">
       <CFSCRIPT>
       nrow = QueryAddRow( WorkQuery) ;
       temp = QuerySetCell( WorkQuery, "workonsite" , #get_worksq. WORKMASTER_ ONSITE_RATE_ OPTION#);
       temp = QuerySetCell( WorkQuery, "workpre", #get_worksq. WORKMASTER_ PRE_CONST_ BILLING_TYPE# );
       temp = QuerySetCell( WorkQuery, "workconst", #get_worksq. WORKMASTER_ CONST_BILLING_ TYPE#);
       temp = QuerySetCell( WorkQuery, "workmarkup" , #get_worksq. WORKMASTER_ MARKUP_BILLING# );
       </CFSCRIPT>
  </cfloop>
  <cfreturn WorkQuery>
</cffunction>
 
 
 


--- On Tue, 11/10/09, onomo <joelonomo@yahoo. fr> wrote:

From: onomo <joelonomo@yahoo. fr>
Subject: [cfajax] cfajax+dbqueries
To: cfajax@yahoogroups. com
Date: Tuesday, November 10, 2009, 7:10 AM

 
Hi everybody,

I am trying to use cfajax to load a content from a database. I have been inpired by this web site:http://www.bifrost. com.au/blog/ index.cfm/ 2006/7/13/ CFAJAX-Suggest
All i have in my execution are the loading messages. I also use firebug to see if my post and response are good for the functions.cfm. , the post has the good values but the response doesn't display anything. I don't know what to do now to make it work. I will be glad to receive your help. Thank you

code:
// functions.cfm



<!--- Function that returns statistic results according to a year/month/usage --->

<cffunction name="statistics" returntype=" query" output="yes" access="remote">
 
    <cfargument name="mois" required="no" type="numeric">
    <cfargument name="annee" required="no" type="numeric">
    <cfargument name="usage" required="no" type="string">
    <cfset var Qresult="">
   
   
      <cfif isDefined(arguments .mois) AND isDefined(arguments .annee) AND isDefined(arguments .usage)> 
         
          <cfquery name="Qresult" datasource=" kpimage">
         
            SELECT DATENAME(year, sdate) as yeardate, DATENAME(month, sdate) as monthdate, count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate), DATENAME(month, sdate), suse
            HAVING (DATENAME(year, sdate) = arguments.annee)
            AND (DATENAME(month, sdate)= arguments.mois)
            AND (suse = arguments.usage)                  
          </cfquery>         
          
          <cfreturn Qresult>
         
      </cfif>
      
      <cfif isDefined(arguments .annee) AND isDefined(arguments .usage)>
      
          <cfquery name="Qresult" datasource=" kpimage">
            SELECT DATENAME(year, sdate) as yeardate,count( suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate),  suse
            HAVING (DATENAME(year, sdate) = <cfqueryparam cfsqltype="cf_ sql_integer" value="#arguments. annee#">)
            AND (suse = <cfqueryparam cfsqltype="cf_ sql_varchar" value="#arguments. usage#">);
          </cfquery>
           <!--- <cfset result = queryyear.result> ---> 
           <cfreturn Qresult>
          
       </cfif>
         
     <cfif isDefined(arguments .usage)>
           <cfquery name="Qresult" datasource=" kpimage">
            SELECT count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY   suse
            HAVING (suse = <cfqueryparam cfsqltype="cf_ sql_varchar" value="#arguments. usage#">);
          </cfquery>
          <!--- <cfset result = queryyear.result> --->
          <cfreturn Qresult> 
               
     </cfif>
 
 
   
</cffunction>


// index.cfm

http://www. w3.org/TR/ html4/loose. dtd">
<html>
<head>
<title>BUGWOOD IMAGES STATISTICS</title>

        <script type='text/javascri pt' src='ajax/core/ engine.js'></script>
        <script type='text/javascri pt' src='ajax/core/ util.js'></script>
        <script type='text/javascri pt' src='ajax/core/ settings. js'></script>
       
        <script language="javascrip t" type="text/javascri pt">
       
            function loadInfo()
            {
                var mois = DWRUtil.getValue( "mois");
                var annee = DWRUtil.getValue( "annee");
                var usage = DWRUtil.getValue( "usage");
                DWREngine._execute( _cfscriptLocatio n, null, 'statistics' , mois, annee, usage, getResultData) ;
               
               
            }
           
           
            function getResultData( Qresult)
            {
                document.getElement ById("info" ).innerHTML =Qresult[0]. RESULT ;
            }
           
           

            function init()
            {
                DWRUtil.useLoadingM essage();
                DWREngine._errorHan dler =  errorHandler;
                loadInfo();
            }
           
        </script>
               
</head>


<body onLoad="init( )">

    <p>&nbsp;</p>
    <hr color="#060" style="color: #060" />
    <h3 align="center"  style="color: #060;  font-size:26px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;  " >BUGWOOD IMAGES STATISTICS</h3>
    <hr color="#060" style="color: #060" />
    <cfquery name="totalhits" datasource=" kpimage">
    select count(useid) AS hits
    from TBL_imgusage
    </cfquery>
    <p style="font- size:26px; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;">
   
    <strong><em><u>Overall Number of Hits:</u></em></strong><cfoutput query="totalhits"><em style="color: ##F60">&nbsp;&nbsp;#hits#</em></cfoutput>
    </p>
   
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center" style="font- size:18px"><strong>You Can Apply The Filters Below According To Your Search</strong>...</p>
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center"></p>
   
   
      <table width="50%" border="1" bordercolor= "#CCCCCC" cellspacing= "0" align="center">
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Month</em></th>
          <td>
          <select id="mois" name="month"  >
          <option ></option>
          <option value="1">January</option>
          <option value="2">February</option>
          <option value="3">March</option>
          <option value="4">April</option>
          <option value="5">May</option>
          <option value="6">June</option>
          <option value="7">July</option>
          <option value="8">August</option>
          <option value="9">September&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
          <option value="10">October</option>
          <option value="11">November</option>
          <option value="12">December</option>
          </select>
          <cfoutput><em style="color: ##060"><strong>...(If selected, You must select a Year)</strong></em></cfoutput></td>
        </tr>
        <tr>
          <th width="23%" align="right" bgcolor="#F2FFFF" scope="row"><em>Year</em></th>
          <td width="77%">
          <select name="year" id="annee" onChange="loadInfo( )">
          <option></option>
          <option value="2004">2004</option>
          <option value="2005">2005</option>
          <option value="2006">2006</option>
          <option value="2007">2007</option>
          <option value="2008">2008</option>
          <option value="2009">2009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </option>
          </select>
          </td>
        </tr>
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Image Usage</em></th>
          <td><select name="usage" id="usage" onChange="loadInfo( )" >
          <option></option>
          <option>Commercial</option>
          <option>Educational</option>
          <option>Personal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
         
          </select></td>
        </tr>
      </table>
     
    <p align="center">&nbsp;</p>
    <p align="center"><strong>Your search's results below</strong></p>
    <table width="400" border="1" align="center" bordercolor= "#CCCCCC" cellspacing= "0">
            <thead>
                <tr>
                    <th width="69">Month</th>
                    <th width="78">Year</th>
                    <th width="133">Usage</th>
                    <th width="92">Result</th>
                </tr>
            </thead>
            <tbody id="teamsBody">
            </tbody>
        </table>
   
<h2 name="info" id="info" ></h2>
   
    </body>
</html>
 




#2025 From: onomo joel <joelonomo@...>
Date: Tue Nov 10, 2009 5:01 pm
Subject: Re : cfajax+dbqueries
joelonomo
Offline Offline
Send Email Send Email
 
Thank you for your answer,
Please can i have an example where to access to those values in the  javascript function to be called by DWREngine._execute? Thank you
 



De : Keith Henderson <head_java@...>
À : cfajax@yahoogroups.com
Envoyé le : Mar 10 Novembre 2009, 11 h 30 min 38 s
Objet : Re: [cfajax] cfajax+dbqueries

 

It appears you are trying to return a variable and not a query object.
See example:
<cffunction name="getWorkOption s" access="private" returntype=" query">
 <cfargument name="curcom" type="string" required="Yes">
 <cfargument name="curwork" type="string" required="Yes">
 <cfset WorkQuery = QueryNew("workonsit e,workpre, workconst, workmarkup" )>
   <cfquery name="get_worksq" dataSource=" XXX_MAST">
  select WORKMASTER_COMPANY_ NO, WORKMASTER_ID, WORKMASTER_ONSITE_ RATE_OPTION, WORKMASTER_PRE_ CONST_BILLING_ TYPE,
         WORKMASTER_CONST_ BILLING_TYPE, WORKMASTER_MARKUP_ BILLING
  from WORKMASTER
        where  WORKMASTER_COMPANY_ NO = '#arguments. curcom#' and WORKMASTER_ID = '#arguments. curwork#'
 </cfquery>
    <cfloop query="get_worksq">
       <CFSCRIPT>
       nrow = QueryAddRow( WorkQuery) ;
       temp = QuerySetCell( WorkQuery, "workonsite" , #get_worksq. WORKMASTER_ ONSITE_RATE_ OPTION#);
       temp = QuerySetCell( WorkQuery, "workpre", #get_worksq. WORKMASTER_ PRE_CONST_ BILLING_TYPE# );
       temp = QuerySetCell( WorkQuery, "workconst", #get_worksq. WORKMASTER_ CONST_BILLING_ TYPE#);
       temp = QuerySetCell( WorkQuery, "workmarkup" , #get_worksq. WORKMASTER_ MARKUP_BILLING# );
       </CFSCRIPT>
  </cfloop>
  <cfreturn WorkQuery>
</cffunction>
 
 
 


--- On Tue, 11/10/09, onomo <joelonomo@yahoo. fr> wrote:

From: onomo <joelonomo@yahoo. fr>
Subject: [cfajax] cfajax+dbqueries
To: cfajax@yahoogroups. com
Date: Tuesday, November 10, 2009, 7:10 AM

 
Hi everybody,

I am trying to use cfajax to load a content from a database. I have been inpired by this web site:http://www.bifrost. com.au/blog/ index.cfm/ 2006/7/13/ CFAJAX-Suggest
All i have in my execution are the loading messages. I also use firebug to see if my post and response are good for the functions.cfm. , the post has the good values but the response doesn't display anything. I don't know what to do now to make it work. I will be glad to receive your help. Thank you

code:
// functions.cfm



<!--- Function that returns statistic results according to a year/month/usage --->

<cffunction name="statistics" returntype=" query" output="yes" access="remote">
 
    <cfargument name="mois" required="no" type="numeric">
    <cfargument name="annee" required="no" type="numeric">
    <cfargument name="usage" required="no" type="string">
    <cfset var Qresult="">
   
   
      <cfif isDefined(arguments .mois) AND isDefined(arguments .annee) AND isDefined(arguments .usage)> 
         
          <cfquery name="Qresult" datasource=" kpimage">
         
            SELECT DATENAME(year, sdate) as yeardate, DATENAME(month, sdate) as monthdate, count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate), DATENAME(month, sdate), suse
            HAVING (DATENAME(year, sdate) = arguments.annee)
            AND (DATENAME(month, sdate)= arguments.mois)
            AND (suse = arguments.usage)                  
          </cfquery>         
          
          <cfreturn Qresult>
         
      </cfif>
      
      <cfif isDefined(arguments .annee) AND isDefined(arguments .usage)>
      
          <cfquery name="Qresult" datasource=" kpimage">
            SELECT DATENAME(year, sdate) as yeardate,count( suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate),  suse
            HAVING (DATENAME(year, sdate) = <cfqueryparam cfsqltype="cf_ sql_integer" value="#arguments. annee#">)
            AND (suse = <cfqueryparam cfsqltype="cf_ sql_varchar" value="#arguments. usage#">);
          </cfquery>
           <!--- <cfset result = queryyear.result> ---> 
           <cfreturn Qresult>
          
       </cfif>
         
     <cfif isDefined(arguments .usage)>
           <cfquery name="Qresult" datasource=" kpimage">
            SELECT count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY   suse
            HAVING (suse = <cfqueryparam cfsqltype="cf_ sql_varchar" value="#arguments. usage#">);
          </cfquery>
          <!--- <cfset result = queryyear.result> --->
          <cfreturn Qresult> 
               
     </cfif>
 
 
   
</cffunction>


// index.cfm

http://www. w3.org/TR/ html4/loose. dtd">
<html>
<head>
<title>BUGWOOD IMAGES STATISTICS</title>

        <script type='text/javascri pt' src='ajax/core/ engine.js'></script>
        <script type='text/javascri pt' src='ajax/core/ util.js'></script>
        <script type='text/javascri pt' src='ajax/core/ settings. js'></script>
       
        <script language="javascrip t" type="text/javascri pt">
       
            function loadInfo()
            {
                var mois = DWRUtil.getValue( "mois");
                var annee = DWRUtil.getValue( "annee");
                var usage = DWRUtil.getValue( "usage");
                DWREngine._execute( _cfscriptLocatio n, null, 'statistics' , mois, annee, usage, getResultData) ;
               
               
            }
           
           
            function getResultData( Qresult)
            {
                document.getElement ById("info" ).innerHTML =Qresult[0]. RESULT ;
            }
           
           

            function init()
            {
                DWRUtil.useLoadingM essage();
                DWREngine._errorHan dler =  errorHandler;
                loadInfo();
            }
           
        </script>
               
</head>


<body onLoad="init( )">

    <p>&nbsp;</p>
    <hr color="#060" style="color: #060" />
    <h3 align="center"  style="color: #060;  font-size:26px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;  " >BUGWOOD IMAGES STATISTICS</h3>
    <hr color="#060" style="color: #060" />
    <cfquery name="totalhits" datasource=" kpimage">
    select count(useid) AS hits
    from TBL_imgusage
    </cfquery>
    <p style="font- size:26px; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;">
   
    <strong><em><u>Overall Number of Hits:</u></em></strong><cfoutput query="totalhits"><em style="color: ##F60">&nbsp;&nbsp;#hits#</em></cfoutput>
    </p>
   
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center" style="font- size:18px"><strong>You Can Apply The Filters Below According To Your Search</strong>...</p>
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center"></p>
   
   
      <table width="50%" border="1" bordercolor= "#CCCCCC" cellspacing= "0" align="center">
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Month</em></th>
          <td>
          <select id="mois" name="month"  >
          <option ></option>
          <option value="1">January</option>
          <option value="2">February</option>
          <option value="3">March</option>
          <option value="4">April</option>
          <option value="5">May</option>
          <option value="6">June</option>
          <option value="7">July</option>
          <option value="8">August</option>
          <option value="9">September&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
          <option value="10">October</option>
          <option value="11">November</option>
          <option value="12">December</option>
          </select>
          <cfoutput><em style="color: ##060"><strong>...(If selected, You must select a Year)</strong></em></cfoutput></td>
        </tr>
        <tr>
          <th width="23%" align="right" bgcolor="#F2FFFF" scope="row"><em>Year</em></th>
          <td width="77%">
          <select name="year" id="annee" onChange="loadInfo( )">
          <option></option>
          <option value="2004">2004</option>
          <option value="2005">2005</option>
          <option value="2006">2006</option>
          <option value="2007">2007</option>
          <option value="2008">2008</option>
          <option value="2009">2009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </option>
          </select>
          </td>
        </tr>
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Image Usage</em></th>
          <td><select name="usage" id="usage" onChange="loadInfo( )" >
          <option></option>
          <option>Commercial</option>
          <option>Educational</option>
          <option>Personal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
         
          </select></td>
        </tr>
      </table>
     
    <p align="center">&nbsp;</p>
    <p align="center"><strong>Your search's results below</strong></p>
    <table width="400" border="1" align="center" bordercolor= "#CCCCCC" cellspacing= "0">
            <thead>
                <tr>
                    <th width="69">Month</th>
                    <th width="78">Year</th>
                    <th width="133">Usage</th>
                    <th width="92">Result</th>
                </tr>
            </thead>
            <tbody id="teamsBody">
            </tbody>
        </table>
   
<h2 name="info" id="info" ></h2>
   
    </body>
</html>
 



#2024 From: Keith Henderson <head_java@...>
Date: Tue Nov 10, 2009 4:30 pm
Subject: Re: cfajax+dbqueries
head_java
Offline Offline
Send Email Send Email
 
It appears you are trying to return a variable and not a query object.
See example:
<cffunction name="getWorkOptions" access="private" returntype="query">
 <cfargument name="curcom" type="string" required="Yes">
 <cfargument name="curwork" type="string" required="Yes">
 <cfset WorkQuery = QueryNew("workonsite,workpre,workconst,workmarkup")>
   <cfquery name="get_worksq" dataSource="XXX_MAST">
  select WORKMASTER_COMPANY_NO, WORKMASTER_ID, WORKMASTER_ONSITE_RATE_OPTION, WORKMASTER_PRE_CONST_BILLING_TYPE,
         WORKMASTER_CONST_BILLING_TYPE, WORKMASTER_MARKUP_BILLING
  from WORKMASTER
        where  WORKMASTER_COMPANY_NO = '#arguments.curcom#' and WORKMASTER_ID = '#arguments.curwork#'
 </cfquery>
    <cfloop query="get_worksq">
       <CFSCRIPT>
       nrow = QueryAddRow(WorkQuery);
       temp = QuerySetCell(WorkQuery, "workonsite", #get_worksq.WORKMASTER_ONSITE_RATE_OPTION#);
       temp = QuerySetCell(WorkQuery, "workpre", #get_worksq.WORKMASTER_PRE_CONST_BILLING_TYPE#);
       temp = QuerySetCell(WorkQuery, "workconst", #get_worksq.WORKMASTER_CONST_BILLING_TYPE#);
       temp = QuerySetCell(WorkQuery, "workmarkup", #get_worksq.WORKMASTER_MARKUP_BILLING#);
       </CFSCRIPT>
  </cfloop>
  <cfreturn WorkQuery>
</cffunction>
 
 
 


--- On Tue, 11/10/09, onomo <joelonomo@...> wrote:

From: onomo <joelonomo@...>
Subject: [cfajax] cfajax+dbqueries
To: cfajax@yahoogroups.com
Date: Tuesday, November 10, 2009, 7:10 AM

 
Hi everybody,

I am trying to use cfajax to load a content from a database. I have been inpired by this web site:http://www.bifrost. com.au/blog/ index.cfm/ 2006/7/13/ CFAJAX-Suggest
All i have in my execution are the loading messages. I also use firebug to see if my post and response are good for the functions.cfm. , the post has the good values but the response doesn't display anything. I don't know what to do now to make it work. I will be glad to receive your help. Thank you

code:
// functions.cfm



<!--- Function that returns statistic results according to a year/month/usage --->

<cffunction name="statistics" returntype=" query" output="yes" access="remote">
 
    <cfargument name="mois" required="no" type="numeric">
    <cfargument name="annee" required="no" type="numeric">
    <cfargument name="usage" required="no" type="string">
    <cfset var Qresult="">
   
   
      <cfif isDefined(arguments .mois) AND isDefined(arguments .annee) AND isDefined(arguments .usage)> 
         
          <cfquery name="Qresult" datasource=" kpimage">
         
            SELECT DATENAME(year, sdate) as yeardate, DATENAME(month, sdate) as monthdate, count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate), DATENAME(month, sdate), suse
            HAVING (DATENAME(year, sdate) = arguments.annee)
            AND (DATENAME(month, sdate)= arguments.mois)
            AND (suse = arguments.usage)                  
          </cfquery>         
          
          <cfreturn Qresult>
         
      </cfif>
      
      <cfif isDefined(arguments .annee) AND isDefined(arguments .usage)>
      
          <cfquery name="Qresult" datasource=" kpimage">
            SELECT DATENAME(year, sdate) as yeardate,count( suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate),  suse
            HAVING (DATENAME(year, sdate) = <cfqueryparam cfsqltype="cf_ sql_integer" value="#arguments. annee#">)
            AND (suse = <cfqueryparam cfsqltype="cf_ sql_varchar" value="#arguments. usage#">);
          </cfquery>
           <!--- <cfset result = queryyear.result> ---> 
           <cfreturn Qresult>
          
       </cfif>
         
     <cfif isDefined(arguments .usage)>
           <cfquery name="Qresult" datasource=" kpimage">
            SELECT count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY   suse
            HAVING (suse = <cfqueryparam cfsqltype="cf_ sql_varchar" value="#arguments. usage#">);
          </cfquery>
          <!--- <cfset result = queryyear.result> --->
          <cfreturn Qresult> 
               
     </cfif>
 
 
   
</cffunction>


// index.cfm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/ /EN" "http://www. w3.org/TR/ html4/loose. dtd">
<html>
<head>
<title>BUGWOOD IMAGES STATISTICS</title>

        <script type='text/javascri pt' src='ajax/core/ engine.js'></script>
        <script type='text/javascri pt' src='ajax/core/ util.js'></script>
        <script type='text/javascri pt' src='ajax/core/ settings. js'></script>
       
        <script language="javascrip t" type="text/javascri pt">
       
            function loadInfo()
            {
                var mois = DWRUtil.getValue( "mois");
                var annee = DWRUtil.getValue( "annee");
                var usage = DWRUtil.getValue( "usage");
                DWREngine._execute( _cfscriptLocatio n, null, 'statistics' , mois, annee, usage, getResultData) ;
               
               
            }
           
           
            function getResultData( Qresult)
            {
                document.getElement ById("info" ).innerHTML =Qresult[0]. RESULT ;
            }
           
           

            function init()
            {
                DWRUtil.useLoadingM essage();
                DWREngine._errorHan dler =  errorHandler;
                loadInfo();
            }
           
        </script>
               
</head>


<body onLoad="init( )">

    <p>&nbsp;</p>
    <hr color="#060" style="color: #060" />
    <h3 align="center"  style="color: #060;  font-size:26px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;  " >BUGWOOD IMAGES STATISTICS</h3>
    <hr color="#060" style="color: #060" />
    <cfquery name="totalhits" datasource=" kpimage">
    select count(useid) AS hits
    from TBL_imgusage
    </cfquery>
    <p style="font- size:26px; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;">
   
    <strong><em><u>Overall Number of Hits:</u></em></strong><cfoutput query="totalhits"><em style="color: ##F60">&nbsp;&nbsp;#hits#</em></cfoutput>
    </p>
   
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center" style="font- size:18px"><strong>You Can Apply The Filters Below According To Your Search</strong>...</p>
    <p align="center" style="font- size:18px">&nbsp;</p>
    <p align="center"></p>
   
   
      <table width="50%" border="1" bordercolor= "#CCCCCC" cellspacing= "0" align="center">
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Month</em></th>
          <td>
          <select id="mois" name="month"  >
          <option ></option>
          <option value="1">January</option>
          <option value="2">February</option>
          <option value="3">March</option>
          <option value="4">April</option>
          <option value="5">May</option>
          <option value="6">June</option>
          <option value="7">July</option>
          <option value="8">August</option>
          <option value="9">September&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
          <option value="10">October</option>
          <option value="11">November</option>
          <option value="12">December</option>
          </select>
          <cfoutput><em style="color: ##060"><strong>...(If selected, You must select a Year)</strong></em></cfoutput></td>
        </tr>
        <tr>
          <th width="23%" align="right" bgcolor="#F2FFFF" scope="row"><em>Year</em></th>
          <td width="77%">
          <select name="year" id="annee" onChange="loadInfo( )">
          <option></option>
          <option value="2004">2004</option>
          <option value="2005">2005</option>
          <option value="2006">2006</option>
          <option value="2007">2007</option>
          <option value="2008">2008</option>
          <option value="2009">2009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </option>
          </select>
          </td>
        </tr>
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Image Usage</em></th>
          <td><select name="usage" id="usage" onChange="loadInfo( )" >
          <option></option>
          <option>Commercial</option>
          <option>Educational</option>
          <option>Personal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
         
          </select></td>
        </tr>
      </table>
     
    <p align="center">&nbsp;</p>
    <p align="center"><strong>Your search's results below</strong></p>
    <table width="400" border="1" align="center" bordercolor= "#CCCCCC" cellspacing= "0">
            <thead>
                <tr>
                    <th width="69">Month</th>
                    <th width="78">Year</th>
                    <th width="133">Usage</th>
                    <th width="92">Result</th>
                </tr>
            </thead>
            <tbody id="teamsBody">
            </tbody>
        </table>
   
<h2 name="info" id="info" ></h2>
   
    </body>
</html>
 


#2023 From: "onomo" <joelonomo@...>
Date: Tue Nov 10, 2009 3:10 pm
Subject: cfajax+dbqueries
joelonomo
Offline Offline
Send Email Send Email
 
Hi everybody,

I am trying to use cfajax to load a content from a database. I have been inpired by this web site:http://www.bifrost.com.au/blog/index.cfm/2006/7/13/CFAJAX-Suggest
All i have in my execution are the loading messages. I also use firebug to see if my post and response are good for the functions.cfm., the post has the good values but the response doesn't display anything. I don't know what to do now to make it work. I will be glad to receive your help. Thank you

code:
// functions.cfm



<!--- Function that returns statistic results according to a year/month/usage --->

<cffunction name="statistics" returntype="query" output="yes" access="remote">
 
    <cfargument name="mois" required="no" type="numeric">
    <cfargument name="annee" required="no" type="numeric">
    <cfargument name="usage" required="no" type="string">
    <cfset var Qresult="">
   
   
      <cfif isDefined(arguments.mois) AND isDefined(arguments.annee) AND isDefined(arguments.usage)> 
         
          <cfquery name="Qresult" datasource="kpimage">
         
            SELECT DATENAME(year, sdate) as yeardate, DATENAME(month, sdate) as monthdate, count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate), DATENAME(month, sdate), suse
            HAVING (DATENAME(year, sdate) = arguments.annee)
            AND (DATENAME(month, sdate)= arguments.mois)
            AND (suse = arguments.usage)                  
          </cfquery>         
          
          <cfreturn Qresult>
         
      </cfif>
      
      <cfif isDefined(arguments.annee) AND isDefined(arguments.usage)>
      
          <cfquery name="Qresult" datasource="kpimage">
            SELECT DATENAME(year, sdate) as yeardate,count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY DATENAME(year, sdate),  suse
            HAVING (DATENAME(year, sdate) = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.annee#">)
            AND (suse = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.usage#">);
          </cfquery>
           <!--- <cfset result = queryyear.result> ---> 
           <cfreturn Qresult>
          
       </cfif>
         
     <cfif isDefined(arguments.usage)>
           <cfquery name="Qresult" datasource="kpimage">
            SELECT count(suse) as result, suse
            FROM TBL_imgusage
            GROUP BY   suse
            HAVING (suse = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.usage#">);
          </cfquery>
          <!--- <cfset result = queryyear.result> --->
          <cfreturn Qresult> 
               
     </cfif>
 
 
   
</cffunction>


// index.cfm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>BUGWOOD IMAGES STATISTICS</title>

        <script type='text/javascript' src='ajax/core/engine.js'></script>
        <script type='text/javascript' src='ajax/core/util.js'></script>
        <script type='text/javascript' src='ajax/core/settings.js'></script>
       
        <script language="javascript" type="text/javascript">
       
            function loadInfo()
            {
                var mois = DWRUtil.getValue("mois");
                var annee = DWRUtil.getValue("annee");
                var usage = DWRUtil.getValue("usage");
                DWREngine._execute(_cfscriptLocation, null, 'statistics', mois, annee, usage, getResultData);
               
               
            }
           
           
            function getResultData(Qresult)
            {
                document.getElementById("info").innerHTML =Qresult[0].RESULT ;
            }
           
           

            function init()
            {
                DWRUtil.useLoadingMessage();
                DWREngine._errorHandler =  errorHandler;
                loadInfo();
            }
           
        </script>
               
</head>


<body onLoad="init()">

    <p>&nbsp;</p>
    <hr color="#060" style="color:#060" />
    <h3 align="center"  style="color:#060;  font-size:26px; font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;  " >BUGWOOD IMAGES STATISTICS</h3>
    <hr color="#060" style="color:#060" />
    <cfquery name="totalhits" datasource="kpimage">
    select count(useid) AS hits
    from TBL_imgusage
    </cfquery>
    <p style="font-size:26px;font-family:'Palatino Linotype', 'Book Antiqua', Palatino, serif;">
   
    <strong><em><u>Overall Number of Hits:</u></em></strong><cfoutput query="totalhits"><em style="color:##F60">&nbsp;&nbsp;#hits#</em></cfoutput>
    </p>
   
    <p align="center" style="font-size:18px">&nbsp;</p>
    <p align="center" style="font-size:18px"><strong>You Can Apply The Filters Below According To Your Search</strong>...</p>
    <p align="center" style="font-size:18px">&nbsp;</p>
    <p align="center"></p>
   
   
      <table width="50%" border="1" bordercolor="#CCCCCC" cellspacing="0" align="center">
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Month</em></th>
          <td>
          <select id="mois" name="month"  >
          <option ></option>
          <option value="1">January</option>
          <option value="2">February</option>
          <option value="3">March</option>
          <option value="4">April</option>
          <option value="5">May</option>
          <option value="6">June</option>
          <option value="7">July</option>
          <option value="8">August</option>
          <option value="9">September&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
          <option value="10">October</option>
          <option value="11">November</option>
          <option value="12">December</option>
          </select>
          <cfoutput><em style="color:##060"><strong>...(If selected, You must select a Year)</strong></em></cfoutput></td>
        </tr>
        <tr>
          <th width="23%" align="right" bgcolor="#F2FFFF" scope="row"><em>Year</em></th>
          <td width="77%">
          <select name="year" id="annee" onChange="loadInfo()">
          <option></option>
          <option value="2004">2004</option>
          <option value="2005">2005</option>
          <option value="2006">2006</option>
          <option value="2007">2007</option>
          <option value="2008">2008</option>
          <option value="2009">2009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </option>
          </select>
          </td>
        </tr>
        <tr>
          <th align="right" bgcolor="#F2FFFF" scope="row"><em>Image Usage</em></th>
          <td><select name="usage" id="usage" onChange="loadInfo()" >
          <option></option>
          <option>Commercial</option>
          <option>Educational</option>
          <option>Personal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
         
          </select></td>
        </tr>
      </table>
     
    <p align="center">&nbsp;</p>
    <p align="center"><strong>Your search's results below</strong></p>
    <table width="400" border="1" align="center" bordercolor="#CCCCCC" cellspacing="0">
            <thead>
                <tr>
                    <th width="69">Month</th>
                    <th width="78">Year</th>
                    <th width="133">Usage</th>
                    <th width="92">Result</th>
                </tr>
            </thead>
            <tbody id="teamsBody">
            </tbody>
        </table>
   
<h2 name="info" id="info" ></h2>
   
    </body>
</html>
 

#2022 From: onomo joel <joelonomo@...>
Date: Tue Nov 10, 2009 3:05 pm
Subject: Cfajax+DBqueries
joelonomo
Offline Offline
Send Email Send Email
 
Hi everybody,

I am trying to use cfajax to load a content from a database. I have been inpired by this web site:http://www.bifrost.com.au/blog/index.cfm/2006/7/13/CFAJAX-Suggest
All i have in my execution are the loading messages. I also use firebug to see if my post and response are good for the functions.cfm., the post has the good values but the response doesn't display anything. I don't know what to do now to make it work. I will be glad to receive your help. Thank you

The function's and html files are attached. Thank you for your help
 






2 of 2 File(s)


#2021 From: James Holmes <james.holmes@...>
Date: Sat Jul 18, 2009 6:48 am
Subject: Re: cfAjax not working in different directories
holmesjr_2005
Offline Offline
Send Email Send Email
 
First. it's best to upgrade to mxAjax - cfajax hasn't been updated in
a long time.

Second, try this:

http://www.bifrost.com.au/blog/index.cfm/2006/7/13/Installing-CFAJAX--Paths-expl\
ained

and

http://www.bifrost.com.au/blog/index.cfm/2006/7/13/Getting-the-CFAJAX-Suggest-ex\
amples-to-work-locally

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



2009/7/17 sergio.bonfiglio@... <sergio.bonfiglio@...>:
>
>
> Hello to the community.
> You will probably consider me an ass, but I'm experiencing a very strange
> behaviour.
> If I try to run the examples from the directory where I put the original
> files all works fine.
> If I try to run the examples in the root or in different directories all
> stops working.
> I checked and re-checked the presence of all the files, and they are the
> same.
> But if I put all in the root, everything refuses to work.
> Can you suggest me a strategy to debug to find out what's missing ?
> I'm using a plain cfajax 1.3 without jquery.
>
> Thanks to anyone for any help.
>
> Sergio
>
>

Messages 2021 - 2032 of 2032   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help