回复 19# yohoboy
我只是修改一下:
Func sql_data_array() ;??ぇ戈???皚??陪ボ?ViewList
Local $ArrayData[$aRow2][9] ;砞﹚?蝴皚?
Local $Date_interval, $iDateCalc, $aItem
Local $c = 0 ;?﹍?蝴皚??
Local $i = 0
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
$ArrayData[$c][0] = $aRow[0]
;$ArrayData[$c][0] = StringTrimRight($aRow[0], 2)
$ArrayData[$c][1] = $aRow[1]
$ArrayData[$c][2] = $aRow[2]
$ArrayData[$c][3] = $aRow[3]
$ArrayData[$c][4] = $aRow[4]
$ArrayData[$c][5] = $aRow[5]
$ArrayData[$c][6] = $aRow[6]
$ArrayData[$c][7] = $aRow[7]
$ArrayData[$c][8] = $aRow[8]
Local $Item = GUICtrlCreateListViewItem($ArrayData[$c][0] & "|" & $ArrayData[$c][1] & "|" & $ArrayData[$c][2] & "|" & $ArrayData[$c][3] & "|" & $ArrayData[$c][4] & "|" & $ArrayData[$c][5] & "|" & $ArrayData[$c][6] & "|" & $ArrayData[$c][7] & "|" & $ArrayData[$c][8], $GUI_ListBox)
$c = $c + 1
WEnd
;_GUICtrlListView_AddArray($GUI_ListBox, $ArrayData)
_SQLite_QueryFinalize($hQuery)
$c = 0 ;?弄?皚?戈?锣? GUI_ListView陪ボ
Local $sText, $sText2, $sText3, $sText4, $aItem, $iDateCalc
$sText2 = _GUICtrlListView_GetItemCount($GUI_ListBox) ;参璸陪ボ?ListView掸计
For $i = 0 To ($sText2 - 1) Step 1 ;癹伴矪瞶
$aItem = _GUICtrlListView_GetItemTextArray($GUI_ListBox, $i) ;?眔–︽戈?
$sText = StringLeft($aItem[1], 10) ;?眔–︽材??戈?(ら戳:yyyy-MM-DD)
If $aItem[6] = "緊急" And $aItem[9] <> "狀 態" Then ;?眔候?ゼ挡?戈?
$iDateCalc = _DateDiff('d', $sText, _NowCalc()) ;?眔瞷?ら戳籔ミ?ら戳ぇ丁ぱ计
If $iDateCalc > 2 And $iDateCalc <= 14 Then ;??7ぱぃ矪瞶???7ぱ???14ぱ玥陪ボ屡︹?砰
Local $b = ControlListView($Title, "", $GUI_ListBox, "FindItem", $aItem[1])
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xFF00FF')
GUICtrlSetBkColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xCCCCCC')
ElseIf $iDateCalc > 14 Then ;??14ぱ??陪ボ?︹?砰
Local $b = ControlListView($Title, "", $GUI_ListBox, "FindItem", $aItem[1])
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xFF0000')
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xFFFFFF')
EndIf
ElseIf $aItem[6] = "一般" And $aItem[9] <> "狀 態" Then ;??弧?
$iDateCalc = _DateDiff('d', $sText, _NowCalc())
If $iDateCalc > 2 And $iDateCalc <= 14 Then
Local $b = ControlListView($Title, "", $GUI_ListBox, "FindItem", $aItem[1])
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0x0000FF')
GUICtrlSetBkColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0x2BD55E');'0x00FF66')
ElseIf $iDateCalc > 14 Then
Local $b = ControlListView($Title, "", $GUI_ListBox, "FindItem", $aItem[1])
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xFF0000')
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xFFFFFF')
EndIf
ElseIf $aItem[6] = "普通" And $aItem[9] <> "狀 態" Then
$iDateCalc = _DateDiff('d', $sText, _NowCalc())
If $iDateCalc > 4 And $iDateCalc <= 14 Then
Local $b = ControlListView($Title, "", $GUI_ListBox, "FindItem", $aItem[1])
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0x0000FF')
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0x009900')
ElseIf $iDateCalc > 14 Then
Local $b = ControlListView($Title, "", $GUI_ListBox, "FindItem", $aItem[1])
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xFF0000')
GUICtrlSetColor(_GUICtrlListView_GetItemParam($GUI_ListBox, $b), '0xFFFFFF')
EndIf
EndIf
Next
EndFunc ;==>sql_data_array
|