Func ReReadLogFile()
Local $T, $R, $C
Select
Case GUICtrlRead($SystemEventsOnly) = $GUI_CHECKED And GUICtrlRead($UserEventsOnly) = $GUI_CHECKED
_SQLite_GetTable2d($DB, 'SELECT id,order_id,date,log,type,is_admin FROM log WHERE type in (1,2) ORDER BY order_id DESC, date DESC LIMIT 300', $T, $R, $C)
Case GUICtrlRead($SystemEventsOnly) = $GUI_UNCHECKED And GUICtrlRead($UserEventsOnly) = $GUI_CHECKED
_SQLite_GetTable2d($DB, 'SELECT id,order_id,date,log,type,is_admin FROM log WHERE type = 2 ORDER BY order_id DESC, date DESC LIMIT 300', $T, $R, $C)
Case GUICtrlRead($SystemEventsOnly) = $GUI_CHECKED And GUICtrlRead($UserEventsOnly) = $GUI_UNCHECKED
_SQLite_GetTable2d($DB, 'SELECT id,order_id,date,log,type,is_admin FROM log WHERE type = 1 ORDER BY order_id DESC, date DESC LIMIT 300', $T, $R, $C)
Case GUICtrlRead($SystemEventsOnly) = $GUI_UNCHECKED And GUICtrlRead($UserEventsOnly) = $GUI_UNCHECKED
_SQLite_GetTable2d($DB, 'SELECT id,order_id,date,log,type,is_admin FROM log WHERE type IN () ORDER BY order_id DESC, date DESC LIMIT 300', $T, $R, $C)
EndSelect
_ArrayDisplay($T)
_GUICtrlListView_BeginUpdate($Log_List)
_GUICtrlListView_DeleteAllItems($Log_List)
$color = '0xdddddd'
For $i = 1 To $R
$temp = StringFormat('%06i', $T[$i][1]) & '|' & $T[$i][2] & '|'
If $T[$i][5] = 1 Then
$temp &= 'Администратор|'
Else
$temp &= 'Пользователь|'
EndIf
$temp &= $T[$i][3]
_GUICtrlListView_AddItem($Log_List, $temp)
;GUICtrlCreateListViewItem($temp, $Log_List)
If $T[$i][1] <> $T[$i - 1][1] Then
Switch $color
Case '0xdddddd'
$color = '0xffffff'
Case '0xffffff'
$color = '0xdddddd'
EndSwitch
EndIf
GUICtrlSetBkColor(-1, $color)
Next
;_GUICtrlListView_endUpdate($Log_List) ; закоментил для отладки. все равно падает
EndFunc