Jun
13
2021
add to config.js, upload and refresh (clear cache using ctrl+F5)
config.protectedSource.push( /<i class[\s\S]*?\>/g );
config.protectedSource.push( /<\/i>/g );
source: https://ckeditor.com/old/forums/CKEditor/FontAwesome-tags-removed-when-switching-between-Source-and-Wysiwyg
no comments
Jun
10
2021
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
source: https://stackoverflow.com/questions/9823010/how-to-force-https-using-a-web-config-file
no comments | posted in ASP, Razno
Apr
17
2021
select * from tbl_events_dates
where
1 =
(
CASE WHEN
tbl_events_dates.dateStart < CAST(cast(year(GETDATE()) as varchar)+'-09-01' AS datetime)
THEN
CASE WHEN
tbl_events_dates.dateStart >= CAST(cast(year(DATEADD(year,-1,GETDATE())) as varchar)+'-09-01' AS datetime)
and
tbl_events_dates.dateStart <CAST(cast(year(GETDATE()) as varchar)+'-09-01' AS datetime)
THEN 1 else 0 end
ELSE
CASE WHEN
tbl_events_dates.dateStart <=CAST(cast(year(GETDATE()) as varchar)+'-09-01' AS datetime)
and
tbl_events_dates.dateStart >= CAST(cast(year(DATEADD(year,1,GETDATE())) as varchar)+'-09-01' AS datetime)
THEN 1 else 0 end
END
)
no comments | posted in MSSQL Database Development
Apr
9
2021
<cfset Local.currencies = arrayNew(1)>
<cfset arrayAppend(Local.currencies, 'EUR')>
<cfset arrayAppend(Local.currencies, 'HRK')>
<cfset arrayAppend(Local.currencies, 'BGN')>
<cfset arrayAppend(Local.currencies, 'RON')>
<cfset currencyList = structNew()>
<cfloop from="1" to="#arrayLen(Local.currencies)#" index="a">
<cfset local.currency = structNew()>
<cfset local.currency.currency = Local.currencies[a]>
<cfset arguments.currency = Local.currencies[a]>
<cfset local.currency.query = get_paiment_report_Query(argumentCollection = arguments)>
<cfset currencyList[local.currency.currency] = local.currency>
</cfloop>
<cfquery name="q_payments" dbtype="query" result="queryResult">
<cfset var count = 0>
<cfloop collection="#currencyList#" item="key" >
<cfif currencyList[key].query.recordcount neq 0>
<cfset count = count+1>
<cfif count gt 1 >
UNION
</cfif>
SELECT * FROM currencyList.#key#.query
</cfif>
</cfloop>
</cfquery>
no comments | posted in Coldfusion
Apr
9
2021
private any function combineQuery(qA, qB) {
var qry1Result = arguments.qA;
var qry2Result = arguments.qB;
var qoqResult = '';
// create new query object
var qoq = new Query();
// set attribute of new query object to be a query result with arbortrary name
qoq.setAttributes(QoQsrcTableA = qry1Result);
qoq.setAttributes(QoQsrcTableB = qry2Result);
// use previously set attribute as table name for QoQ andset dbtype = query
qoqResult = qoq.execute(sql="select * from QoQsrcTableA union select * from QoQsrcTableB", dbtype="query");
// return result
return qoqResult.getResult();
}
source: https://coldfusion.adobe.com/2017/10/unioning-queries-using-query-of-query/
no comments | posted in Coldfusion
Mar
9
2021
SELECT DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) AS StartOfMonthDate
SELECT EOMONTH(getdate()) AS EndOfMonthDate
no comments | posted in MSSQL Database Development
Feb
17
2021
<cffunction name="getClientFileName" returntype="string" output="false" hint="">
<cfargument name="fieldName" required="true" type="string" hint="Name of the Form field" />
<cfset var tmpPartsArray = Form.getPartsArray() />
<cfif IsDefined("tmpPartsArray")>
<cfloop array="#tmpPartsArray#" index="local.tmpPart">
<cfif local.tmpPart.isFile() AND local.tmpPart.getName() EQ arguments.fieldName>
<cfreturn local.tmpPart.getFileName() />
</cfif>
</cfloop>
</cfif>
<cfreturn "" />
</cffunction>
source: http://www.stillnetstudios.com/get-filename-before-calling-cffile/
no comments | posted in Coldfusion
Feb
8
2021
SELECT *
FROM tableName
ORDER BY (CASE WHEN dateColumn < GETDATE()
THEN 1
ELSE 0
END) DESC, dateColumn ASC
source: https://stackoverflow.com/questions/12365246/order-by-date-with-past-dates-after-upcoming-dates
no comments | posted in MSSQL Database Development
Jun
16
2020
=IF(AND(B78=P78;C78=Q78;D78=R78;E78=S78;F78=T78);"DA";"NE")
… and dragg…
https://www.ablebits.com/office-addins-blog/2015/08/26/excel-compare-two-columns-matches-differences/
https://support.microsoft.com/en-us/office/using-if-with-and-or-and-not-functions-d895f58c-b36c-419e-b1f2-5c193a236d97?ui=en-us&rs=en-us&ad=us
no comments
May
19
2020
<cfpdf action="getInfo" source ="test.pdf" name="PDFInfo">
<cfset pageCount = "#PDFInfo.TotalPages#" >
no comments | posted in Coldfusion