|
shKmn_éRBeQIenAkm<úCa |
|
|
<%
dim i
dim SumVillage,SumCF,SumPopulation
SumVillage=0
SumCF=0
SumPopulation=0
i=0
while (Not QCF.EOF)
IF QCF.Fields.Item("ProvinceID").Value <> 0 THEN
if i mod 2 then
response.write(" | ")
else
response.write(" ")
end if
response.write("| " & QCF.Fields.Item("ProvinceID").Value )
response.write(" | " & trim(QCF.Fields.Item("ProvinceKH").Value) & " | ")
response.write("" & setcama(QCF.Fields.Item("CountOfCF").Value,False) & " | ")
SumCF = SumCF + QCF.Fields.Item("CountOfCF").Value
if isnull(QCF.Fields.Item("CountOfVillage").Value)= false then
response.write("" & setcama(QCF.Fields.Item("CountOfVillage").Value,False) & " | ")
SumVillage= SumVillage + QCF.Fields.Item("CountOfVillage").Value
else
response.write("0 | ")
end if
if isnull((QCF.Fields.Item("SumOfPopulation").Value))=true then
response.write("" & "0" & " nak; | ")
else
response.write("" & setcama(QCF.Fields.Item("SumOfPopulation").Value,False) & " nak; | ")
SumPopulation = SumPopulation + QCF.Fields.Item("SumOfPopulation").Value
end if
if isnull(QCF.Fields.Item("SumOfCFmember").Value)=true then
response.write("" & "0" & " nak; | ")
else
response.write("" & setcama(QCF.Fields.Item("SumOfCFmember").Value,False) & " nak; | ")
SumCFMember = SumCFMember + QCF.Fields.Item("SumOfCFmember").Value
end if
response.write(" ")
qcf.movenext
i=i+1
ELSE
qcf.movenext
END IF
Wend
%>
<%
QCF.Close()
Set QCF = Nothing
function SetCama(Numbers,DecimalPointYesNo)
ThousandDevideString = "/"
DecimalPoint="."
If Numbers > 0 Then
dot = False
For K = 1 To Len(Numbers)
If Mid(Numbers, K, 1) = "." Then
strright = Mid(Numbers, K, 3)
If strright = "." Or strright = "" Then
strright = DecimalPoint & "00"
Else
strright = Mid(Numbers, K + 1, 2)
If Len(strright) = 1 Then
strright = strright & "0"
End If
End If
StrLeft = Mid(Numbers, 1, K - 1)
If StrLeft = "" Then
StrLeft = "0"
End If
dot = True
Exit For
End If
Next
If dot = True Then
lenght = Len(StrLeft)
If lenght > 3 Then
j = 0
For K = 1 To lenght Step 3
j = j + 1
If K = 1 Then
SetCama = Right(StrLeft, 3)
Else
SetCama = Right(StrLeft, 3) & ThousandDevideString & SetCama
End If
If Len(StrLeft) > 3 Then
StrLeft = Left(StrLeft, Len(StrLeft) - 3)
End If
Next
SetCama = SetCama & DecimalPoint & strright
Else
SetCama = StrLeft & DecimalPoint & strright
End If
Else
If DecimalPointYesNo = True Then
strright = DecimalPoint & "00"
Else
strright = ""
End If
StrLeft = Numbers
lenght = Len(StrLeft)
If lenght > 3 Then
j = 0
For K = 1 To lenght Step 3
j = j + 1
If K = 1 Then
SetCama = Right(StrLeft, 3)
Else
SetCama = Right(StrLeft, 3) & ThousandDevideString & SetCama
End If
If Len(StrLeft) > 3 Then
StrLeft = Left(StrLeft, Len(StrLeft) - 3)
End If
Next
SetCama = SetCama & strright
Else
SetCama = StrLeft & strright
End If
End If
Else
If DecimalPointYesNo = True Then
SetCama = "0" & DecimalPoint & "00"
Else
SetCama = "0"
End If
End If
end function
%> |
|