This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @str VARCHAR(255); | |
SELECT @str = LOWER(?); | |
SELECT * ( | |
SELECT TOP 8 * FROM [oca_search_model] | |
WHERE [osm_isactive] = 1 | |
AND LOWER([osm_category]) = LOWER(?) | |
AND ( | |
LOWER([osm_keywords]) LIKE '%'+@str+'%' | |
OR LOWER([osm_description]) LIKE '%'+@str+'%' | |
OR LOWER([osm_name]) LIKE @str+'%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(Array.prototype.indexOf === undefined) | |
{ | |
Array.prototype.indexOf = function(val) | |
{ | |
for (var i = 0; i < this.length; i++) | |
{ | |
if(this[i] == val) | |
return i; | |
} | |
return -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(JSON.hasOwnProperty('encode') && !JSON.hasOwnProperty('stringify')){ | |
JSON.stringify = JSON.encode; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var report = { | |
run: function () | |
{ | |
return $("form :input[name!='']").filter(this.isUniqueField); | |
}, | |
isUniqueField: function (index) | |
{ | |
if(report.elementNameCache.indexOf(this.name) < 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Function GetTableDefinition( table_name, conn, id, idfield ) | |
dim rs, fld, rec | |
dim where: where = "" | |
If IsNumeric(id) And id > 0 and idfield <> "" Then | |
where = " WHERE " & idfield & " = " & id | |
End If | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' appends the second argument to the first if the first is an array. | |
' MUST be a dynamic array! Returns new array. | |
' Usage: | |
' Dim myArray() | |
' myArray = ArrayAppend(myArray, "foo") | |
Function ArrayAppend( a, o ) | |
On Error Resume Next | |
Err.Clear() | |
dim tn, i | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function BusinessDayAdd(delta, dt) | |
dim weeks, days, day | |
weeks = Fix(delta/5) | |
days = delta Mod 5 | |
day = DatePart("w",dt) | |
If (day = 7) And days > -1 Then | |
If days = 0 Then | |
days = days - 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(Number.prototype.mod === undefined) | |
{ | |
Number.prototype.mod = function(n) { | |
return ((this%n)+n)%n; | |
} | |
} | |
if(Date.prototype.addBusinessDays === undefined) | |
{ | |
Date.prototype.addBusinessDays = function(dd) { | |
var weeks = (dd >= 0) ? Math.floor(dd/5): Math.ceil(dd/5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' returns the index of obj in array. obj can be anything. Returns -1 if not found. | |
Function inArray(arr, obj) | |
On Error Resume Next | |
Dim x: x = -1 | |
If isArray(arr) Then | |
For i = 0 To UBound(arr) | |
If arr(i) = obj Then | |
x = i | |
Exit For |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(String.prototype.toKey === undefined) | |
{ | |
String.prototype.toKey = function(){ | |
var s = this.toLowerCase(); | |
s = s.replace(/^[0-9_-]+|[^a-z0-9_\s-]|(\s.\s){1,}|[\s]{2,}|[_\s-]+$/ig, ''); | |
s = s.replace(/[\-\s_]+/ig,"_"); | |
return s; | |
} | |
} |
OlderNewer