$sTableID = "tableID"; // ID таблицы
$oSort = new CAdminSorting($sTableID, "ID", "desc"); // объект сортировки
$lAdmin = new CAdminList($sTableID, $oSort); // основной объект списка
$filter = new CAdminFilter(
$sTableID."_filter",
array(
"ID",
)
);
function CheckFilter()
{
global $FilterArr, $lAdmin;
foreach ($FilterArr as $f) global $$f;
return count($lAdmin->arFilterErrors)==0;
}
// *********************** /CheckFilter ******************************* //
$FilterArr = Array(
"find",
"find_id",
"find_link_site",
"find_points",
"find_total",
);
$lAdmin->InitFilter($FilterArr);
if (CheckFilter())
{
$arFilter = Array(
"ID" => ($find!="" && $find_name == "id"? $find:$find_id),
"LINK_SITE" => $find_link_site,
"POINTS" => $find_points,
"TOTAL" => $find_total,
);
$sql = 'SELECT ... ORDER BY ID desc';
$audit_list = $DB->Query($sql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
$audit_list = new CAdminResult($audit_list, $sTableID);
$lAdmin->AddHeaders(array(
array( "id" =>"ID",
"content" =>"ID",
"sort" =>"id",
"align" =>"center",
"default" =>true,
),
array( "id" =>"id_user",
"content" => "Юзер",
"sort" =>"id_user",
"align" =>"left",
"default" =>true,
),
array( "id" =>"link_site",
"content" => "Сайт",
"sort" =>"link_site",
"align" =>"left",
"default" =>true,
),
array( "id" =>"total",
"content" => "Итог",
"sort" =>"total",
"align" =>"left",
"default" =>true,
),
array( "id" =>"percentage",
"content" => "Процент",
"sort" =>"percentage",
"align" =>"left",
"default" =>true,
),
));
while($myrow = $audit_list->NavNext(true, "f_")):
...
$row =& $lAdmin->AddRow($myrow['id'], $myrow);
$row->AddViewField("ID", $myrow['id']);
$row->AddViewField("id_user", $myrow['link_user']);
$row->AddViewField("link_site", $myrow['link_site']);
$row->AddViewField("total", $myrow['total']);
$row->AddViewField("percentage", $myrow['percentage']);
...
endwhile;
|