Как вывести две стрелки сортировки таблицы по параметрам ?
// Ascending & Descending payment date filter import $w = cot_import('w', 'G', 'ALP', 4); if ($w != 'desc' && $w != 'asc') $w = 'desc'; $sort_order = 'ORDER BY PaymentDate ' . $w; $sort = cot_import('sort', 'G', 'ALP', 16); $users_sort_tags = array( 'data' => array('FZ_HKPAY_TOP_DATE', &$L['fz_Payment_Date'],), ); $k = '_.__._'; $asc = explode($k, cot_url('index', array('e' => 'fazenda', 'a' => 'hkpay', 'h' => $h , 'sort' => $k, 'w'=> 'asc'))); $desc = explode($k, cot_url('index', array('e' => 'fazenda', 'a' => 'hkpay', 'h' => $h , 'sort' => $k, 'w'=> 'desc'))); foreach ($users_sort_tags as $k => $x) { $t->assign($x[0], $fz_sort_data = cot_rc('users_link_sort', array( 'asc_url' => implode($k, $asc), 'desc_url' => implode($k, $desc), 'icon_down' => $k == $sort && $w == 'asc' ? $R['icon_vert_active']['asc'] : $R['icon_down'], 'icon_up' => $k == $sort && $w == 'desc' ? $R['icon_vert_active']['desc'] : $R['icon_up'], 'text' => $x[1], ))); }
Одной стрелкой с разными направлениями стрелки
// Ascending & Descending payment date filter import $w = cot_import('w', 'G', 'ALP', 4); !isset($w) ? $w = 'desc' : $w; $Arrow_pressed = cot_import('pr', 'G', 'ALP', 1); if ( isset($Arrow_pressed) ) { $w == 'desc' ? $w = 'asc' : $w = 'desc'; } $k = '_.__._'; $w == 'asc' ? $asc = explode($k, cot_url('index', array('e' => 'fazenda', 'a' => 'hkpay', 'h' => $h , 'sort' => $k, 'w'=> 'asc' , 'upg' => $ret, 'pr' => '1'))) : $asc = explode($k, cot_url('index', array('e' => 'fazenda', 'a' => 'hkpay', 'h' => $h , 'sort' => $k, 'w'=> 'desc' , 'upg' => $ret, 'pr' => '1'))); foreach ($users_sort_tags as $k => $x) { $t->assign($x[0], cot_rc('users_link_sort', array( 'asc_url' => implode($k, $asc), 'icon_down' => $k == $sort && $w == 'asc' ? $R['icon_vert_active']['asc'] : $R['icon_vert_active']['desc'], 'text' => $x[1], ))); }
TPL
<table class="table_Style_forum margin_top_20"> <tr> <td colspan="3" align="center" class="th_Style2"> <form action="{FZ_GOBACK}" method="post" enctype="multipart/form-data" name="fz_search"> <input type="hidden" name="" value="" /> <button class="button1 login_button" type="submit" name="action" value="toprofile">{PHP.L.fz_Button_cencel}</button> </form> </td> </tr> <tr> <td align="center" class="th_Style2">{FZ_HKPAY_TOP_DATE}</td> <td align="center" class="th_Style2">{PHP.L.fz_Payment_For}</td> <td align="center" class="th_Style2">{PHP.L.fz_Payment_Desc}</td> </tr> <!-- BEGIN: FZ_HKPAY_ROW --> <tr> <td class="td_Style2" align="left">{FZ_HKPAY_ROW_DATE}</td> <td class="td_Style2" align="center">{FZ_HKPAY_ROW_TYPE_TEXT}</td> <td class="td_Style2" align="center"> {FZ_HKPAY_ROW_PAYMENT_TEXT}</td> </tr> <!-- END: FZ_HKPAY_ROW --> </table>