Php sorting nested in html

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.