Php sorting nested in html: this sorting code is written & nbsp; how can we nest it in html & nbsp; click the page button to sort (strtolower ($ _ GET [sort]) asc )? $ Sortdesc: $ sortasc; unset ($ surl [orderby], $ surl [sort php sorting nested in html
How can I nest the sorting code in html and click the page button to sort it?
// Sort
(Strtolower ($ _ GET ['sort ']) = "asc ")? $ Sort = "desc": $ sort = "asc ";
Unset ($ surl ['orderby'], $ surl ['sort ']);
$ OrderUrl = http_build_query ($ surl );
If ($ _ GET ['orderby']) {
// If (strtolower ($ _ GET ['orderby']) = "leve") $ parm ['orderby'] = "m. credits ". text ($ _ GET ['sort ']);
If (strtolower ($ _ GET ['orderby']) = "rate") $ parm ['orderby'] = "B. borrow_interest_rate ". text ($ _ GET ['sort ']);
Elseif (strtolower ($ _ GET ['orderby']) = "borrow_money") $ parm ['orderby'] = "B. borrow_money ". text ($ _ GET ['sort ']);
Else $ parm ['orderby'] = "B. id DESC ";
} Else {
$ Parm ['orderby'] = "B. borrow_status ASC, B. id DESC ";
}
$ Sorder ['corderby '] = strtolower (text ($ _ GET ['orderby']);
$ Sorder ['csort '] = strtolower (text ($ _ GET ['sort']);
$ Sorder ['URL'] = $ orderUrl;
$ Sorder ['sort '] = $ sort;
$ Sorder ['orderby'] = text ($ _ GET ['orderby']);
// Sort
$ List = getBorrowList ($ parm );
// Dump (M ()-> GetLastsql (); exit;
$ This-> assign ("Sorder", $ Sorder );
$ This-> assign ("searchUrl", $ searchUrl );
$ This-> assign ("searchMap", $ searchMap );
$ This-> assign ("Bconfig", $ Bconfig );
$ This-> assign ("Buse", $ this-> gloconf ['borrow _ use']);
$ This-> assign ("list", $ list );
$ This-> display ();
}
------ Solution ----------------------
Pass the sorting condition back.
There are two methods: Form Post submission, or URL with parameters. you can determine the sorting method based on the submitted data.